SYS_MENU SYS_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

SYS_MENU

Started by AfroJoJo, December 03, 2008, 07:35:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AfroJoJo

Does anyone know how to remove the hyperlink(<a href>) from the logout menu button? I want it to just be in plain text and not clickable. I would like it to say "Logged in as USERNAME". Any ideas?

AfroJoJo

I just also add that I do know I should make the change in the theme.php file, but I have tried already. I'm not sure how to do it. I have messed around with the code below and can't get anywhere.

// HTML template for sys_menu
$template_sys_menu = <<<EOT
          {BUTTONS}
EOT;

// HTML template for sub_menu
$template_sub_menu = $template_sys_menu;

if (!defined('THEME_HAS_NO_SYS_MENU_BUTTONS')) {
  // HTML template for template sys_menu spacer
  $template_sys_menu_spacer ="::";

  // HTML template for template sys_menu buttons
  $template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a> {SPACER}
  <!-- END {BLOCK_ID} -->
EOT;

  // HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MY_GAL_LNK}','{MY_GAL_TITLE}','{MY_GAL_TGT}','my_gallery',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    ########### Added ###########
    if (is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
      addbutton($sys_menu_buttons,'{UPL_APP_LNK}','{UPL_APP_LNK}','editpics.php?mode=upload_approval','upload_approval',$template_sys_menu_spacer);
    }
    ############################
    addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}','upload_pic',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq',$template_sys_menu_spacer);
    addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
    addbutton($sys_menu_buttons,'','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    // Login and Logout don't have a spacer as only one is shown, and either would be the last option.

  $params = array('{BUTTONS}' => assemble_template_buttons($template_sys_menu_button,$sys_menu_buttons));
 
  $template_sys_menu = template_eval($template_sys_menu,$params);
}

Gizmo

Post a link to your gallery. What theme are you using?
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

AfroJoJo

I am using the classic theme. I am using the moderator mod as you can see in the above code.

So basically what I want to do is just remove the logout link and replace it with "Logged in as $username". I can get it to do that, but I can remove the clickable link in "Logged in as $username". How do I remove the <a href> from these functions - addbutton($sys_menu_buttons...

Gizmo

Sorry I was away for several days.

change this line:
addbutton($sys_menu_buttons,'','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');

to:
addbutton($sys_menu_buttons,'','{LOGOUT_TITLE}','','logout','');
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

AfroJoJo

Doing what you showed above removes everything.

So I changed that line to this:
addbutton($sys_menu_buttons,'{LOGOUT_LNK}','','','logout','');
Then another line to this:
'{LOGOUT_LNK}' => "Logged in as " . stripslashes(USER_NAME),

It almost does what I want except you can still click "Logged in as $username". Even though it doesnt take you anywhere, it still isn't right.