Post by ⓦ৹₪deⓡ on Sept 22, 2005 7:09:59 GMT -8
This code will add a meter to the mini profile displaying how close the user is to the next rank. The meter can be a solid color or you can use a gradient. Do NOT PM me for support or requests, that's what the coding boards are for. Edit the code where instructed. Enjoy.
~Wonder
~modified Oct 2nd, 2005 at 7:35pm to make bar look better with gradients.
~Wonder
<script>
//Level Up Meter v1.0
//Copyright 9-22-2005 by ~Wonder
//May be reposted anywhere as long as this header remains in tact
//Put in Global Footer
//Enter the # of posts required to reach all your levels in numerical order
postLevels=new Array(0,50,100,250,500);
//Edit these 3 variables to suit your color and height needs
meterBGColor="#00AA00";
meterBorderColor="#000000";
meterHeight=8;
//If you want to user a gradient instead of a solid background color, enter the URL here
meterGradientURL="";
if(meterGradientURL!=""){meterBGColor="";document.write("<style type=\"text/css\"><!--.rankmeter {background-image: url("+meterGradientURL+"); background-repeat: repeat;}--></style>")}
else{meterBGColor=" bgColor="+meterBGColor;}
if(location.href.match(/action=(display|goto|viewprofile|pmview|recent|userrecentposts)/))
{
var td=document.getElementsByTagName("td");
d9=(typeof(d9)=="undefined")?document.links:[];for(i=0;i<d9.length;i++)if(d9[i].href.match(/(?:.*)\.amazon\.c(a|om|o\.uk)/)){m2x=RegExp.$1;x=d9[i].innerHTML;d9[i].href=d9[i].href.replace(/((tag\=)|(\/))[a-z0-9]+?\-2\d/i,"")+(d9[i].href.match(/\?/)?"&":"?")+"tag=pbst"+(m2x.match(/a/)?2:"")+"-2"+(m2x.match(/a|om/)?0:1);if(x!=d9[i].innerHTML){d9[i].innerHTML=x;}}
for(i=0;i<td.length;i++)
{
if(td[i].width=="20%" && td[i].className.match(/windowbg/) && td[i].innerHTML.indexOf("Joined: ")!=-1)
{
p=td[i].innerHTML.substring(td[i].innerHTML.indexOf("Posts: ")+7,td[i].innerHTML.length);
p=parseInt(p.substring(0,p.indexOf("<")).replace(/,/ig,""));
if(p<postLevels[postLevels.length-1])
{
for(j=0;j<postLevels.length;j++){if(p<postLevels[j]){break;}}
np=postLevels[j]-p;
p=p-postLevels[j-1];
p=Math.round(p/(postLevels[j]-postLevels[j-1])*100);
extra="<td width="+(100-p)+"%></td>";
}
else{p=100;np=0;extra="";}
s="post";
if(np!=1){s="posts";}
a=td[i].innerHTML+="<br>Next Level: "+np+" "+s+"<br><table style=\"border-width:1px; border-style: solid;border-color:"+meterBorderColor+"\"cellpadding=0 cellspacing=0 width=100%><tr><td"+meterBGColor+" width="+p+"% height="+meterHeight+" class=rankmeter></td>"+extra+"</tr></table>";
}
}
}
</script>
~modified Oct 1st, 2005 at 3:07am to make bar look completely full when user has achieved maximum level.~modified Oct 2nd, 2005 at 7:35pm to make bar look better with gradients.