MyBB Community Forums

Full Version: Is it possibile to close thread after report?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone!

Is it possibile to autolock a thread as soon as it has been reported by a member to prevent further replies in it?

Thankyou.
If you are saying auto-close thread reported no by default.
(2019-07-20, 10:01 AM)Mostafa.Shiraali Wrote: [ -> ]If you are saying auto-close thread reported  no by default.

That is understood but with some code modifications,it must be possibile but i am not a coder.

So,i need help.
Can you give some more information about what you're looking for? Do you want the thread to be closed if any of the posts within the thread are reported or just the first post? Do you want it to be closed if anybody reports it or just the owner? If you can provide an example of how you want it to be used it would be easier to code. Smile
Yes,I can write a plugin to do this , But I do not work for free
If you not found free and you want order I am at your service.
Email : [email protected]
Discord : MostafaShiraali#7754
(2019-07-20, 10:27 AM)KuJoe Wrote: [ -> ]Can you give some more information about what you're looking for? Do you want the thread to be closed if any of the posts within the thread are reported or just the first post? Do you want it to be closed if anybody reports it or just the owner? If you can provide an example of how you want it to be used it would be easier to code. Smile

Hello,

If the first post in any thread is reported by any user(which is allowed to report) the thread should be closed to prevent further replies.

Thanks

(2019-07-20, 10:29 AM)Mostafa.Shiraali Wrote: [ -> ]Yes,I can write a plugin to do this , But I do not work for free
If you not found free and you want order I am at your service.
Email : [email protected]
Discord : MostafaShiraali#7754

Yes, that was understood when you wrote your first post.

I will save your contact for more complicated questions.
Using Hooks, add and activate the following:

Hook: report_do_report_end
Title: Autolock thread when reporting post
Code:
global $new_report, $report_type;

if ($report_type == 'post' and $new_report['id2']) {

    require_once MYBB_ROOT.'inc/class_moderation.php';
    (new Moderation)->close_threads($new_report['id2']);

}


Edit: ninj'd, but my code applies for every post, not just the first one, so you might find KuJoe's solution more suitable for your needs.
Guys, thanks for your support.


I am really impressed by KuJoe for making me the plugin.


I will try it and update you.
Is worth noting this is quite open to abuse, people could close all threads simply by reporting them.
Pages: 1 2