miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
Specific miniBB Support Forums / Specific /  
 

Grouping an array of users ($specialTitles)

 
Author tom322
Active Member
#1 · Posted: 12 Oct 2011 00:16Reply Quote
In bb_specials.php I have this array of user special titles (they appear next to usernames on topic pages). Is there a way to make this array smaller (I want to avoid repeating the same word over again; there must be a way to group this somehow)? I mean the [Senior Member] group. Thank you.

$specialTitles=array(
1=>' [Administrator]',
2=>' [Backup Administrator]',
535=>' [Senior Member]',
661=>' [Senior Member]',
794=>' [Senior Member]',
506=>' [Senior Member]',
972=>' [Senior Member]',
885=>' [Senior Member]',
125=>' [Senior Member]',
133=>' [Senior Member]',
198=>' [Senior Member]',
891=>' [Senior Member]',
127=>' [Senior Member]',
569=>' [Senior Member]',
317=>' [Senior Member]',
071=>' [Senior Member]',
185=>' [Senior Member]',
122=>' [Senior Member]',
984=>' [Senior Member]',
177=>' [Senior Member]',
195=>' [Senior Member]',
125=>' [Senior Member]',
375=>' [Senior Member]',
185=>' [Senior Member]',
226=>' [Senior Member]',
226=>' [Senior Member]',
330=>' [Senior Member]',
1661=>' [Senior Member]',
207=>' [Senior Member]',
2511=>' [Senior Member]',
250=>' [Senior Member]',
3171=>' [Senior Member]',
2892=>' [Senior Member]',
4213=>' [Senior Member]'
);

Author Paul
Lead Lead Developer
#2 · Posted: 12 Oct 2011 10:38Reply Quote
$seniorMembers=array(535, 661, 794);
foreach($seniorMembers as $s) $specialTitles[$s]='[Senior Member]';
put this after $specialTitles definition, removing all 'senior member' references from it.

Author tom322
Active Member
#3 · Posted: 12 Oct 2011 17:30Reply Quote
Thanks! That's what I needed (and it's seems simple if I see the solution ;).

Specific miniBB Support Forums / Specific /
 Grouping an array of users ($specialTitles)
 Share Topic's Link

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

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
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 Private Messaging add-on: allow your miniBB-forums members to communicate with each other.