MyBB Community Forums

Full Version: Need some help.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I do PHP inside my templates? :O
You can't. The only way to have something dynamic in your template is to add a variable like {$var} to your template and let a php file define the variable somewhere before the template where the variable is in is called. I mean, like for example you put {$var} in the template index, then you'll need to add
$var = "whatever you want here";
in the index.php file before this line
eval("\$index = \"".$templates->get("index")."\";");
If you don't want to use file edits, you can make your own plugin and use this hook index_end
A complete list off hooks can be found here: http://wiki.mybboard.com/index.php/MyBB_Plugin_Hooks on the MyBB Wiki
that works for me, i was just used to vBulletin where you can do that.