Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 12:51 pm EST
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:
Any help would be appreciated. :helpme:
14
16
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:
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:
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
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
11
11
Quote
longness
Anonymous
Thanks. Ä°t worked. :banana:
11
11
Quote
All times are EST. The time is now 12:51 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