A template set is a collection of files that together form a
single template. All template sets are stored in their own
subdirectory under the directory
{phorum dir}/templates
. If we asume
that we have three templates default
,
template1
and template2
,
then the directory structure for storing these templates
would look like this:
{phorum dir}
|
+-- templates
|
+-- default
|
+-- template1
|
+-- template2
Inside these template subdirectories, the files for the templates are stored. There, the the following files can be found:
This is a PHP file that is used for describing some properties of the template. This file can define the following variables:
$name
$version
$template_hide
Example 1.1. Template information file: $info.php
<?php // Prevent loading from outside the Phorum application. if (!defined("PHORUM")) return; // Template information. $name = "A brilliant template"; $version = "1.2-beta"; $template_hide = 1; ?>
These are the files that hold the actual template code.
When the Phorum application wants to display a template,
it is always referenced by its basename (i.e. without any
file extension like .php
or
.tpl
after it). If the file
<template basename>.php
exists
in the template directory, then Phorum will use that file
as the template input.
Else, <template basename>.tpl
will
be used.
An example: if Phorum wants to display the "header" template,
it will first search for header.php
in
the template directory. If that file does not exist, it will
use header.tpl
instead.
PHP files (*.php
) contain pure
PHP/HTML code. In Phorum template files
(.tpl
) you can additionally
make use of the Section 1.4, “The Phorum template language”.
Using this system, template authors can completely revert to using pure PHP-code for templates, without using the template language at all. The Phorum development team does not recommend doing this. To keep templates simple, always try to stick to the combination of HTML code and the template language.
In most cases these will be image files which are stored
in a subdirectory images
of the
template. But template authors are free to add
whatever subdirectories and files they like to the
template directory (e.g. Flash based page components,
CSS stylesheets, audio files, JavaScript libraries, etc.).
Combining all this, the full tree for a typical template would look like this:
{phorum dir}
|
+-- templates
|
+-- templatename
|
+-- info.php
|
+-- *.tpl
|
+-- images
|
+-- *.gif, *.jpg, *.png