From 2aa4a0d29399c2338cda3c2267fa12b25b851f6f Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Wed, 12 Apr 2006 15:09:46 +0000 Subject: [PATCH] Fix date display in properties --- include/functions_smarty.inc.php | 7 ++++++- templates/default/admin/media_items.tpl | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index 1976efd..35485c5 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -468,9 +468,14 @@ function serendipity_smarty_rss_getguid($params, &$smarty) { * @param int The timestamp to format (unix seconds) * @param string The strftime() format options on how to format this string * @param boolean Shall timezone conversions be applied? + * @param boolean Try to detect a valid timestamp? * @return */ -function serendipity_smarty_formatTime($timestamp, $format, $useOffset = true) { +function serendipity_smarty_formatTime($timestamp, $format, $useOffset = true, $detectTimestamp = false) { + if ($detectTimestamp && stristr($detectTimestamp, 'date') === false) { + return $timestamp; + } + if (defined($format)) { return serendipity_formatTime(constant($format), $timestamp, $useOffset); } else { diff --git a/templates/default/admin/media_items.tpl b/templates/default/admin/media_items.tpl index 2c0ed33..e1a69e1 100644 --- a/templates/default/admin/media_items.tpl +++ b/templates/default/admin/media_items.tpl @@ -50,7 +50,7 @@ {if NOT $media.enclose}

{$file.name}.{$file.extension} [{$file.mime}]

- {if $file.authorid != 0}{$CONST.POSTED_BY} {$file.authorname}{/if} {$CONST.ON} {$file.date|@formatTime:DATE_FORMAT_ENTRY}. + {if $file.authorid != 0}{$CONST.POSTED_BY} {$file.authorname}{/if} {$CONST.ON} {$file.date|@formatTime:DATE_FORMAT_SHORT}. {if $file.hotlink} {$file.nice_hotlink} {elseif $file.is_image} @@ -105,7 +105,7 @@ {foreach from=$meta_data key="meta_name" item="meta_value"} {$meta_name} - {$meta_value} + {$meta_value|@formatTime:DATE_FORMAT_SHORT:false:$meta_name} {/foreach} -- 2.39.5