com web/master: Explicitly select columns in note table since rating gets overwritten. Fix links in votes div.: manage/user-notes.php
| From: | Sherif Ramadan | Date: | Tue, 25 Dec 2012 03:17:06 +0000 |
| Subject: | com web/master: Explicitly select columns in note table since rating gets overwritten. Fix links in votes div.: manage/user-notes.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15140@lists.php.net to get a copy of this message | ||
Commit: f1325b9bbb33478f53167bae42966c3f49f3247c
Author: Sherif Ramadan <googleguy@php.net> Mon, 24 Dec 2012 22:17:06 -0500
Parents: 22b90f95ef9df411b1a9abe9cb32afb9a9dfbc38
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=f1325b9bbb33478f53167bae42966c3f49f3247c
Log:
Explicitly select columns in note table since rating gets overwritten.
Fix links in votes div.
Changed paths:
M manage/user-notes.php
Diff:
diff --git a/manage/user-notes.php b/manage/user-notes.php
index 25d348f..6358291 100644
--- a/manage/user-notes.php
+++ b/manage/user-notes.php
@@ -127,7 +127,8 @@ if (!$action) {
} else if ($type == 3) {
$sql = "SELECT SUM(votes.vote) AS up, (COUNT(votes.vote) - SUM(votes.vote)) AS down,
".
"ROUND((SUM(votes.vote) / COUNT(votes.vote)) * 100) AS rate, ".
- "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, note.*,
UNIX_TIMESTAMP(note.ts) AS ts ".
+ "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, ".
+ "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";
@@ -135,7 +136,8 @@ if (!$action) {
} else if ($type == 4) {
$sql = "SELECT SUM(votes.vote) AS up, (COUNT(votes.vote) - SUM(votes..vote)) AS down,
".
"ROUND((SUM(votes.vote) / COUNT(votes..vote)) * 100) AS rate, ".
- "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, note.*,
UNIX_TIMESTAMP(note.ts) AS ts ".
+ "(SUM(votes.vote) - (COUNT(votes.vote) - SUM(votes.vote))) AS rating, ".
+ "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 ASC LIMIT $limit, 10";
@@ -282,7 +284,7 @@ if (!$action) {
" <div style=\"padding: 15px;\">\n".
" <a href=\"?action=resetall&id={$id}\">Reset all
votes</a> |".
" <a href=\"?action=resetup&id={$id}\">Reset up
votes</a> |".
- " <a href=\"?action=resetdown&id={$id}\">Reset down
votes</a>\n".
+ " <a href=\"?action=resetdown&id={$id}\">Reset down
votes</a> |".
" <a href=\"?votessearch={$id}&view=notes&type=5\">See
Votes</a>\n".
" </div>\n".
"</div>\n";