miniBB ® 

miniBB

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

Simple array for all moderators in all forums ($mods)

 
Author tom322
Active Member
#1 | Posted: 14 Apr 2011 09:29 
In bb_specials.php I have this array of mods:

$mods=array(1=>array(2,3,4,5),2=>array(2,3,4,5),71=>array(2,3,4,5),3=>array(2,3,4,5),4=>array(2,3,4,5),5=>array(2,3,4,5) , 6=>array(2,3,4,5),7=>array(2,3,4,5),8=>array(2,3,4,5),9=>array(2,3,4,5),41=>array(2,3,4,5),42=>array(2,3,4,5),14=>array( 2,3,4,5),8=>array(2,3,4,5),17=>array(2,3,4,5),23=>array(2,3,4,5),18=>array(2,3,4,5),47=>array(2,3,4,5),43=>array(2,3,4,5 ),24=>array(2,3,4,5),28=>array(2,3,4,5),29=>array(2,3,4,5),30=>array(2,3,4,5),31=>array(2,3,4,5),32=>array(2,3,4,5),33=> array(2,3,4,5),34=>array(2,3,4,5),35=>array(2,3,4,5),36=>array(2,3,4,5),55=>array(2,3,4,5), 46=>array(2,3,4,5),38=>array(2,3,4,5),68=>array(2,3,4,5),69=>array(2,3,4,5));

That means that all moderators can moderate all forums. Is there a simpler way to write this array? Thank you.

---------

PS> Nevermind, I think I found most of the answers here: Usergroups

Author myBTBdb
Partaker
#2 | Posted: 15 Apr 2011 04:09 
$mods = array();
$forumCount = mysql_query("SELECT forum_id FROM minibbtable35_forums");
while($row=mysql_fetch_array($forumCount)) {
$id = $row['forum_id'];
$mods[$id] = array(7,23,31);
}

This is how I do it :)

Author tom322
Active Member
#3 | Posted: 15 Apr 2011 09:05 
Well, I like it because it's short but I'm not sure if doing a database query is not too complex for this task. I think some smart array (merge) should work faster ;)

Author Paul
Lead Developer 
#4 | Posted: 18 Apr 2011 05:08 
The code provided by myBTBdb above just automates the process. Whenever you add a new forum, the list of moderators is automatically expanded to this forum. If you have a lot of forums, let's say 100, it would bring some comfort. It's an easy mySQL query - I think in terms of resources it is almost nothing to for the database. But in some aspects it could brings an additional load to the server.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Simple array for all moderators in all forums ($mods)
 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
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑