No new thread unless one is approved
#11


(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!  Heart


Attached Files
.php   threadapproval.php (Size: 10.6 KB / Downloads: 38)
Looking for great MyBB plugins & themes?
Join MyBBForge — The Forge is growing, check out our collection!
👉 Come forge something awesome with us.
Reply
#12
(2025-10-19, 02:52 PM)xxcorrosionxx Wrote:

I think this video is for the default feature to moderate users with X or fewer posts ? Just to clarify people.

Regards.
Send me a DM or PM if you want to sponsor any update or addition to my plugins.

[Image: signature.png]

Discord omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#13
Ok, I think I understand now. The video is for the plugin file you share in the same post.

I think this feature already exists within the core with no plugins. Maybe the plugin is useful, anyway, but it is not what the person in this thread is asking for.

The author of this thread wants to moderate all threads in X forum, always. But the author of this forum wants to stop people from creating new threads if there are threads for that user waiting approval in that X forum.

My code accomplishes this because every time people try to create a new thread, the code checks if the person already has unapproved threads in that forum. If the person has unapproved threads in that forum, they can not create new threads until the last is approved.

I hope I made myself clear, or maybe somebody else can clarify better.

Regards.
Send me a DM or PM if you want to sponsor any update or addition to my plugins.

[Image: signature.png]

Discord omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply
#14
Core Functionality

When a user without any previously approved threads creates a new one, that thread is automatically set to “pending approval.”

Once a moderator or admin approves that first thread, the user gains normal posting privileges and can create new threads without needing approval in the future.


.
Looking for great MyBB plugins & themes?
Join MyBBForge — The Forge is growing, check out our collection!
👉 Come forge something awesome with us.
Reply
#15
(2025-10-20, 09:44 AM)xxcorrosionxx Wrote: Core Functionality

When a user without any previously approved threads creates a new one, that thread is automatically set to “pending approval.”

Once a moderator or admin approves that first thread, the user gains normal posting privileges and can create new threads without needing approval in the future.


.

I think OP doesn't want to have to approve all the threads an user can try to create until the first is validated. So the purpose is to forbid new user to create more than one thread.
I can understand the demand, as some users don't read the rules (if they exists) or information message (like "thread is now waiting for admin approval") and will try to create several times the same thread, thinking it's a bug. And admins have often others things to do than approve or delete pending threads.
Tchat en français
Do not ask me help through PM or Discord

Reply
#16
Currently users may be able to see their own unapproved content. What may be useful as a new setting for 1.9 is a setting to be able to set the maximum # of unapproved threads per forum (unlimited by default as it currently is).

Feel free to open a suggestion thread for this but I think it should be focused on 1.9 only.

Regards.
Send me a DM or PM if you want to sponsor any update or addition to my plugins.

[Image: signature.png]

Discord omar.gonzalez (Omar G.#6117); Telegram at @omarugc;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)