Post by silentflesh on Aug 22, 2009 17:20:20 GMT -5
Source: support.proboards.com/index.cgi?board=codedatabase&action=display&thread=319850
Add to Global Footer
Add to Global Footer
<script type="text/javascript">
<!--
/* Twitter Icon in Mini Profile - Open Source */
/* By Luke */
/* [url]http://support.proboards.com/[/url] */
var twttrIcon="http://wimg.co.uk/Wa5rPk.png"; //Twitter mini profile icon
if(document.modifyForm){
var iAim=document.modifyForm.aim.parentNode.parentNode.parentNode;
var twttrTr=iAim.cloneNode(true);
twttrTr.childNodes[0].firstChild.innerHTML='Twitter:';
twttrTr.childNodes[1].firstChild.innerHTML='<input type="text" size="35" maxlength="15" id="twttrInp" />';
twttrTr.childNodes[2].firstChild.innerHTML='Your Twitter username here.';
iAim.parentNode.insertBefore(twttrTr, iAim);
var twttrTe=document.modifyForm.personaltext;
var twttrInp=document.getElementById('twttrInp');
if(twttrTe.value.match(/ \[F4:(.+?)\]/)){
twttrInp.value=RegExp.$1;
twttrTe.value=twttrTe.value.replace(/ \[F4:(.+?)\]/, '');
}
function iSaFa(){
if(twttrInp.value!=""){
twttrTe.value=twttrTe.value+' [F4:'+twttrInp.value+']';
}
}
if(document.addEventListener){
document.modifyForm.addEventListener('submit', iSaFa, false);
}
else{
document.modifyForm.attachEvent('onsubmit', iSaFa);
}
}
if(location.href.match(/action=(display|(user)?recent|viewprofile|calendarview|search2|pmview)/) || location.href.match(/index.cgi$/) && document.title.match(/Preview/) && document.postForm){
var iTd=document.getElementsByTagName('td');
var i=iTd.length;
while(--i){
if(iTd.item(i).width=="20%" && iTd.item(i).vAlign=="top" && iTd.item(i).className.match(/windowbg(2)?/) && iTd.item(i).innerHTML.match(/\[F4:(.+?)\]/)){
var itwttr=iTd.item(i).getElementsByTagName('center');
var iFatwttr=document.createElement('span');
iFatwttr.innerHTML='<a href="http://www.twitter.com/'+RegExp.$1+'" target="_blank"><img src="'+twttrIcon+'" border="0" alt="Twitter" title="Twitter" /></a>';
itwttr.item(itwttr.length-1).appendChild(iFatwttr);
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[F4:(.+?)\]/, '');
}
}
}
//-->
</script>