RSS2.0 Feed button

"Ever heard Victoria's REAL secret? Too much support hurts."
R. Stevens

Sam Devol

Running with Scissors

Reading This

Integrate PunBB into your WordPress site

Posted on August 28th, 2007
Published in Computers, Things, WordPress
Tagged with:

I wanted to add a forum to my WordPress blog but everything I came across did not integrate well (design/page continuity, etc.) or was too simple for my tastes… Then I came across a tutorial here (there are a few around, that’s just the one I tripped across). Following the tutorial I had a somewhat more integrated forum…
…where the blood-splatter of our butchery won’t stain anything…
With the lessons learned and the release of PunBB 1.2.15 I decided to see if I could do a better job. Since the first install/integration I had added a css-based navigation menu and some random quotes which did not display when my banner/header was displayed above the PunBB forum.

Annoyed, I picked up the scissors and started running….

Important to this whole process is where I installed PunBB. I chose /wp-content/myforums. If you do choose to install in a different location/path just modify my examples accordingly, however, you may experience problems if you move it outside the ‘wordpress’ directory (YMMV).

Since I didn’t want to re-design or customize PunBB any more then necessary, I used their template system as well as their include/user feature (allows a user to ‘include’ their own PHP scripts/pages).

First I had to massage my WordPress theme’s header.php into 2 files I named head.php and body.php so there wasn’t any DOCTYPE duplication and it would be valid XHTML strict. About now is a good time to copy your header/php file to a place where the blood-splatter of our butchery won’t stain anything.

The following will only work in versions less than 2.3
With 2.3 I had to remove all calls to WP functions.

  1. Remove all lines (at the top of the header.php file) that refer to and (as these would duplicate what PunBB 1.2.15 already sends)
  2. Add this in it’s place, right at the top: (this allows our WordPress functions to be used)
  3. Scroll down to the (head closing) tag and delete it AND everything that follows through the rest of the file.
  4. Save it as /wp-content/myforums/include/user/head.php
  5. Re-open the original, unedited header.php file (same one we used above)
  6. Delete everything from line #1 all the way through, and including, the tag
  7. Now save that as /wp-content/myforums/include/user/body.php
  8. Now open your themes footer.php
  9. Scroll down to the end of the file and delete any reference to the closing tags
    and
  10. Now save that as /wp-content/myforums/include/user/foot.php
  11. Now open /wp-content/myforums/include/template/main.tpl
  12. After the line containing but before the line insert the line:
  13. Then, after the line containing but before the line
    insert the line:
  14. And finally, after the 2 closing

but before the insert the line:

  • Lastly, I killed PunBB’s –>
  • Et voilá!

    I found the minima theme for PunBB worked best for my site, but after the integration steps above, I still found annoying traces of borders, so I opened /wp-content/myforums/style/imports/Minima_cs.css and changed the #brdmenu border-width: element/property to border-width:0;

    I also found the PunBB ‘header’ (in the box along with the top horizontal nav links) very clumsy so I commented it out, effectively.

    Here is the original main.tpl:



    And my finished /wp-content/myforums/include/template/main.tpl:



    –>


    I thought this worked quite well with my theme (Barthelme) and it is (was?) XHTML valid. You can see the results here: Support Forums

    Integrating it with other themes may require different ‘tweaks’ but this tutorial should get you in the ballpark.

    As always, feedback is welcome!

    Related Posts:

    Nobody Commented on " Integrate PunBB into your WordPress site "

    Subscribe to these comments Comment RSS or TrackBack URL

    Leave Your Reply Below

     Username

     Email Address

     WebsiteI follow icon

    About The Site

    myimg

    Observations of a Troubleshooting Monkey and

    ex IT Director

    ex Digital Video Director

    ex Missile Mechanic

    ex Motorcycle Mechanic

    Work Background Contact me