MyBB Community Forums

Full Version: php template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to drop php directly into a template (header)?

I have a little script that pulls recent posts, and i want to do this:

http://syntheticcheese.co.uk/jamiers
You can't use php in a template. Templates are HTML based. However, you can add a variable in a template which can be replaced by something created in php-code.
How would that be done? Could you show me an example to learn from?
If you take a look at any of the templates, you will see variables; they are preceeded by a dollar sign ($).
The template "index" for instance has $forums in it. If you do a search in index.php (which uses this template), you will find that $forums will give you the list of forums for your site. So if you wanted to move your forum list down to the bottom of the page, just move $forums to the bottom of the template.