Advertise Here

Author Topic: [Code] Change Username Colors Across Board  (Read 9574 times)

0 Members and 1 Guest are viewing this topic.

Offline Vitality

  • SMF For Free Member
  • *
  • Posts: 53
  • Revolution X
    • View Profile
    • Revolution X

  • Total Badges: 14
    Badges: (View All)
    Linux User Topic Starter Combination Level 3 Level 2
[Code] Change Username Colors Across Board
« on: November 11, 2008, 10:43:46 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.
FOOTERS
Code: [Select]
<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: [Select]
changer("u=#","USERNAME","COLOR");
Enjoy!
« Last Edit: November 16, 2008, 07:56:16 pm by Vitality »

Offline gee

  • SMF For Free Newbie
  • *
  • Posts: 10
    • View Profile

  • Total Badges: 9
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Change Username Colors Across Board
« Reply #1 on: November 16, 2008, 01:53:17 am »
Should this go to the header or the footer section?

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Change Username Colors Across Board
« Reply #2 on: November 16, 2008, 02:21:23 am »
Since he didnt say, until he does..  try it in the Header.. if that doesnt work try it in the Footer..   It wont hurt to test it.

Offline Vitality

  • SMF For Free Member
  • *
  • Posts: 53
  • Revolution X
    • View Profile
    • Revolution X

  • Total Badges: 14
    Badges: (View All)
    Linux User Topic Starter Combination Level 3 Level 2
Re: [Code] Change Username Colors Across Board
« Reply #3 on: November 16, 2008, 07:56:41 pm »
Woops, I'm sorry. It goes in the footers. ;) I've now edited the first post with this info.

Offline gee

  • SMF For Free Newbie
  • *
  • Posts: 10
    • View Profile

  • Total Badges: 9
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Change Username Colors Across Board
« Reply #4 on: November 18, 2008, 05:22:57 am »
So is this code for admins only? Or this code works for all registered members too? I mean, can I change a user's username into another different color too?

Offline Celebrus

  • SMF For Free Hero
  • *
  • Posts: 941
    • View Profile
    • Vikhyat Korrapati

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Change Username Colors Across Board
« Reply #5 on: November 18, 2008, 05:28:43 am »
So is this code for admins only? Or this code works for all registered members too? I mean, can I change a user's username into another different color too?

No and yes twice. Read the last couple of lines to see how.

Offline [JeReMy]

  • SMF For Free Master
  • *
  • Posts: 1174
  • www.ourhangout.org
    • View Profile
    • ourhangout

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Change Username Colors Across Board
« Reply #6 on: November 18, 2008, 07:14:41 am »
thx for the code

Offline Vitality

  • SMF For Free Member
  • *
  • Posts: 53
  • Revolution X
    • View Profile
    • Revolution X

  • Total Badges: 14
    Badges: (View All)
    Linux User Topic Starter Combination Level 3 Level 2
Re: [Code] Change Username Colors Across Board
« Reply #7 on: November 18, 2008, 07:37:58 pm »
So is this code for admins only? Or this code works for all registered members too? I mean, can I change a user's username into another different color too?
It works for all registered members. :)

Offline Nevada

  • SMF For Free Full Member
  • *
  • Posts: 102
    • View Profile
    • Pogo Members

  • Total Badges: 19
    Badges: (View All)
    Level 4 Webmaster Fifth year Anniversary Fourth year Anniversary Third year Anniversary
Re: [Code] Change Username Colors Across Board
« Reply #8 on: May 30, 2009, 07:19:09 pm »

Come join now! Based on Pogo!
Pogo Members join now! ;D

http://twarehouse.smfforfree3.com


JOIN TODAY.

Offline NYNick

  • SMF For Free Member
  • *
  • Posts: 62
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Change Username Colors Across Board
« Reply #9 on: July 12, 2009, 07:52:21 pm »
Awesome code :) Thanks

Offline Ranamayank

  • SMF For Free Member
  • *
  • Posts: 68
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Change Username Colors Across Board
« Reply #10 on: September 24, 2009, 11:47:15 am »
hey its not working for me  :'(
its only working for the owner of the site.....

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: [Code] Change Username Colors Across Board
« Reply #11 on: September 24, 2009, 03:51:13 pm »
It's very hard to resolve problems unless you give us:

1.The url of the forum you are talking about

2. The exact code you are using

3. You must have the code in place on your forum

Complete information helps us help you.


And I Play:  Mafia-Mandemz

Offline Zion

  • SMF For Free Full Member
  • *
  • Posts: 104
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 100 Posts
Re: [Code] Change Username Colors Across Board
« Reply #12 on: October 01, 2009, 01:58:15 am »
Thanks for this code. Changing mine now :)
I'm Back and trying harder.

 

Related Topics

  Subject / Started by Replies Last post
50 Replies
12956 Views
Last post July 30, 2007, 09:58:16 am
by Agent Moose
27 Replies
9558 Views
Last post May 19, 2009, 07:33:01 am
by Seldom Fail
10 Replies
15674 Views
Last post January 11, 2014, 03:05:53 am
by Lolcopte
14 Replies
6424 Views
Last post May 18, 2009, 09:32:27 pm
by Seldom Fail
3 Replies
1566 Views
Last post February 01, 2009, 04:46:10 pm
by simply sibyl