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: Help with Custom header and footer  (Read 7768 times)

0 Members and 1 Guest are viewing this topic.

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Help with Custom header and footer
« 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
« Last Edit: July 19, 2005, 04:04:11 pm by Nibbler »
Logged
Dillon Weyer
dill@mystaffie.com

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Help with Custom header and footer
« Reply #1 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
Logged
Dillon Weyer
dill@mystaffie.com

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Help with Custom header and footer
« Reply #2 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
Logged
Dillon Weyer
dill@mystaffie.com

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Help with Custom header and footer
« Reply #3 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.
Logged

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Help with Custom header and footer
« Reply #4 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
Logged
Dillon Weyer
dill@mystaffie.com

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Help with Custom header and footer
« Reply #5 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
Logged
Dillon Weyer
dill@mystaffie.com

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Help with Custom header and footer
« Reply #6 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.
Logged

Hamsterpants

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 34
    • My Staffie.com
Re: Help with Custom header and footer
« Reply #7 on: July 21, 2005, 12:22:15 pm »

ok cool
Logged
Dillon Weyer
dill@mystaffie.com

stock

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 109
Re: Help with Custom header and footer
« Reply #8 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!!!
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 19 queries.