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:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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 1 Guest 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');