#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 14, 2005 14:16:54 GMT -8
This will chane the title color of each board depending on the amount of posts each has...
Put it in your Main Footer...
<script language=JavaScript> <!--
// Board Title color depending on amount of posts // By Todge
var level = new Array(0); var levelColor = new Array('');
// Edit below here...
level[1] = 100; levelColor[1] = 'red'; level[2] = 500; levelColor[2] = 'blue'; level[3] = 1000; levelColor[3] = 'gold';
// Edit above here...
document.write('<style>'); for(l=0; l<level.length-1; l++) { document.write('.level'+(l+1)+':link { color: '+levelColor[l+1]+'; }'); } document.write('</style>');
var p; var BCell = document.getElementsByTagName('TD'); for(t=0; t<BCell.length; t++) { if(BCell[t].width == '66%' && BCell[t].className == 'windowbg2') { p = parseInt(BCell[t+2].getElementsByTagName('font')[0].innerHTML.split(',').join('')); for(c=1; c<level.length; c++) { if(p >= level[c]) { BCell[t].getElementsByTagName('A')[0].className = 'level'+c; } } } }
// --> </script>
Edit it as follows....
level[1] = 100; levelColor[1] = 'red'; level[2] = 500; levelColor[2] = 'blue'; level[3] = 1000; levelColor[3] = 'gold';
You can use hex colors instead of named colors...
As it stands, boards with more than 100 posts will be red, boards with more than 500 will be blue etc.
Keep adding...
level[4] = AMOUNT OF POSTS; levelColor[4] = 'COLOR OF TITLE';
for all your levels...
|
|