MyBB Community Forums

Full Version: Creating your own PHP variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey all. I would like to require a page which calls some data from a mysql database (one i've created) and writes the data to certain variables. And then i'd like to print one of these variables (called $hits) on the forum. I would like to encorporate this into the template at the bottom after "RSS Syndication". I have tried doing it like how it would be done in a normal php page but i have had no luck with it. How do i use php within my forum to require the file and print(echo()) the data?
In global.php, before this line:
eval("\$footer = \"".$templates->get("footer")."\";");
Add this:
require_once '<your file here>';

Then in the footer template, add $hits where you want to.

Make sure that the file you 'require' does not make any output (print/echo) by itself.
groovy thanks alot it worked Toungue