[pmwiki-devel] read, edit and save a page
Hans
design5 at softflow.co.uk
Tue Nov 14 14:34:09 CST 2006
Tuesday, November 14, 2006, 8:18:32 PM, Guillermo wrote:
> 1) read a page (by name) and store it in a variable (say $text)
$newpage = MakePageName($pagename, 'Group.PageName');
$new = RetrieveAuthPage('Group.PageName', 'read', false, READPAGE_CURRENT);
> 2) modify $text (I known how to do this)
$new['text'] = '...';
> 3) save the page with $text as the new content
$new['author'] = $Author;
$new['ctime'] = $Now;
SaveAttributes($newpage, $new, $new);
PostPage($newpage, $new, $new);
PostRecentChanges($newpage, $new, $new);
Redirect($newpage);
You could try something like the above.
Hans
More information about the pmwiki-devel
mailing list