forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: JeWelz on October 13, 2004, 03:09:30 am

Title: Issue with displayimage.php when performing search
Post by: JeWelz on October 13, 2004, 03:09:30 am
I have been modifying some of the php code (as well as some of the database information like changing the album/category via a direct db update) and I'm wondering if I've broken something because the search option is not working.

I perform a search and all of the proper thumbnails are populated via the thumbnails.php file.  Once I click on one of the thumbnails that came up from the search I get the following message:

No image to display

File: blah blah blah/coppermine/displayimage.php - Line: 621
[/color]

Line 620 and 621:
    if ($pic_count == 0) {
        cpg_die(INFORMATION, $lang_errors['no_img_to_display'], __FILE__, __LINE__);


I tried to find out where $pic_count is populated - I found an occurance of it in functions.inc.php but it doesn't make any sense to me how the functions.inc.php occurance of $pic_count is related to the usage in displayimage.php

In functions.inc.php $pic_count exists in only one place, in the case statement switch($album) where case = random:

 $result = db_query("SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET");
                $nbEnr = mysql_fetch_array($result);
                $pic_count = $nbEnr[0];
_____________________

Why is $count used in all of the other case statements other than the random one and how might this relate to my issue?  What should I try to fix my problem?  Am I looking at the right stuff? I'm not a very experienced coder and very new to PHP - please let me know what other information I need to provide to obtain assistance in finding my bug.

THANKS!!!
Julie
Title: Re: Issue with displayimage.php when performing search
Post by: JeWelz on October 30, 2004, 05:11:29 am
you could probably delete this post - I am no longer encountering this issue. I believe it was due to manually updating the database.  I changed the album number of photos that were stored in the database as well as their categories.

Thanks!
Julie