March 28, 2024, 09:21:23 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Change Username Colors Across Board

Pages: [1]   Go Down
  Print  
Author Topic: Change Username Colors Across Board  (Read 863 times)
0 Members and 1 Guest are viewing this topic.
Vitality
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 154



View Profile
Badges: (View All)
« on: November 11, 2008, 10:47:20 pm »

If you're an admin, and your group color is red, this will find every link to your profile, and change the color of it to the color the group; in this case, it would be red. You can have multiple names colored, and in different colors.
Code:
<script>
/*Change username colors across board by Vitality of TCZ || Revolution X*/
var a = document.getElementsByTagName('a')
function changer (xid,xuser,xcolor){
for(i=0,n=a.length;i<n;i++){
if(a[i].href.match(xid) && a[i].innerHTML.match(xuser)){
a[i].style.color=xcolor
}}}
changer("u=1","Vitality","blue");
</script>
All you need to edit is that line at the bottom, right before the final script tag.
Here is the outline if you're unsure of what goes where/if you'd like to add more (for reference):
Code:
changer("u=#","USERNAME","COLOR");

Enjoy!
« Last Edit: November 14, 2008, 10:46:45 pm by Vitality » Report Spam   Logged


CODE

Share on Facebook Share on Twitter

Spoken
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 454



View Profile
Badges: (View All)
« Reply #1 on: November 12, 2008, 08:35:33 am »

Awesome! Im gonna use it!
Report Spam   Logged

Mr_Smith
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 217



View Profile WWW
Badges: (View All)
« Reply #2 on: November 13, 2008, 01:59:28 pm »

Headers or footers? huh?
Report Spam   Logged

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #3 on: November 13, 2008, 03:25:33 pm »

Footers.

Also, why don't you make it just go by the user number and not the whole URL?  Also, If the user changes their desplay name, you will have to change that section of the code.
Report Spam   Logged


Vitality
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 154



View Profile
Badges: (View All)
« Reply #4 on: November 13, 2008, 04:58:52 pm »

EDIT: A newer version is updated in the first post. It's a bit faster, smaller and more efficient!
« Last Edit: November 14, 2008, 09:45:47 pm by Vitality » Report Spam   Logged


CODE
Mr_Smith
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 217



View Profile WWW
Badges: (View All)
« Reply #5 on: November 26, 2008, 12:12:56 pm »

changer("u=1","Vitality","blue");

What needs to stand in that: 1 shown in red?
Report Spam   Logged

deathwilldie
Administrator
Adminitrator
Offline Offline

Posts: 1,769


View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Level 5
« Reply #6 on: November 26, 2008, 01:48:37 pm »

That means the user number.  Just get the User number for the user and put that in it.
Report Spam   Logged

Mr_Smith
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 217



View Profile WWW
Badges: (View All)
« Reply #7 on: November 26, 2008, 02:46:19 pm »

alright... tyvm Grin hehe
Report Spam   Logged

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #8 on: June 22, 2009, 03:55:41 am »

Cool code.
I use it for my Forum Shop Tongue
Report Spam   Logged






Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy