User & Groups Module - Blank Page?
#1
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?
Reply
#2
Could you paste the rest of the code?
My Plugins: [1.8]|[1.6]

** Selling custom plugin that enables Bitcoin payments. PM me if interested in purchasing! **
Reply
#3
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)