From 1f252eba64acf18719bd514a7a4464ca18f4c1cb Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 30 Mar 2011 20:48:08 -0500 Subject: Always set ModifiedTS including new packages Set it equal to the SubmittedTS field, which will be our indication the package is new when we show the logo on the front page of the AUR. This results in the ability to remove the use of the unindexable GREATEST() function from the AUR code everywhere we had to use it before to handle the 0 timestamp case. Note that there is no race condition here in calling UNIX_TIMESTAMP() twice- it always returns the time at the beginning of statment execution: mysql> select unix_timestamp(), sleep(2), unix_timestamp(); +------------------+----------+------------------+ | unix_timestamp() | sleep(2) | unix_timestamp() | +------------------+----------+------------------+ | 1300851746 | 0 | 1300851746 | +------------------+----------+------------------+ 1 row in set (2.00 sec) Signed-off-by: Dan McGee Signed-off-by: Lukas Fleischer --- web/template/stats/updates_table.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'web/template/stats/updates_table.php') diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php index b9f6d6d..a8cdf5a 100644 --- a/web/template/stats/updates_table.php +++ b/web/template/stats/updates_table.php @@ -20,12 +20,10 @@ $mod_int = intval($row["ModifiedTS"]); $sub_int = intval($row["SubmittedTS"]); -if ($mod_int != 0): - $modstring = gmdate("r", $mod_int); -elseif ($sub_int != 0): +if ($mod_int == $sub_int): $modstring = 'New! ' . gmdate("r", $sub_int); else: - $modstring = '(unknown)'; + $modstring = gmdate("r", $mod_int); endif; ?> @@ -36,4 +34,3 @@ endif; - -- cgit v1.2.3-70-g09d2