Post by Ajay on Mar 6, 2010 9:42:07 GMT -8
No longer need this code, as this feature has been built into ProBoards v5.
Just edit the red
Goes in Global Footers
Original code based off of : this.
<script type="text/javascript">
<!--
//Original code by iAlex -- Code modified by Ajay -- Open Source
var itweetIcon="wimg.co.uk/pvG.png"; // You may keep this image URL to change it to your own.
//Only edit further if you are a professional.
if(document.modifyForm){
var iAim=document.modifyForm.aim.parentNode.parentNode.parentNode;
var iTweetTr=iAim.cloneNode(true);
iTweetTr.childNodes[0].firstChild.innerHTML='Twitter Username:';
iTweetTr.childNodes[1].firstChild.innerHTML='<input type="text" size="35" maxlength="15" id="itweetInp" />';
iTweetTr.childNodes[2].firstChild.innerHTML='Enter your Twitter Username here.';
iAim.parentNode.insertBefore(iTweetTr, iAim);
var iPerTe=document.modifyForm.personaltext;
var itweetInp=document.getElementById('itweetInp');
if(iPerTe.value.match(/\[F4:(.+?)\]/)){
itweetInp.value=RegExp.$1;
iPerTe.value=iPerTe.value.replace(/\[F4:(.+?)\]/, '');
}
function iSaFa(){
if(itweetInp.value!=""){
iPerTe.value=iPerTe.value+'[F4:'+itweetInp.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 iCentre=iTd.item(i).getElementsByTagName('center');
var iFaSpan=document.createElement('span');
iFaSpan.innerHTML='<a href="http://www.twitter.com/'+RegExp.$1+'" target="_blank"><img src="'+itweetIcon+'" border="0" alt="Twitter" title="Twitter" /></a>';
iCentre.item(iCentre.length-1).appendChild(iFaSpan);
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[F4:(.+?)\]/, '');
}
}
}
//-->
</script>
To have your own twitter displayed go to your profile> Modify Profile> Twitter Username: enter your username.
Enjoy.
Just edit the red
Goes in Global Footers
Original code based off of : this.
<script type="text/javascript">
<!--
//Original code by iAlex -- Code modified by Ajay -- Open Source
var itweetIcon="wimg.co.uk/pvG.png"; // You may keep this image URL to change it to your own.
//Only edit further if you are a professional.
if(document.modifyForm){
var iAim=document.modifyForm.aim.parentNode.parentNode.parentNode;
var iTweetTr=iAim.cloneNode(true);
iTweetTr.childNodes[0].firstChild.innerHTML='Twitter Username:';
iTweetTr.childNodes[1].firstChild.innerHTML='<input type="text" size="35" maxlength="15" id="itweetInp" />';
iTweetTr.childNodes[2].firstChild.innerHTML='Enter your Twitter Username here.';
iAim.parentNode.insertBefore(iTweetTr, iAim);
var iPerTe=document.modifyForm.personaltext;
var itweetInp=document.getElementById('itweetInp');
if(iPerTe.value.match(/\[F4:(.+?)\]/)){
itweetInp.value=RegExp.$1;
iPerTe.value=iPerTe.value.replace(/\[F4:(.+?)\]/, '');
}
function iSaFa(){
if(itweetInp.value!=""){
iPerTe.value=iPerTe.value+'[F4:'+itweetInp.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 iCentre=iTd.item(i).getElementsByTagName('center');
var iFaSpan=document.createElement('span');
iFaSpan.innerHTML='<a href="http://www.twitter.com/'+RegExp.$1+'" target="_blank"><img src="'+itweetIcon+'" border="0" alt="Twitter" title="Twitter" /></a>';
iCentre.item(iCentre.length-1).appendChild(iFaSpan);
iTd.item(i).innerHTML=iTd.item(i).innerHTML.replace(/\[F4:(.+?)\]/, '');
}
}
}
//-->
</script>
To have your own twitter displayed go to your profile> Modify Profile> Twitter Username: enter your username.
Enjoy.
- Fixed mini-profile width bug. - 7/21/11