summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-28 01:52:40 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-28 01:52:40 +0200
commit2276171b2987c42ce9658e9cac469f2714939a33 (patch)
tree8f590640baf13a8f384a0aceb6e7875a30f416c1 /web
parentc1c7f9b35090904a4c566de026c487a0eb33da49 (diff)
Only include current TUs in the last votes list
Do not show users that took part in past TU votes but no longer have TU powers. Also, fix the sorting column while we're touching these lines. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web')
-rw-r--r--web/lib/acctfuncs.inc.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index d8a44f8..fe748a2 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -1004,9 +1004,10 @@ function last_votes_list() {
$dbh = DB::connect();
$q = "SELECT UserID, MAX(VoteID) AS LastVote FROM TU_Votes, ";
- $q .= "TU_VoteInfo WHERE TU_VoteInfo.ID = TU_Votes.VoteID AND ";
- $q .= "TU_VoteInfo.End < UNIX_TIMESTAMP() GROUP BY UserID ";
- $q .= "ORDER BY VoteID DESC";
+ $q .= "TU_VoteInfo, Users WHERE TU_VoteInfo.ID = TU_Votes.VoteID AND ";
+ $q .= "TU_VoteInfo.End < UNIX_TIMESTAMP() AND ";
+ $q .= "Users.ID = TU_Votes.UserID AND Users.AccountTypeID = 2 ";
+ $q .= "GROUP BY UserID ORDER BY LastVote DESC";
$result = $dbh->query($q);
$details = array();