Next Question: removing menu items Next Question: removing menu items
 

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

Next Question: removing menu items

Started by Walkinman, January 07, 2006, 01:05:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Walkinman

Hey folks,

I know this has been asked, and I've read the docs (and about a hundred threads looking for it), but I don't know how, exactly, to remove the items like "Last uploads", "Last Comments", etc, from the main page. I understand I have to go to theme/sample/theme.php, and find some coding, copy it to the theme.php for my template (water_drop), and "comment it out" .. but I'm not sure exactly how to do this.

Can someone please give me a detailed lesson on how to do this? Exactly what do I need to copy and tase, and then how do I 'comment it out"?

Thank you.

Cheers

Carl

ecto

Sure you have really read the docs? ::)

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_album_list

Read "The content of the main page".

So if you'd like to remove random and last uploaded from the default "catlist/alblist/random,2/lastup,2" you'd change it to "catlist/alblist"

Walkinman

ello Ecto,

Thanks for your note. Yes, I did read that. That's not what I was asking, sorry if I wasn't clear. What I want to remove is the menu items at the top of the page. This stuff here:

"Album list    Last uploads    Last comments    Most viewed    Top rated"

Eventually I want to tweak the others too, but I figure one thing at a time is more than enough for me.  :)

Thanks.

Cheers

Carl

Casper

Read this thread http://forum.coppermine-gallery.net/index.php?topic=25197.0, there is an excellent plug-in attached to one of the posts by donnoman which does this very well.

it's easy to edit to remove the buttons/links you want.

@gaugau, I think this plug-in (final_extract) should be on the mods board and available in the downloads, perhaps with a simple instruction.  It will be widely used and refered to.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Walkinman

Hey Casper,

Thanks for your help. I confess, I can't make it work. I wasn't completely sure how to interpret everything on that thred (I read it last night), but after playing with it now, I think I made it work. At first I would get a blank white page, but I think it's working now.

I really appreciate all your help.

Thanks again.

Cheers

Carl

Walkinman

Hey Casper,

I knnow this might count as a 2nd question, but it's really an extension of the first. Can I make it so the remaining menu items, "Home ::   Register ::   Login
My Favorites :: Search"

all appear on one line, with perhaps some more space between them? And how can I change "My Favorites" to "My Lightbox"?

Thanks so much.

Cheers

Carl

ecto

#6
Find this in lang/english.php and edit as you see fit:

'fav_lnk' => 'My Favorites',


And to put the menu items om the same line, find {SYS_MENU} and {SUB_MENU} in themes/your_theme/template.html and make sure there are no <br /> between them.. for the classic theme it looks like this:

              {SYS_MENU} <br /> {SUB_MENU}

You could change it to this to have it all on one line, notice I added the " :: " just to make it look good.

              {SYS_MENU} :: {SUB_MENU}


To edit the space between them, find $template_sys_menu_spacer in themes/your_theme/theme.php and edit as you see fit. For the classic theme it looks like this:

  $template_sys_menu_spacer ="::";

If you can't find it in your theme.php file, then go to themes/sample/theme.php and copy all of this to your theme.php file (add it just above "?>" at the end of the file), and then edit $template_sys_menu_spacer.


// HTML template for sub_menu
if (!isset($template_sub_menu))  //{THEMES}
$template_sub_menu = $template_sys_menu;

if (!defined('THEME_HAS_NO_SYS_MENU_BUTTONS')) {

  // HTML template for template sys_menu spacer
  if (!isset($template_sys_menu_spacer))  //{THEMES}
  $template_sys_menu_spacer ="::";

  // HTML template for template sys_menu buttons
  if (!isset($template_sys_menu_button))  //{THEMES}
  $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
  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','');
    // Login and Logout don't have a spacer as only one is shown, and either would be the last option.
  } //{THEMES}

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

Walkinman

Hey Ecto,

Thank you so much. The help here is really extraordinary. I really do appreciate it very much, thanks again. I'm out for the weekend, but I should be able to edit that space when I get back. Until then, everything else (so far!! . ;)) is coming up great.

Thanks again.

Cheers

Carl

Joachim Müller

Quote from: Casper on January 07, 2006, 01:57:37 AM
@gaugau, I think this plug-in (final_extract) should be on the mods board and available in the downloads, perhaps with a simple instruction.  It will be widely used and refered to.
Good idea, please start a thread on the mods board that explains everything and contains a link to the plugin.
Imo we should even add the plugin to the cvs, at least for the devel branch.

Paver

#9
I posted a thread in the plugin contributions board for donnoman's final_extract plugin, as a central place to find it, and for further development: http://forum.coppermine-gallery.net/index.php?topic=26893.0

Also, I'm just about to post a FAQ sticky in this board for the "Failed to find block" error, which also describes removing menu items.