Deporteando (@albertof) |
1.-where change language :
today and yesterday
2.-where change format date by
day/ month /Year
[code]
function get_date($timeline, $type = 'time',$timezone = NULL) {
GLOBAL $settings, $client;
if (!isset($timezone)) $timezone = $client['timezone'];
$timeline = $timeline + $timezone3600;
$current = time() + $timezone3600;
$it_s = intval($current - $timeline);
$it_m = intval($it_s/60);
$it_h = intval($it_m/60);
$it_d = intval($it_h/24);
$it_y = intval($it_d/365);
if ($type == 'date'){
return gmdate($settings['date_format'],$timeline);
}
else {
if(gmdate("j",$timeline) == gmdate("j",$current) && (( $current - $timeline) < 360024)) {
return t($settings['date_today']).', '.gmdate($settings['time_format'],$timeline);
}
elseif(gmdate("j",$timeline) == gmdate("j",($current-360024) ) && (( $current - $timeline) < 7200*24)) {
return t($settings['date_yesterday']).', '.gmdate($settings['time_format'],$timeline);
}
return gmdate($settings['date_format'].', '.$settings['time_format'],$timeline);
}
}
[/code]
also fix for an old get_date bug inside
Jcow Master @falcone
114 months ago
|