the content of $handler will vary depending on what you are doing and what hook you are running. also, you should be able to use the $mybb->input instead
$plugins->add_hook("datahandler_post_validate_thread", "support_thread_validateforum");
function support_thread_validateforum(&$handler)
{
global $mybb;
$display = false;
// print_r($handler);
//die();
//get usergroups from settings
$forumArr = explode(",","1,2");
$groupArr = explode(",", "1,2");
$post = $handler->data;
if (in_array($post['fid'],$forumArr))
{
//current forum is a support forum
//is the user required to enter a forum?
if (!in_array($mybb->user['usergroup'],$groupArr))
{
//this user isn't exempt
$display = true;
}
}
if ($display == true)
{
if ((int)$mybb->input['forumsubject'] == 0)
{
$handler->set_error("you did not pick a forum");
return false;
}
}
/*echo $display;
print_r($mybb);
print_r($mybb->input);
die();*/
}
Lost interest, sold my sites, will browse here once in a while. It's been fun.