MyBB Community Forums

Full Version: Include own php file in global.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way for me to make a plugin that would allow me to include a custom.php in my global.php? For the sake of template variables accessible from any page, or helper functions for all my custom pages.

Thanks in advance.
...that's what a plugin is. a PHP file loaded...
I'm confused as to what you mean. If you are just trying to create new template variables, you can do so by hooking a function into the "global_end" hook. Just use global variables in the function to create new template variables that will be accessible globally.

As far as custom functions, if you're essentially just creating a library of functions for other pages and plugins, you can define as many custom plugins as you want inside of your plugin file.
Thanks for the replies, I guess I should have done a little more research into plugins before asking Smile

You both answered my question, so thank you both Smile