[pmwiki-users] How to include wiki page into php variable?

Octocias octocias at googlemail.com
Mon Apr 10 03:02:32 CDT 2006


I'm really anxious to get this particular markup working for me. *Please*
help me fix it - There are so many cool things I can do with it!

regards,

Octocias

On 09/04/06, Octocias <octocias at googlemail.com> wrote:
>
> Now that I can extract WikiCode, I find that I cannot insert it into a
> page without being incorrectly translated. Logic tells me this could be
> solved by correcting the "when" parameter in the markup function call, but I
> have tried so many that I have to give up on trial and error and ask for a
> definitive/intelligent solution.
>
> As a simple test, please see the following page:
>
> http://www.octocias.com/index.php?n=Private.TestA
>
> And here is the test code from my config.php :
>
> Markup('test', '<include', '/\\(:[t|T]est +(.+) *:\\)/e',
> "QuickTest('$1')");
> function QuickTest( $Source )
> {
>   $page = ReadPage( "$Source", READPAGE_CURRENT );
>   $out  = $page['text'];
>   return $out;
> }
>
>
> Can you help me solve this?
>
>
> On 08/04/06, Patrick R. Michaud <pmichaud at pobox.com > wrote:
>
> > On Sat, Apr 08, 2006 at 08:11:44PM +0100, Octocias wrote:
> > >    As a follow-up, I've tried to borrow code from the (:include:)
> > markup and
> > >    I did:
> > >
> > >    $out = PRR(IncludeText( 'Group.Pagename', ''));
> > >
> > >    .. without success.
> > >
> > >    Can you tell me if this is supposed to work or how to make it work?
> >
> >
> > If you just want to read the text of another page, it's:
> >
> >     $page = ReadPage('Group.Pagename', READPAGE_CURRENT);
> >     $out = $page['text'];
> >
> > The READPAGE_CURRENT says that you're just interested in the
> > most recent version of the page (so you can avoid reading the
> > history).  If you want the history read also, omit the READPAGE_CURRENT.
> >
> > Note that this doesn't do any authorization checking for the page --
> > it reads it even if the current visitor isn't authorized to view
> > it.  To get the page only if the visitor has permission to see it,
> > then use:
> >
> >     $page = RetrieveAuthPage('Group.Pagename', 'read', false,
> > READPAGE_CURRENT);
> >     if (!$page) { ...can't read page... }
> >     $out = $page['text'];
> >
> > Pm
> >
>
>
>
> --
> Octocias
> http://www.octocias.com
>



--
Octocias
http://www.octocias.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060410/222d5f68/attachment.html 


More information about the pmwiki-users mailing list