Resizing avatars

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Resizing avatars

Post by ecwpa » Tue Apr 17, 2012 9:13 pm

I'm currently redesigning our forum template but I've found that there's no way to resize avatars. There's a variable that calls avatars but won't let me resize them.

Within my theme I have a special design for the first post in order to have more space for it. Currently the first topic doesn't have any avatars because they were a bit too big. I still want to have them but there's no way to call avatars without touching phpBB code outside themes.

So I'm wondering if this is something you would consider if a RFC is made?
Slightly better English than it was in 2005, still improving :D

User avatar
brunoais
Registered User
Posts: 958
Joined: Fri Dec 18, 2009 3:55 pm

Re: Resizing avatars

Post by brunoais » Wed Apr 18, 2012 4:07 pm

This is a great idea for an extension. Dunno about a core feature... A core feature like this is not that bad, actually. I Just don't know if it is good enough.

User avatar
AliasM2K
Registered User
Posts: 82
Joined: Tue Mar 27, 2012 2:33 am

Re: Resizing avatars

Post by AliasM2K » Thu Apr 19, 2012 2:44 am

Quite a good suggestion. I think it would be good to do it the way it is done by Gravatar.

Code: Select all

http://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=200
The parameter s to denote the size of the avatar. Something like that would be good right?

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: Resizing avatars

Post by ecwpa » Thu Apr 19, 2012 2:36 pm

Wow, that works really great. Tried a lot of sizes and and still works, very

Now, the thing is most phpBB forums do not force users to have simmetrical avatars (100x100px, 150x150px etc). I'm not sure if this can be done without hug changes. Maybe using something like this?

Code: Select all

<!-- DEFINE $AVATAR_HEIGH = 100 --> 
<!-- DEFINE $AVATAR_WIDTH = 100 -->
Although, just getting the avatar route would be enough for me. I just need to resize them, and I could do it just with the file route.


Edit: That gravatar implementation sounds great for uploaded images too.
Slightly better English than it was in 2005, still improving :D

User avatar
Arty
Registered User
Posts: 970
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

Re: Resizing avatars

Post by Arty » Fri Apr 20, 2012 6:09 pm

You can do it via css. Add class to avatar container, like class="avatar", then in css add

Code: Select all

.avatar img { max-width: 100px; max-height: 100px; }
Formerly known as CyberAlien.

Free phpBB styles | Premium responsive XenForo styles

User avatar
AliasM2K
Registered User
Posts: 82
Joined: Tue Mar 27, 2012 2:33 am

Re: Resizing avatars

Post by AliasM2K » Sun Apr 22, 2012 2:16 am

Quick and simple :D Way to go Arty :)

User avatar
brunoais
Registered User
Posts: 958
Joined: Fri Dec 18, 2009 3:55 pm

Re: Resizing avatars

Post by brunoais » Sun Apr 22, 2012 7:07 am

AliasM2K wrote:Quick and simple :D Way to go Arty :)
But that only solves the showing part. If it is a 1000x1000 image, the users will still download that huge image.

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: Resizing avatars

Post by ecwpa » Sun Apr 22, 2012 1:58 pm

Arty wrote:You can do it via css. Add class to avatar container, like class="avatar", then in css add

Code: Select all

.avatar img { max-width: 100px; max-height: 100px; }
Just tried that, doesn't work. It should but there's a problem, {postrow.POSTER_AVATAR} returns something like this:

Image

Since the avatar sizes are inline I can't really alter it via CSS. Same happens with {postrow.POST_AUTHOR_FULL} styling.
Slightly better English than it was in 2005, still improving :D

User avatar
Vinny
Style Customisations
Style Customisations
Posts: 126
Joined: Thu May 20, 2010 4:01 am
Location: Brazil
Contact:

Re: Resizing avatars

Post by Vinny » Sun Apr 22, 2012 8:48 pm

ecwpa wrote:Just tried that, doesn't work. It should but there's a problem, {postrow.POSTER_AVATAR} returns something like this:
Did you add a class in CSS and declared it in HTML?
ecwpa wrote:Since the avatar sizes are inline I can't really alter it via CSS. Same happens with {postrow.POST_AUTHOR_FULL} styling.
I tested and it works perfectly. :geek:

ecwpa
Registered User
Posts: 181
Joined: Mon Jan 24, 2005 2:10 am
Contact:

Re: Resizing avatars

Post by ecwpa » Sun Apr 22, 2012 9:26 pm

Yes, there was a class called. avatar already declared so I just added what artsy suggested. I'll check again if I did something wrong.
Slightly better English than it was in 2005, still improving :D

Post Reply