Bug with a custom footer ? (i've read the faq) Bug with a custom footer ? (i've read the faq)
 

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

Bug with a custom footer ? (i've read the faq)

Started by mika2k3, May 23, 2004, 06:00:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mika2k3

Hello Everybody !

I want to have a custom header and a custom footer. I've read the FAQ (of course  ;) ) but have still a problem :

I've modified the "theme.php" file :


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

if(empty($custom_header)){
     include('header.php');
     $custom_header = ob_get_contents();
     ob_clean();
  }

if(empty($custom_footer)){
     include('footer.htm');
     $custom_footer = 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,
       '{MAIN_MENU}' => theme_main_menu(),
       '{ADMIN_MENU}' => theme_admin_mode_menu(),
'{CUSTOM_HEADER}' => $custom_header,
'{CUSTOM_FOOTER}' => $custom_footer
       );

   echo template_eval($template_header, $template_vars);
}



And my "template.html" file :


{CUSTOM_HEADER}
<link rel="stylesheet" href="themes/odileetmatthieu/style.css" />
<script type="text/javascript" src="scripts.js"></script>
<table width="100%" height="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="#E3BE0A">
<tr>
<td align="center" valign="top">
{MAIN_MENU}
{ADMIN_MENU}
{GALLERY}
</td>
</tr>
</table>
{CUSTOM_FOOTER}


The problem is that my {CUSTOM_FOOTER} isn't interpreted (i see nothing under the gallery !?)

But if i change my "template.html" like this...


{CUSTOM_HEADER}
{CUSTOM_FOOTER}
<link rel="stylesheet" href="themes/odileetmatthieu/style.css" />
<script type="text/javascript" src="scripts.js"></script>
<table width="100%" height="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="#E3BE0A">
<tr>
<td align="center" valign="top">
{MAIN_MENU}
{ADMIN_MENU}
{GALLERY}
</td>
</tr>
</table>


I see my header. It seems that everything under {GALLERY} is ignored ??


Can u help me please.

Thanks.

glaive

Just a thought, I've only been at it a couple hours, but I've been programming for a very long time.
If you look below the the header function  in "theme.php" you will find the footer function.

Repeat what you have done with the header file in the header function, only with the footer file in the footer function.

Cheers
Alex

Joachim Müller

#2
You may find thisthread from the old support board helpfull:
Quote from: greg link=http://coppermine.sourceforge.net/oldboard/viewtopic.php?t=1825
When the template.html is read, it is splitted in 2. What is before the {GALLERY} tag is output by the pageheader function, what is after by the pagefooter function.

If your menu is in the "footer" you need to modify your theme.php file
       $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);
will become        $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'],
       );

       echo template_eval($template_header, $template_vars);
andecho $template_footer;will become        $template_vars = array(
               '{MAIN_MENU}' => theme_main_menu(),
               '{ADMIN_MENU}' => theme_admin_mode_menu()
       );

       echo template_eval($template_footer, $template_vars);

Greg

GauGau