1
fredriksk
hide submenu items for anonomus users in mainmenu
  • 2004/10/11 16:35

  • fredriksk

  • Just popping in

  • Posts: 9

  • Since: 2004/5/10


Just fought of anoter question

Can you hide submenu choices in mainmenu?

Example:
I´m letting anonomus users (that havn´t loged in yet) view news. But I don´t want them to se the submit news that is indented under news in the main menu. I have already seen to that they can´t submit news but I don´t want the alternative to submit news to be visiable in the main menu to non-loged in users.

(Users and admins should be able to see this choice in the menu though)

2
giba
Re: hide submenu items for anonomus users in mainmenu
  • 2004/10/11 16:55

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Go in administration of modules.
Choice 0 (zero) in I modulate it of the news.
Later It includes in the multimenu to send the news and you must define to only show for registered users.

Example: http://www.seusite.com.br/modules/news/submit.php

Sorry my english.

3
Stewdio
Re: hide submenu items for anonomus users in mainmenu
  • 2004/10/11 16:55

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


This level of permission control is not available in the news module currently supplied with XOOPS.

You can however, upgrade and use News 1.2 or greater. This module has many new additions to the permission system which allows greater user control of who can approve, submit and view news.

Please read the instructions carfully before you upgrade. You can get a copy by clicking:
http://dev.xoops.org/modules/xfmod/project/?group_id=1008

Good Luck

4
fredriksk
Re:hide submenu items for anonomus users in mainmenu
  • 2004/10/11 20:16

  • fredriksk

  • Just popping in

  • Posts: 9

  • Since: 2004/5/10


OK.

Can I remove the subitem "post an article" from the main menu all together then?

5
Tbird
Re:hide submenu items for anonomus users in mainmenu
  • 2004/10/21 12:46

  • Tbird

  • Just popping in

  • Posts: 1

  • Since: 2004/1/16


Hi
I wonder if anyone has thought of a solution to this topic as none of the posts seems to work. Well one of them might work, but I cant figure out what this guy is writing. So if anyone knows of a solution or knows what Giba is talking about, please post it here.
Thanx

6
Mithrandir
Re:hide submenu items for anonomus users in mainmenu

xoops_version.php in the news module:

change
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";

to
global $xoopsUser;
if (
$xoopsUser) {
    
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
    
$modversion['sub'][1]['url'] = "submit.php";
}

7
WarDick
Re:hide submenu items for anonomus users in mainmenu
  • 2004/10/21 14:41

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


I believe a better solution is possible. Mith's solution will work however it becomes a hack and when you upgrade your site will again be broken. Unless this is put into the distrubition.

I have implemented the same features in the menu templates using the same logic as Mith's. The advantage is that when upgrades are released my menus still work. Using this approach a user can navigate a site without any messages like you are not allowed and the following redirects.

Neither Mith's nor my solutions takes full advantage of the XOOPS permissions system but either could be made to do so. They will however solve the dilema you described.

8
Mithrandir
Re:hide submenu items for anonomus users in mainmenu

I don't think it is necessary to go into too deep future-safe solutions.
My personal opinion is that if the need is greater than this quick solution, the answer is to upgrade to News 1.2.1 as it has a much more permission-using main menu.

9
WarDick
Re:hide submenu items for anonomus users in mainmenu
  • 2004/10/21 15:13

  • WarDick

  • Just can't stay away

  • Posts: 890

  • Since: 2003/9/13


Well that is a solution for news but what about other modules?

The template solution will work for any module.

10
Mithrandir
Re:hide submenu items for anonomus users in mainmenu

The question was only for News, though. But in general, you are right.

Login

Who's Online

324 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 324


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