summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-10-15 16:59:15 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-10-16 18:15:45 +0200
commite9ebcc4479a09ebcf057664c55124caa00cf1946 (patch)
treed7a1218758fd99f2e3eb4a8c00bec28a2e622639 /web/lib
parentc986ba0c52a771daf3593e3e262d3345997311ad (diff)
downloadaur-e9ebcc4479a09ebcf057664c55124caa00cf1946.tar.gz
aur-e9ebcc4479a09ebcf057664c55124caa00cf1946.tar.xz
Add a time stamp to package base votes
This can potentially be used to identify trending packages. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 1ac0b470..df59a80c 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -667,12 +667,12 @@ function pkgbase_vote ($base_ids, $action=true) {
$first = 0;
$vote_ids = $pid;
if ($action) {
- $vote_clauses = "($uid, $pid)";
+ $vote_clauses = "($uid, $pid, UNIX_TIMESTAMP())";
}
} else {
$vote_ids .= ", $pid";
if ($action) {
- $vote_clauses .= ", ($uid, $pid)";
+ $vote_clauses .= ", ($uid, $pid, UNIX_TIMESTAMP())";
}
}
}
@@ -686,7 +686,7 @@ function pkgbase_vote ($base_ids, $action=true) {
$dbh->exec($q);
if ($action) {
- $q = "INSERT INTO PackageVotes (UsersID, PackageBaseID) VALUES ";
+ $q = "INSERT INTO PackageVotes (UsersID, PackageBaseID, VoteTS) VALUES ";
$q.= $vote_clauses;
} else {
$q = "DELETE FROM PackageVotes WHERE UsersID = $uid ";