member menus member menus
 

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

member menus

Started by laskos, March 13, 2005, 11:39:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

laskos

hi.

I am hoping someone can help. I am looking at adding a seperate menu button for members only. So when a guest goes onto the site they see the normal buttons, but when a member signs in i want a chat button to show up on the left ?

can this be done and if so can someone please help.

thanks

laskos

Nibbler

You'd need to add it into your theme's theme.php with the existing links. Put it inside a condition statement to make it members only:

if (USER_ID) {
// something
}


If you want specific code you need to give specific information.

Thx

#2
Hi,

I also would like to add a link to something like a chat (only for registered user) in my coppermine menu.
And why not by the why hide all the gallerie tools as weel.

I have try, with If (user_ID) but I don't find the right syntax...
<!-- END logout -->

                        <br /> <br />
                        <a href="http://www.google.com"><img src="themes/subsilver/images/icon_mini_chat.gif" alt="">Chat</a>
                        <a href="{LASTUP_TGT}"><img src="themes/subsilver/images/icon_mini_message.gif" alt="">{LASTUP_LNK}</a>
                        <a href="{LASTCOM_TGT}"><img src="themes/subsilver/images/icon_mini_message.gif" alt="">{LASTCOM_LNK}</a>
                        <a href="{TOPN_TGT}"><img src="themes/subsilver/images/icon_mini_message.gif" alt="">{TOPN_LNK}</a>
                        <a href="{TOPRATED_TGT}"><img src="themes/subsilver/images/icon_mini_message.gif" alt="">{TOPRATED_LNK}</a>
                        <a href="{FAV_TGT}"><img src="themes/subsilver/images/icon_mini_message.gif" alt="">{FAV_LNK}</a>
                       
                </span>
EOT;
Here is all the HTML link from my them.php file that I would like to hide for unregistered user.

May I ask somebody to help me to create the right code.

Thanks in advance
THX

Joachim Müller

// HTML template for main menu
$template_main_menu = <<<EOT
                <span class="topmenu">
<!-- BEGIN album_list -->
                        <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a> ::
<!-- END album_list -->
<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>  ::
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                        <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a> ::
<!-- END my_profile -->
<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a> ::
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a> ::
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a> ::
<!-- END upload_pic -->
<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> ::
<!-- END register -->
<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}">{LOGIN_LNK}</a>
<!-- END login -->
<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
<!-- END logout -->
                        <br />
EOT;
if (USER_ID) {
    $template_main_menu .= '                        <a href="http://www.google.com"><img src="themes/subsilver/images/icon_mini_chat.gif" alt="">Chat</a>'."\n\r";
}
$template_main_menu .= <<<EOT
                        <a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                </span>
EOT;
or (even easier)// HTML template for main menu
$template_main_menu = <<<EOT
                <span class="topmenu">
<!-- BEGIN album_list -->
                        <a href="{ALB_LIST_TGT}" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a> ::
<!-- END album_list -->
<!-- BEGIN my_gallery -->
                        <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a> ::
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a>  ::
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                        <a href="{MY_PROF_TGT}">{MY_PROF_LNK}</a> ::
<!-- END my_profile -->
<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a> ::
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                        <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a> ::
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a> ::
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a> ::
<!-- END upload_pic -->
<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a> ::
<!-- END register -->
<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}">{LOGIN_LNK}</a>
                        <br />
<!-- END login -->
<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
                        <br />
                        <a href="http://www.google.com"><img src="themes/subsilver/images/icon_mini_chat.gif" alt="">Chat</a>
<!-- END logout -->
                        <a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>
                </span>
EOT;
although I don't think they have a chat on the google home page ;)

Thx

Thanks a lot GauGau,

As usual, you provid us a useful help ;D

Finally I opt for the seconde solution you propose and as my gallery is only viewable for registered members, I have also include all the other links as you can see here below.
<!-- BEGIN logout -->
                        <a href="{LOGOUT_TGT}">{LOGOUT_LNK}</a>
                        <br /><br />
                        <a href="http://www.google.com">Chat</a> ::
                        <a href="{LASTUP_TGT}">{LASTUP_LNK}</a> ::
                        <a href="{LASTCOM_TGT}">{LASTCOM_LNK}</a> ::
                        <a href="{TOPN_TGT}">{TOPN_LNK}</a> ::
                        <a href="{TOPRATED_TGT}">{TOPRATED_LNK}</a> ::
                        <a href="{FAV_TGT}">{FAV_LNK}</a> ::
                        <a href="{SEARCH_TGT}">{SEARCH_LNK}</a>

<!-- END logout -->
                                        </span>
EOT;


Of course google do no Chat (yet lol), I still looking for a good one ! (Any idea are well come !)

Best regards
THX