[pmwiki-users] Page creation

The Editor editor at fast.st
Tue Oct 10 12:28:15 CDT 2006


I'm trying to get ZAP to use the handle update function everywhere.  I
now have it deleting pages this way (to preserve the history), and was
thinking about how to create new pages.  Any thoughts on how to do
this code?  IE, what do I use for oldpage if no page exists?

	if (! PageExists($pp)) {
?		$oldpage = ReadPage($pp);
?		$newpage = $oldpage;
		$newpage['text'] = ZAPtemplate("page");
		UpdatePage($pp, $oldpage, $newpage);
		$m .= "Page $pp created.  ";
		}

Perhaps

	if (! PageExists($pp)) {
		$newpage['text'] = ZAPtemplate("page");
		UpdatePage($pp, $newpage, $newpage);
		$m .= "Page $pp created.  ";
		}

Or is there a better way?  Perhaps some existing function for new page creation?

Cheers,
Caveman




More information about the pmwiki-users mailing list