Howto keep a button visible for anymous and registred users within 1 main_menu? Howto keep a button visible for anymous and registred users within 1 main_menu?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Howto keep a button visible for anymous and registred users within 1 main_menu?

Started by Bagheera, February 13, 2005, 06:56:51 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bagheera

Hi,

I'm trying to add a second "Albumlist" button in the theme Rainy_Day, but I'm unable to find out why it doesn't work.

Note: I'm trying to use that button twice, logically I could copy album_list to album_list2 everywhere in theme.php and use album_list2 as the 2nd button, but there should be a more easier way to fix that, shouldn't it?

Some mod history:
- Removed Main_Menu2
- Moved some buttons from Main_Menu2 to Main_Menu1
- Made some buttons only available for registred users only (also the album_list button)

Which means:
Anonymous users got only the button: "Login" and later on also "Register" (When the theme is going online for the big public)
Registred members: got the buttons: "Album list", "Last Comments", "Top Rated", "My Favorites", "My Profile" and ..duh.. "Logout"

As the site will mainly be used by childeren and by "only-knows-howto-turn-on-a-pc-users" it could be very difficult for them to navigate
through the gallaries and not to force the users to register. Therefore I want to create that 2nd album list button to make navigation easier for them.


Added simply a 2nd line in theme.php with the result that the screen stays white after reloading the site.


$template_main_menu = &$template_main_menu1;

    if (USER_ID) {
        template_extract_block($template_main_menu, 'login');
    [b]template_extract_block($template_main_menu, 'album_list'); [/b]
    } else {
        template_extract_block($template_main_menu, 'album_list');
        template_extract_block($template_main_menu, 'logout');


- I've also tried to use the Main_Menu2 option, but I'm unable to get it right, but then I got the result that the buttons of the 2nd menu are
disorderd and the gifs aren't correct anymore.

Other option:
- I've also thought about to add a html-link to the index.php file (<a href="hostname/index.php">Albumlist</A>), but that will be the latest option.

Has someone tried this already or can someone give me a hint what I could do?

Thanks

kegobeer

What is this?

template_extract_block($template_main_menu, 'album_list');
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Bagheera

hmm, my mistake.

Used within the code-tag....  :-[

should be:

$template_main_menu = &$template_main_menu1;

    if (USER_ID) {
        template_extract_block($template_main_menu, 'login');
        template_extract_block($template_main_menu, 'album_list');
    } else {
        template_extract_block($template_main_menu, 'album_list');
        template_extract_block($template_main_menu, 'logout');