|
Post by Dalton on Jun 6, 2009 12:40:25 GMT -5
Ok, Beaker, AK, whoever, who figured out how to make avatar's full size? I'm not saying I dont like it, but its was a bit of a surprise to see the full size gif of a few things. Just wondering who made this awesome discovery, and who I should be thanking
|
|
|
Post by bryce on Jun 6, 2009 12:42:34 GMT -5
Some restrictions need to be put into place, some people have HUGE images as their avatars so now they're stretching into posts -.-.
|
|
Jake
Members
Too fabulous for a title.....
Guido's reaction to Taylor's ban...JAGERBOMBS ALL AROUND!
Posts: 3,683
|
Post by Jake on Jun 6, 2009 12:43:47 GMT -5
Calm down, we are experimenting.
|
|
|
Post by bryce on Jun 6, 2009 12:46:36 GMT -5
Sorry, it was the huge GIF of Cena that made me react
|
|
|
Post by BK London on Jun 6, 2009 12:59:50 GMT -5
Yeah, we're dabbling for now.
|
|
|
Post by El Shadowo on Jun 6, 2009 13:14:47 GMT -5
Hitman's nearly gave me a heart attack <_<
|
|
|
Post by BK London on Jun 6, 2009 13:22:56 GMT -5
So, at this point I have pasted and copied several times around and it seems we're still having a problem with altering the avatar size. The code is supposed to remove the limit for avatar size and sets a new one depending on which values I place into the code. However, it instead makes all the avatars the limit size and you are unable to alter them. It's really pissing me off. If anyone's good at this sort of thing, you can take a look at the code.
<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.alt.match(/\[avatar\]/i)){ var imgPar = iAv.parentNode; var temp = imgPar.innerHTML.replace(/width=.?\d+.?/i, ''); imgPar.innerHTML = temp.replace(/height=.?\d+?.?/i, ''); resizeAv(i); } } }
// --> </script>
|
|
|
Post by Thunderkiss on Jun 6, 2009 13:24:14 GMT -5
Someone do this, because I really dont want tiny ass avatars anymore.
|
|
|
Post by Thunderkiss on Jun 6, 2009 13:27:02 GMT -5
I dont know if I am helping BK, but here is what I found. support.proboards.com/index.cgi?board=codedatabase&action=display&n=1&thread=70213Global Footer: <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 .alt=="[avatar]"){ var t=img.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.width>maxWidth && img.alt.match(/\[avatar\]/i)){ img.style.height=""+(img.height*maxWidth/img.width)+"px"; img.style.width=""+maxWidth+"px"; } if(img.height>maxHeight && img.alt.match(/\[avatar\]/i)){ img.style.width=""+(img.width*maxHeight/img.height)+"px"; img.style.height=""+maxHeight+"px"; } } // --> </script>
|
|
VorteX
Experienced Member
Stay a while...and listen.
Posts: 723
|
Post by VorteX on Jun 6, 2009 13:51:27 GMT -5
If still needed I'll take a look later tonight.
|
|
|
Post by bryce on Jun 6, 2009 15:13:35 GMT -5
Richmond is doing a web design course - if he doesn't know JS then SHAME ON HIM!
|
|
|
Post by BK London on Jun 6, 2009 16:13:59 GMT -5
I used that code before the one I posted - it provided the same result.
|
|
VorteX
Experienced Member
Stay a while...and listen.
Posts: 723
|
Post by VorteX on Jun 6, 2009 16:17:06 GMT -5
I've changed nothing here besides the 't' and 's' variables to something more meaningful (nitpicking mostly). Anyway, I put this in the footer section of my test board as it says and I have a 128x128 avatar up there that is showing properly. Basically all it does is find an image that the forum tagged 'avatar' (so it doesn't banners and such) and uses a regular expression to change the width / height to whatever it originally was.
EDIT: The code above does indeed work, as I put an even larger avatar up there with success. The only downside is you can no longer use the forum to automatically resize it for you. If you use a JS hack to automatically resize, I believe everyones avatar will show up the same size (which is what the original code did). In short, this will work but it's up to the members to use responsible sizes.
EDIT 2 (nerd note mostly): The replace() function does most of the work here as it replaces whatever size the forum set with a blank string, thus making the image default to whatever size it currently is. Exciting I know ;D.
|
|
|
Post by BAWSE Train on Jun 6, 2009 16:44:17 GMT -5
THAT STRETCHES MY SCREEEEEEEEEEEEEEEEN
|
|
|
Post by BK London on Jun 6, 2009 16:50:58 GMT -5
So, considering I wanted to make all avatars 150 x 150, would I have to change what the height equals to simply 150 and same with the width?
|
|