voters.php: Show time stamps if available

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-10-17 09:53:02 +02:00
parent e9ebcc4479
commit c64b51f2ee
2 changed files with 7 additions and 2 deletions

View file

@ -17,7 +17,12 @@ if (has_credential(CRED_PKGBASE_LIST_VOTERS)):
<div class="boxbody">
<ul>
<?php while (list($indx, $row) = each($votes)): ?>
<li><a href="<?= get_user_uri($row['Username']); ?>"><?= htmlspecialchars($row['Username']) ?></a></li>
<li>
<a href="<?= get_user_uri($row['Username']); ?>"><?= htmlspecialchars($row['Username']) ?></a>
<?php if ($row["VoteTS"] > 0): ?>
(<?= gmdate("Y-m-d H:i", intval($row["VoteTS"])) ?>)
<?php endif; ?>
</li>
<?php endwhile; ?>
</ul>
</div>

View file

@ -712,7 +712,7 @@ function pkgbase_vote ($base_ids, $action=true) {
function pkgbase_votes_from_name($pkgbase_name) {
$dbh = DB::connect();
$q = "SELECT UsersID, Username, Name FROM PackageVotes ";
$q = "SELECT UsersID, Username, Name, VoteTS FROM PackageVotes ";
$q.= "LEFT JOIN Users ON UsersID = Users.ID ";
$q.= "LEFT JOIN PackageBases ";
$q.= "ON PackageVotes.PackageBaseID = PackageBases.ID ";