deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Dec 5, 2009 15:05:21 GMT -8
This code works fine, but you could only see the colored names in threads, and in their profiles. I'd want it to be like usergroups to where you can see their name in colors throughout the forums.
The code:
<script type="text/javascript"> <!--
/* Different Colors for Member Ranks by hpmad Do not repost or claim without permission from creator For more codes like this one go to: http://talkpark.proboards.com */
/* ['Rank Name','Rank Color'] There is no comma on the last line! */ var ranks = [ ['Newbie','ffffff'], ['Junior','F00990'], ['Firble','cc0000'], ['Polygon','00FF00'], ['Button Masher','0000ff'], ['Bandicoot','ffcc00'], ['Lagger','ff9900'] ];
var td = document.getElementsByTagName('td'); var lc = /(action=(viewprofile|display|pmview|search2|recent|calendarview|userrecentposts)|index.cgi$)/i; var ck = /<\/a><\/b><br\s?\/?>(.+?(<br\s?\/?><img.+?>)?)<br\s?\/?>/i; if(location.href.match(lc)){ for(i=0;i<td.length;i++){ if(td[i].className.match(/windowbg/) && td[i].width=='20%' && td[i].innerHTML.match(ck)){ var bb = td[i].getElementsByTagName('b')[0]; for(t=0;t<ranks.length;t++){ if(RegExp.$1.match(new RegExp(ranks[t][0],'i')) && bb){ var dName = bb.innerHTML.match(/>(.+?)<\/a>/i) ? RegExp.$1:false; bb.innerHTML = dName ? bb.innerHTML.replace(/">.+?<\/a>/i,'"><font color="'+ranks[t][1]+'">'+dName+'</font></a>'):bb.innerHTML; } } } } }
//--> </script>
I have more updates upon other codes but I'll request it when I'm ready.
|
|
|
Post by Wormopolis on Dec 5, 2009 16:38:41 GMT -8
the code has a location check in it that confines it to certain pages of the forum.
I would get rid of this line:
if(location.href.match(lc)){
and one of the closing "}" at the bottom
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Dec 5, 2009 18:26:13 GMT -8
I got rid of them, but nothing changed.
|
|
|
Post by Wormopolis on Dec 5, 2009 21:33:41 GMT -8
oh.. duh. Im dumb. the code will only work on a page that contains the data it needs. places like main page doesnt show a users postcount (or post rank title). which is how this code works. unless you want to manually add in every user and thier post count to a code (and update it all the time) there would be no way to make this work.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Dec 5, 2009 22:56:43 GMT -8
Oh, what if you created a new one?
|
|
|
Post by Wormopolis on Dec 5, 2009 23:21:04 GMT -8
still wouldnt be able to ascertain a user postcount from a page that doesnt display it. the only thing that is global is a user's groupid.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Dec 5, 2009 23:24:55 GMT -8
oh ok thanks
|
|
|
Post by Wormopolis on Dec 6, 2009 0:48:18 GMT -8
sorry it wasnt the answer you hoped for.
|
|