Avatar Ratava

comments or issues with this board

Moderators: TapeOpLarry, tomb

User avatar
syrupcore
deaf.
Posts: 1793
Joined: Mon Mar 08, 2004 4:40 am
Location: Portland, Oregon
Contact:

Post by syrupcore » Sat Dec 23, 2006 2:35 pm

yeah, I just tried it out. In the css you can add this:

Code: Select all

img.avatar {max-width: 75px;}
* html img.avatar {width: 75px;}
seems to work fine and doesn't have the page jump. the second line (* html ...)is for IE6 and below. IE6 doesn't support max-width because it's an asshole. that means all avatars in IE6 and below will be stretched a little if they're under 75px (like hillary's) but they should upgrade their damn browser anyway. I dunno what the desired avatar width is. i just guessed at 75.

your,
nerd.

User avatar
Dmitry Kichenko
alignin' 24-trk
Posts: 60
Joined: Wed Aug 23, 2006 11:51 pm
Contact:

Post by Dmitry Kichenko » Sat Dec 23, 2006 2:47 pm

Yeah.. Looks like the delay in resizing is because it's done on the client side of things via JS.. Makes sense now..

Why wouldn't they just do it via CSS to begin with?

Still, the easiest way is to just force everyone to use a fixed sized avatar, and whichever ones are above the set limit will not show up at all :).

RefD
on a wing and a prayer
Posts: 5993
Joined: Fri Aug 27, 2004 9:10 pm

Post by RefD » Sat Dec 23, 2006 9:01 pm

*drinks more h80r4d3 and rants about IE crapulance*
?What need is there to weep over parts of life? The whole of it calls for tears.? -- Seneca

User avatar
wedge
tinnitus
Posts: 1088
Joined: Tue Jul 06, 2004 9:08 pm
Location: Washington, D.C.

Post by wedge » Sat Dec 23, 2006 9:20 pm

Dmitry Kichenko wrote:Still, the easiest way is to just force everyone to use a fixed sized avatar, and whichever ones are above the set limit will not show up at all :).
I agree with this... I've seen this type of rule enforced on other websites... It wouldn't seem unreasonable to see "Avatar must not exceed X pixels in width." on the Profile Settings page...

tret-lo
gettin' sounds
Posts: 101
Joined: Mon Aug 11, 2003 11:33 am
Location: Cambridge, MA

Post by tret-lo » Sun Dec 24, 2006 12:20 am

syrupcore wrote:yeah, I just tried it out. In the css you can add this:

Code: Select all

img.avatar {max-width: 75px;}
* html img.avatar {width: 75px;}
seems to work fine and doesn't have the page jump. the second line (* html ...)is for IE6 and below. IE6 doesn't support max-width because it's an asshole. that means all avatars in IE6 and below will be stretched a little if they're under 75px (like hillary's) but they should upgrade their damn browser anyway. I dunno what the desired avatar width is. i just guessed at 75.

your,
nerd.
I thought about this, but I decided to go with the javascript resizing because max-width isn't supported by all browers. Still, maybe it is better than the current fix.

Since there seem to be enough nerds around here to generate some real interest in this, I will explain the problem in detail.

In the good old days (2 weeks ago), we used the phpbb "remote avatar resize" plugin to handle the avatar resizing. This plugin uses the php fopen() function on a remote url (your avatar) to actually open the file and check the image size. If it is bigger than a specified size, it resizes the image (maintaining the aspect ratio) by inserting html width and height attributes.

Citing security concerns, our web host spontaneously turned of the "fopen remote" option in the php configuration, so the script could no longer read the remote files. I tried rewriting the plugin using CURL, but this was dreadfully slow, adding about 5 seconds of load time for each avatar. Not good when there could be 15 avatars on one page.

This brings us to the current solution. Once the page loads, it calls a javascript function that does the same thing as the plugin but on the client (browser) side rather than on the server side. If the image is bigger than the desired width, javascript resizes it.

I can set up whatever you guys prefer. I like syrupcore's css idea more, especially with the IE fix that I hadn't thought of. My real preference, however, would be to require users to resize their own avatars. This would have the added advantage of speeding up page load times, since some of the avatars are actually huge. But it would be a pain in the ass until they all got resized.

Seems like we have a few programmers around. I don't know if anyone has experience with phpBB, but with the 20+ plugins we're running, plus custom hacks like the megaboard and now this image resizing, it can sometimes feel like a house of cards. Thanks for your patience everybody.

User avatar
syrupcore
deaf.
Posts: 1793
Joined: Mon Mar 08, 2004 4:40 am
Location: Portland, Oregon
Contact:

Post by syrupcore » Sun Dec 24, 2006 12:03 pm

Dmitry Kichenko wrote:Still, the easiest way is to just force everyone to use a fixed sized avatar, and whichever ones are above the set limit will not show up at all :).
that might be the best way, but might not the easiest for the users of the board. If there was a plugin to disallow images over x size with a link to some online tool that would resize it for you, that might work out but I'm assuming lots of people don't really know how to make and host a resized image. they just find something on google images and copy a link.

Ryan, thanks for all the info. the js you whipped up is sassy. I was looking over it trying to see if I could suggest something but I got nothing. you might be able to get away with setting all images to display: none; until after the script runs to avoid the screen jump. maybe with just a this.class = "foo" in your loop where foo is set to display none and then this.class = "" after the resize has run on each.

phpbb, hacks or no hacks, is totally a house of cards. thank you for all the work. there's another thread around here about bloatware... phpbb should be included! I've installed it and skinned it for a few clients who demanded it but I try to steer people clear of it cause it's a beast. thank you for all your work!

two totally useless suggestions for now but perhaps for the future... most good BBs realize that phpbb is king and offer import scripts. I've had great luck with punbb and vanilla (although I've never actually done an import from phpbb). pun is powerful. vanilla is super elegant, super hackable. The other suggestion is consider switching hosts to dreamhost. employee owned, pretty much unlimited bandwidth, unlimited databases and a shit ton of space. dead cheap, nice fellas.

I'm totally down to help out however I can on the code side of things. I get a lot from this board.

RefD
on a wing and a prayer
Posts: 5993
Joined: Fri Aug 27, 2004 9:10 pm

Post by RefD » Sun Dec 24, 2006 9:11 pm

foo bar baz wibble!

BOHICA!!

*forces magic smoke to escape from a Mackie 1604*
?What need is there to weep over parts of life? The whole of it calls for tears.? -- Seneca

User avatar
TapeOpHillary
TapeOp Admin
TapeOp Admin
Posts: 811
Joined: Thu May 01, 2003 6:58 am
Location: NYC
Contact:

Post by TapeOpHillary » Tue Dec 26, 2006 9:24 am

syrupcore wrote:The other suggestion is consider switching hosts to dreamhost. employee owned, pretty much unlimited bandwidth, unlimited databases and a shit ton of space. dead cheap, nice fellas.
yes and yes. i absolutely love dreamhost, even with all the problems they had over the summer. *however*, that said, dreamhost is the host for the regular tapeop.com site and dreamhost is the host that screwed us when i bandwidth got out of control and just took the board down and essentially blacklisted us because of it...
sorry, too lazy to find the thread about it all...
they have changed to an unlimited bandwidth for all accounts, but i don't think it's really true if you're on a shared server. you should have seen the mess it caused!

User avatar
syrupcore
deaf.
Posts: 1793
Joined: Mon Mar 08, 2004 4:40 am
Location: Portland, Oregon
Contact:

Post by syrupcore » Tue Dec 26, 2006 1:13 pm

I remember the thread. I'm really shocked. they didn't warn you or anything? I read a post about it once on their blog. I just reread it and see it's not about bandwidth or disk space but about CPU cycles. Here's the post about it for anyone who wants to read it. Some one actually says in a comment something about 'this being a problem for very active forums'. :(

It's pretty doofy that they offer PHP-BB as an auto install from their control panel when phpbb is a total resource hog. why not offer vanilla or pun? Or even the newer wordpress derived one.

I'm seriously bummed to hear about the tomb experience there. I've been with them for a few years and always recommend them as they've been great. Now I need to reconsider.

their blog posts about the summer outages were too funny. Most places would feed their clients a bunch of tight lipped spin.

User avatar
Jon Nolan
tinnitus
Posts: 1085
Joined: Fri Jun 30, 2006 9:28 pm
Location: New Hampshire
Contact:

Post by Jon Nolan » Sat Jan 06, 2007 8:35 am

Tatertot wrote:I like the time delay a lot. Especially when that Les Paul guy posts.
sorry! now you can have a gander at the roto toms i've uploaded. irony = good times. too bad my posts weren't more informative :)

j-no

Post Reply

Who is online

Users browsing this forum: No registered users and 39 guests