com web/master: 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:
manage/user-notes.php
| From: | Philip Olson | Date: | Tue, 26 Apr 2016 21:38:15 +0000 |
| Subject: | com web/master: 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: manage/user-notes.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-24687@lists.php.net to get a copy of this message | ||
Commit: df77530be0cfaf10deafc35f22a997a2eac11f87
Author: philip <philip@roshambo.org> 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