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: Bug with a custom footer ? (i've read the faq)  (Read 3774 times)

0 Members and 1 Guest are viewing this topic.

mika2k3

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
    • http://www.ecrantotal.org
Bug with a custom footer ? (i've read the faq)
« on: May 23, 2004, 06:00:36 pm »

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 :

Code: [Select]
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 :

Code: [Select]
{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...

Code: [Select]
{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.
Logged

glaive

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Bug with a custom footer ? (i've read the faq)
« Reply #1 on: July 17, 2004, 03:09:47 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Bug with a custom footer ? (i've read the faq)
« Reply #2 on: July 17, 2004, 03:23:19 pm »

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
Code: [Select]
       $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
Code: [Select]
       $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);
and
Code: [Select]
echo $template_footer;will become
Code: [Select]
       $template_vars = array(
                '{MAIN_MENU}' => theme_main_menu(),
                '{ADMIN_MENU}' => theme_admin_mode_menu()
        );

        echo template_eval($template_footer, $template_vars);

Greg

GauGau
« Last Edit: July 18, 2004, 07:45:00 pm by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 18 queries.