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

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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 2 Guests 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