MyBB Community Forums

Full Version: how to enter CUSTOM php in the theme templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi, i am working on a rsps community, and i have a system that i have worked out completely in my head, or atleast i had until i tried entering php into the welcomeblock, and it spat it out as a php comment, so i was wondering if there is any way to output custom php from a mybb theme template eg welcomeblock

what i want to put in it is a simple mysql query and echo out some data after it fetches it for a sidebar that came with my theme

forum url rspsdb.org/index.php

thanks, if this is not possible what usable alternatives could i use to return the same result?
Our templates are mostly (X)HTML with a few variable substitutions. PHP is not allowed as it would be a security hole.

You will need to add a variable to the welcomeblock template, then create and activate a plugin which populates that variable.
and how would i do that, i have never created a plugin before
You also could use this plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=260

A more secure version that doesn't allow all PHP commands:
http://mybbhacks.zingaburga.com/showthread.php?tid=464
thanks ALOT this worked 100% mybb for best forum software and best support team + community