]> git.mjollnir.org Git - s9y.git/commitdiff
Fix date display in properties
authorgarvinhicking <garvinhicking>
Wed, 12 Apr 2006 15:09:46 +0000 (15:09 +0000)
committergarvinhicking <garvinhicking>
Wed, 12 Apr 2006 15:09:46 +0000 (15:09 +0000)
include/functions_smarty.inc.php
templates/default/admin/media_items.tpl

index 1976efdc62e54ca3c879b40c3b3f0c4f6759d11f..35485c57cd39c5e596f04f5864edd55ade5596f3 100644 (file)
@@ -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 {
index 2c0ed33ab04a71131d91857be944f5b685a60837..e1a69e1f1076bf906223c14313501b9496b1b3c5 100644 (file)
@@ -50,7 +50,7 @@
     {if NOT $media.enclose}
         <h3>{$file.name}.{$file.extension} [<em>{$file.mime}</em>]</h3>
         <div>
-            {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}
             {foreach from=$meta_data key="meta_name" item="meta_value"}
                 <tr>
                     <td><em>{$meta_name}</em></th>
-                    <td>{$meta_value}</td>
+                    <td>{$meta_value|@formatTime:DATE_FORMAT_SHORT:false:$meta_name}</td>
                 </tr>
             {/foreach}
             </table></dd>