31
Mods & Plugins (Requests & Discussions) / Re: [MOD] - Universal field date - gallery and admin
« on: January 23, 2008, 08:05:50 AM »
Sounds really unfriendy. A free Mod is noththing without support...
Thanks...
Thanks...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if (!function_exists('get_universal_field_date')) {
function get_universal_field_date($image_date) {
global $lang, $config;
$start_time = $image_date;
$now = time();
$total_secs = ($now - $start_time);
$total_days = intval($total_secs / 86400);
// Show today image date if uploaded in same day.
if ($total_days == 0) {
return str_replace(array("{uploaded_today_date}"), array(format_date($config['time_format'], $image_date)), $lang['uploaded_images_today']);
// Show yesterday image (if upload yesterday).
} elseif ($total_days == 1) {
return str_replace(array("{uploaded_yesterday_date}", "{uploaded_yesterday_time}"), array(format_date($config['date_format'], $image_date), format_date($config['time_format'], $image_date)), $lang['uploaded_images_yesterday']);
// Show after 2 days image upload date.
} elseif ($total_days > 1) {
return format_date($config['date_format'] . " " . $config['time_format'], $image_date);
// Show invalid date set from image owner or admin (if set after date upload).
} else {
$total_days = preg_replace("/[^0-9]+/i", "", $total_days);
return str_replace(array("{total_days}"), array($total_days), $lang['uploaded_images_near_future']);
}
}
}
if (!function_exists('get_universal_field_date')) {
function get_universal_field_date($image_date) {
global $lang, $config;
$start_time = $image_date;
$now = time();
$total_secs = ($now - $start_time);
$total_days = intval($total_secs / 86400);
// Show today image date if uploaded in same day.
if ($total_days == 0) {
return str_replace(array("{uploaded_today_date}"), array(format_date($config['time_format'], $image_date)), $lang['uploaded_images_today']);
// Show yesterday image (if upload yesterday).
} elseif ($total_days == 1) {
return str_replace(array("{uploaded_yesterday_date}", "{uploaded_yesterday_time}"), array(format_date($config['date_format'], $image_date), format_date($config['time_format'], $image_date)), $lang['uploaded_images_yesterday']);
// Show after 2 days image upload date.
} elseif ($total_days > 1) {
return format_date($config['date_format'] . " " . $config['time_format'], $image_date);
// Show invalid date set from image owner or admin (if set after date upload).
} else {
$total_days = preg_replace("/[^0-9]+/i", "", $total_days);
return str_replace(array("{total_days}"), array($total_days), $lang['uploaded_images_near_future']);
}
}
}