MyBB Community Forums

Full Version: PHP Include in template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to use a php include to include a header file and footer file so that the forums look like the rest of my site. How can I do this? By using the template editor, I am not able to insert php code, so I don't really know where to go from there. Can anybody please help.
You would have to "hook" it in with an eval string (usually before the "template get" string in) the appropriate MyBB core.php file for the section you are trying to call it into.

Then create a new template with the information and call it with the variable you created in the eval string.

I don't think there's any other way, as .xml is NOT .php compliant. Sad

And / or you could use the html content of the .php file and bridge it / add it into an existing template.. Smile
Sounds pretty complicated... hmmm. I'm not sure what I'm gonna do yet. I might just have to make the forums be "different" than the rest of the site.
What's your site? People tend to overcomplicate things that can have simple answers.