aurweb/web/template/stats/updates_table.php
Marcel Korpel 57250a1641 updates_table.php: Fix identification of new packages
Currently, package creation has to be done separately from first
submission, so ModifiedTS will never be the same as SubmittedTS.
Consider all packages that are submitted within an hour from package
creation as new.

Signed-off-by: Marcel Korpel <marcel.korpel@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-08-19 09:49:28 +02:00

23 lines
852 B
PHP

<h3><?= __("Recent Updates") ?></h3>
<a href="<?= get_uri('/rss/') ?>" title="Arch Package Updates RSS Feed" class="rss-icon"><img src="/images/feed-icon-14x14.png" alt="RSS Feed" /></a>
<table>
<tbody>
<?php foreach ($newest_packages->getIterator() as $row): ?>
<tr>
<td class="pkg-name">
<a href="<?= get_pkg_uri($row["Name"]); ?>" title="<?= htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]); ?>"><?= htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]); ?></a>
</td>
<td class="pkg-new">
<?php if ($row["ModifiedTS"] - $row["SubmittedTS"] < 3600): ?>
<img src="images/new.png" alt="New!" />
<?php endif; ?>
</td>
<td class="pkg-date">
<span><?= gmdate("Y-m-d H:i", intval($row["ModifiedTS"])); ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>