aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_html.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-03-07 18:51:58 +0000
committerrub <rub@piwigo.org>2007-03-07 18:51:58 +0000
commit1415354b9c13b0dca0b8933206589f3e3fec972d (patch)
tree15382ec00bdced60ef1ad8e87f0b685c2bef31f9 /include/functions_html.inc.php
parent885393221f6c8045d858ea545b1339120eb5b625 (diff)
0000662: Recent elements don't use sometimes time and not truncated datetime
& Standardize system date used git-svn-id: http://piwigo.org/svn/trunk@1876 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r--include/functions_html.inc.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index 5612454b0..43cf5d9e6 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -55,10 +55,17 @@ function get_icon($date, $is_child_date = false)
return '';
}
- $diff = time() - $unixtime;
+ if (!isset($page['get_icon_cache']['unix_timestamp']))
+ {
+ // Use MySql date in order to standardize all recent "actions/queries"
+ list($page['get_icon_cache']['unix_timestamp']) =
+ mysql_fetch_array(pwg_query('select UNIX_TIMESTAMP(CURRENT_DATE)'));
+ }
+
+ $diff = $page['get_icon_cache']['unix_timestamp'] - $unixtime;
$day_in_seconds = 24*60*60;
$page['get_icon_cache'][$date] = false;
- if ( $diff < $user['recent_period'] * $day_in_seconds )
+ if ( $diff <= $user['recent_period'] * $day_in_seconds )
{
if ( !isset($page['get_icon_cache']['_icons_'] ) )
{