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

Christophe David pmwiki at christophedavid.org
Thu Sep 13 15:06:05 CDT 2007


>> Could someone please post the PHP code equivalent to
>> (:include Main.SomePage#FromHere#ToHere:)
> $text = RetrieveAuthSection($pagename, 'Main.SomePage#FromHere#ToHere');
> Pm

I have a pagelist format that includes a section of the listed pages,
as shown below.  This works exactly as expected, except that when
there are many pages, it only includes the n first ones.  Some kind of
limit seems to be reached, and I did not manage yet to find out which.

So I tried with the PHP approach to define pagelist.  Hence my
question about the code to get a section of a page in PHP.  See code
below.

Unfortunately, this still does not work as I now get the source page
content with the markups not expanded.

Would someone have an idea
- why the conventional way fails after a certain number of pages
- how to let the PHP way generate an output that will be further
processed to handle markups ?

Thank you in anticipation.

Christophe



[[#XYZ]]
(:template first:)
(:table align=center:)
(:cellnr:)

(:template each:)
(:cellnr align=center:)
(:include {=$FullName}#begin#end:)
(:cellnr align=center:)
[[{$ScriptUrl}/{=$FullName}|{{=$FullName}$:MyPTV}]]
(:cellnr:)

(:template last:)
(:tableend:)
[[#XYZend]]


$FPLFormatOpt['XYZ']['fn'] = 'XYZ';

function XYZ($pagename, &$matches, $opt)
   {
   global $pagename, $ScriptUrl;

   $matches = MakePageList($pagename, $opt, 0);
   $out  = '<table align="center" cellspacing="5" cellpadding="5">' . "\n";

   foreach($matches as $m)
      {
      $out .=     '<tr><td align="center" border="0">'
                . RetrieveAuthSection($pagename, $m . '#begin#end')
                . '</td></tr>'
                . "\n"
              ;
      }
   $out .= '</table>';
   return $out;
   }



More information about the pmwiki-users mailing list