Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Album - Most viewed - Critical error  (Read 4029 times)

0 Members and 1 Guest are viewing this topic.

pavelh

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Album - Most viewed - Critical error
« on: July 19, 2010, 10:27:28 am »

Hello,
in my photogallery, in some albums: if I open the album and click to most viewed and then click to thumbnail, the critical error is displayed.

http://www.klatovy.net/fotogalerie/thumbnails.php?album=topn&cat=-2504

Code: [Select]
While executing query 'SELECT r.pid, r.aid, filepath, filename, url_prefix, pwidth, pheight, filesize, ctime, r.title, r.keywords, r.votes, pic_rating, hits, caption, r.owner_id, pic_raw_ip, pic_hdr_ip
                FROM foto_pictures AS r
                INNER JOIN foto_albums AS a ON a.aid = r.aid
                WHERE (r.aid = 2504)
                AND approved = 'YES'
                AND hits > 0
                ORDER BY hits ASC, pid DESC
                 LIMIT 0 ,-186' in include/functions.inc.php on line 1593

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 '-186' at line 8

I would guess - there could be a missing apostrophe in this line: LIMIT 0 ,-186'

If I displayed most viewed pictures in category, error is not displayed. Only in album.

Thanx, Pavel.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Album - Most viewed - Critical error
« Reply #1 on: July 19, 2010, 12:18:28 pm »

Already fixed in svn. See that topic.
Logged

jay4499

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Album - Most viewed - Critical error
« Reply #2 on: August 07, 2010, 09:06:06 am »

Already fixed in svn. See that topic.

I'm having the same problem and clicked on your link but don't see any solution to the problem.  Any help would be appreciated. 
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Album - Most viewed - Critical error
« Reply #3 on: August 07, 2010, 10:49:57 am »

Please upgrade to cpg1.5.8.
Logged

jay4499

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Album - Most viewed - Critical error
« Reply #4 on: August 07, 2010, 08:14:21 pm »

Please upgrade to cpg1.5.8.

Thank you.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Album - Most viewed - Critical error
« Reply #5 on: September 03, 2010, 02:22:25 pm »

Marking as solved.
Logged

KB.cpg

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Album - Most viewed - Critical error
« Reply #6 on: December 02, 2011, 02:52:43 pm »

Already fixed in svn. See that topic.
I have latest coppermine installed:
   Coppermine version: 1.5.16
   $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.5.x/include/functions.inc.php $
   $Revision: 8243 $
 
But still have same problem - negative limits in SQL like this: ORDER BY r.pid ASC LIMIT 0 ,-231
Code: [Select]
While executing query 'SELECT r.pid, r.aid, filepath, filename, url_prefix, pwidth, pheight, filesize, ctime, r.title, r.keywords, r.votes, pic_rating, hits, caption, r.owner_id
 FROM cpg_pictures AS r
 INNER JOIN cpg_albums AS a ON a.aid = r.aid
 WHERE (category = 14715) AND r.aid NOT IN (193, 301, 161, 114, 386, 53, 64, 86, 85, 91, 93, 94, 96, 97, 84, 121, 105, 108, 141, 143, 40, 196, 198, 203, 206, 217, 220, 20, 232, 236, 242, 271, 252, 253, 255, 258, 272, 285, 289, 295, 345, 207, 224, 259, 291, 584, 378, 411, 442, 732, 444, 456, 470, 590, 492, 493, 494, 502, 521, 535, 538, 550, 556, 569, 580, 592, 596, 598, 601, 638, 645, 648, 654, 693, 666, 677, 695, 698, 700, 701, 703, 705, 706, 707, 708, 709, 710, 711, 715, 725, 726, 727, 731)
 AND approved = 'YES'
 ORDER BY r.pid ASC  LIMIT 0 ,-231' in include/functions.inc.php on line 1501 the following error was encountered:
 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 '-231' at line 6
How fix it?
Thank you
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Album - Most viewed - Critical error
« Reply #7 on: December 02, 2011, 03:04:18 pm »

KB.cpg, please start a new thread that contains more information. E.g. we need a link to your gallery and an explanation where the occurs exactly. It seems that the 'lastup' meta album is affected in your case, which differs from the initial error.


Closing.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.