Advanced search  

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

Pages: [1]   Go Down

Author Topic: Album title in slideshows  (Read 2366 times)

0 Members and 1 Guest are viewing this topic.

lysbjerg

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Album title in slideshows
« on: March 08, 2004, 03:50:56 pm »

I am a newbie to templates so please help me out here.

I am trying to display the album title when running a slideshow.

Here is what I've done:

In
Code: [Select]
displayimage.php in
Code: [Select]
function slideshow() I've added
Code: [Select]
$CURRENT_ALBUM_DATA as a global variable.

Before the
Code: [Select]
echo template_eval($template_display_picture, $params); line I've added
Code: [Select]
echo '<tr><th>'.$CURRENT_ALBUM_DATA['title'].'</th></tr>'; but
Code: [Select]
$CURRENT_ALBUM_DATA['title'] seems empty...

If I instead add
Code: [Select]
echo '<tr><th>TEST</th></tr>'; the TEST title appears as wanted.

Thank you in advance

Simon
Logged

lysbjerg

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
A possible solution
« Reply #1 on: March 08, 2004, 04:36:55 pm »

OK. Here is what I've done:

In displayimage.php I've added the code

Code: [Select]
else if (isset($HTTP_GET_VARS['slideshow']) && is_numeric($album)) {
    $result = db_query("SELECT title, comments, votes, category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$album}' LIMIT 1");
    if (!mysql_num_rows($result)) cpg_die(CRITICAL_ERROR, sprintf($lang_errors['pic_in_invalid_album'], $album), __FILE__, __LINE__);
    $CURRENT_ALBUM_DATA = mysql_fetch_array($result);
}


after

Code: [Select]
// Retrieve data for the current album
if (isset($CURRENT_PIC_DATA)) {
    $result = db_query("SELECT title, comments, votes, category FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CURRENT_PIC_DATA['aid']}' LIMIT 1");
    if (!mysql_num_rows($result)) cpg_die(CRITICAL_ERROR, sprintf($lang_errors['pic_in_invalid_album'], $CURRENT_PIC_DATA['aid']), __FILE__, __LINE__);
    $CURRENT_ALBUM_DATA = mysql_fetch_array($result);

    if (is_numeric($album)) {
        $cat = - $album;
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
        breadcrumb($actual_cat, $breadcrumb, $breadcrumb_text);
        $cat = - $album;
    } else {
        $actual_cat = $CURRENT_ALBUM_DATA['category'];
    }
}


Probably not the best solution but it seems to work...
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 18 queries.