2025-10-19, 02:52 PM
(This post was last modified: 2025-10-19, 03:02 PM by Nitr0x. Edited 1 time in total.)
(2025-10-18, 02:53 AM)Omar G. Wrote:$plugins->add_hook('datahandler_post_validate_thread', 'foo_datahandler_post_validate_thread'); function datahandler_post_validate_thread(\PostDataHandler $data_handler): \PostDataHandler { $thread_data = &$data_handler->data; $forum_id = (int)$thread_data['fid']; $user_id = (int)$thread_data['uid']; global $db; $query = $db->simple_select( 'threads', 'tid', "fid='{$forum_id}' AND uid='{$user_id}' AND visible='0'" ); if($db->num_rows($query)) { $data_handler->set_error("You already have unapproved content in this forum. Please wait for it to be approved before posting another."); } return $data_handler; }
Use something like Hooks:
https://github.com/OUGC-Network/MyBB-Hooks
Regards.
Thanks, it helped!
Looking for great MyBB plugins & themes?
Join MyBBForge — The Forge is growing, check out our collection!
👉 Come forge something awesome with us.
Join MyBBForge — The Forge is growing, check out our collection!
👉 Come forge something awesome with us.