From 2434a6ddb14f1469619d20e88c60584221b8d922 Mon Sep 17 00:00:00 2001 From: shish Date: Fri, 27 Jul 2007 02:31:15 +0000 Subject: [PATCH] mysql 4.x fix git-svn-id: file:///home/shish/svn/shimmie2/trunk@383 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/user/main.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ext/user/main.php b/ext/user/main.php index 902db77b..43813141 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -282,21 +282,27 @@ class UserPage extends Extension { private function count_upload_ips($duser) { global $database; $rows = $database->db->GetAssoc(" - SELECT owner_ip, COUNT(images.id) AS count + SELECT + owner_ip, + COUNT(images.id) AS count, + MAX(posted) AS most_recent FROM images WHERE owner_id=? GROUP BY owner_ip - ORDER BY MAX(posted) DESC", array($duser->id)); + ORDER BY most_recent DESC", array($duser->id), false, true); return $rows; } private function count_comment_ips($duser) { global $database; $rows = $database->db->GetAssoc(" - SELECT owner_ip, COUNT(comments.id) AS count + SELECT + owner_ip, + COUNT(images.id) AS count, + MAX(posted) AS most_recent FROM comments WHERE owner_id=? GROUP BY owner_ip - ORDER BY MAX(posted) DESC", array($duser->id)); + ORDER BY most_recent DESC", array($duser->id), false, true); return $rows; } // }}}