Post by wildgoosespeeder on Apr 2, 2010 19:57:37 GMT -8
This code allows you to have 1 - (number of characters of the user's display name) colors for members. The colors cycle. Preview here.
Editing:
memberscolors[d++] = [username, color 1, color 2, etc...];
To find the username, click the user's name. In the address box you will find something similar to this:
http://wildgoosespeeder.proboards.com/index.cgi?action=viewprofile&user=admin
Underlined is the username.
The colors are very easy to add. Colors are in hexidecimal. All the following examples work:
memberscolors[d++] = ["admin","007000","ffff00"];
memberscolors[d++] = ["member","abcdef","123456","00FF00"];
memberscolors[d++] = ["another","654321","665544","332211","1a2b3c"];
Global Footer
ChangeLog:
v2.3
-No more need to manually add the display name.
v2.2
-Minor tweaks.
v2.1
-Added a variable "z" and the expression "z++" so you don't have to change the numbers manually within the brackets of memberscolors[].
v2.0
Initial Release
-Codes completely redesigned to allow for 1-infinite amount of colors.
Editing:
memberscolors[d++] = [username, color 1, color 2, etc...];
To find the username, click the user's name. In the address box you will find something similar to this:
http://wildgoosespeeder.proboards.com/index.cgi?action=viewprofile&user=admin
Underlined is the username.
The colors are very easy to add. Colors are in hexidecimal. All the following examples work:
memberscolors[d++] = ["admin","007000","ffff00"];
memberscolors[d++] = ["member","abcdef","123456","00FF00"];
memberscolors[d++] = ["another","654321","665544","332211","1a2b3c"];
Global Footer
<script language="javascript">
/*
Multi-Colored Display Names by wildgoosespeeder
v2.3
Based from the JavaScript codes of
Two Colored Display Names by Code Dragon and Boccy109
*/
var a = document.getElementsByTagName("a");
var b = "";
var c = true;
var d = 0;
var e = "";
var memberscolors = [];
// [username, color 1, color 2, etc...]
memberscolors[d++] = ["admin","007000","ffff00"];
memberscolors[d++] = ["member","abcdef","123456","00FF00"];
memberscolors[d++] = ["another","654321","665544","332211","1a2b3c"];
for(loop = 0; loop < memberscolors.length; loop++)
{
for(href = 0; href < a.length; href++)
{
if(a[href].href.match(new RegExp("action=viewprofile&user=" + memberscolors[loop][0] + "$")))
{
if(a[href].getElementsByTagName("font")[0])
{
b = a[href].getElementsByTagName("font")[0].innerHTML;
}
else
{
b = a[href].innerHTML;
}
c = true;
break;
}
else
{
c = false;
}
}
if(c)
{
for(f = 0; f < b.length; f++)
{
e += "<font color='#" + memberscolors[loop][(f % (memberscolors[loop].length - 1)) + 1] + "'>" + b.charAt(f) + "</font>";
}
for(href = 0; href < a.length; href++)
{
if(a[href].href.match(new RegExp("action=viewprofile&user=" + memberscolors[loop][0] + "$")))
{
a[href].innerHTML = e;
}
}
e = "";
}
}
</script>
ChangeLog:
v2.3
-No more need to manually add the display name.
v2.2
-Minor tweaks.
v2.1
-Added a variable "z" and the expression "z++" so you don't have to change the numbers manually within the brackets of memberscolors[].
v2.0
Initial Release
-Codes completely redesigned to allow for 1-infinite amount of colors.