2008-08-23, 11:23 PM
Pages: 1 2
2008-08-24, 11:52 PM
Easy fix:
in admin/modules/forum/attachments.php find:
in admin/modules/forum/attachments.php find:
$query = $db->query("
SELECT a.*, u.uid, u.username, SUM(a.filesize) as totalsize
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
GROUP BY a.uid
ORDER BY totalsize DESC
LIMIT 5
");
replace with $query = $db->query("
SELECT a.*, u.uid, u.username, SUM(a.filesize) as totalsize
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
WHERE u.uid != 0
GROUP BY a.uid
ORDER BY totalsize DESC
LIMIT 5
");
2008-08-25, 12:03 AM
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
2008-08-25, 12:43 AM
Actually, wait, I might have made a mistake, does that actually work with MySQL? u.uid is probably actually NULL, but I think MySQL treats it as 0, but that's just a guess...
(I can't test things here at Uni)
(I can't test things here at Uni)
2008-08-25, 04:57 AM
Yes, I believe MySQL will treat it as a null if the column row doesn't exist when left joining. a u.uid > 0 is probably better since that would include null's too (null can't be more then 0)
2008-08-25, 11:30 AM
So what's the fix now then?
2008-08-25, 03:07 PM
Try This:
2008-08-25, 04:40 PM
Still the same as before...
2008-08-25, 11:16 PM
I think there's a bit of an issue with using this:
(or, if you wanted to, you could check for the username)
if(!$user['uid'])
{
$user['username'] = $lang->na;
}
Since "a.*" will pull in a uid with a number. Try changing something like thisSELECT a.*, u.uid, u.username, SUM(a.filesize) as totalsize
to SELECT a.*, u.uid AS useruid, u.username, SUM(a.filesize) as totalsize
and make the other appropriate change.(or, if you wanted to, you could check for the username)
2008-08-25, 11:48 PM
How will it put in a uid with a number higher then 0 if it doesn't even exist? Either way my "if statement" should catch all cases - It's not a strict comparison.
Pages: 1 2