1
Fredrik
Control who can see sub-menus?!
  • 2004/6/1 9:01

  • Fredrik

  • Just popping in

  • Posts: 26

  • Since: 2004/4/21


I would like to control the visibility of sub-menus!

I don't want an Anonymous User to see sub-menus like "submit article" or "submit photo" which he/she has no access to, but at the same time I want the same Anonymous User to see sub-menus for Tiny-D etc. where I have publically available articles.
Any suggestions how to accomplish this?

2
Mithrandir
Re: Control who can see sub-menus?!

News v1.2 RC2 only show "Submit news" to users with submit permissions - you can see the approach there (Not a straight forward, easy-to-use way, I am afraid).

3
jmass
Re: Control who can see sub-menus?!
  • 2004/6/1 13:40

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


How stable is that release? Worth upgrading to?

JMass

4
Mithrandir
Re: Control who can see sub-menus?!

I run it myself on several sites without problems and I have not had any bug reports on RC2, so if it is still the case on Monday 7th, it will be released as a full version.

However, I do recommend that you try it out on a local/test installation prior to upgrading.

5
Olorin
Re: Control who can see sub-menus?!
  • 2004/6/1 15:24

  • Olorin

  • Just popping in

  • Posts: 50

  • Since: 2003/7/5 1


You can try "MultiMenu 1.14-04 Japanese edition", which enables you to create 4 original menus that works like the original menu.
http://malaika.s31.xrea.com/modules/mydownloads/singlefile.php?cid=2&lid=9

So create 2 menus: the menu for anonymous which doesn't contain post news on its list, and the menu for admin users which contains the all.

Grammars(in case it doesn't contain any english document):
[module_name]
[module_name]views.php?id=xxx
makes a link to a certain module if it is installed.

+[module_name]
+[module_name]views.php?id=xxx
The submenu is always shown

@[module_name]
@[module_name]views.php?id=xxx
The submenu is shown if necessary

I'm afraid to say I've not installed this module. And it could require the multibyte extension(mb_???), which means that it could not work on your server. Please check your PHP before you install.

6
JackJ
Re: Control who can see sub-menus?!
  • 2004/6/1 19:30

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


The New News module sounds like the way to go, below is some coding and tips for hiding sub-menus from anon users This example is for News.(I copied this from XOOPS For Dummies)

Hiding Submenus for Unregistered Users

Each module has any related submenus defined in the xooops_version.php file in the individual modules root folder.

For example to hide the submit menu from the anon users group in the News module look for the Menu code:

// 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";

In this one anon users will see the archive sub-menu only

Notice this line

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

group 2 = registered users

group 1 = webmasters

7
Fredrik
Re: Control who can see sub-menus?!
  • 2004/6/5 8:25

  • Fredrik

  • Just popping in

  • Posts: 26

  • Since: 2004/4/21


Nice, exactly what I was looking for!

Thanks for the help!

Login

Who's Online

350 user(s) are online (239 user(s) are browsing Support Forums)


Members: 0


Guests: 350


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