coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: CaptainB on January 02, 2008, 12:42:18 AM

Title: Left side menu problems
Post by: CaptainB 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:
   $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.

Title: Re: Left side menu problems
Post by: Nibbler 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.
Title: Re: Left side menu problems
Post by: Joachim Müller 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// 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.
Title: Re: Left side menu problems
Post by: CaptainB 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).

Title: Re: Left side menu problems
Post by: CaptainB on January 02, 2008, 12:03:02 PM
EDIT: the theme.php and not the template.php.
Title: Re: Left side menu problems
Post by: Nibbler on January 02, 2008, 01:00:23 PM
You copied pageheader(). I said pagefooter().
Title: Re: Left side menu problems
Post by: CaptainB 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!