Changeset 1040
- Timestamp:
- Feb 13, 2006, 11:15:56 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_html.inc.php
r1036 r1040 26 26 // +-----------------------------------------------------------------------+ 27 27 28 function get_icon( $date ) 29 { 30 global $user, $conf, $lang; 31 32 if (!preg_match('/\d{4}-\d{2}-\d{2}/', $date)) 33 { 34 return ''; 35 } 36 37 list( $year,$month,$day ) = explode( '-', $date ); 28 function get_icon($date) 29 { 30 global $page, $user, $conf, $lang; 31 32 if (empty($date)) 33 { 34 $date = 'NULL'; 35 } 36 37 if (isset($page['get_icon_cache'][$date])) 38 { 39 return $page['get_icon_cache'][$date]; 40 } 41 42 if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})/', $date, $matches)) 43 { 44 // date can be empty, no icon to display 45 $page['get_icon_cache'][$date] = ''; 46 return $page['get_icon_cache'][$date]; 47 } 48 49 list($devnull, $year, $month, $day) = $matches; 38 50 $unixtime = mktime( 0, 0, 0, $month, $day, $year ); 51 52 if ($unixtime === false // PHP 5.1.0 and above 53 or $unixtime === -1) // PHP prior to 5.1.0 54 { 55 $page['get_icon_cache'][$date] = ''; 56 return $page['get_icon_cache'][$date]; 57 } 39 58 40 59 $diff = time() - $unixtime; … … 51 70 $output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="(!)" />'; 52 71 } 53 return $output; 72 73 $page['get_icon_cache'][$date] = $output; 74 75 return $page['get_icon_cache'][$date]; 54 76 } 55 77
Note: See TracChangeset
for help on using the changeset viewer.