Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Move {GAL_NAME} to bottom of gallery  (Read 5477 times)

0 Members and 1 Guest are viewing this topic.

bighairy

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Move {GAL_NAME} to bottom of gallery
« on: March 13, 2006, 09:42:08 pm »

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!)
« Last Edit: March 14, 2006, 05:26:04 am by TranzNDance »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Move {GAL_NAME} to bottom of gallery
« Reply #1 on: March 13, 2006, 10:59:10 pm »

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.
Logged

bighairy

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Move {GAL_NAME} to bottom of gallery
« Reply #2 on: March 13, 2006, 11:17:09 pm »

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)

Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Move {GAL_NAME} to bottom of gallery
« Reply #3 on: March 13, 2006, 11:29:14 pm »

Here's the code you need to paste into your theme.php:
Code: [Select]
// 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.
Logged

bighairy

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Move {GAL_NAME} to bottom of gallery
« Reply #4 on: March 13, 2006, 11:54:06 pm »

 :)

Thanking you kindly!

Graeme
Logged
Pages: [1]   Go Up
 

Page created in 0.038 seconds with 15 queries.