Added some bodaudinh's code in to make it support Username colouring and (should) fix the double quotes bug. Thanks to him for the code!
1. Replace fadeText with:
Code:
function fadeText (intext)
{
var result="";
intext = intext.substring (0, intext.length);
colorx = 255;
z = colorx / intext.length;
for (var i = 0; i < intext.length; i++)
{
colorx = 255 * Math.sin (i / (intext.length / 3));
colory = con2hex (colorx);
colorz = z * i;
colorw = con2hex(colorz);
k = intext.length;
j = k - i;
if(j < 0)
j = 0;
coloru = z * j;
colorv = con2hex(coloru);
result += ("<font color=\"#" + colorv + colory + colorw + "\">" + intext.substring(i, i + 1) + "</font>")
}
return result;
}
2. Add these 2 functions below fadeText function:
Code:
function showRainbow(classname){
var txtValue = "";
var b = getElementsByClassName(classname);
for (var i = 0; i < b.length; i++ ) {
txtValue = fadeText(b[i].innerHTML,1);
b[i].innerHTML = txtValue;
}
}
function getElementsByClassName(classname, node) {
if(!node) node = document.getElementsByTagName("body")[0];
var a = [];
var re = new RegExp('\\b' + classname + '\\b');
var els = node.getElementsByTagName("*");
for(var i=0,j=els.length; i<j; i++)
if(re.test(els[i].className)) a.push(els[i]);
return a;
}
3. Replace the BBcode replacement bit to:
Code:
<span class="rainbow">{param}</span>
(which also means you can turn off all Disable options)
3. Add this in anywhere in footer:
Code:
<!-- DOUBLE RAINBOW ALL THE WAY CROSS THE SKY -->
<script type="text/javascript">
<!--
showRainbow('rainbow');
// End -->
</script>
<!-- WOW WOW OH MY GOD LOOK AT THAT RAINBOW -->