1
phillipd
How does one add main Menu buttons with "group" security
  • 2006/8/31 16:22

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


I have figured out how to add buttons to the main menu that launch a page of my choosing by adding code to the "system_block_mainmenu.html" file, but this shows the buttons to unregistered users. How do I do this such that I can use a "group" and prevent just anyone from seeing the buttons in the main menu?

Thanks

Doug P
......

2
Djiman
Re: How does one add main Menu buttons with "group" security
  • 2006/8/31 18:00

  • Djiman

  • Just popping in

  • Posts: 91

  • Since: 2006/7/26


I dont know if this might help you!

In your xoops_version
where you have the 'has main' and 'submenu'

try using this;
should work for atleast to the regisetered ..
it is not my idea I only found it in a file somewhere.! maybe it is something that is close to what you need.


<start>
// Menu
$modversion['hasMain'] = 1;

global $xoopsModule;
if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $modversion['dirname']) {
global $xoopsModuleConfig, $xoopsUser;
$isAdmin = false;
if (!empty($xoopsUser)) {
$isAdmin = ($xoopsUser->isAdmin($xoopsModule->getVar('mid')));
}
// Add the Submit new item button
if ($isAdmin || (isset($xoopsModuleConfig['allowsubmit']) &&
$xoopsModuleConfig['allowsubmit'] == 1 &&
(is_object($xoopsUser) ||
(isset($xoopsModuleConfig['anonpost']) && $xoopsModuleConfig['anonpost'] == 1)))) {
$modversion['sub'][1]['name'] = _MI_LANGUGE_SOMETHING ;
$modversion['sub'][1]['url'] = "submit.php?op=add";
}
$modversion['sub'][2]['name'] = "lang_something_here.php"; /* the button 's language */
$modversion['sub'][2]['url'] = "../to somewhere/"; /* the url */

}
<end>
+++++++++++++++++++++++++++++++++++
or there could be other pretty ways to do it!1

3
Will_H
Re: How does one add main Menu buttons with "group" security
  • 2006/8/31 18:07

  • Will_H

  • Friend of XOOPS

  • Posts: 1786

  • Since: 2004/10/10


Or you could say... Get Multi-Menu

4
Djiman
Re: How does one add main Menu buttons with "group" security
  • 2006/8/31 18:48

  • Djiman

  • Just popping in

  • Posts: 91

  • Since: 2006/7/26


I told you there is a better way .
that is a much better idea !

5
Shine
Re: How does one add main Menu buttons with "group" security
  • 2006/8/31 20:42

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


Or simply add the following code within the mentioned system_block_mainmenu.html
(system/templates/blocks/)

<!-- end module menu loop -->
      <{if 
$xoops_isuser}>
<
class="menuMain" href="<{$xoops_url}>/modules/atpagina/chatroom.php" title="memberchatroom">&nbsp;Memberchatroom</a>
<{else}>
       <{/if}>

The menu item will only show up for registered uders. Anonymous users won;t see it.

6
phillipd
Re: How does one add main Menu buttons with "group" security
  • 2006/9/1 13:51

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


All good suggestions, thankyou very much...

Doug P
......

Login

Who's Online

215 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 215


more...

Donat-O-Meter

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

Latest GitHub Commits