The Arcive of vBulletin Modifications Site. |
|
Colored usernames in memberlist Details »»
|
|||||||||||||||||||||||||
Well this has already been done for online users but as far as I know not for the memberlist, so I did that today on my board and thought I'd share it with you.
Basically it allows you to color the usernames appearing in your member list according to which usergroup they belong to. I'ts a tiny hack and my very first one. Maybe it could be done better, but here it goes. Tested on unmodified memberslist.php for v.2.2.5. Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
and here is a screenshot (on my board I have also installed the gender hack, so the little figure infront of the username will not show up unless you have also installed this other hack).
|
|
#3
|
||||
|
||||
|
Instead of:
Code:
if ($var == 10) {
// do something
} elseif ($var == 15) {
// do something else
} elseif ($var == 20) {
// do some other thing
} else {
// do the default
}
Code:
switch ($var) {
case '10':
// do something
break;
case '15':
// do something else
break;
case '20':
// do some other thing
break;
default:
// do the default
}
|
|
#4
|
|||
|
|||
|
Thanks chen, I'll see if I can improve the code accordingly
|
|
#5
|
||||
|
||||
|
|
#6
|
|||
|
|||
|
ok, ive updated the code according to Fireflys code - so now its your hack firefly
|
|
#7
|
||||
|
||||
|
I just added this hack as well, but I have a suggestion...
Try creating a new css entry, a new class for each level and then instead of hard coding the colors in the memberlist.php file you can go in the vB Admin CP and change a bit of text. Might save some time later on. |
|
#8
|
||||
|
||||
|
Useful hack, thanks!
|
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
||||
|
||||
|
btw! I will install next weekend
|
![]() |
|
|