2012-06-18, 05:47 PM
Im playing about with the datahandler hooks to trigger post/thread errors and have an issue when using:
When I use the hook above and the function below to trigger errors while creating a "new thread", the error displays but if the condition is true, the error still displays and prevents the thread from being created. Any ideas why ?
$plugins->add_hook("datahandler_post_validate_thread", "test_run");
When I use the hook above and the function below to trigger errors while creating a "new thread", the error displays but if the condition is true, the error still displays and prevents the thread from being created. Any ideas why ?
function test_run()
{
global $db,$mybb,$forum,$fid,$posthandler,$post,$thread;
if ($forum['fid'] == 1)
{
$mess = $post['message'];
if(strlen($mess) < 50)
{
$posthandler->set_error("Error Message Here.....");
return false;
}
}
}