Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Fixed]: Bug in functions.ini.php in combination with lightbox??  (Read 40209 times)

0 Members and 1 Guest are viewing this topic.

Ivo007

  • Coppermine newbie
  • Offline Offline
  • Posts: 15

Hi all

I have implemented lightbox in my coppermine 1.4.14 gallery. It worked all fine except by clicking on the random thumbnails I would get the error "There was an error while processing a database query".
The debug mode said:
While executing query "SELECT * FROM cpg14x_pictures WHERE approved = 'YES'  ORDER BY RAND() LIMIT -1" on 0

mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1

File: /home/www/web170/html/domainxyz/gallery/include/functions.inc.php - Line: 249


That happens only when I click on the random images. The rest worked fine. I had to correct 2 lines in functions.ini.php (see below). After that i had no problems any more, all fine.

here the lines:
line 1229:
original: $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";

corrected:  $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";

line 1505:
original:  search_phrase = '$query_terms',
corrected: search_phrase = '$query_term',

I upgraded my gallery from 1.4.14 to 1.4.18. It went all smooth. Although, I had to do the same corrections in functions.ini.php for the same lines. Don't know if thats a bug from an older version of coppermine,  but might be double checked.
If you want to do more investigations let me know, I will set an testgallery so you can test the scenario.

Cheers
Ivo
« Last Edit: March 03, 2009, 01:58:47 am by Paver »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: [Fixed]: Bug in functions.ini.php in combination with lightbox??
« Reply #1 on: March 03, 2009, 01:59:39 am »

Both bugs have been fixed and committed to the Subversion repositories (stable and devel).

Will be in 1.4.21 and higher.
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 18 queries.