Commit: 889a45f607966f6a238bd9d4ed8209af8f9aa936 Author: Sherif Ramadan <[email protected]> Thu, 13 Dec 2012 14:06:23 -0500 Parents: d701848307bcd2ac547e07beb22ae43c0d222a66 Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=889a45f607966f6a238bd9d4ed8209af8f9aa936 Log: Got the links for top/bottom rated notes backwards. Fixing order of the query. Changed paths: M manage/user-notes.php Diff: diff --git a/manage/user-notes.php b/manage/user-notes.php index 5ee10f1..098d661 100644 --- a/manage/user-notes.php +++ b/manage/user-notes.php @@ -99,14 +99,14 @@ if (!$action) { "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, note.*, UNIX_TIMESTAMP(note.ts) AS ts ". "FROM note ". "JOIN(votes) ON (note.id = votes.note_id) ". - "GROUP BY note.id ORDER BY rating ASC LIMIT $limit, 10"; + "GROUP BY note.id ORDER BY rating DESC LIMIT $limit, 10"; /* Bottom rated notes */ } else if ($type == 4) { $sql = "SELECT SUM(votes.vote) AS up, (COUNT(votes.vote) - SUM(votes.vote)) AS down, ". "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, note.*, UNIX_TIMESTAMP(note.ts) AS ts ". "FROM note ". "JOIN(votes) ON (note.id = votes.note_id) ". - "GROUP BY note.id ORDER BY rating DESC LIMIT $limit, 10"; + "GROUP BY note.id ORDER BY rating ASC LIMIT $limit, 10"; /* Last notes */ } else { $sql = "SELECT SUM(votes.vote) AS up, (COUNT(votes.vote) - SUM(votes.vote)) AS down, note.*, UNIX_TIMESTAMP(note.ts) AS ts ". -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
