PhpBB2Integration
Questions answered by this recipe
- How can I integrate PmWiki and phpBB2 forum, presenting them as one site?
- How can I integrate a PmWiki sidebar into my phpBB2 (and others) forum?
Description
Integration options for PmWiki and phpBB2 forums (plus others). This recipe provides details of how to better integrate PmWiki and forum software, specifically phpBB2. The idea is to better present PmWiki and the forum software using a common look-and-feel and integrating the Wiki sidebar within the forum. Some things described here are generic in nature and relevant to all forum software, e.g. Wiki sidebar interface, and some guidance specific to the phpBB2 forum software.
An example of an 'integrated' PmWiki and phpBB site the author created is the RomRaider Open Source project over on http://www.romraider.com. You will notice that the site is using PmWiki. All links on the sidebar are also normal Wiki pages except the 'Forums' link. Clicking the forums link switches over to the phpBB2 software. Notice that the page header, sidebar, and skin all look the same.
In summary the following customisations were performed to create this:
- New PmWiki interface to output 'raw' HTML for a given page (the SideBar in this case)
- Get SideBar 'raw' html from above into forum skin - not a copy, dynamically create it everytime from PmWiki
- Add PmWiki SideBar CSS stylesheet items to forum CSS making sidebar look the same in both the Wiki and Forum
- Create new PmWiki skin matching forum styles/colours to create a common look-and-feel
New PmWiki interface to output 'raw' HTML
Basically we want the SideBar (or any other page e.g. Group.Header or Footer) dynamically created from PmWiki and displayed in the forum skin. Physically integrating the PmWiki and phpBB2 source code would be a nightmare especially as php currently does not support namespaces. The solution is to create a simple interface between PmWiki and the forum software. For this recipe the author has used a simple HTML/URL interface. The following get_html_page.php PmWiki plugin simply allows one to add ?action=html to any Wiki URL. Calling this URL returns plain html pertaining only to the section being requested. This HTML is intended to be captured/consumed in to a php variable and integrated with the phpBB2 forum skin - thus displaying the SideBar - dynamically. Specifically the returned HTML does not have HTML header and footer information only the content that would be passed to the PmWiki skin.
In the above example from RomRaider the forum software requests the sidebar using the following URL: http://www.romraider.com/Site/SideBar?action=html
... which returns the snippet below:
<p class='sidehead'> <a class='wikilink' href='http://www.romraider.com/RomRaider/RomRaider'>RomRaider</a> </p><ul> <li><a class='wikilink' href='http://www.romraider.com/RomRaider/Features'>Features</a></li> <li><a class='wikilink' href='http://www.romraider.com/RomRaider/Download'>Download</a></li> <li><a class='wikilink' href='http://www.romraider.com/RomRaider/Screenshots' title="RomRaider 0.4.1 Beta">Screenshots</a></li> <li><a class='wikilink' href='http://www.romraider.com/RomRaider/News'>News</a></li> </ul> <p class='vspace sidehead'> <a class='wikilink' href='http://www.romraider.com/Documentation/Documentation'>Documentation</a> [snip...]
Installation of PmWiki interface to output 'raw' HTML
To install the above plugin to PmWiki perform the following procedure:
- Copy get_html_page.phpΔ to your cookbook/ directory
- local/config.php should be appended with the line: if ($action == 'html') include_once("
$FarmD
/cookbook/get_html_page.php"); - Now check that on any wiki page you can add ?action=html. The page returned will look really basic - that's good!
- Next, move to section below to make the forum software capture/consume the SideBar raw HTML
Get SideBar 'raw' html from above into forum skin
We need to make the forum software capture/consume the SideBar raw HTML. The forum software will be modified to read the SideBar raw HTML from the above URL into in to a php variable. The forum skin/template will then be modified to use this new variable, integrating it as appropriate e.g. as a SideBar on left-hand side.
The following phpBB_sidebar_example_mods.zipΔ archive is for reference purposes only for the reader to better understand the author's approach. The following steps reference files in this archive, specific areas of interest can be found by searching for "SMC:".
- Alter your forum software to store (implode) the returned HTML from [(approve links)
edit
diff]. For phpBB2 the author modified include/page_header.php creating a variable called
$wiki_temp
holding the contents the sidebar html then adding that as a newWIKI_SIDEBAR
element to the global$template
array. - Alter your forum skin/template to integrate the new
WIKI_SIDEBAR
template variable into an appropriate position e.g. left sidebar. The author modified his templates/fisubsilverwiki/overall_header.tpl file to add a new cell to the table inserting the html contents of the sidebar (see the last few lines of this file) - Modifiy your forum template CSS stylesheet to recognise the 'class' items in your html sidebar returned from the Wiki. The author modified the templates/fisubsilverwiki/fisubsilver.css template stylesheet, basically copying the relevant items from his PmWiki skin stylesheet e.g. pmwiki/pub/skins/pmwiki/pmwiki.css
Future Enhancements
Below is a list (incomplete) of other considerations and/or potential enhancements for a better integration between PmWiki and phpBB2:
- Forum headers and footers (and others) could also be dynamically based on the wiki versions in the same way as we did with the sidebar.
- Integrated forum and wiki search. Some ideas might be:
(a) A single search box which searches both Wiki and Forum. Search page results would be split into two showing search results for both.
(b) Single search box with two check boxes under - Wiki and Forum. Selected items would be searched. Search results same as above. Perhaps default to both checkboxes selected.
(c) Drop down list allowing user to select either Wiki or Forum or Both. Selected one(s) would be searched.
Release Notes
- Version 1.0 - 07 March 2007
Comments
(Oct 07 2007)
I have got Problems with the CSS. I want to integrate my form in the monobook.css style, but it doesn't work, because the font is always bigger, than in the monobook style. Any Ideas ?. Why can't find the class=wikilink? Where is the definition for it?
Thanks
-Kay Zimmermann
See Also
- AuthPhpBB2 - AuthPhpBB2 permits user authentication via phpBB2 forum software to be used to edit protect PmWiki pages. Your phpBB2 username is used as the PmWiki edit author name.
- AuthPhpbb2Sso - Single Sign On for PmWiki and phpBB2
- AuthPhpBB3 - This page explains user authentication via phpBB 3 Olympus.
Contributors
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.