Post by Ron White on Mar 31, 2006 0:43:09 GMT -5
Goes in the Global Footer
This code will add a profile option for an Xfire ID. It will then display an xfire icon in the miniprofile that links to xfire:add_friend?user=XFIREID. Edit where specified.
-+-Win32##Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (VAUSSU03)##1280 × 768##1-+-
This code will add a profile option for an Xfire ID. It will then display an xfire icon in the miniprofile that links to xfire:add_friend?user=XFIREID. Edit where specified.
<script>
//Xfire Icon v1.0 [CB]
//Copyright 11-20-2005 ~Wonder
//May be reposted anywhere as long as this header remains in tact
//Enter URL of the image you want to appear as Xfire icon
xfireIcon="http://img505.imageshack.us/img505/6027/xfire0fe.gif";
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.match(/\[x\=(.+?)\]/m))
{
xid=RegExp.$1;bp=new RegExp("(<br><br>)?\\[x\\="+xid+"\\]","i");
c=td[i].getElementsByTagName("center");
xid=xid.replace(/\W/,"");
for(j=0;j<c.length;j++){if(c[j].innerHTML.match(bp)){c[j].innerHTML+="<a href=\"xfire:add_friend?user="+xid+"\"><img src=\""+xfireIcon+"\" border=0 alt=\"[xfire]\"></a>";}}
td[i].innerHTML=td[i].innerHTML.replace(bp,"");
}
}
}
if(location.href.match(/action\=modifyprofile/))
{tab=document.modifyForm.aim.parentNode.parentNode.parentNode.parentNode.parentNode;
document.modifyForm.personaltext.value.match(/\[x\=(\w+)\]/)==null?xid="":xid=RegExp.$1;p=document.modifyForm.personaltext;p.onblur=bb;p.onfocus=br;
temprow=tab.insertRow(-1);temp=temprow.insertCell(0);temp.innerHTML="<font size=\"-1\">Xfire:</font>";temp.width=160;temp.vAlign="top";temp=temprow.insertCell(1);
temp.innerHTML="<font size=\"-1\"><input name=\"xid\" size=35 maxlength=\"25\" value=\""+xid+"\"></font>";
temp.width=245;temp.valign="top";document.modifyForm.xid.onkeyup=bb;temp=temprow.insertCell(2);
temp.innerHTML="<font size=\"-2\">Enter your Xfire id.</font>";
temp.width=245;temp.valign="top";}
function bb(){xid=document.modifyForm.xid.value.replace(/ |\W/,"");(xid.length>0)?p.value=p.value.replace(/\[x\=\w+\]/,"")+"[x="+xid+"]":br();}
function br(){p.value=p.value.replace(/\[x\=\w+\]/,"");}
</script>
-+-Win32##Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (VAUSSU03)##1280 × 768##1-+-