3.1. How do I add more smilies to my forums?
Adding more smilies to your forums is not difficult, but it involves editing one of the scripts that comes with PunBB. Here's a step-by-step instruction. Having very basic knowledge of PHP or programming in general is recommended.
Copy the smilies you want to add/change to into the directory img/smilies/.
Open up the file include/parser.php in a text editor and locate the line that starts with "// Here you can add additional smilies if you like" (it's almost at the top of the file). There you will find two PHP arrays - $smiley_text and $smiley_img. $smiley_text contains the character combinations for the smileys (e.g. or ) and $smiley_img contains the filenames of the smiley images (e.g. big_smile.png or roll.png).
For every new smiley that you want to add, add a character combination to $smiley_text and a filename to $smiley_img. Please note that you must escape the character ' (singlequote) with a backslash if you use it in any of your smilies (e.g. ':rock\'n\'roll:'). Singlequote must be escaped so that PHP can understand that it is not the end of the string, but a character in the string. The same goes for backslash. If your smiley contains a backslash, just must escape that backslash with another backslash (e.g. ':\\').
Once you've added your smileys above, you should pay attention to the row below the smiley arrays. It says that if any of your smilies contain any of the characters &, ", ', < or >, you must uncomment the row thereafter.
Finally save/upload the file and try it out. A list of all installed smilies can be found at the bottom of the help text in help.php.
If you get a PHP error message stating that it encountered a "Parse error", you probably forgot to escape a singlequote or backslash character in the $smiley_text array.
3.2. How do I add my own footer and header so that I can integrate my forums into design of the rest of my website?
For this purpose, PunBB has a simple template system. The template files are located in include/template/. There are three templates - main.tpl, maintenance.tpl and redirect.tpl. The file main.tpl contains the template for almost all pages that are displayed in the forum, the file maintenance.tpl is the template for the message page that is displayed when the forum is put in maintenance mode, and finally the file redirect.tpl is used to display the redirect pages e.g. when logging in or when posting a message.
The templates contain variables that are replaced with actual content when a page is displayed. All variables in PunBB are enclosed in less-than and more-than signs (< and >). For example, the variable for the title of the forums is called <pun_title>. When PunBB displays the index page, it reads the file main.tpl and replaces <pun_title> with the title of the forums. There are 11 replacement variables in main.tpl.
If you want to customize the look of PunBB so that it fits the design of other pages on your website, it is primarily the template files you should edit. For example, if you wanted to add your own logo at the top of all forum pages, you would edit main.tpl and add HTML for displaying your logo at the appropriate position in the file. It is possible to include PHP scripts from the templates. See the next FAQ entry for more info on that.
3.3. Is it possible to include my own PHP scripts in the templates?
Yes. PunBB has a special replacement variable called pun_include for including scripts in the templates. For example, if you wanted to include a script called banner.php (located in the forum root directory) at the bottom of all forum pages, you would add the following to your template files:
The path to banner.php is relative to the forum root directory. PunBB will execute the script and the pun_include variable will be replaced by any output that the script produces. Please note that all included scripts have access to the PunBB variables, so if you e.g. wanted to access the database, you could use the $db object just like the rest of PunBB does. Replacement of the pun_include variable is the last thing that PunBB does when it outputs a page, so you don't have to worry about not using variable names that PunBB uses.
3.4. I want to display information from the forums on my website's front page. How can I do this?
The script extern.php found in the forum root directory can output various bits of information from the forums. This script can be called via a PHP include command or through the use of Server Side Includes (SSI). For more information on this, see the usage instructions at the top of the script extern.php.
3.5. Does PunBB provide RSS feeds for recent discussions?
Yes. The script extern.php can produce RSS 0.91 feeds on recent discussions. For example, to syndicate news about the 15 most recently active topics, visit the URL:
To receive news about the 15 newest topics, the URL is:
More information on the different possibilities can be found in the usage instructions located at the top of the script extern.php in the forum root directory.
3.6. Where can I find info on how to create custom styles for PunBB?
A PunBB community member by the name of ps21 has written an excellent skinning/styling guide for PunBB. It includes information on the different CSS classes used in PunBB and lots of other useful information for aspiring style creators. You can download the guide from the PunBB downloads page.
3.7. I've developed a modification for PunBB and I want to release it to the public. What do I do now?
Visit the PunBB downloads page and download the Mod SDK. It contains a textfile with instructions, a template for the readme file (all mods have a readme.txt) and a template for a mod installation script (if needed).
For more information about PunBB modding, visit the PunBB Resource.