[pmwiki-users] WritePage question
Tom Lederer
celok at gmx.net
Sat Sep 16 11:38:57 CDT 2006
Hi all,
i want to write a script which allows non logged in users to edit
something.
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
# array
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
modified text)
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?
Best Regards,
Tom
--
Tom
http://www.celok.de
http://www.frappr.com/celok
More information about the pmwiki-users
mailing list