Hi,
I was wondering if it possible to add a second header that can be included in the same way as {CUSTOM_HEADER}. I want this code to appear the {GALLERY} so {CUSTOM_FOOTER} would not work.
Thanks
Gareth
Huh? Review your posting, I don't understand. Some words seem to be missing.
Hi,
Sorry I missed a few words out :) Hopefully this will be a bit clearer.
Basically I want to have an additional {CUSTOM_HEADER} e.g. {CUSTOM_HEADER2}, to include a PHP file in my template.html. I was just wondering is this possible?
I am not using the default {CUSTOM_FOOTER} as the content I want to include will appear above {GALLERY}.
Thanks
Gareth
Just include it at the end of your existing header script.
Hi,
I wanted to seperate the two headers as they are included at different points in template.html
Edit themes/yourtheme/template.html and add the token {CUSTOM_HEADER2} as you see fit.
Then edit themes/yourtheme/theme.php ,findfunction pageheader
and edit as suggested below. If you don't have that function definition in your custom theme, copy// Function for writing a pageheader
function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
$custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
$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'] . ' - ' . strip_tags(bb_decode($section)),
'{CHARSET}' => $charset,
'{META}' => $meta,
'{GAL_NAME}' => $CONFIG['gallery_name'],
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
'{SYS_MENU}' => theme_main_menu('sys_menu'),
'{SUB_MENU}' => theme_main_menu('sub_menu'),
'{ADMIN_MENU}' => theme_admin_mode_menu(),
'{CUSTOM_HEADER}' => $custom_header,
);
echo template_eval($template_header, $template_vars);
}
from themes/sample/theme.php into a new line before?>
of themes/yourtheme/theme.php
To add the needed code for the second token, find$custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
and add after if (into a new line)$custom_header2 = cpg_get_custom_include('path/to/your/second/header.file');
Then find '{CUSTOM_HEADER}' => $custom_header,
and add after it (into a new line) '{CUSTOM_HEADER2}' => $custom_header2,