MOD Name: Resize Avatars Based on Max Width and Height Author:spooky2280 MOD Description: This MOD resizes avatars (including remote ones) to make it so they don't break your layout. The max width and height are the ones set within the ACP. Avatars that do not exceed the max width and height are left as is. See the MOD in action: http://christianfecteau.com/rmwa
Of course it works with EasyMod. The avatar is resized with Javascript as soon as it is loaded by the browser. So the only possible speed issue is the speed connection of the user and the speed of the server where the avatar is hosted. It works everywhere avatars are displayed, including the ACP.
Yes. The max width and height are the ones you set in the ACP. They're grabbed from the db everytime a page is loaded. So if you used to allow 200px*200px avatars and decide to back it off to 100px*100px, your already uploaded 200px*200px avatars are resized to your new settings. This includes gallery avatars also as well as remote ones of course.
I had a problem with it. At first, it seemed to work just fine.
Note: the maximum allowed dimensions for avatar in my forum is 100x100. I tried a 200x200 avatar on my forum, and I went back to the add profile area and noticed the avatar was resized. I went to the view profile area and, for a moment, the avatar was the original size, but was scaled down. After that, though, the avatar disappeared. I mean, in the add profile area, no avatar was displayed, and in the view profile area, the same thing. All I would get it a white box with a red x in the middle, for a moment.
The avatar is resized "onload". So it's normal to see it with its real dimensions while it's loading. For very big images, it could be a few seconds.
I assume your problem was with a remote avatar?
"white box with a red x in the middle" means that the image could not be found on the remote server. The server was down or it could be a problem with your browser's cache. Try a different browser to see if you still get the problem.
Also, one thing I don't know: if you scale down your max width and height, will phpBB still loads previous uploaded avatars now too big for your new settings? I think it will load them anyway. To test it, just disable Javascript in your browser. My MOD doesn't work with Javascript disabled.
Well I installed this with easymod which reported no errors and a successful install, yet it isn't working.
Can you confirm the js file goes in /templates rather than in templates/subsilver etc.?
As far as I can see it correctly installed, but if I try to intentionally upload an oversized avatar all I get is the default message saying its too big as per my acp configuration settings.
It's not when you upload avatars. It's when they are displayed. By default, phpBB checks if uploaded avatars respect the restrictions you fixed in the ACP, but it doesn't check this for remote avatars. That's when my MOD comes in.
Last edited by Cryomenace on Thu Feb 24, 2005 3:07 am, edited 1 time in total.
/Cryomenace
Apache/2.2.2 (Win32) mod_ssl/2.2.2 OpenSSL/0.9.8b PHP/5.1.4 MySQL/5.0.20 phpBB/2.0.21 Server at Port 443
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4