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: Left side menu problems  (Read 2981 times)

0 Members and 1 Guest are viewing this topic.

CaptainB

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Left side menu problems
« on: January 02, 2008, 12:42:18 am »

Hi,

According to this: http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#rightHandMenu I should be able to make my a left/right side menu appear.

However I have some problems.

When I look @ my theme.php file (one slightly modified from the Hardwired default theme), I have no section with this, as it says in the above link:
Code: [Select]
   $template_vars = array(
      '{LANG_DIR}' => $lang_text_dir,
      '{TITLE}' => $CONFIG['gallery_name'].' - '.$section,
      '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
      '{META}' => $meta,
      '{GAL_NAME}' => $CONFIG['gallery_name'],
      '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
      '{MAIN_MENU}' => theme_main_menu(),
      '{ADMIN_MENU}' => theme_admin_mode_menu()
   );

   echo template_eval($template_header, $template_vars);

That's why I tried to insert it, and split it up as descriped in the above link, however that dosn't work, and I get a white page with this error:

Quote
Fatal error: Call to undefined function theme_main_menu() in /xxxxxxxxx/xxxxxxxxx.xxx/xxxxxxxxx.xxx/xxxxx.xxx/gallery/themes/behrentzs/theme.php on line 42

When I remove that lines again, everything turns out as before.
Here's a link to my gallery: http://www.behrentzs.com/gallery/

Where the "{" and "}" are, is where I try to move my menu.

« Last Edit: January 02, 2008, 02:36:08 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Left side menu problems
« Reply #1 on: January 02, 2008, 01:02:22 am »

You need to add the entire pagefooter function to your theme.php, not just that section of code you posted. If you have problems zip up and attach your theme to this thread.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Left side menu problems
« Reply #2 on: January 02, 2008, 07:57:21 am »

If a particular section (function / constant definition / variable definition) that you would like to override doesn't exist in your custom theme, copy the corresponding section from the sample theme. In your case, copy
Code: [Select]
// Function for writing a pageheader
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

        $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
        header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        );

    echo template_eval($template_header, $template_vars);
}
from themes/sample/theme.php into a new line before
Code: [Select]
?>of the file themes/yourtheme/theme.php, then modify as suggested.
Logged

CaptainB

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Left side menu problems
« Reply #3 on: January 02, 2008, 12:01:49 pm »

I still can't make it work with the code provided above. I think I've done it right, but obviously it seems like I havn't, as it still dosn't work and still just show the "{" and "}" where the menus should have been.

Attrachted is the theme with the template.php modified as I think it should be (still not working).

Logged

CaptainB

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Left side menu problems
« Reply #4 on: January 02, 2008, 12:03:02 pm »

EDIT: the theme.php and not the template.php.
Logged

Nibbler

  • Guest
Re: Left side menu problems
« Reply #5 on: January 02, 2008, 01:00:23 pm »

You copied pageheader(). I said pagefooter().
Logged

CaptainB

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Left side menu problems
« Reply #6 on: January 02, 2008, 02:34:52 pm »

Ah, I didn't realize they were seperate like that. Thanks guys, now it works like a charm!
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 15 queries.