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: Having an awful time with menu links in water_drop  (Read 4921 times)

0 Members and 1 Guest are viewing this topic.

JoelFan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Having an awful time with menu links in water_drop
« on: October 23, 2010, 01:08:27 pm »

Hi everyone, and all apologies for bringing a problem to the table.

I can assure that before making this post I've spent several days trying to solve this issue on my own via the documentation at http://documentation.coppermine-gallery.net/en/theme.htm#theme_files and at http://documentation.coppermine-gallery.net/en/theme_theme_php.htm and also through via many searches of this forum. I know that the last thing anyone wants to see is a question that has already been answered in the documentation or in other forum threads.

With that in mind, I am hesitant and reluctant to bother anyone here with my dilemma, but I have run out of avenues for troubleshooting what is probably a very simple issue, yet seemingly beyond my grasp.

On with the basic scenario and evrything I've tried thus far....

On a very standard hosting account (cPanel, Linux, Apache, PHP 5, mySQL 5) environment I have done a fresh empty install of CPG 1.5.8 (Stable) and everything works fine with the excpetion of the fact that I cannot moidy the menu links display in the water_drop theme to display the way that I need them to.

Let me preface this by mentioning that I've also restored the the  "Final Extraction" pugin to achieve my goal, yet still even with all of its power and the use of excerpts of code from the "sample" theme I keep ending up against a brick wall.

Basically all I wanto to be able to do are two simple things:
1. Remove specific menu links (such as Login or Most Viewed) from the links menu
2. Have the {SYS_MENU} and {SUB_MENU} on the same line together without the missing "caret" images in between each link

To truly show what I'm trying to achieve, since sometimes visuals are better than words, I have attached a modified screenshot to this post.

Now with that said and the screenshot attached I will try to put it into words:

I want the public un-registered user links to only show HOME / ALBUMS / SEARCH and yet everything I've attempted based on the CPG 1.5.8 documetion and also by applying the Final Extration plugin, my quest ends in failure (either a blank screen or an error message such as a "Call to undefined function assemble_template_buttons() " ).

Part of this seems to be dependent on the fact that the theme.php file for the water_drop theme doesn't have any of the common variables that other themes do. Basically the content of the water_drop theme consists of this:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2010 Coppermine Dev Team
  v1.0 originally written by Gregory Demar

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.

  ********************************************
  Coppermine version: 1.5.8
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/themes/water_drop/theme.php $
  $Revision: 7805 $
**********************************************/

define('THEME_HAS_PROGRESS_GRAPHICS'1);

// HTML template for template sys_menu spacer
$template_sys_menu_spacer '<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';

?>

So, here is what I have tried based on all of the documentation I could find here on this site in the docs / themes section and also upon forum searches:

First I tried simply installing the Final Extraction plugin. The results were that I was easily able to remove unwanted menu links, but there seemed to be no way to place the needed caret.gif images and spacers between sys menu items and sub menu items.

SO...

Second I tried following the documentation and adding this piece of code to the theme.php file:

Code: [Select]
/******************************************************************************
** Section <<<$template_sub_menu>>> - START
******************************************************************************/
// 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 = '<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';

  // HTML template for template sys_menu buttons

  $template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <a href="{HREF_TGT}" title="{HREF_TITLE}" {HREF_ATTRIBUTES}>{HREF_LNK}</a> {SPACER}
  <!-- END {BLOCK_ID} -->
EOT;

  // 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',$template_sys_menu_spacer);
    // addbutton($sys_menu_buttons,'{CONTACT_LNK}','{CONTACT_TITLE}','{CONTACT_TGT}','contact',$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);
    // if (array_key_exists('allowed_albums', $USER_DATA) && is_array($USER_DATA['allowed_albums']) && count($USER_DATA['allowed_albums'])) {
    //  addbutton($sys_menu_buttons,'{UPL_APP_LNK}','{UPL_APP_TITLE}','{UPL_APP_TGT}','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,'{SIDEBAR_LNK}','{SIDEBAR_TITLE}','{SIDEBAR_TGT}','sidebar',$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,'{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.



  $sys_menu_buttons = CPGPluginAPI::filter('sys_menu',$sys_menu_buttons);
  $params = array('{BUTTONS}' => assemble_template_buttons($template_sys_menu_button,$sys_menu_buttons));
  $template_sys_menu = template_eval($template_sys_menu,$params);
}
/******************************************************************************
** Section <<<$template_sub_menu>>> - END
******************************************************************************/

Noting that I put a // before each menu item that I wish to remove from the visitors public menu. When doing so I either encounter a blank page or a " Fatal error: Call to undefined function assemble_template_buttons() ... " when trying to load the CPG after the theme.php modification as described above.

Obviously I'm either overlooking something simple (very possible!) or there is more code necessary to add to theme.php for the water_drop theme to work, OR maybe this is a matter of editing a PHP file or template file within CPG 1.5.8

Could I perhaps ask for the expert advice of a more experienced CPG webmaster to help me resolve this and perhaps point out what I am doing wrong?

Many MANY thanks to anyone who is willing to provide their opinions and advice. Thank you!
Logged

JoelFan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: Having an awful time with menu links in water_drop
« Reply #1 on: October 23, 2010, 01:12:03 pm »

Here is the screenshot that sums it up.
Logged

François Keller

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 9094
  • aka Frantz
    • Ma galerie
Re: Having an awful time with menu links in water_drop
« Reply #2 on: October 23, 2010, 01:40:02 pm »

The final_extract plugin is what you should use to do this
Logged
Avez vous lu la DOC ? la FAQ ? et cherché sur le forum avant de poster ?
Did you read the DOC ? the FAQ ? and search the board before posting ?
Mon Blog

JoelFan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: Having an awful time with menu links in water_drop
« Reply #3 on: October 23, 2010, 02:35:41 pm »

The final_extract plugin is what you should use to do this

Thank you. I have used it (as I mentioned in the original post) and the problem is that it cannot put all the the menu links on one straight line, and even if it could it still cannot add the correct divider graphics/spaces between the links.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1543
  • aka 'i-imagine'
    • Home Page
Re: Having an awful time with menu links in water_drop
« Reply #4 on: October 23, 2010, 03:14:07 pm »

JoelFan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: Having an awful time with menu links in water_drop
« Reply #5 on: October 30, 2010, 06:35:20 am »

Thanks for the reply Joe - I understand that it is usually much easier to help someone if they post a link to their CPG, but I'm not comfortable posting a link to mine publicly at this time. I'll just try my best to continue attempting to sort the issue out on my own for the moment. Besides, my CPG itself is working fine - no errors or anything like that - at this point it's just a matter of trying to get Water_Drop to allow me to display the SYSMENU and SUBMENU links all on one single line, rather than on two separate lines. So far it seems like I'll need to find a file where I can edit that part manually.

Thank you though, for being willing to help, I really do appreciate it!
Logged

JoelFan

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: Having an awful time with menu links in water_drop
« Reply #6 on: October 30, 2010, 08:44:36 am »

I think I've found a solution and it might be helpful to other users so I'll post details here after I test it out.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.