<?php if (!defined('PmWiki')) exit() ; #---------------------------------------------------- /* This file is EZDate.php; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License, or (at your option) any later version. Copyright 2007 GNUZoo (guru@gnuzoo.org) http://www.pmwiki.org/wiki/Profiles/GNUZoo Please donate to the author: http://gnuzoo.org/GNUZooPayPal/ */ #---------------------------------------------------- $RecipeInfo['EZDate']['Version'] = '1.5' ; #---------------------------------------------------- switch ($action) { case "edit" : if (! @$_POST['preview']) break ; case "browse" : case "print" : $FmtPV['$EZTimeStamp'] = 'time()' ; Markup('EZDate', 'fulltext', '/\\(:(ezdate|eztime)(\\s.*?)?:\\)/i', "EZDate") ; } #---------------------------------------------------- function EZDate($m) { # 3 backreferences, $1 & $2 are nested inside $0 list($pmwiki_element, $name, $args) = $m ; $args = ParseArgs($args) ; $ezformat = $args[''][0] ; $eztimestamp = $args[''][1] ; if ($ezformat === "" | $ezformat === NULL) { $name = strtolower($name) ; if ($name === "ezdate") $ezformat = "F j, Y" ; if ($name === "eztime") $ezformat = "g:i:s a" ; } if ($eztimestamp === "" | $eztimestamp === NULL) return date($ezformat) ; return date($ezformat, $eztimestamp) ; } #----------------------------------------------------