Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 12:37 pm EST

Geeklog Forums

Turning off menu items for non logged in users


Curly

Anonymous
Hi,

I know there's a bit of PHP code I can drop in to my header.thtml to only display (for example) the links to my Gallery or Downloads sections to logged in users, rather than have the links appear, but then come up and say user does not have access, I would rather have them not visable at all.

Any one know, I know its only a couple of lines.

Curly
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
For Geeklog's built-in menu entries, you can use {allowed_menu_elements} instead of {menu_elements}.

For the plugins, you would have to modify their menu functions to check the global variable $_USER['uid']. If it's not set or 1, the current user is not logged in.

bye, Dirk
 Quote

Status: offline

ItsCurly

Forum User
Junior
Registered: 12/05/05
Posts: 24
Took me a while to reply, as been busy with other site related stuff, GL has so many cool features and plugins to play with, its great!

I finally figured out about {allowed_menu_elements} and it removes everything. Cool, thats what I wanted. However, when I log in, it has all my custom menu items not showing up as I am guessing the custom stuff in lib-custom.php only applies to {menu_elements} not {allowed_menu_elements}.

Is there any way around this? If not, can I request it as a feature in a future update!

In the meantime, just found the update for filemgmt which apparently has the features I am interested in - turning on an off specific download for certain groups. Blaine is a busy man, but he does an excellent job, and Dirk is always there when anyone needs help too.

--UPDATE--

Been tinkering, new filemgmt works fine and trying a workaround - turning everything off in config.php for the top menu, and setting manual links for logged in users in lib-custom.php. This works fine, the only issue I have is with filemgmt. The only link I have left at the top for non logged in users is My Downloads. I am assuming the setting for this lies within the filemgmt plugin, as the other plugins don't show up when logged out, but do when logged in.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Quote by ItsCurly: I am assuming the setting for this lies within the filemgmt plugin, as the other plugins don't show up when logged out, but do when logged in.
Have a look at the online admin settings in the filemgmt plugin.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

ItsCurly

Forum User
Junior
Registered: 12/05/05
Posts: 24
Thanks for your prompt reply.

I have these settings in online admin, but still shows up on front page when logged out:

Restrict access to group 'Logged-In Users' only: Yes
Allow Logged-In uploads: No
Enable Anonymous access: No
Allow Anonymous uploads: No

It does restrict access in that when you click the link it says 'user does not have access to the document repository'
 Quote

All times are EST. The time is now 12:37 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content