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: [Solved]: Problem adding a custom header  (Read 4660 times)

0 Members and 1 Guest are viewing this topic.

skateoroma

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
[Solved]: Problem adding a custom header
« on: May 15, 2004, 04:46:32 am »

I've followed the directions in the FAQ but I still can't get my page header to display.  I receive the error below.

Fatal error: Call to undefined function: theme_display_album_list_cat() in /home/quadindu/public_html/62mm/gallery/index.php on line 493

theme.php edits

Code: [Select]
function pageheader($section, $meta = '')

{

   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   if(empty($custom_header)){
      include('/home/quadindu/public_html/62mm/include/header.php');
      static $custom_header = ob_get_contents();
      ob_clean();
   }

   header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
   user_save_profile();

   $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(),
      '{CUSTOM_HEADER}' => $custom_header,


        );

    echo template_eval($template_header, $template_vars);

}


template.php edits

Code: [Select]
<table>
<tr>
<td width="100%" align=center>{CUSTOM_HEADER}</td>
</tr>
</table>

www.62mm.org/gallery

Please help.  Thx.... ??? ??? ???
« Last Edit: May 16, 2004, 01:02:19 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Problem adding a custom header
« Reply #1 on: May 15, 2004, 09:14:11 am »

check that the function theme_display_album_list_cat is actually there. Make sure you haven't accidentally deleted or added surplus curly braces in the wrong place.
It's impossible to tell anything else by the code snippets you posted.

GauGau
Logged

skateoroma

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
Re: Problem adding a custom header
« Reply #2 on: May 15, 2004, 08:19:42 pm »

Thanks man, i got it working.  I just used a php include statement and took out all the other custom stuff.  No {CUSTOM_HEADER} call needed either.

theme.php
Code: [Select]
function pageheader($section, $meta = '')

{

    global $CONFIG, $THEME_DIR;

    global $template_header, $lang_charset, $lang_text_dir;



    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');

    user_save_profile();



    $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()

        );

//Call to custom header
include("/path_to_custom_header/header.php");

    echo template_eval($template_header, $template_vars);

}

That's it.  Worked very well.  Thanks...
Logged

kirky

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Female
  • Posts: 24
  • I'm only new to this.. so speak slowly .. please..
    • Kirky's Kreations
Re: [Solved]: Problem adding a custom header
« Reply #3 on: January 29, 2005, 11:01:20 am »

I just want to thank you so much for posting that skateoroma . I was at my wits end and I used your method and it worked fantastic for me.. if only someone else had of shared it. I don't have much expereince with this sort of thing but i tried editing like the FAQ i got my header but the rest of page turned out awful.. yay Im so happy now.. my header is sliced up images using imageready so was a bit of a pain! thanks :) :) ;D  now just gotta change colours and remove the logo add my background image and make page same width as my header and i am done..

Kirsten

http://www.kirkyskreations.com/gallery/
Logged
Kirsten xx
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.