// Format the date & time accordingly // Locale date & time for no locale server // Version 2.1 Author: Dark (_mxm_) http://rusfusion.ru function showdate($format, $val) { global $settings, $userdata, $locale; $months_long = explode("|", $locale['months']); $months_short = explode("|", $locale['shortmonths']); if (isset($userdata['user_offset'])) { $offset = $userdata['user_offset']+$settings['serveroffset']; } else { $offset = $settings['timeoffset']+$settings['serveroffset']; } if ($format == "shortdate" || $format == "longdate" || $format == "forumdate" || $format == "newsdate") { $format = $settings[$format]; } $val = $val + ($offset * 3600); $format = str_replace('%b', $months_short[intval(strftime('%m', $val))], $format); $format = str_replace('%B', $months_long[intval(strftime('%m', $val))], $format); return strftime($format, $val); }