[pmwiki-devel] rename() not working...
The Editor
editor at fast.st
Mon Nov 13 18:20:10 CST 2006
I have this little snippet triggered when someone in a ZAP chat room
issues the command !clear:
case "clear" :
$g = "Chat-$_POST[room]";
$p = ListPages("/^$g\./");
foreach ($p as $pp) {
$n = substr($pp, strpos($pp, ".") + 1);
if (! ereg("^[0-9]{10}.+$", $n)) continue;
$a = strftime("Archives-%Y-%m-%d-%H", substr($n, 0, 10));
$m .= "|$pp, $g.$a|";
rename("$pp", "$g.$a");
}
break;
The line with $m = is a debugging message that gives the exact before
and after names of the pages, correctly. I'm guessing I need to put
some kind of path name into the function to get it to work. Can
someone help me? Or maybe there is a similar, PmWik function?
Cheers,
Caveman
PS. I'm slowly getting the ZAPchat command language up and running.
About 1/3 of the commands work already. The rest will take a bit more
time, but no major obstacles in view. This is going to be really
neat!
More information about the pmwiki-devel
mailing list