MyBB Community Forums

Full Version: Redirect from global_start
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Stupid question, but my LED is not blinking :p

When I'm trying to redirect through 'global_start' hook the css of redirect page is failing to load.

$plugins->add_hook('global_start', 'redirect_do');

function redirect_do(){
	global $mybb, $theme, $templates, $headerinclude;
	if($mybb->user['uid'] == 1){
		redirect('somepage.php');
	}
}

Result:

[Image: rBQ0Tfa.png]

I've tried $theme & $headerinclude set to global but no luck.

What I'm missing?
$theme and $headerinclude are not available in global_start, they're set later.
I realize that.
So, there is no option ??!!!
You try using global end ?
global_end is too late for the actual function I'm trying to perform.