<HTML dir=ltr><HEAD><TITLE>Re: [pmwiki-users] New Hierarchical Groups Recipe...</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">On Sun, Jan 28, 2007 at 09:11:10AM -0000, Crisp, Steve [<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:country-region w:st="on"><st1:place w:st="on">UK</st1:place></st1:country-region>] wrote:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; I'm still trying to integrate PmWiki and phpBB2 so users think its the<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; same site.&nbsp; The site has a simple structure, header, sidebar, content<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; and footer.&nbsp; The idea is to use PmWiki as the main site and switch out<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; to phpBB2 when users click 'forum' in the sidebar.&nbsp; Sounds simple, but<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; the things I've done so far (see below) are not working well and I'm<o:p></o:p></FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">&gt; looking for advice.</FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New"></FONT></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT size=2><FONT face="Courier New">I now a great solution (for me) that integrates PmWiki and phpBB2 as a single (looking) site.&nbsp; Basically I've added an 'action=hmtl' to return the raw html of any particular page.&nbsp; In my case, _all_ I wanted to do was get the Wiki sidebar in to the forum.&nbsp; I went down this route to keep the interface between PmWiki and phpBB2 as minimalistic as possible and in a format that the forum skin (style) can deal with.&nbsp; Additionally it's dynamic so updates to the sidebar in the Wiki are reflected&nbsp;in the forum.</FONT></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>I've ended up with something that works very well.&nbsp;See&nbsp;<A href="http://www.enginuity.org/">http://www.enginuity.org/</A>&nbsp;for the Wiki and click the 'Forums' link in the sidebar - they look very similar.</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>Before I can create a mini recipe I could do with some advice on how to 'unplug' my changes from pmwiki.php.&nbsp; Basically I've added a new function called HandleHTML, see below:&nbsp;&nbsp;</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>function HandleHTML($pagename, $auth = 'read') {<BR>&nbsp; if (PageExists($pagename)) {<BR>&nbsp;&nbsp;&nbsp; $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);<BR>&nbsp;&nbsp;&nbsp; if (!$page) Abort('?cannot read $pagename');<BR>&nbsp;&nbsp;&nbsp; PCache($pagename,$page);<BR>&nbsp;&nbsp;&nbsp; $text = @$page['text'];<BR>&nbsp;&nbsp;&nbsp; $text = '(:groupheader:)'.@$text.'(:groupfooter:)';<BR>&nbsp;&nbsp;&nbsp; print MarkupToHTML($pagename, $text);<BR>&nbsp; }<BR>&nbsp; else {<BR>&nbsp;&nbsp;&nbsp; Abort('?$pagename does not exist');<BR>&nbsp; }<BR>}<BR></FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>... and extended the $HandleActions array accordingly, see below:</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>$HandleActions = array(<BR>&nbsp; 'html' =&gt; 'HandleHTML',<BR>&nbsp;&nbsp;....</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>So back to my question ... how can I unplug the above changes from pmwiki.php into perhaps a new cookbook/gethtmlpage.php file?</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>Obviously any other recommendations/improvements to my abortion of an attempt to code php (copying what I saw around that did similar)!</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2></FONT></SPAN>&nbsp;</P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>Regards,</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>-Steve.</FONT></SPAN></P>
<P class=MsoPlainText style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB><FONT face="Courier New" size=2>&nbsp;</P></FONT></SPAN></BODY></HTML>