createOption("replace", "text to change to W3C-DTF", "text", "%%NOW%%"); } function uninstall() { mysql_query("DROP TABLE ".sql_table('plugin_fdate')); } function event_PreAddItem(&$data) { if($this->getOption('replace')) { $data['body'] = $this->fdate($data['body']); if(trim($data['more'])) { $data['more'] = $this->fdate($data['more']); } } return; } function event_PreUpdateItem(&$data) { if($this->getOption('replace')) { $data['body'] = $this->fdate($data['body']); if(trim($data['more'])) { $data['more'] = $this->fdate($data['more']); } } return; } function fdate($str) { $fdate = date("Y-m-d\TH:i:s"); $diff = date("O"); $diff = substr($diff, 0, 3) . ':' . substr($diff, 3); $fdate .= $diff; $str = str_replace($this->getOption('replace'), $fdate, $str); return $str; } } ?>