Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 07:42 am EDT

Geeklog Forums

Gallery Menu Link Not Showing


Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
I recently upgraded from 1.4.0 to 1.4.1. When I looked at the menuitems at the top I noticed that the link to "Gallery" was no longer there. I can bring it up by hard coding it into the header.thtml file. However, I wanted to use the lib-custom.php and config.php files to accomplish this since I thought I would be needing more links to and this would make it easier. I have serach and read posts in this forum some which were identical to my situation but I was unable to resolve my situation. I am sure that the problem is not with GeekLog but at my end. Evidently I just cannot resolve it. Any help is appreciated. Thanks. The following is the code I have in the respective files and I am using the Professional Theme.

header.thtml
<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{allowed_menu_elements}{plg_menu_elements}</b></td>
</tr>

config.php
$_CONF['allowed_menu_elements'] = array
(
'home', // link to homepage
'contribute', // contribute / "submit a story" link
// 'calendar', // link to the site calendar
//'search', // link to advanced search
'stats', // link to site stats
'directory', // link to list of past stories
//'prefs', // link to user's preferences
// 'polls', // link to past polls
'plugins', // links added by plugins, like {plg_menu_elements}
'custom' // for custom links (see lib-custom.php)
//'account information' //
);

lib-custom.php
function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

// Sample link #1: Link to Gallery
$myentries[] = array ('url' => $_CONF['site_url'] . '/forensic/gallery/index.php/',
'label' => 'Gallery'Wink;

// Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar/index.php?mode=personal',
'label' => 'My Calendar'Wink;
}
return $myentries;
}

"Justice through Science"
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
which gallery are you using?

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
My apologies. I am using 1.5.3 version of gallery.
"Justice through Science"
 Quote

Status: offline

suprsidr

Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
Yeah, I don't believe G1 actually registers as a plugin.
As for your custom menu entries, that looks correct to me.
Have you cleared your cache?

-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Make sure the function function CUSTOM_menuEntries() is not commented out (it is in the default lib-custom.php).

bye, Dirk
 Quote

Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
Yes, I cleared the cache numerous times.

I also made sure the function CUSTOM_menuEntries () was not commented out in the default lib-custom.php as this was the one error that you consistently pointed out to many posters with this problem. Here is the way it reads with only the upper part being commented out.

/**
* This is an example of a function that returns menu entries to be used for
* the 'custom' entry in $_CONF['menu_elements'] (see config.php).
*
*/

function CUSTOM_menuEntries ()
{
global $_CONF, $_USER;

$myentries = array ();

// Sample link #1: Link to Gallery
$myentries[] = array ('url' => $_CONF['site_url'] . '/gallery/index.php',
'label' => 'Gallery';

// Sample link #2: Link to the Personal Calendar - only visible for
// logged-in users
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url']
. '/calendar/index.php?mode=personal',
'label' => 'My Calendar';
}

return $myentries;
}

I should have also pointed that here is what I get for the menuitems on the page:

Contribute | Advanced Search | Site Statistics | Directory | Crime Laboratory News | Links | Polls | Forum | Calendar

However in my config.php file I had not commented out home which appeared and had commented out search which did appear. Again thanks for the help. I keep hoping its just some stupid error on my part that can be easily found.

"Justice through Science"
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: chemdata

$_CONF['allowed_menu_elements'] = array


Missed this one. That should be
Text Formatted Code
$_CONF['menu_elements'] = array
without the "allowed_".

bye, Dirk
 Quote

Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
I made the change in the lib-custom.php to $_CONF['menu_elements'] = array. I then went and played around with the header.thtml file to the following lines :
<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{allowed_menu_elements}{plg_menu_elements}</b></td></tr>
making different combination of the {allowed_menu_elements}, {menu_elements} and{plg_menu_elements}. The only combination that gave me close to what I wanted but without the Gallery link was:

<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{allowed_menu_elements}{plg_menu_elements}</b></td></tr>

I get the following menu when I am logged in:
Home | Contribute | Site Statistics | Directory | Crime Laboratory News | Links | Polls | Forum | Calendar

I get the following menu when I am NOT logged in:
Home | Crime Laboratory News


If I used {menu_elements}{plg_menu_elements} or {menu_elements} the Gallery link did show up as shown below.

=================================================================================
When I have the following code in header.thtml :

<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{menu_elements}{plg_menu_elements}</b></td></tr>
I get the following menu when I am logged in:
Home | Contribute | Site Statistics | Directory | Crime Laboratory News | Links | Polls | Forum | Calendar | Gallery | My Calendar Crime Laboratory News | Links | Polls | Forum | Calendar

I get the following menu when I am NOT logged in:
Home | Contribute | Site Statistics | Directory | Crime Laboratory News | Crime Laboratory News
=================================================================================
When I have the following code in header.thtml :

<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{menu_elements}</b></td></tr>
I get the following menu when I am logged in:
Home | Contribute | Site Statistics | Directory | Crime Laboratory News | Links | Polls | Forum | Calendar | Gallery | My Calendar

I get the following menu when I am NOT logged in:
Home | Contribute | Site Statistics | Directory | Crime Laboratory News
=================================================================================

Thanks for the help thus far.
"Justice through Science"
 Quote

Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
I am trying to hardcode the Gallery link into the header.thtml file. I was using javascript similar to what was use in the lib-custom.php since I only want it to show if the user is logged in.

<script type="text/javascript">
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1))
{
document.write("<b><a class='header-navigation' href='http://www.mydomain/gallery/index.php'>Gallery</a></b>"Wink;
}
else
{
document.write(" "Wink;
}
</script>


Unfortunately this did not work. Is there an alternative to if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) which I can use in the javascript? Thanks.
"Justice through Science"
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Sorry, but I'm not sure what you are trying to accomplish. Why the JavaScript?

bye, Dirk
 Quote

Status: offline

chemdata

Forum User
Junior
Registered: 06/07/05
Posts: 21
I am trying to make sure that the Gallery link only appears when the user is logged in and not just a guest browsing the website. I am using javascript because when I took the portion of the lib-custom.php file which dealt with the gallery and tried using it in the head.thtml as below and it didn't work for me.

<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{allowed_menu_elements}{plg_menu_elements}</b>

<?php
{
global $_CONF, $_USER;

$myentries = array ();
// Sample link #1: Link to Gallery
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
$myentries[] = array ('url' => $_CONF['site_url'] . '/gallery/index.php',
'label' => 'Gallery'Wink;
}
}
?>

</td></tr>


I then tried its as javascript as below but that didn't work either. I thought it might have to do with the if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) and was looking for an equivalent to use.

<tr><td colspan="2" valign="bottom" bgcolor="#406E9B"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{allowed_menu_elements}{plg_menu_elements}</b>
<script type="text/javascript">
if (!empty ($_USER['uid']) && ($_USER['uid'] > 1))
{
document.write("<b><a class='header-navigation' href='http://www.mydomain/gallery/index.php'>Gallery</a></b>"Wink;
}
else
{
document.write(" "Wink;
}
</script>
</td></tr>


I hope I am expressing myself well enough but if not please let me know and I will try again. Thanks for the help.
"Justice through Science"
 Quote

All times are EDT. The time is now 07:42 am.

  • 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