| Re: Hiding links from anonymous users |
| by JackJ on 2004/4/23 22:04:34 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 |
| Hiding links from anonymous users |
| by nthomson on 2004/4/23 21:31:22 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'] = '<a href="'.XOOPS_URL.'/modules/agendax/index.php?op=eventform"><small>'._AGX_POSTANEWEVENT.'</small></a>'; } 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 |