Welcome to Geeklog, Anonymous Tuesday, June 06 2023 @ 06:01 pm EDT

Geeklog Forums

How to hide media gallery from menu?


longness

Anonymous
Ä°s there An option to hide the media gallery from anonymous users. Calendar has a this type option but I couldn't find it for media gallery. Besides I couldn't find any topic regarding this subject.

Any help would be appreciated. :helpme:
 Quote

Status: offline

mevans

Forum User
Full Member
Registered: 02/08/04
Posts: 393
Location:Texas
longness,

No, there is not an option to hide the menu entry to anonymous users, just a method to keep anonymous users out (Login Required setting).

If you want to manually remove the entry, you can edit the Media Gallery functions.inc file (plugins/mediagallery/ directory).

Around line 296 you will see:

Text Formatted Code

function plugin_getmenuitems_mediagallery() {
     global $_CONF, $_USER, $_MG_CONF;
 
      $menulabel = $_MG_CONF['menulabel'];
      $menurul   = $_MG_CONF['site_url'] . "/index.php";     // Menu url here
 
      $menuitems = array();
      $menuitems["$menulabel"] = $menurul;
      return $menuitems;
}
 


You can change this to:

Text Formatted Code

function plugin_getmenuitems_mediagallery() {
     global $_CONF, $_USER, $_MG_CONF;

     if ( !isset($_USER['uid']) || $_USER['uid'] < 2 ) {
         return;
     }
 
      $menulabel = $_MG_CONF['menulabel'];
      $menurul   = $_MG_CONF['site_url'] . "/index.php";     // Menu url here
 
      $menuitems = array();
      $menuitems["$menulabel"] = $menurul;
      return $menuitems;
}
 


This change will now only show the menu entry to users who are logged into the site.

Let me know if this fixes it for you.

Thanks!
Mark
 Quote

longness

Anonymous
Thanks. Ä°t worked. :banana:
 Quote

All times are EDT. The time is now 06:01 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