Left side menu problems Left side menu problems
 

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]

Main Menu

Left side menu problems

Started by CaptainB, January 02, 2008, 12:42:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CaptainB

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:
   $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:

QuoteFatal 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.


Nibbler

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.

Joachim Müller

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// 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?>of the file themes/yourtheme/theme.php, then modify as suggested.

CaptainB

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).


CaptainB

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

Nibbler

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

CaptainB

Ah, I didn't realize they were seperate like that. Thanks guys, now it works like a charm!