vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Colored usernames in memberlist (https://vborg.vbsupport.ru/showthread.php?t=38549)

tkeil69575 05-11-2002 10:00 PM

Colored usernames in memberlist
 
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:
Code:

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:
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
}


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

Quote:

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... :)


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01095 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete