PDA

View Full Version : Colored usernames in memberlist


tkeil69575
05-11-2002, 10:00 PM
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.

tkeil69575
05-12-2002, 08:59 AM
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).

Admin
05-12-2002, 09:47 AM
Instead of:
if ($var == 10) {
// do something
} elseif ($var == 15) {
// do something else
} elseif ($var == 20) {
// do some other thing
} else {
// do the default
}
You can use the switch structure:
switch ($var) {
case '10':
// do something
break;
case '15':
// do something else
break;
case '20':
// do some other thing
break;
default:
// do the default
}

tkeil69575
05-12-2002, 10:21 AM
Thanks chen, I'll see if I can improve the code accordingly :)

snyx
05-12-2002, 10:26 AM
:p

tkeil69575
05-12-2002, 10:48 AM
ok, ive updated the code according to Fireflys code - so now its your hack firefly :D

SugarDadE
05-12-2002, 11:01 AM
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.

Boofo
05-12-2002, 02:51 PM
Useful hack, thanks! :)

ZiRu$
05-12-2002, 09:12 PM
Originally posted by tkeil69575
ok, ive updated the code according to Fireflys code - so now its your hack firefly :D

no its still yours....Firefly will say the same thing

ZiRu$
05-12-2002, 09:12 PM
btw! I will install next weekend

lordnet
05-15-2002, 04:17 AM
cool hack :)

my best wish...

LORD

Chris M
05-24-2002, 07:06 PM
Ah...German...

One of the best languages if I do say so myself...

Satan

Kars10
02-04-2003, 09:51 AM
Installed and works like a charm!!
Thanks... :)

BTW: I use replacements for each color.

Example:

{whosonlineadmin} = #FFFF00
{whosonlinemod} =#FFFF66
{whosonlinesupermod} =#FFFF99

So u can change this colors easy for all your colored users like on whos online or Foumhome... :)