00001 <?php 00011 require_once $smarty->_get_plugin_filepath('shared', 'make_timestamp'); 00031 function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_date = '') 00032 { 00033 if ($string != '') { 00034 $timestamp = smarty_make_timestamp($string); 00035 } elseif ($default_date != '') { 00036 $timestamp = smarty_make_timestamp($default_date); 00037 } else { 00038 return; 00039 } 00040 if (DIRECTORY_SEPARATOR == '\\') { 00041 $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); 00042 $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); 00043 if (strpos($format, '%e') !== false) { 00044 $_win_from[] = '%e'; 00045 $_win_to[] = sprintf('%\' 2d', date('j', $timestamp)); 00046 } 00047 if (strpos($format, '%l') !== false) { 00048 $_win_from[] = '%l'; 00049 $_win_to[] = sprintf('%\' 2d', date('h', $timestamp)); 00050 } 00051 $format = str_replace($_win_from, $_win_to, $format); 00052 } 00053 return strftime($format, $timestamp); 00054 } 00055 00056 /* vim: set expandtab: */ 00057 00058 ?>
| Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|
