[pmwiki-users] PmWiki 2.2-beta12 - UpdatePage() released

Crisses crisses at kinhost.org
Wed Oct 4 05:58:15 CDT 2006


Module maintainers and programmers should be very happy to know that  
PM has released -beta12 yesterday with UpdatePage() capabilities.

This function allows you to update pages in the wiki with full and  
proper updating of the wiki -- RecentChanges, Diffs, or auto-adding  
Categories (see other changes in the Release Notes) for example.

Usage:

UpdatePage($pagename, $oldpage, $newpage);

In this case $oldpage is the array format pulled from
ReadPage($pagename);
$newpage should be a similar array.  Note that $newpage['text'] would  
be the new text to be the full body of the page.
A diff will be calculated between $oldpage['text'] and $newpage['text']

Example use:
$pagename = "Group.PageName";
$text ="I want to completely change the page body and replace it with  
this text.";
XESReplacePage($pagename,$text);
function XESReplacePage($pagename, $text){
	$oldpage = ReadPage($pagename);
	$newpage = $oldpage;
	$newpage['text'] = $text;
	UpdatePage($pagename, $oldpage, $newpage);
}

Please report any problems to PM.  I didn't have anything to do with  
this, except being the first person to try it out after he added it  
to the core.  I noticed that the beta was released silently and  
wanted to inform the other module maintainers and document this since  
some people have certainly been waiting for it.

I would LOVE to see this used by xmlrpc, FastData, and hopefully an  
upcoming email-to-wiki CLI code that could be called by Fetchmail- 
 >Procmail (something I could possibly write!  yippee!! :) ),  
although I now find xmlrpc to be incredible for maintaining my wikis.

Any questions?  I may not be able to answer them ;)

Crisses
----
"The trouble with so many of us is that we have sought directions,  
answers, values, and beliefs from the important people in our world.   
Rather than trusting ourselves to search within and find our own  
answers to the conflicts in our life, we sell out by becoming what  
others expect of us.  Our being becomes rooted in their expectations,  
and we become strangers to ourselves."
  -- Gerald Corey, Theory and Practice of Counseling & Psychotherapy  
(Sixth Ed.), p. 148, on existential therapy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20061004/1f3a9b06/attachment.html 


More information about the pmwiki-users mailing list