MyBB Community Forums

Full Version: How to add PHP code to template files, without adding them to template files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

How can I add PHP code to template files, without adding them to template files? Recently I have started learning PHP and have made my first small code snippet that works exactly as intended.

Say I want to replace a mybb $variable with my own PHP code, where would I add the PHP code?
you can add the codes to the templates where you want it to be executed... however you will have to install the PHP in Templates plugin....

http://mybbhacks.zingaburga.com/showthread.php?tid=260
http://mybbhacks.zingaburga.com/showthread.php?tid=464
Yes, that is what I have used to test out the PHP code. However I heard that it is not secure to use raw PHP in templates.

Is there a more secure way of adding code to templates, without actually putting the raw code in the templates?