Multiple Custom Headers Multiple Custom Headers
 

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

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,