Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 10:25:14 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: cpg1.5.2 beta released
The brand new cpg1.5.x series that comes with a lot of new features finally has reached the release stage: a first public beta release cpg1.5.2 has been released that is mainly aimed at translators, testers and community members that have contributed in the past. The beta release is not meant to be used in a production environment, but only on testbeds and for evaluation purposes. There is currently no support for cpg1.5.x yet!
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [Fixed]: Bug in functions.ini.php in combination with lightbox??  (Read 4153 times)
0 Members and 1 Guest are viewing this topic.
Ivo007 Topic starter
Coppermine newbie

Posts: 11


« on: April 23, 2008, 01:47:22 am »

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, 12:58:47 am by Paver » Logged
Paver
Dev Team member
****
Gender: Male
United States United States

Posts: 1604


Paul Van Rompay


« Reply #1 on: March 03, 2009, 12: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
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.037 seconds with 16 queries.