miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Setting up moderators for the whole forums at once

Author ZikZak
Registered
#1 | Posted: 31 Jul 2006 12:07 | Edited by: ZikZak 
How do I give moderator rights to a user for every forum without doing one entry per forum in the modsarray ?

Can I do something like that ?
array(1,20)=>array(5) ?

Author Paul
Lead Developer
#2 | Posted: 31 Jul 2006 12:11 | Edited by: Paul 
You can paste in bb_specials.php something like that (instead of default array):

if($forum!=0){
$mods[$forum]=array(USER_ID1, USER_ID2...);
}

This will set specified USER_IDs for all available forums.

Author Ivan
Advanced Member
#3 | Posted: 31 Jul 2006 13:15 
Hi, Paul!

Is it possible somewhere around the abobe, before or after, to add some more admins with the default syntax?

Author Paul
Lead Developer
#4 | Posted: 31 Jul 2006 13:27 | Edited by: Paul 
Yes, it's possible (not admins, but moderators).

/* Define moderators here as specified by default */

$mods=array(
1=>array(2,3,4),
2=>array(10)
);

/* Define moderators here in whole for all possible forums */

$modsAll=array(USER_ID1, USER_ID2...);

/* Here goes the algorithm for concatenating both arrays */

if($forum!=0 or $action=='userinfo'){
foreach($modsAll as $mod_id) {
if(!isset($mods[$forum])) $mods[$forum]=array();
if(!in_array($mod_id, $mods[$forum])) $mods[$forum][]=$mod_id;
}
}

Haven't tested it but should work...

Author Ivan
Advanced Member
#5 | Posted: 31 Jul 2006 14:01 | Edited by: Ivan 
Thanks, Paul :) Of course - mods, not admins, my fault.

It's good to know the above code because some days ago I made a new forum and a couple of hours I wondered why am I not a mod of the new one - I forgot that I must add it in bb_specials.php :)

I would even say that it's very useful.

Greetings!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications / Setting up moderators for the whole forums at once Top

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

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB