5 This function replaces &now in text with a timestamp
6 as long as it is surrounded by any form of whitespace
7 Written by Alfred Sterphone, III
12 $ewiki_plugins["edit_save"][] = "ewiki_edit_save_timestamp";
14 function ewiki_edit_save_timestamp(&$save)
16 $save['content'] = replaceAmpNow($save['content'], time());
19 function replaceAmpNow($a_input, $a_timestamp)
21 $pattern = "/(^|[\s])(&now)($|[\s])/i";
22 $dateFormat = "l, F dS, Y h:i A";
24 $retval = preg_replace($pattern,
25 "\$1''".date($dateFormat, $a_timestamp)."''\$3",