forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Tranz on December 26, 2005, 04:39:48 pm

Title: most viewed in keyword album > No image to display
Post by: Tranz on December 26, 2005, 04:39:48 pm
Here's a keyword album's most viewed page: http://takethu.com/thumbnails.php?album=topn&cat=-17&page=1

When I click on a thumbnail, it shows an error message: No image to display.

This also happens to a cpg-contrib keyword album: http://cpg-contrib.org/thumbnails.php?album=topn&cat=-6
Title: Re: most viewed in keyword album > No image to display
Post by: donnoman on December 26, 2005, 10:48:15 pm
Thumbnails keeps track of the album keyword by setting $CURRENT_ALBUM_KEYWORD before calling get_pic_data.

It can be addressed by doing this.  However this still leaves a secondary complaint that I've seen with keyworded albums, in that when you go to displayimage, your focus is changed to that images NATIVE category rather than maintaining the keyworded category.

find
Code: [Select]
$META_ALBUM_SET = $ALBUM_SET; //displayimage uses $ALBUM_SET but get_pic_data in functions now uses $META_ALBUM_SET

// Retrieve data for the current picture

replace with
Code: [Select]
$META_ALBUM_SET = $ALBUM_SET; //displayimage uses $ALBUM_SET but get_pic_data in functions now uses $META_ALBUM_SET

//attempt to fix topn images for keyworded albums
if ($cat < 0) {
    $result = cpg_db_query("SELECT category, title, aid, keyword, description, alb_password_hint FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='" . (- $cat) . "'");
    if (mysql_num_rows($result) > 0) {
        $CURRENT_ALBUM_DATA = mysql_fetch_array($result);
        $CURRENT_ALBUM_KEYWORD = $CURRENT_ALBUM_DATA['keyword'];
    }
}

// Retrieve data for the current picture
Title: Re: most viewed in keyword album > No image to display
Post by: Tranz on December 26, 2005, 11:51:20 pm
Great! That fixed it. Thanks.
Title: Re: most viewed in keyword album > No image to display
Post by: Tranz on December 27, 2005, 09:06:44 pm
Fix committed to CVS.