Post by Code Dragon on Jan 31, 2007 11:04:39 GMT -8
This is another code that Boccy and I worked on together. It can make the users' display names one or two colors.
Global Footer
<script type="text/javascript">
<!--
/*
Two Colored Display Names by Code Dragon and Boccy109
Code from chaobreederxl2.proboards80.com
Please do not repost, edit, or claim as your own
*/
function color(username,clr1,clr2){
var a = document.getElementsByTagName('a');
for(href=0;href<a.length;href++){
if(a[href].href.indexOf("action=viewprofile&user="+username) != -1){
var b = (a[href].firstChild.innerHTML)? a[href].firstChild.innerHTML : a[href].innerHTML;
if(arguments[2]!=""){
var c = parseInt(0);
var d = true;
var e = "";
while(c<b.length){
if(d){
e+="<font color='#"+clr1+"'>"+b.charAt(c)+"</font>";
d=false;
}
else{
e+="<font color='#"+clr2+"'>"+b.charAt(c)+"</font>";
d=true;
}
c++;
}
a[href].innerHTML=e;
}
else{
a[href].style.color=clr1;
}
}
}
}
/////////////////////////////////////////////////
/*
Syntax:
color("USERNAME","color1","color2");
Leave the second color blank for just one color, like so:
color("USERNAME","color1","");
*/
////////////////////////////////////////////////
color("USERNAME","color1","color2");
// -->
</script>
Edit the red to the USERNAME of the user that you wish to change the color of.
Edit the blue to the FIRST COLOR of the user that you wish to change the color of.
Edit the green to the SECOND COLOR of the user that you wish to change the color of, or just leave it blank, as the code instructs.
To add more colors, then simply repeat the color() function, and edit it appropriately.
Enjoy!
March 5th, 2007: Fixed an error that was causing it not to work.
February 25th, 2007: Made it so when the names are hovered, the lines under the letters are the same colors as the letters.
Global Footer
<script type="text/javascript">
<!--
/*
Two Colored Display Names by Code Dragon and Boccy109
Code from chaobreederxl2.proboards80.com
Please do not repost, edit, or claim as your own
*/
function color(username,clr1,clr2){
var a = document.getElementsByTagName('a');
for(href=0;href<a.length;href++){
if(a[href].href.indexOf("action=viewprofile&user="+username) != -1){
var b = (a[href].firstChild.innerHTML)? a[href].firstChild.innerHTML : a[href].innerHTML;
if(arguments[2]!=""){
var c = parseInt(0);
var d = true;
var e = "";
while(c<b.length){
if(d){
e+="<font color='#"+clr1+"'>"+b.charAt(c)+"</font>";
d=false;
}
else{
e+="<font color='#"+clr2+"'>"+b.charAt(c)+"</font>";
d=true;
}
c++;
}
a[href].innerHTML=e;
}
else{
a[href].style.color=clr1;
}
}
}
}
/////////////////////////////////////////////////
/*
Syntax:
color("USERNAME","color1","color2");
Leave the second color blank for just one color, like so:
color("USERNAME","color1","");
*/
////////////////////////////////////////////////
color("USERNAME","color1","color2");
// -->
</script>
Edit the red to the USERNAME of the user that you wish to change the color of.
Edit the blue to the FIRST COLOR of the user that you wish to change the color of.
Edit the green to the SECOND COLOR of the user that you wish to change the color of, or just leave it blank, as the code instructs.
To add more colors, then simply repeat the color() function, and edit it appropriately.
Enjoy!
March 5th, 2007: Fixed an error that was causing it not to work.
February 25th, 2007: Made it so when the names are hovered, the lines under the letters are the same colors as the letters.