miniBB ® 

miniBB

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

Setting up moderators for the whole forums at once

 
Author ZikZak
Partaker
#1 | Posted: 31 Jul 2006 12:07 
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 
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 
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 
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
 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
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑