Topic: Dynamic template mod
##
##
## Mod title: Dynamic Template tweak
##
## Mod version: 1.0
## Works on PunBB: 1.2, 1.2.1, 1.2.2
## Release date: 2005-02-27
## Author: CodeXP (codexp [at] tasarinan.com)
##
## Description: This mod will allow you to use different templates for
## your CSS style sheets. The template system will now
## look for *.tpl files prefixed with '<stylename>_'
## instead of the deault ones (main.tpl, admin.tpl etc.).
## If it can't find any prefixed templates, it will load
## the default ones instead.
##
## Affected files: header.php
## include/functions.php
##
## Affects DB: No
##
##
## Notes: This mod should work with any version of PunBB, but I've
## only tested it with the 1.2.x release.
##
## Example on use:
## - Let's say that you're using Oxygen.css as your default
## style with your PunBB forum. Then you make a new style
## called "mycoolstyle" that requires you to change something
## in one, or all, of the *.tpl files. Doing that would
## usually break the layout of the rest of your *.css styles.
##
## With this mod, you can just save your new *.tpl files as
## 'mycoolstyle_main.tpl' (same format for all your *.tpl's).
## What now happens is that all your other *.tpl's will use
## the ordinary templates, but your 'mycoolstyle' one will
## use the new template filenames instead.
## If for some reason you're missing one of the new files,
## the mod will load the default PunBB one's instead :)
##
##
## DISCLAIMER: Please note that "mods" are not officially supported by
## PunBB. Installation of this modification is done at your
## own risk. Backup your forum database and any and all
## applicable files before proceeding.
##
##
Hi everyone! Here's my first mod ever for PunBB
What does it do you ask? Well, first let me give you some background info on *why* I made this:
It started with me wanting to create a new style/theme for PunBB. That part of it was rather easy, but it required me to modify the *.tpl files. That in itself wouldn't be a problem if I was only using the new style. No, the problem occured when you changed to a style that *didn't* need the modifications in the template files (you could say that the layout wasn't quite the same anymore).
Ok then, how does this mod solve anything?
Example:
If you got Oxygen.css selected as your style, PunBB will look for 'include/template/Oxygen_main.tpl etc.. If it finds it, it will ignore the default main.tpl file. If it can't find any new templates that fit this naming scheme, it will revert to using the default *.tpl.
Hope this will be of interest to some fellow PunBB users. Feel free to ask if you have any questions (I'm bad at explaining, I know )
Edit: Added demo account on my test forum. Login/pass (needed to change style): Test_user / test
- The default style contains several modifications to the default *.tpl's. All the others are using the default styles. As you can see, the modifications to the templates only affects the new style/theme