[pmwiki-users] WritePage question
celok at gmx.net
Sat Sep 16 11:38:57 CDT 2006
i want to write a script which allows non logged in users to edit
Of the security issue i am well aware :)
However i lose the history. This is rather difficult for me, as i
can't find much docs about the functions.
Here is what i do (comment what i want it to do):
Lock(2); # lock page
$page = ReadPage($pagename, READPAGE_CURRENT); # read page into
$page (which is an array)
$text = split("\n", $page['text']); # spilt text from $page in lines
(not touching anything else in the
foreach ($text as $number => $line)
## here the modification is done
$page['text'] = join("\n", $text); # join lines back to $page['text']
WritePage($pagename, $page); # write everything (along with
Redirect($pagename); # return to page
As far as i understand it, only the "text=" line from the page is
touched, but the page loses it's entire history.
Where do i go wrong, and how can i preserve the history?
More information about the pmwiki-users