com web/master: Got the links for top/bottom rated notes backwards. Fixing order of the query.: manage/user-notes.php

From: Date: Thu, 13 Dec 2012 19:06:23 +0000
Subject: com web/master: Got the links for top/bottom rated notes backwards. Fixing order of the query.: manage/user-notes.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-15077@lists.php.net to get a copy of this message
Commit: 889a45f607966f6a238bd9d4ed8209af8f9aa936 Author: Sherif Ramadan <googleguy@php.net> 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 ".

« previous php.webmaster (#15077) next »