| [ Index ] |
krapohl.info |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * Smarty plugin 5 * ------------------------------------------------------------- 6 * Type: modifier 7 * Name: date_format 8 * Purpose: format datestamps via strftime 9 * Input: string: input date string 10 * format: strftime format for output 11 * default_date: default date if $string is empty 12 * ------------------------------------------------------------- 13 */ 14 if(pnModAvailable('pnRender')){ 15 require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); 16 } else { 17 require_once $this->_get_plugin_filepath('shared','make_timestamp'); 18 } 19 function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null) 20 { 21 if($string != '') { 22 return strftime($format, smarty_make_timestamp($string)); 23 } elseif (isset($default_date) && $default_date != '') { 24 return strftime($format, smarty_make_timestamp($default_date)); 25 } else { 26 return; 27 } 28 } 29 30 /* vim: set expandtab: */ 31 32 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Feb 16 22:40:07 2005 | Cross-referenced by PHPXref 0.6 |