MyBB Community Forums

Full Version: Use PHP code in a MyBB Theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I have tried to add a php code to my mybb theme (I am running latest 1.4) and I am having trouble as it is not working. It does not show anything when it is supposed to show either a piece of text or a banner ad.

I am using the default template and not any other template.

Example of a type of php I am using:-

<?php include("content.php"); ?>

That does not work.

<?php
echo "Hello World!"; // This will print out Hello World!
?>

Also this does not work.

I have been editing the templates direct and incerting the code but it just does not work for some reason.

Any help would be great.

Thank you all in advance.
You're not allowed to use PHP in templates by default.

However there is an interesting plugin that enables it, PHP in Templates / Complex Templates. Be careful, it's a powerful and dangerous tool.
WOW! Smile

Just what I was looking for.

I will try not to poop my forum up Rolleyes Big Grin

Thank you for your kind help.