News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

random pictures error in categories!!!!!!!!

Started by binba, October 19, 2003, 07:36:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

binba

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!!!!!!!!!!!!!

John

So you are saying that random pic only works in sub cat?

binba

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.

????

binba

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

binba

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]

John

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.