Help with Custom header and footer Help with Custom header and footer
 

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

Help with Custom header and footer

Started by Hamsterpants, July 18, 2005, 11:43:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hamsterpants

Hi All,

Please could someone have a look at the code below and let me know if you can spotthe problem. All I am getting is a page that display :
Powered by Coppermine Photo Gallery
{CUSTOME_FOOTER}

here is the bit of code from the theme.php page.

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

  if(empty($custom_header)){
     include('http://www.mystaffie.com/_header.php');
     /*static*/ $custom_header = ob_get_contents();
     ob_clean();
    }   
   
    $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'] . ' - ' . $section,
        '{CHARSET}' => $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);
}
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;


   if(empty($custom_footer)){
     include('http://www.mystaffie.com/_footer.php');
     /*static*/ $custom_footer = ob_get_contents();
     ob_clean();
    }         
   
   if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }
   
   $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
    );   

   echo template_eval($template_footer, $template_vars);
}


Thanks
Dill
Dillon Weyer
dill@mystaffie.com

Hamsterpants

ok I am getting the custom header to work fine now, but the custom footer is not showing. Also the power by sits at the top fo the page now and not the bottom. updated code from theme.php below. I have also attached template.php

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

  if(empty($custom_header)){
     include('http://www.mystaffie.com/_header.php');
     /*static*/ $custom_header = ob_get_contents();
     ob_clean();
    }   

    $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'] . ' - ' . $section,
        '{CHARSET}' => $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);
}
// Function for writing a pagefooter
function pagefooter()
{
    global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

     if(empty($custom_footer)){
       include('http://www.mystaffie.com/_footer.php');
       /*static*/ $custom_footer = ob_get_contents();
       ob_clean();
      }   

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }
   
    $template_vars = array(
      '{CUSTOM_FOOTER}' => $custom_footer,
        );

    echo template_eval($template_footer, $template_vars);
}

Thanks inadvance
Dill
Dillon Weyer
dill@mystaffie.com

Hamsterpants

ok just another update. i have paste the custom fotter html into template rather then trying to use an include all works fine, so must be something wrong that I have doen in the code in theme.php.

Any help would be apprciated.

Thanks
Dill
Dillon Weyer
dill@mystaffie.com

donnoman

you must be a Brit, adding "e"'s where they don't belong  ;D
Quote
Powered by Coppermine Photo Gallery
{CUSTOME_FOOTER}

Check your spelling of that tag in your template.html; It should be {CUSTOM_FOOTER} to match what you have in the template_vars array.

Hamsterpants

mmmm :-[ feel like an idiot, let me try without the "e". I am actually South African, but living in the UK. They must be rubbing off one me :)

Thanks very much
Dill
Dillon Weyer
dill@mystaffie.com

Hamsterpants

Ok still had some issues, like the "powered by" was at the top of the page. I canned the changes I had made and started again. I would highly recomend reading this post - http://forum.coppermine-gallery.net/index.php?topic=9863.0 , issues solved. Last question, how do I now mark this post as solved?

Thanks
Dill
www.mystaffie.com
Dillon Weyer
dill@mystaffie.com

Joachim Müller

Quote from: Hamsterpants on July 19, 2005, 12:05:13 PM
Last question, how do I now mark this post as solved?
You can't, that's something only moderators can do. You just do as you did: reply to your own thread, saying that it's solved. Then, a moderator will tag the thread accordingly.

Hamsterpants

Dillon Weyer
dill@mystaffie.com

stock

Just a note about custome - not brits do not spell it wrong. it is custom here too!!!