[pmwiki-users] (:include Main.SomePage#FromHere#ToHere:) in PHP ?

Thomas -Balu- Walter list+pmwiki-users at b-a-l-u.de
Fri Sep 14 19:37:45 CDT 2007


On Mon, Sep 10, 2007 at 11:52:09AM -0500, Patrick R. Michaud wrote:
> On Mon, Sep 10, 2007 at 10:37:05AM +0200, Christophe David wrote:
> > Could someone please post the PHP code equivalent to
> > 
> > (:include Main.SomePage#FromHere#ToHere:)
> > 
> > It can be done with ReadPage() followed by a regular expression
> > search, but there must be an easier way to do it...
> 
>    $text = RetrieveAuthSection($pagename, 'Main.SomePage#FromHere#ToHere');

I'm doing something like this for my RSS description field:

$FmtPV['$BlogExcerpt'] = 'htmlspecialchars(MarkupToHTML($pn, "(:include $pn#entrybody#extendedbody:)"))';

Can/should I use something with the RetrieveAuthSection() there or is
that just as good as my version?

Also I'd like to simulate the following at the end of the description.

(:if !equal "{=$:More}" "":)[[Blog/{=$Name}#extendedbody | {=$:More}]](:ifend:)

But I'm not sure how to check for the page variable in PHP.

     Balu




More information about the pmwiki-users mailing list