Changeset 2182
- Timestamp:
- Jan 14, 2008, 10:08:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_html.inc.php
r2117 r2182 33 33 return ''; 34 34 } 35 35 36 36 if (isset($page['get_icon_cache'][$date])) 37 37 { … … 41 41 } 42 42 43 if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})/', $date, $matches)) 44 {// date can be empty, no icon to display 45 $page['get_icon_cache'][$date] = false; 46 return ''; 47 } 48 49 list($devnull, $year, $month, $day) = $matches; 50 $unixtime = mktime( 0, 0, 0, $month, $day, $year ); 51 if ($unixtime === false // PHP 5.1.0 and above 52 or $unixtime === -1) // PHP prior to 5.1.0 53 { 54 $page['get_icon_cache'][$date] = false; 55 return ''; 56 } 57 58 if (!isset($page['get_icon_cache']['unix_timestamp'])) 43 if (!isset($page['get_icon_cache']['sql_recent_date'])) 59 44 { 60 45 // Use MySql date in order to standardize all recent "actions/queries" 61 list($page['get_icon_cache']['unix_timestamp']) = 62 mysql_fetch_array(pwg_query('select UNIX_TIMESTAMP(CURRENT_DATE)')); 63 } 64 65 $diff = $page['get_icon_cache']['unix_timestamp'] - $unixtime; 66 $day_in_seconds = 24*60*60; 46 list($page['get_icon_cache']['sql_recent_date']) = 47 mysql_fetch_array(pwg_query('select SUBDATE( 48 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)')); 49 } 50 67 51 $page['get_icon_cache'][$date] = false; 68 if ( $d iff <= $user['recent_period'] * $day_in_seconds)52 if ( $date > $page['get_icon_cache']['sql_recent_date'] ) 69 53 { 70 54 if ( !isset($page['get_icon_cache']['_icons_'] ) ) … … 85 69 $page['get_icon_cache'][$date] = true; 86 70 } 71 87 72 if (! $page['get_icon_cache'][$date] ) 88 73 return ''; 89 74 return $page['get_icon_cache']['_icons_'][$is_child_date]; 90 75 } 91 92 76 93 77 function create_navigation_bar(
Note: See TracChangeset
for help on using the changeset viewer.