Changeset 438 for trunk


Ignore:
Timestamp:
Jun 19, 2004, 1:25:06 AM (20 years ago)
Author:
z0rglub
Message:

get_icon function takes a date in YYY-MM-DD format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/htmlfunctions.inc.php

    r398 r438  
    2626// +-----------------------------------------------------------------------+
    2727
    28 function get_icon( $date_comparaison )
     28function get_icon( $date )
    2929{
    3030  global $user, $conf, $lang;
    31   $difference = time() - $date_comparaison;
    32   $jours = 24*60*60;
     31
     32  list( $year,$month,$day ) = explode( '-', $date );
     33  $unixtime = mktime( 0, 0, 0, $month, $day, $year );
     34 
     35  $diff = time() - $unixtime;
     36  $day_in_seconds = 24*60*60;
    3337  $output = '';
    3438  $title = $lang['recent_image'].' ';
    35   if ( $difference < $user['long_period'] * $jours )
     39  if ( $diff < $user['long_period'] * $day_in_seconds )
    3640  {
    3741    $icon_url = './template/'.$user['template'].'/theme/';
    38     if ( $difference < $user['short_period'] * $jours )
     42    if ( $diff < $user['short_period'] * $day_in_seconds )
    3943    {
    4044      $icon_url.= 'new_short.gif';
    41     $title .= $user['short_period'];
     45      $title .= $user['short_period'];
    4246    }
    4347    else
    4448    {
    4549      $icon_url.= 'new_long.gif';
    46     $title .= $user['long_period'];
     50      $title .= $user['long_period'];
    4751    }
    48   $title .=  '&nbsp;'.$lang['days'];
     52    $title .=  '&nbsp;'.$lang['days'];
    4953    $size = getimagesize( $icon_url );
    5054    $output = '<img title="'.$title.'" src="'.$icon_url.'" style="border:0;';
Note: See TracChangeset for help on using the changeset viewer.