Replacing BBCode with Textile on PunBB

I had to set up a forum last year and I chose PunBB to run it. PunBB is both clean and featureful, but it comes with BBcode as it’s default styling mechanism. I followed Mary’s directions to install Textile as posted in the Textpattern forum, but those directions are behind a login and I had a few things to add. So here’s my version:

Before we start, this replaces BBCode!

1. Download Textpattern

2. Grab the classTextile.php file (/textpattern/lib/classTextile.php) and copy it into PunBB’s includes folder (/upload/includes)

3. Open parser.php (/uploads/includes/parser.php) in your favorite text editor and comment out two functions, parse\message_ and parse\signature_. As of version 1.2.14 these start on lines 375 and 445 respectively.

4. Add this code after the two functions you just commented out.

5. Save. Now you can use Textile in PunBB.

6. You’ll notice that the submission textarea still mentions BBCode and not Textile. You can change text surrounding the ‘BBCode’ link on line 496 of post.php (/upload/post.php) and line 213 of edit.php (/upload/edit.php). But to actually change the linktext to read “Textile” you’ll also need to edit the /upload/lang/English/common.php file on line 86, right before the comment text “You probably shouldn’t change this.” I’ve pointed the link to the Textile page, but I plan to edit the help.php file (/upload/help.php) to include some local reference for formatting syntax. If you support multiple languages, you’ll need to edit each language common file.