forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: Hamsterpants on July 18, 2005, 11:43:45 am

Title: Help with Custom header and footer
Post by: Hamsterpants on July 18, 2005, 11:43:45 am
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
Title: Re: Help with Custom header and footer
Post by: Hamsterpants on July 18, 2005, 12:18:57 pm
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
Title: Re: Help with Custom header and footer
Post by: Hamsterpants on July 18, 2005, 01:11:22 pm
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
Title: Re: Help with Custom header and footer
Post by: donnoman on July 19, 2005, 04:38:52 am
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.
Title: Re: Help with Custom header and footer
Post by: Hamsterpants on July 19, 2005, 09:27:53 am
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
Title: Re: Help with Custom header and footer
Post by: Hamsterpants on July 19, 2005, 12:05:13 pm
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
Title: Re: Help with Custom header and footer
Post by: Joachim Müller on July 20, 2005, 08:00:56 am
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.
Title: Re: Help with Custom header and footer
Post by: Hamsterpants on July 21, 2005, 12:22:15 pm
ok cool
Title: Re: Help with Custom header and footer
Post by: stock on August 15, 2005, 09:54:13 pm
Just a note about custome - not brits do not spell it wrong. it is custom here too!!!