Coppermine version: cpg1.5.3 (RC)
Server: Linux srv77 2.6.26-2-vserver-amd64 #1 SMP Thu Nov 5 03:47:07 UTC 2009 x86_64
(Virtual hosting server by One.com)
PHP Version: 5.3.2
Image library used: GD Version 2.x
Bridging: none
Themes tested: Rainy day (before in another theme I get the same error)
Client OS: NVT
Client Browser: NVT
Install type: 1 month with the new time
Source: functions.inc.php -- Coppermine version: 1.5.4
Browser language: I use Dutch
Coppermine language: There are a few langue in
What happened (potential bug): I get the error message in the log files, but we don’t see any error on board Apr 08, 2010 at 04:00 AM - 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 gallerypictures AS r
INNER JOIN galleryalbums AS a ON a.aid = r.aid
WHERE (r.aid = 2074) AND r.aid NOT IN (15, 14, 20, 315, 81, 82, 192, 408, 528, 585, 610, 769, 821, 1159, 1414, 100, 1861, 1900, 150, 173, 304, 381, 469, 540, 627, 726, 850, 497, 520, 588, 618, 633, 680, 704, 705, 714, 754, 791, 830, 852, 1112, 1539, 1574, 1703, 1739, 1840, 2047)
AND approved = 'YES'
AND hits > 0
ORDER BY hits ASC, pid DESC
LIMIT 0 ,-225' in include/functions.inc.php on line 1583 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 '-225' at line 8
How to replicate (what I did when the problem showed up): I'm logged in as admin and click on the read the log files under “database”
Attention:
I have edit the functions.inc.php
Why? Well now I have creation a group “moderators” These group can see all the pictures include private albums.
Find these:
function get_private_album_set($aid_str="")
{
if (GALLERY_ADMIN_MODE) {
return;
}
global $CONFIG, $USER_DATA, $FORBIDDEN_SET, $FORBIDDEN_SET_DATA;
$superCage = Inspekt::makeSuperCage();
$FORBIDDEN_SET_DATA = array();
if ($USER_DATA['can_see_all_albums']) {
return;
}
And I have edit it with these one:
function get_private_album_set($aid_str="")
{
global $USER, $CONFIG, $CURRENT_CAT_NAME, $CURRENT_ALBUM_KEYWORD, $FAVPICS, $FORBIDDEN_SET_DATA, $FORBIDDEN_SET, $USER_DATA;
if (GALLERY_ADMIN_MODE || ($USER_DATA['group_name']== 'Moderators')) {
return;
}
global $CONFIG, $USER_DATA, $FORBIDDEN_SET, $FORBIDDEN_SET_DATA;
$superCage = Inspekt::makeSuperCage();
$FORBIDDEN_SET_DATA = array();
if ($USER_DATA['can_see_all_albums']) {
return;
}
In the attachement the current functions.inc.php file
In the attachement a screenshot from the error code