Hi,
I've searched but not found a solution for this, i would like to add "My Favorites to the sys_menu instead of the pageheader menu. Ive successfully removed the button from the pageheader, however i cannot get it to work with the sys_menu.
Can anyone help me with the code that i need to add here:
// HTML template for template sys_menu buttons
if (!isset($sys_menu_buttons)) { //{THEMES}
// {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);
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_LNK}', '{LOGOUT_TITLE}', '{LOGOUT_TGT}', 'logout', '');
and probably also here:
if ($which == 'sys_menu' ) {
if (USER_ID) {
template_extract_block($template_sys_menu, 'login');
} else {
template_extract_block($template_sys_menu, 'logout');
template_extract_block($template_sys_menu, 'my_profile');
}
if (!USER_IS_ADMIN) {
template_extract_block($template_sys_menu, 'enter_admin_mode');
template_extract_block($template_sys_menu, 'leave_admin_mode');
} else {
if (GALLERY_ADMIN_MODE) {
template_extract_block($template_sys_menu, 'enter_admin_mode');
} else {
template_extract_block($template_sys_menu, 'leave_admin_mode');
}
}
if (!USER_CAN_CREATE_ALBUMS) {
template_extract_block($template_sys_menu, 'my_gallery');
}
if (USER_CAN_CREATE_ALBUMS) {
template_extract_block($template_sys_menu, 'my_profile');
}
if (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {
template_extract_block($template_sys_menu, 'upload_pic');
}
if (USER_ID || !$CONFIG['allow_user_registration']) {
template_extract_block($template_sys_menu, 'register');
}
if (!USER_ID || !$CONFIG['allow_memberlist']) {
template_extract_block($template_sys_menu, 'allow_memberlist');
}
if (!$CONFIG['display_faq']) {
template_extract_block($template_sys_menu, 'faq');
}
Thanks for the support!
I fixed this my self, i found this thread : http://forum.coppermine-gallery.net/index.php?topic=26897.0 (http://forum.coppermine-gallery.net/index.php?topic=26897.0) (sticky,i should have seen it before making this post).
QuoteThe 5th parameter is the BLOCK_ID and must not be modified. Coppermine uses the BLOCK_ID to identify this button and uses it when it wants to do something in the core code with this button. In the example above, 'home' is the BLOCK_ID. If for example you want to replace the home link with a link to your BBS so you can switch back & forth between your Coppermine gallery and your forum boards, replace the _LNK, _TITLE, and _TGT, but keep the BLOCK_ID as 'home' even though it might not be your home page. If you want to add a link in addition to the home link, you add a new addbutton line in the appropriate place. The curly braces in the default buttons are used by Coppermine as labels to be replaced with language-compatible text or URLs. If you want to replace something with custom text & URL, do not use curly braces - just type in the text & URL in single quotes. So, in this example, you would modify the home addbutton as follows:
Code:
addbutton($sys_menu_buttons,'Forum','Go to the forums.','../phpBB/index.php','home',$template_sys_menu_spacer);
As you see, I didn't touch the BLOCK_ID 'home'.
Worked great, i didn't use the home however, i used 'faq' but it was just the same, great and easy.
Quote from: dke on February 09, 2008, 12:51:47 AM
I fixed this my self, i found this thread : http://forum.coppermine-gallery.net/index.php?topic=26897.0 (http://forum.coppermine-gallery.net/index.php?topic=26897.0) (sticky,i should have seen it before making this post).
Exactly!