|
Post by MonsterControl on Jan 19, 2012 21:22:12 GMT -4
<script type="text/javascript"> <!-- /* link avatar to website */
var img = document.getElementsByTagName('img'); if(location.href.match(/ion=(display|(pm)?(calendar)?view|(user)?recent|search2)/)) { for(i=0; i<img.length; i++) { if(img.item(i).alt == '[homepage]') { var r = 1; while(img.item(i-r) && img.item(i-r).alt != '[avatar]') { r--; } if(r < 6) { img.item(i-r).style.cursor = 'hand'; img.item(i-r).store = img.item(i).parentNode.href; img.item(i-r).onclick = function() { location.href = this.store; } img.item(i).style.display = 'none'; } } } } //--> </script>
|
|
|
Post by MonsterControl on Jan 19, 2012 22:34:45 GMT -4
<script type="text/javascript"> <!-- /* Remove avatar size limits for everyone by california */ var img=document.getElementsByTagName("img"); if(location.href.match(/=(display|viewprofile|search2|pmview|recent)/)){ for(i=0;i<img.length;i++){ if(img[i].alt=="[avatar]"){ var t=img[i].parentNode; var s=t.innerHTML.replace(/width=.?\d+?.?/i,''); t.innerHTML=s.replace(/height=.?\d+?.?/i,''); } } } // --> </script>
If you want to increase the avatar size limit (100x100) instead of removing it completely, put this code in the Global Footer, below the code above.
<script type="text/javascript"> <!-- /* avatar size limit by california */
var maxWidth=200; var maxHeight=200;
var img=document.getElementsByTagName("img"); for(i=0;i<img.length;i++){ if(img[i].width>maxWidth && img[i].alt.match(/\[avatar\]/i)){ img[i].style.height=""+(img[i].height*maxWidth/img[i].width)+"px"; img[i].style.width=""+maxWidth+"px"; } if(img[i].height>maxHeight && img[i].alt.match(/\[avatar\]/i)){ img[i].style.width=""+(img[i].width*maxHeight/img[i].height)+"px"; img[i].style.height=""+maxHeight+"px"; } } // --> </script>
|
|
|
Post by MonsterControl on Jan 27, 2012 20:50:54 GMT -4
<script type="text/javascript"> <!-- /* increase avatar size limit by california */
var maxWidth = 150; var maxHeight = 150;
function resizeAv(imgnum){ var targetImg = document.getElementsByTagName("img")[imgnum]; if(isNaN(targetImg.width) || isNaN(targetImg.height)){ setTimeout("resizeAv("+imgnum+");", 500); }else{ if(targetImg.width > maxWidth){ var newHeight = Math.round(targetImg.height*(maxWidth/targetImg.width)); targetImg.width = maxWidth; targetImg.height = newHeight; targetImg.style.width = ""+maxWidth+"px"; targetImg.style.height = ""+newHeight+"px"; } if(targetImg.height > maxHeight){ var newWidth = Math.round(targetImg.width*(maxHeight/targetImg.height)); targetImg.width = newWidth; targetImg.height = maxHeight; targetImg.style.width = ""+newWidth+"px"; targetImg.style.height = ""+maxHeight+"px"; } } }
var iAv = document.getElementsByTagName("img"); if(location.href.match(/on=(displ|search2|viewpr|pmv|(user)?rece|cal\w+iew)/)){ for(i=0; i<iAv.length; i++){ if(iAv[i].alt.match(/\[avatar\]/i)){ var imgPar = iAv[i].parentNode; var temp = imgPar.innerHTML.replace(/width=.?\d+.?/i, ''); imgPar.innerHTML = temp.replace(/height=.?\d+?.?/i, ''); resizeAv(i); } } }
// --> </script>
|
|