summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgbasefuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-02-26 10:30:16 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-02-26 10:30:16 +0100
commit69f7eb115a0a48d4d2808708bcfef9eaf292f64c (patch)
treee8e4ac633b88099b6836ba3f637b0ab2b1d6a472 /web/lib/pkgbasefuncs.inc.php
parentfdd932ff8d5e5899cfeae9a8b29011fa2cf9d439 (diff)
parent5fd417d70154470d145c83a4b60693c8d877b016 (diff)
downloadaur-69f7eb115a0a48d4d2808708bcfef9eaf292f64c.tar.gz
aur-69f7eb115a0a48d4d2808708bcfef9eaf292f64c.tar.xz
Merge branch 'master' into maint
Diffstat (limited to 'web/lib/pkgbasefuncs.inc.php')
-rw-r--r--web/lib/pkgbasefuncs.inc.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index b0827844..57b307d8 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -98,7 +98,7 @@ function pkgbase_add_comment($base_id, $uid, $comment) {
$q = "INSERT INTO PackageComments ";
$q.= "(PackageBaseID, UsersID, Comments, CommentTS) VALUES (";
$q.= intval($base_id) . ", " . $uid . ", ";
- $q.= $dbh->quote($comment) . ", UNIX_TIMESTAMP())";
+ $q.= $dbh->quote($comment) . ", " . strval(time()) . ")";
$dbh->exec($q);
$comment_id = $dbh->lastInsertId();
@@ -144,7 +144,7 @@ function pkgbase_pin_comment($unpin=false) {
$dbh = DB::connect();
$q = "UPDATE PackageComments ";
if (!$unpin) {
- $q.= "SET PinnedTS = UNIX_TIMESTAMP() ";
+ $q.= "SET PinnedTS = " . strval(time()) . " ";
} else {
$q.= "SET PinnedTS = 0 ";
}
@@ -395,7 +395,7 @@ function pkgbase_flag($base_ids, $comment) {
$dbh = DB::connect();
$q = "UPDATE PackageBases SET ";
- $q.= "OutOfDateTS = UNIX_TIMESTAMP(), FlaggerUID = " . $uid . ", ";
+ $q.= "OutOfDateTS = " . strval(time()) . ", FlaggerUID = " . $uid . ", ";
$q.= "FlaggerComment = " . $dbh->quote($comment) . " ";
$q.= "WHERE ID IN (" . implode(",", $base_ids) . ") ";
$q.= "AND OutOfDateTS IS NULL";
@@ -680,15 +680,15 @@ function pkgbase_adopt ($base_ids, $action=true, $via) {
$comaintainers = pkgbase_get_comaintainers($base_id);
if (count($comaintainers) > 0) {
- $uid = uid_from_username($comaintainers[0]);
+ $comaintainer_uid = uid_from_username($comaintainers[0]);
$comaintainers = array_diff($comaintainers, array($comaintainers[0]));
pkgbase_set_comaintainers($base_id, $comaintainers);
} else {
- $uid = "NULL";
+ $comaintainer_uid = "NULL";
}
$q = "UPDATE PackageBases ";
- $q.= "SET MaintainerUID = " . $uid . " ";
+ $q.= "SET MaintainerUID = " . $comaintainer_uid . " ";
$q.= "WHERE ID = " . $base_id;
$dbh->exec($q);
}
@@ -749,12 +749,12 @@ function pkgbase_vote ($base_ids, $action=true) {
$first = 0;
$vote_ids = $pid;
if ($action) {
- $vote_clauses = "($uid, $pid, UNIX_TIMESTAMP())";
+ $vote_clauses = "($uid, $pid, " . strval(time()) . ")";
}
} else {
$vote_ids .= ", $pid";
if ($action) {
- $vote_clauses .= ", ($uid, $pid, UNIX_TIMESTAMP())";
+ $vote_clauses .= ", ($uid, $pid, " . strval(time()) . ")";
}
}
}
@@ -972,7 +972,7 @@ function pkgbase_delete_comment($undelete=false) {
$q = "UPDATE PackageComments ";
$q.= "SET DelUsersID = ".$uid.", ";
- $q.= "DelTS = UNIX_TIMESTAMP() ";
+ $q.= "DelTS = " . strval(time()) . " ";
$q.= "WHERE ID = ".intval($comment_id);
$dbh->exec($q);
return array(true, __("Comment has been deleted."));
@@ -1005,7 +1005,7 @@ function pkgbase_edit_comment($comment) {
$q = "UPDATE PackageComments ";
$q.= "SET EditedUsersID = ".$uid.", ";
$q.= "Comments = ".$dbh->quote($comment).", ";
- $q.= "EditedTS = UNIX_TIMESTAMP() ";
+ $q.= "EditedTS = " . strval(time()) . " ";
$q.= "WHERE ID = ".intval($comment_id);
$dbh->exec($q);
return array(true, __("Comment has been edited."));