MyBB Community Forums

Full Version: datahandler_post_validate_thread hook not working!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a hook to:


$plugins->add_hook("datahandler_post_validate_thread", "test");

Want function only affect new threads but nothing is happening???

$post->data['subject']
$post->data['message']

function allowed_charecters(&$post)
{
global $mybb;
if($post->data['subject'] > $test)
{
echo "works";

}
add_hook($hook_name, $function_name);

Your function should be named "test"

The following is a valid hook

$plugins->add_hook("datahandler_post_validate_thread", "test");

function test() {
    // code here
}

Although I hope you won't use "test" as a function name Big Grin
Thanks buddy! Sorry it is named right just failed to post it here.

How would you do this??

If new thread or you edit first post check title but dont check if it's a reply? How to get postcounter?