coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: Bagheera on February 13, 2005, 06:56:51 PM

Title: Howto keep a button visible for anymous and registred users within 1 main_menu?
Post by: Bagheera on February 13, 2005, 06:56:51 PM
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
Title: Re: Howto keep a button visible for anymous and registred users within 1 main_me
Post by: kegobeer on February 13, 2005, 06:59:40 PM
What is this?

template_extract_block($template_main_menu, 'album_list');
Title: Re: Howto keep a button visible for anymous and registred users within 1 main_me
Post by: Bagheera on February 13, 2005, 07:01:58 PM
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');