summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2013-08-26 17:29:24 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2013-08-26 17:34:31 +0200
commit2dd3d04f45f8a0e57f0c8686a12d7b95fe5bdb59 (patch)
treec2899efec29286a45b09942e03dd02bdadae1c4e /web/lib
parentfb76aab8cffbc3d251fb635ae8e986c7138d8d68 (diff)
downloadaur-2dd3d04f45f8a0e57f0c8686a12d7b95fe5bdb59.tar.gz
aur-2dd3d04f45f8a0e57f0c8686a12d7b95fe5bdb59.tar.xz
Add "Last Votes by TU" list
This shows a list of all Trusted Users and the vote ID of the last proposal each of the TUs voted on. This list is sorted by vote ID. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 31cdd790..f52dfc32 100644
--- a/web/lib/acctfuncs.inc.php
+++ b/web/lib/acctfuncs.inc.php
@@ -996,6 +996,25 @@ function past_proposal_list($order, $lim) {
}
/**
+ * Get the vote ID of the last vote of all Trusted Users
+ *
+ * @return array The vote ID of the last vote of each Trusted User
+ */
+function last_votes_list() {
+ $dbh = DB::connect();
+
+ $q = "SELECT UserID, MAX(VoteID) AS LastVote FROM TU_Votes GROUP BY UserID ORDER BY VoteID DESC";
+ $result = $dbh->query($q);
+
+ $details = array();
+ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
+ $details[] = $row;
+ }
+
+ return $details;
+}
+
+/**
* Determine the total number of Trusted User proposals
*
* @return string The total number of Trusted User proposals