MyBB Community Forums

Full Version: Looking for a function in mybb that is called every time a page loads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I've loked around for a bit for a function that is called every time a page loads. But it seems mybb caches many of the funcitons (or so it seems). I mean, I've tried putting my code in the output_page funciton in functions.php and it still wont trigger my error Confused

Any ideas?
What exactly is it you're trying to do? You could use frostschutz's hooks plugin and hook to the global_start or global_end hook.
I would prefer to keep this outside of the plugin system Smile It's for a project and it requires a new kind of error page if the forum is suspended Smile
if you are wanting to edit a core file, just stick at the end of global.php
Does mybb cache global.php? I already tried that, and nothing happened. Confused

I even tried putting bad code and a die(); in there and nothing changed.

It's the same with modifying the registration of users. I tried editing the User datahandler to reject any user that begins with "abcde" and it doesnt even load the code. Confused
MyBB does not cache any PHP files. So its your browser cache or any PHP accelerator/optimizer that is not getting updated when the file is compiled/parsed by the server
well, fixed that, now next question.

I need to add a setting to the mybb_settings table that i can display with $mybb->settings['thesetting'];

However, it doesnt seem to get loaded. Is this because it's not got a GID?
All settings should be loaded, looking at init.php. No idea why yours wouldn't be getting loaded.
Yeah, I'm having the same trouble finding out Toungue I tried print_r($mybb->settings) and it's not there either :s

I'll keep looking tomorrow when I have a clearer head Toungue
Have you rebuilt the settings cache? In plugins, you have to run the function rebuild_settings() after inserting new settings.
Pages: 1 2