diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-06-18 23:25:06 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-06-18 23:25:06 +0000 |
commit | 1cb24e744fcdd5aab89c4958c7cfa4ffa33b2248 (patch) | |
tree | 8bed5f276e062a26c5f9d76612575c4b58a2b72f /include | |
parent | 9cdca2bad154c4b1b777d58d2f8ce12deb0cb14f (diff) |
get_icon function takes a date in YYY-MM-DD format
git-svn-id: http://piwigo.org/svn/trunk@438 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r-- | include/htmlfunctions.inc.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/htmlfunctions.inc.php b/include/htmlfunctions.inc.php index 25b330ff3..3c6046c99 100644 --- a/include/htmlfunctions.inc.php +++ b/include/htmlfunctions.inc.php @@ -25,27 +25,31 @@ // | USA. | // +-----------------------------------------------------------------------+ -function get_icon( $date_comparaison ) +function get_icon( $date ) { global $user, $conf, $lang; - $difference = time() - $date_comparaison; - $jours = 24*60*60; + + list( $year,$month,$day ) = explode( '-', $date ); + $unixtime = mktime( 0, 0, 0, $month, $day, $year ); + + $diff = time() - $unixtime; + $day_in_seconds = 24*60*60; $output = ''; $title = $lang['recent_image'].' '; - if ( $difference < $user['long_period'] * $jours ) + if ( $diff < $user['long_period'] * $day_in_seconds ) { $icon_url = './template/'.$user['template'].'/theme/'; - if ( $difference < $user['short_period'] * $jours ) + if ( $diff < $user['short_period'] * $day_in_seconds ) { $icon_url.= 'new_short.gif'; - $title .= $user['short_period']; + $title .= $user['short_period']; } else { $icon_url.= 'new_long.gif'; - $title .= $user['long_period']; + $title .= $user['long_period']; } - $title .= ' '.$lang['days']; + $title .= ' '.$lang['days']; $size = getimagesize( $icon_url ); $output = '<img title="'.$title.'" src="'.$icon_url.'" style="border:0;'; $output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="" />'; |