Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Customize sys menu buttons  (Read 6523 times)

0 Members and 1 Guest are viewing this topic.

marek!

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Customize sys menu buttons
« on: February 09, 2011, 11:49:32 pm »

Hi, I’ve read the whole coppermine manual again and again, can’t find how to apply attributes to each sys_menu or sub_menu buttons separately. My coppermine site (water drop theme) http://dualcab.net/gallery is bridged with phpbb3 forum (x-vision theme) http://dualcab.net
Phpbb3 theme applies attributes to each button separately –menu buttons have different background images. In coppermine I’ve managed to place {sys_menu} and {sub_menu} tokens in appropriate positions but after applying classes to the whole (sys_menu} token it doesn’t work properly – with the mouse over, all buttons change backgrounds image. I’ve put the whole menu code from sample theme into my theme.php, but unlike admin menu, which is more like table layout, sys_menu and su_menu are in php coding only. I don’t know much about php so how can I apply different attribute (different class from my style.css) to each menu button separately. 
Also, in which class in css styles can I change font size and color in menu buttons?
Thank you for the any help.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Customize sys menu buttons
« Reply #1 on: February 10, 2011, 09:08:17 am »

Please read that thread for a start: http://forum.coppermine-gallery.net/index.php/topic,68315.0.html

Please attach your whole theme as zip file if you need further help.
Logged

marek!

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Customize sys menu buttons
« Reply #2 on: February 10, 2011, 01:15:53 pm »

Thank you Andre. Please find  attached the Zip copy of my theme. I would like to mention I did read before the thread you referred to me and I DO have the “function addbutton” in my theme.php
As I said before I don’t quite understand php coding. At the bottom of my css file I put classes from phpbb3 theme which define each menu button separately, i.e. Left Button, Right Button and Middle Button. They’ve got different background images. Now, if ‘sys_menu’ or ‘submenu’ were in table layout, I know how to apply classes to <td>, <div>, etc... but I have no idea how to apply styles to this for example:

// HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}{HREF_ATTRIBUTES}
    addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home');

My apologies for the trouble but I would really like to have the same buttons as in phpbb3 theme.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Customize sys menu buttons
« Reply #3 on: February 10, 2011, 03:09:28 pm »

Please open the theme.php file and have a look at the following part:
Code: [Select]
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer);
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer,'rel="nofollow"');
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer,'rel="nofollow"');
    if ($CONFIG['browse_by_date'] != 0) {
        addbutton($sub_menu_buttons, '{BROWSEBYDATE_LNK}', '{BROWSEBYDATE_TITLE}', '{BROWSEBYDATE_TGT}', 'browse_by_date', $template_sub_menu_spacer, 'rel="nofollow" class="greybox"');
    }
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','');

As you can see, some of the buttons have a 7th parameter
Code: [Select]
,'rel="nofollow"'
That's the place where you can add your additional css classes. E.g. change the mentioned code to
Code: [Select]
    addbutton($sub_menu_buttons,'{CUSTOM_LNK_LNK}','{CUSTOM_LNK_TITLE}','{CUSTOM_LNK_TGT}','custom_link',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_custom_link"');
    addbutton($sub_menu_buttons,'{ALB_LIST_LNK}','{ALB_LIST_TITLE}','{ALB_LIST_TGT}','album_list',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_album_list"');
    addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}','lastup',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_lastup"');
    addbutton($sub_menu_buttons,'{LASTCOM_LNK}','{LASTCOM_TITLE}','{LASTCOM_TGT}','lastcom',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_lastcom"');
    addbutton($sub_menu_buttons,'{TOPN_LNK}','{TOPN_TITLE}','{TOPN_TGT}','topn',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_topn"');
    addbutton($sub_menu_buttons,'{TOPRATED_LNK}','{TOPRATED_TITLE}','{TOPRATED_TGT}','toprated',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_toprated"');
    addbutton($sub_menu_buttons,'{FAV_LNK}','{FAV_TITLE}','{FAV_TGT}','favpics',$template_sub_menu_spacer,'rel="nofollow" class="my_theme_btn_favpics"');
    if ($CONFIG['browse_by_date'] != 0) {
        addbutton($sub_menu_buttons, '{BROWSEBYDATE_LNK}', '{BROWSEBYDATE_TITLE}', '{BROWSEBYDATE_TGT}', 'browse_by_date', $template_sub_menu_spacer, 'rel="nofollow" class="greybox"');
    }
    addbutton($sub_menu_buttons,'{SEARCH_LNK}','{SEARCH_TITLE}','{SEARCH_TGT}','search','','rel="nofollow" class="my_theme_btn_search"');
and use that classes in your css file.
Logged

marek!

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Customize sys menu buttons
« Reply #4 on: February 11, 2011, 12:15:15 am »

Thank you soooo much!!! Andre. That's what I was after!!!
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 21 queries.