miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

permission to start threads only for special users

 
Author ksyr
Guest
#1 | Posted: 9 Oct 2006 10:11 
hello folks,

is it possible to disallow all (registered, or not) users to open new threads and define users with the permission to do it ?

Author Ivan
Advanced Member
#2 | Posted: 9 Oct 2006 11:36 
For disallowing users to make new topics, make the respective forum(s) post-only.

As per defining regular users that can in such case - in contrast to the others - I cannot remember such possibility. But the administrator and these that you made moderators always can, even if the forum(s) are post-only.

Author ksyr
Guest
#3 | Posted: 9 Oct 2006 12:07 
okay, thank you for that.

i hope there is a way to define users with the permisssion to open threads. if anybody knows, or have a tip for me, how to realize that with php-basic knowledge, or with an existing plugin/hack - please tell me. thanksalot!

Author Paul
Lead Developer 
#4 | Posted: 9 Oct 2006 12:10 

Author Ivan
Advanced Member
#5 | Posted: 9 Oct 2006 13:38 
I think that for 1) he wants "post-only", otherwise who will make the posts in the threads :)

Author Paul
Lead Developer 
#6 | Posted: 9 Oct 2006 14:08 
So, moderators will make posts in these threads? Or I misunderstand something.

Author ksyr
Guest
#7 | Posted: 9 Oct 2006 17:11 
yeah, correct ivan - i want a completely post only-forum, and some users - without moderator-permissions - have the possibility to open threads. like an advanced usergoup..
i think this would be a good feature for a next version (although i love the simplicity of minibb).

Author Ivan
Advanced Member
#8 | Posted: 10 Oct 2006 01:05 
Hi Paul :) He wants only admin/mods to open the new threads - and after that users to post in them. Else, if all is read-only, only admin/mods will be capable to post and it will be like a blog :)))

By the way, miniBB is very flexible and might be easy transformed to a blog, too :)

Author Paul
Lead Developer 
#9 | Posted: 10 Oct 2006 03:27 
Ok, if I understand this time correctly...

Add in bb_specials.php array defining "group of users by forum", users, which are allowed to create topics. That way:

$poForumsAllowedUsers=array(
FORUM_ID1=>array(USER_ID1, USER_ID2, USER_ID3...),
FORUM_ID2=>array(USER_ID4, USER_ID5, USER_ID6...),
....
);

All forum IDs also must be defined in $poForums array.

For example, I have read-only forums with IDs 2 and 9, and want to assign user with ID 1127 which is able to create topics in the forum ID 9.

$poForumsAllowedUsers=array(
9=>array(1127)
);

$poForums=array(2, 9);

After defining users, you will need to paste at the end of your language pack (/lang/eng.php or whatever):

/* Hack for assigning topic creation rights in post-only forums */
if($user_id!=0 and $forum!=0){
if(isset($poForumsAllowedUsers[$forum]) and in_array($user_id,$poForumsAllowedUsers[$forum])){
$tmproForums=array();
foreach($roForums as $key) if($key!=$forum) $tmproForums[]=$key;
$poForums=$tmproForums;
}
}
/* --Hack for assigning topic creation rights in post-only forums */

It works on my side...

this would be a good feature for a next version (although i love the simplicity of minibb) - sorry, no new features anymore! Else we will bloat implementing every custom request. This little hack should help you.

Author Ivan
Advanced Member
#10 | Posted: 10 Oct 2006 04:50 
Paul, excuse me:

All forum IDs also must be defined in $roForums array.

You mean the same IDs to be defined together in both $roForums and $poForums, or this may be used separately for the one category and for the other?

By the way, it's a very nice little snippet. I would call it "Assigning semi-moderators addon" :)))

Author Paul
Lead Developer 
#11 | Posted: 11 Oct 2006 02:33 
Sorry, I've meant only $poForums for sure (my typo). Fixed my message above, so hope now it should be clear.

Author Ivan
Advanced Member
#12 | Posted: 11 Oct 2006 08:49 
Thank you, Sir! Благодарю вас, сэр! :)

Very good small code for half-moderators, really :)

Author Ivan
Advanced Member
#13 | Posted: 3 Dec 2006 10:34 
Hi :)

After I promoted miniBB to one more site :) there appeared a small need, similar to the above.

Until now we can authorize specific users to open topics in the post only forums. Is there a simple way to have read-only forums - respectively defined - in which some specific users to be capable to write and to create topics?

Yes, I know that I can make them moderators, but they might be about 20, and then I'll need also to give them one by one the rank "User" etc. - what seems me complicated.

Thanks in advance.

Author Paul
Lead Developer 
#14 | Posted: 3 Dec 2006 15:03 
Try to specify the following:

- bb_specials.php - add new definition:

$roForums_allowed=array(
7=>array(16,9),
2=>array(9)
);


where 7,2 etc. state for the forum IDs, and what in parentheses - for allowed user IDs to post.

- bb_plugins.php - at the very top, after if (!defined('INCLUDED776')) die ('Fatal error.'); paste:

if($forum>0 and $user_id>0 and ($user_id==1 or $isMod==1 or (isset($roForums_allowed[$forum]) and in_array($user_id, $roForums_allowed[$forum])) ) ) { }
else $roForums[]=$forum;


That would work out, but I'm not sure it is really safe way. Users will not see the message form to post; however, their posting rights are allowed at the intermediate code in index.php. If you want to be sure no hackers will break this, you can use non-core-destructive solution above.

However, if you want to be highly protected, only modifying index.php directly you can achieve that. Find the piece of code which is marked as /* Private, archive and post-only forums stuff */, and paste the mentioned code above for bb_plugins.php, into index.php instead.

Let me know the results...

Author Ivan
Advanced Member
#15 | Posted: 3 Dec 2006 16:48 
Thanks, Paul! I'll try it in a day or two, and will tell how it works. A couple of hours ago the said server refused me the pleasure to enter in it and I obviously have to wait until the admin solves the problem :)

Thanks again!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 permission to start threads only for special users
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑