Commit: df77530be0cfaf10deafc35f22a997a2eac11f87 Author: philip <[email protected]> Tue, 26 Apr 2016 14:38:15 -0700 Parents: 7d300ac8b0d8a4281f1b0fca152b8788f94bfbab Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=df77530be0cfaf10deafc35f22a997a2eac11f87 Log: Order by 'up' which is the sum of all 1 and -1 votes. The 'rate' feels a bit bogus, so let's skip it when finding good/bad notes Changed paths: M manage/user-notes.php Diff: diff --git a/manage/user-notes.php b/manage/user-notes.php index bfd3511..1bba609 100644 --- a/manage/user-notes.php +++ b/manage/user-notes.php @@ -116,7 +116,7 @@ if (!$action) { "note.id, note.sect, note.user, note.note, UNIX_TIMESTAMP(note.ts) AS ts ". "FROM note ". "JOIN(votes) ON (note.id = votes.note_id) ". - "GROUP BY note.id ORDER BY rate DESC,up DESC, down DESC LIMIT $limit, 10"; + "GROUP BY note.id ORDER BY up DESC, rate DESC, down 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, ". @@ -125,7 +125,7 @@ if (!$action) { "note.id, note.sect, note.user, note.note, UNIX_TIMESTAMP(note.ts) AS ts ". "FROM note ". "JOIN(votes) ON (note.id = votes.note_id) ". - "GROUP BY note.id ORDER BY rate ASC,up ASC, down DESC LIMIT $limit, 10"; + "GROUP BY note.id ORDER BY up ASC, rate ASC, down DESC LIMIT $limit, 10"; /* Votes table view */ } else if ($type == 5) { $search_votes = true; // set this only to change the output between votes table and notes table -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
