Looking for a function in mybb that is called every time a page loads
#1
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?
Reply
#2
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.
Reply
#3
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
Reply
#4
if you are wanting to edit a core file, just stick at the end of global.php
Lost interest, sold my sites, will browse here once in a while. It's been fun.
Reply
#5
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
Reply
#6
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
Lost interest, sold my sites, will browse here once in a while. It's been fun.
Reply
#7
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?
Reply
#8
All settings should be loaded, looking at init.php. No idea why yours wouldn't be getting loaded.
Reply
#9
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
Reply
#10
Have you rebuilt the settings cache? In plugins, you have to run the function rebuild_settings() after inserting new settings.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)