MyBB Community Forums

Full Version: edits to global.php vs init.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am modding my 1.2.12 install to preload banner advertisements that will then be output in the templates. I have the variables populated and if I output them directly via echo they are working correctly.

If I put the PHP code to generate the banner ads at the end of init.php, they work fine. Variables are populated and the templates output the data. If I put them at the end of global.php, the variables are populated, but the templates are not utilizing them.

Is there some reason that the templates are not using the variables (though they are populated) when they are coded in global.php vs init.php, which is called from inside global.php anyway?

In the end I would prefer the codes to be in global.php so I can get user group information and limit ad output for certain groups.
never mind, I was generating the code after the template outputs in the global.php file.