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

Guillermo Calderon - INCO calderon at fing.edu.uy
Thu Nov 23 12:49:07 CST 2006


marc wrote:
> 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)
> 

I tried all this but found nothing.
Maybe it is in a different version. I have 2.1.24.
Is it ok?




More information about the pmwiki-devel mailing list