[pmwiki-devel] read, edit and save a page

marc gmane at auxbuss.com
Wed Nov 22 03:48:08 CST 2006


Guillermo Calderon - INCO said...
> Patrick R. Michaud wrote:
> > On Tue, Nov 14, 2006 at 06:18:32PM -0200, Guillermo Calderon - INCO wrote:
> > 
> >>I want to write php code to do the following:
> >>
> >>  1) read  a page (by name) and store it in a variable (say $text)
> >>  2) modify $text (I known how to do this)
> >>  3) save the page with $text as the new content
> > 
> > 
> >        $page = ReadPage($name)
> >        $text = $page['text'];
> >        # ...
> >        $text = modify($text);    # you do this part
> >        # ...
> >        $newpage = $page;
> >        $newpage['text'] = $text;
> >        UpdatePage($name, $page, $newpage);
> > 
> > Pm
> 
> Thanks all for your answers.
> Pm, I cant't find the function "UpdatePage". Where is it?

It's in pmwiki.php. An easy way to find functions is to do a recursive 
grep on pmwiki/ Or, if you use vim, as I do, try

  :vim /updatepage/ **/*.php

(more precisely, :vim /function *updatepage/ **/*.php)

-- 
Best,
Marc




More information about the pmwiki-devel mailing list