MyBB Community Forums

Full Version: User & Groups Module - Blank Page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to create a new user module in the Users & Groups tab, for some reason the page is completely white. There's nothing inside the <body>, the title of the page is empty as well.

I've checked Apache & PHP error logs and they both don't say anything about this page. I'm currently using these two hooks in the inc/plugin/ file.

  $plugins->add_hook('admin_user_menu', create_function('&$args', '$args[] = array(\'id\' => \'ranks\', \'title\' => \'Manage Ranks\', \'link\' => \'index.php?module=user-ranks\');'));
    $plugins->add_hook('admin_user_action_handler', create_function('&$args', '$args[\'ranks\'] = array(\'active\' => \'ranks\', \'file\' => \'ranks.php\');'));

Is there perhaps a hook I'm missing?
Could you paste the rest of the code?
Don't use create_function() - it has been deprecated in PHP 7.1 and will be removed in 7.2. Instead, use a proper function:

$plugins->add_hook('admin_user_menu', 'myplugin_admin_user_menu');
function myplugin_admin_user_menu(&$sub_menu)
{
	$sub_menu[] = array(
		'id' => 'ranks',
		'title' => 'Manage Ranks',
		'link' => 'index.php?module=user-ranks',
	);
}

$plugins->add_hook('admin_user_action_handler', 'myplugin_admin_user_action_handler'); 
function myplugin_admin_user_action_handler(&$actions)
{
	$actions['ranks'] = array(
		'active' => 'ranks',
		'file' => 'ranks.php',
	);
}

That should also give some better error logs if there is a problem.