[2.0.11] Resize Avatars Based on Max Width and Height

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
11
69%
Very Good
4
25%
Good
0
No votes
Fair
0
No votes
Poor
1
6%
 
Total votes: 16

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28683
Joined: Sat Aug 16, 2003 7:36 am

[2.0.11] Resize Avatars Based on Max Width and Height

Post by Extensions Robot »

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


MOD Version: 1.0.2

Download File: Resize_Avatars_Based_on_Max_Width_and_Height_1.0.2.zip
mods overview page: View
File Size: 3859 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
This MOD will resize over-sized avatars.
subnet_rx
Registered User
Posts: 52
Joined: Sat May 01, 2004 10:49 pm
Location: Hattiesburg, MS
Contact:

Post by subnet_rx »

does this work with EasyMOD?
User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo »

Sounds like what I'm looking for. I'll try it out. Hopefully, there won't be any speed issues, and hopefully, it'll work in viewprofile, too.
I write articles on community building
@ The Infinity Program.
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

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.
User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo »

Does this include avatars that go over the dimensions limitations prior to the installation of this modification?
I write articles on community building
@ The Infinity Program.
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

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.
User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo »

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.
I write articles on community building
@ The Infinity Program.
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

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.
snow leopard
Registered User
Posts: 90
Joined: Mon Dec 29, 2003 3:12 pm

Post by snow leopard »

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.
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

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.
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

I won't be online 2005/02/23 and 2005/02/24
Cryomenace
Registered User
Posts: 22
Joined: Wed Jan 19, 2005 11:33 am
Location: Taastrup, Denmark

test

Post by Cryomenace »

EDIT: Post moved to other forum.
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
User avatar
Fr0zen
Registered User
Posts: 191
Joined: Tue Dec 21, 2004 6:26 am
Location: Chicago, Illinois
Contact:

Post by Fr0zen »

Is there anyway to adapt this mod for remote linked profile pictures. ?
spooky2280
Registered User
Posts: 142
Joined: Tue Jul 20, 2004 8:48 pm

Post by spooky2280 »

Fr0zen, I'm sure there is a way. Can you figure it out and post the code? I will inculde it in the next release of the MOD.
Post Reply

Return to “[2.0.x] MOD Database Cleanup”