Multiple Custom Headers Multiple Custom Headers
 

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

Multiple Custom Headers

Started by kingspice, August 02, 2007, 07:54:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kingspice

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

Joachim Müller

Huh? Review your posting, I don't understand. Some words seem to be missing.

kingspice

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

Nibbler

Just include it at the end of your existing header script.

kingspice

Hi,
I wanted to seperate the two headers as they are included at different points in template.html

Joachim Müller

Edit themes/yourtheme/template.html and add the token {CUSTOM_HEADER2} as you see fit.
Then edit themes/yourtheme/theme.php ,findfunction pageheaderand 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,