forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: the_todd on June 08, 2005, 05:36:45 am

Title: cpg 1.4 BUG report: Not reporting actual total filesize
Post by: the_todd on June 08, 2005, 05:36:45 am
Coppermine 1.4 isn't reporting the correct total_filesize in include/picmgmt.inc.php   I found the error and have the solution. Seems to be an overlooked typo:
Original Code: about line 130
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('', '{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
   
Now Notice This in the line:
Code: [Select]
'{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['filesize']It should be:
Code: [Select]
'{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']
on a side note:, there is so much different in this version I am starting to port my mods over, I haven't looked too hard, but where is the code that is making the $USER_DATA  array , I don't see it being created in init.inc.php anymore. Where did it go? Also I'm having trouble with some SQL queries, what have you done with that, particularly in regard to this query which is giving me errors from picmgmt.inc.php
Code: [Select]
$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");
        $record = mysql_fetch_array($result);

Todd
Title: Re: cpg 1.4 BUG report: Not reporting actual total filesize
Post by: donnoman on June 08, 2005, 07:52:00 am
Thanks for catching that Todd.

Fix committed as documented.

FYI, the $USER_DATA array is now populated in the bridge files.

Even if you aren't using a bridge, coppermines native layer is implemented as a "bridge".