Move {GAL_NAME} to bottom of gallery Move {GAL_NAME} to bottom of 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

Move {GAL_NAME} to bottom of gallery

Started by bighairy, March 13, 2006, 09:42:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bighairy

Funily enough I originially wrote this theme :-) so thanks for all the help upgrading it!

I have one thing I'd like to do but just don't have time so maybe someone else can help. I'd like to move the logo and the Gallery Name and description to the bottom of the page (so that you don't have to scroll the screen when looking at pictures)

I originially did this by modifiying the theme.php but the bit I modified doesn't seem to be there any more.

Now if I move the
                <h1>{GAL_NAME}</h1>
              <h3>{GAL_DESCRIPTION}</h3><br />

bits to the bottom in template.html they don't get replaced.

I was wondering if someone else could help me out on this? I really would love to but I'm out of practice with html/php and out of time!

(I'm the GB that appears all through the source code in echo commands!)

Paver

bighairy: You have uncovered an interesting quirk that may be useful to address in future versions, but it's not really an issue because you can "fix" this issue with a customized theme function. 

The template file is split into the section before the {GALLERY} tag ($template_header) and the section after it ($template_footer).  The theme functions pageheader() and pagefooter() each evaluate its respective section.  If you look at these functions in sample/theme.php, you'll see that {GAL_NAME} and {GAL_DESCRIPTION} are only parsed in pageheader().  So what you need to do is to copy the pagefooter() function from sample/theme.php and customize it ($template_vars specifically) to replace the tags you want parsed.

bighairy

Thanks! I remember this took me a while to sort last time but I just don't have the bandwidth to plough through the files. I know it's cheeky but is there anyone who could come up with a new suitable themes.php file for me?

I would be very grateful and it would more than repay the karma I banked when I wrote the original filmstrip vert!

Graeme (aka bighairy)


Paver

Here's the code you need to paste into your theme.php:
// 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() : '',
        '{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['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(),
    );

    echo template_eval($template_footer, $template_vars);
}


Then you can put all the tags you see above anywhere you want in your template.html.

bighairy