Welcome to Geeklog, Anonymous Friday, December 13 2024 @ 01:00 pm EST

Geeklog Forums

Need help with menu elements after upgrading


Status: offline

Rick78

Forum User
Regular Poster
Registered: 10/20/03
Posts: 98
Hi All,

I just upgraded from version 1.3.8 to 1.3.11 and I have some problems with getting new items in the menu bar.
My theme is an older one, but it does call the menu_elements fine. I can '//' items out in the config.php and they go away. However, if I remove the '//' from the custom line, the two samples in lib-custom.php (Gallery, and My Calendar) do not appear.

How do I get these to appear?

I assume that once I can get this to work, I can add more.
I think I need some understanding to the way the
function CUSTOM_menuEntries ()
actually works and how to update it.

Thanks a lot for any help.

The site I am working on : http://www.flagfootball.dk

Regards,
Rick
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 10/20/03
Posts: 98
More info:
I split the system and public_html directories up. My lib-custom.php is still in the system folder (/etc/geeklog/flagfootball/system/lib-custom.php)
My public_html is here:
/var/www/html/flagfootball/

Other functions in the lib-custom.php (which I added) are working correctly.
 Quote

Status: offline

thechadd

Forum User
Newbie
Registered: 02/23/05
Posts: 6
the only difference in my themes is this:

old (manually added elements):
Text Formatted Code
<td width='100%' height='20' valign="top" align="center">
            {allowed_menu_elements}{plg_menu_elements}<a href="http://MYIP/gallery">gallery</a> | <a href='http://MYIP/kplaylist/'>mp3's</a>
            </td>

 


new (using build in menu element stuff):
Text Formatted Code
<td width='100%' height='20' valign="top" align="center">
            {menu_elements}{plg_menu_elements}
            </td>

 

Then in the config.php make sure the custom is uncoimmented:
Text Formatted Code
$_CONF['menu_elements'] = array
(
    // 'home',      // link to homepage
    'contribute',   // contribute / "submit a story" link
    'links',        // link to the links section (aka web resources)
    'polls',        // link to past polls
    'calendar',     // link to the site calendar
    'search',       // link to advanced search
    'stats',        // link to site stats
    // 'prefs',     // link to user's preferences
    'plugins',       // links added by plugins, like {plg_menu_elements}
    'custom'     // for custom links (see lib-custom.php)
);
 


and in lib-custom.php add the new entries:

Text Formatted Code
/**
* 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 ();

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

    // link #2: Link to mp3's    // logged-in users only
    if (!empty ($_USER['uid']) && ($_USER['uid'] > 1)) {
        $myentries[] = array ('url'   => $_CONF['site_url/..']  . '/kplaylist/',
                              'label' => 'mp3\'s');
    }

    return $myentries;
}

 

 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 10/20/03
Posts: 98
Thanks for the reply.

Is the first reference the header.thtml in the theme?
My header.thtml already has this:

Text Formatted Code
<td colspan="2" valign="bottom" bgcolor="#9A0503"><img src="{layout_url}/theme-images/pixel.gif" alt="" height="20" width="8" align="absmiddle" border="0">{menu_elements}{plg_menu_elements}</td>
 
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Rick78: I can '//' items out in the config.php and they go away. However, if I remove the '//' from the custom line, the two samples in lib-custom.php (Gallery, and My Calendar) do not appear.

The function CUSTOM_menuEntries is commented out. Did you remove the comment markers?

bye, Dirk
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 10/20/03
Posts: 98
Hi Dirk,

Thanks for the reply. I do not understand how it is commented out in the function. I remmoved the '//' in config.php on the custom line.
My lib-custom.php:

Text Formatted Code
/*
function CUSTOM_menuEntries ()
{
    global $_CONF, $_USER;

    $myentries = array ();

    // Sample link #1: Link to Gallery
    $myentries[] = array ('url'   => $_CONF['site_url'] . '/gallery/',
                          '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.php?mode=personal',
                              'label' => 'My Calendar');
    }

    return $myentries;
}
*/

?>

 
 Quote

mach

Anonymous
notice the /* and the */ before and after your function... these are also comment markers
 Quote

Status: offline

Rick78

Forum User
Regular Poster
Registered: 10/20/03
Posts: 98
Yes Yes.

Thanks a lot!

I wonder why this has to be commented out.
Does it cause a problem if it is not commented?

It should maybe be noted in the config.php comments.

Thanks a lot.

Rick
 Quote

ensalada

Anonymous
Thanks this advice was very helpful. Now how do I update my site with 1.3.11?

I downloaded the .zip file and uploaded it to my Admin plugins folder but it is not unzipped.

What am I doing wrong??

Big Celebration Very Happy Can someone help me
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by ensalada: I downloaded the .zip file and uploaded it to my Admin plugins folder but it is not unzipped.

There is no .zip file for Geeklog - only a .tar.gz

And, obviously, you have to unpack it (either locally or, if you can, on the server). Then follow the instructions ...

bye, Dirk
 Quote

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