MyBB Community Forums

Full Version: Open/close own topic question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

On my forum members have the right to open and close there own topic, but can I disable that if an staff member close the topic?
Seems like you are using a plugin for this because by default members can close or open own threads. Can you provide a list of all activated plugins?
You'd have to modify the plugin code. Here is the steps I believe would be necessary.

Step 1) Add a column named closerid as an Integer to the mybb_threads table. That is where you would store the user id of who closed the thread.

Step 2) You'd have to locate the correct hook where closing the thread takes place. You'd hook to that so it will update the closerid column with the correct value.

Step 3) In the function it uses to determine if the user can open / close the thread, you'd need to use an if statement. There is a function built in that checks if a user is a moderator of the forum so you'd want to use that.
(2013-09-08, 04:42 PM)dragonexpert Wrote: [ -> ]You'd have to modify the plugin code. Here is the steps I believe would be necessary.

Step 1) Add a column named closerid as an Integer to the mybb_threads table. That is where you would store the user id of who closed the thread.

Step 2) You'd have to locate the correct hook where closing the thread takes place. You'd hook to that so it will update the closerid column with the correct value.

Step 3) In the function it uses to determine if the user can open / close the thread, you'd need to use an if statement. There is a function built in that checks if a user is a moderator of the forum so you'd want to use that.

Or maybe deactivate the plugin so by default only Super Moderators and Admins can close threads?
(2013-09-08, 05:28 PM)Arbaz Wrote: [ -> ]
(2013-09-08, 04:42 PM)dragonexpert Wrote: [ -> ]You'd have to modify the plugin code. Here is the steps I believe would be necessary.

Step 1) Add a column named closerid as an Integer to the mybb_threads table. That is where you would store the user id of who closed the thread.

Step 2) You'd have to locate the correct hook where closing the thread takes place. You'd hook to that so it will update the closerid column with the correct value.

Step 3) In the function it uses to determine if the user can open / close the thread, you'd need to use an if statement. There is a function built in that checks if a user is a moderator of the forum so you'd want to use that.

Or maybe deactivate the plugin so by default only Super Moderators and Admins can close threads?

I think he wants members to be able to open and close their own threads, unless they are locked by a moderator / admin.