1
nthomson
Hiding links from anonymous users
  • 2004/4/23 21:31

  • nthomson

  • Just popping in

  • Posts: 49

  • Since: 2004/4/13


Hi,

Is there a way to hide certain links from every one else except the webmasters?

For example, i want every one/anonymous users to view my Agendax calendar and events.But i don't want them to add a new event..So i have to hide the "Post a new event link" in minical and "Add a event" in agendax page..

I tried the following in minical.php


if ($isadmin) {
$block['postNewEvent'] = ''._AGX_POSTANEWEVENT.'';
}

It hides the "Post a new event link". But it hides for the admin user too.. Is there a way we can work around this?

Thanks,
Ann

2
JackJ
Re: Hiding links from anonymous users
  • 2004/4/23 22:04

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Go to the xoops_version.php file in the root of the module and look for the "menu" code.

I don't have calender, but this is how I do in in "News"

// Menu
$modversion['hasMain'] = 1;
global $xoopsUser;
if(!empty($xoopsUser)) {
$group = $xoopsUser->getGroups();

if (in_array(2, $group)) { //or other group-IDs
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
}
$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
$modversion['sub'][2]['url'] = "archive.php";


Note:

if (in_array(2, $group)) { //or other group-IDs

Choosing group "2" hides the sub-menu from anon users

Login

Who's Online

344 user(s) are online (261 user(s) are browsing Support Forums)


Members: 0


Guests: 344


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits