coppermine-gallery.com/forum

Support => Older/other versions => cpg1.1.X Support (standalone) => Topic started by: binba on October 19, 2003, 07:36:49 PM

Title: random pictures error in categories!!!!!!!!
Post by: binba on October 19, 2003, 07:36:49 PM
I have this problem, I tried 3 times to delete the whole gallery and start fresh, and it keeps on popping up:

I have category 'A', which has a subcategory 'B'. In category 'B' I have 1 album.

When I view category 'A' I see the subcategory as usual, and a list of random pictures. Whenever I click on any random pictureI get an error message.

For example, category A in here: http://www.rossandrachel.com/gallery/index.php?cat=2 . Click on any picture in the random or "last additions" place, and see the error message.

The installation is clean, I didn't add anything except categories A and B, an album and 2 pictures.

ANY IDEAS?????????? HELP ME!!!!!!!!!!!!!
Title: random pictures error in categories!!!!!!!!
Post by: John on October 19, 2003, 07:54:44 PM
So you are saying that random pic only works in sub cat?
Title: random pictures error in categories!!!!!!!!
Post by: binba on October 19, 2003, 08:06:08 PM
I don't know. It also works on the main gallery page.

but when I have a category who has a subcategory - then it doesn't work.

Anybody knows what happens?? I used debug mode and got the following message:

While executing query "SELECT aid from cpg11d_pictures WHERE pid='1' Array LIMIT 1"

mySQL error: You have an error in your SQL syntax near 'Array LIMIT 1' at line 1


I think there's a problem with the variable $ALBUM_SET but I'm not sure. In one place it's used as a global array, in the other as a string.

????
Title: random pictures error in categories!!!!!!!!
Post by: binba on October 19, 2003, 09:15:30 PM
I think I found the fix, but I still don't understand how no one before me had this problem. What I did is:

In displayimage.php, find

$ALBUM_SET[] = $row['aid'];

replace by:

$ALBUM_SET_ARRAY[] = $row['aid'];

the error message seems to be gone now, I hope it won't come up somewhere else
Title: random pictures error in categories!!!!!!!!
Post by: binba on October 19, 2003, 09:38:48 PM
continuing the fix:

in displayimage.php, fine:


function get_subcat_data($parent, $level)
{
    global $CONFIG, $ALBUM_SET;


replace by:

function get_subcat_data($parent, $level)
{
    global $CONFIG, $ALBUM_SET_ARRAY;
[/code]
Title: random pictures error in categories!!!!!!!!
Post by: John on October 19, 2003, 10:59:39 PM
This code you posted... I dont see the need to do this with the code?, perhaps you should run 1.2rc2, if instaling for the first time, I had a problem with 1.1 but it went away with the new version.