{SYS_MENU} and all others are not interpreted if after {GALLERY} {SYS_MENU} and all others are not interpreted if after {GALLERY}
 

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

{SYS_MENU} and all others are not interpreted if after {GALLERY}

Started by quin, March 26, 2007, 03:51:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

quin

hallo

i found this topic.
but i dont understand what i have to add to my theme.php.
at the moment it contains nothing but these four lines.

define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_HAS_NAVBAR_GRAPHICS', 1);
define('THEME_HAS_FILM_STRIP_GRAPHIC', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);

{GALLERY} is the first tag in my theme, so everthing else isn't displayed.

anyone out there who can tell me the lines i have to add
or give me a link to do it myself ?

quin

quin

the correct link in the top: http://forum.coppermine-gallery.net/index.php?topic=6353.0

am i not allowes to edit my posts?

Joachim Müller

Quote from: quin on March 26, 2007, 05:21:22 PM
am i not allowes to edit my posts?
No. The edit feature has been abused in the past, that's why.
{GALLERY} is a separator token. If the menu tokens are suppossed to come after it in template.html, then you'll have to define then in the pagefooter instead of the pageheader.

The thread you refer to is completely outdated and therefor not very relevant.

quin

here are the files. perhaps you could have a look on it

greetz
quin



ps.: mir fällt es wirklich schwer dein englisch umzusetzen. hätts't du doch besser diesen thread geclosed. ;)
aber egal .. an herausforderungen wachsen soll man ja.

Joachim Müller

Maybe I haven't made myself clear: the stuff in curly braces are placeholder tokens - when the theme is parsed, they get replaced by actual, dynamic content. The {GALLERY}-token inside template.html however is different: don't think of it as a placeholder, but the actual gallery content that the other stuff is just being wrapped around. {GALLERY} is more a separator between the stuff that comes before it and the stuff that comes after it. The stuff in curly braces that comes before it must be defined inside the function pageheader; stuff in curly braces that comes after the {GALLERY}-separator must be defined inside the function pagefooter.
With almost all themes that come with coppermine, the order remains the same of the placeholder tokens before and after the {GALLERY}-token, so the defult themes that come with coppermine work fine with the pageheader and pagefooter functions that eixst out of the box and that are being taken into account if you don't have a theme-specific function defined in your custom theme. This is what is necessary in your case: the menu tokens that usually come before {GALLERY} in most themes (and that susequently are by default being defined inside the pageheader function) come after the {GALLERY}-token inside your template.html. That's why their definition needs to go into pagefooter.
I have zipped your theme with the needed modifications applied, but just for clarification (and for the potential benefit of others who might come across this thread looking for similar issues), here's what I did: I copied // 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);
}

// Function for writing a pagefooter
function pagefooter()
{
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
    );

    echo template_eval($template_footer, $template_vars);
}
from themes/sample/theme.php into a new line before?>of the custom theme file themes/works/theme.php ("works" is the name of quin's custom theme in this example). Subsequently, I had the default function definition overriden inside the custom theme. Now it's time to modify the functions accordingly - I changed above code to// 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,
        '{CUSTOM_HEADER}' => $custom_header,
        );

    echo template_eval($template_header, $template_vars);
}

// Function for writing a pagefooter
function pagefooter()
{
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
        '{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(),
    );

    echo template_eval($template_footer, $template_vars);
}


HTH

Joachim

P.S. There's an additional benefit for others (non-German speaking visitors of this forum) if I answer threads like yours on the international forum instead of the German-only one. Please respect board rules and do only post English here (for the benefit of others with similar issues).

quin

 ;D

great thanks for the explanations!!
i think just understood a crucial point in creating coppermine themes.

quin