Post by ⓦ৹₪deⓡ on Nov 20, 2005 1:34:11 GMT -8
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 indicated. Do NOT PM me for support or requests, that's what the coding boards are for. Enjoy.
~Wonder
Global Footer
Note for When/If Removing this Code:
This code stores information in the "Personal Text" field of the users profile. If at some point you decide to remove this code or for whatever reason the code stops working then that information will remain visible in the personal text field until you or the user removes it. This information would look something like: [x=X-Fire_ID]
~modified Feb 8th, 2006 at 7:38pm to fix PB space error.
Edit where indicated. Do NOT PM me for support or requests, that's what the coding boards are for. Enjoy.
~Wonder
Global Footer
<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>
Note for When/If Removing this Code:
This code stores information in the "Personal Text" field of the users profile. If at some point you decide to remove this code or for whatever reason the code stops working then that information will remain visible in the personal text field until you or the user removes it. This information would look something like: [x=X-Fire_ID]
~modified Feb 8th, 2006 at 7:38pm to fix PB space error.