Post by Jim on Feb 4, 2007 19:44:47 GMT -5
Global Footer
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. Edit where specified.
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. Edit where specified.
<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)/))
{
var td=document.getElementsByTagName("td");
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>