MyBB Community Forums

Full Version: disallow creating threads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'd like to disallow a user to create threads. Same as the MyBB system, but user based in stead of group based.

I'm using a custom profile field to do so, but I'm unable to figure out what variable I have to set to accomplish this.

I tried to set $mybb->usergroup['canpostthreads'] = 0; but the publish button is still there Sad What variable allows to remove this permission?
LOL i just asked that question yesterday...its an option in the usergroup

$mybb->usergroup['canpostthreads'] = 0;

I misread but you said user based?
set them to moderated posting? in the modcp, go to their profile.
Hi Leefish, I don't want to moderate posting, just new threads. Do you know what variable I have to set in the plugin script to force moderate posting after confirming that he's creating a new thread?

@expat, did you try to set $mybb->usergroup['canpostthreads'] = 0; ? I did, and it didn't work. The user is still able to click the button, and he'll see the normal create thread form.
You can ignore the "user based" part, because I know how to detect the user's settings.
you can take the group off creating threads completely, also you prevent the user from creating thread....

BUT i dont think there is ready function to hide the button
(2015-11-16, 05:45 PM)patrick Wrote: [ -> ]I'd like to disallow a user to create threads. Same as the MyBB system, but user based in stead of group based.

I'm using a custom profile field to do so

I always do the same thing (using the profile fields as user based settings) Smile

BTW, what hook you use in your plugin script?
Will it be applied to all forums or for a specific forum(s) only?
global_start. It's the same hook I use to prevent certain users to give reputation using $mybb->usergroup['cangivereputations'] = 0;

It will be used only for a few forums.
Since I don't know how the script looks like (so I can't test it), not quite sure why it doesn't work for you (I also use the global_start hook).
Please make sure there is no other scripts (plugins and/or core edits) interfere it.
Or try to take a long route by using multiple hooks.