phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

Resizing avatars

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.

Resizing avatars

Postby 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?
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am

Re: Resizing avatars

Postby 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.
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: Resizing avatars

Postby 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?
User avatar
AliasM2K
Registered User
 
Posts: 82
Joined: Tue Mar 27, 2012 2:33 am

Re: Resizing avatars

Postby 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.
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am

Re: Resizing avatars

Postby 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.
User avatar
Arty
Styles Team
Styles Team
 
Posts: 796
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars

Re: Resizing avatars

Postby AliasM2K » Sun Apr 22, 2012 2:16 am

Quick and simple :D Way to go Arty :)
User avatar
AliasM2K
Registered User
 
Posts: 82
Joined: Tue Mar 27, 2012 2:33 am

Re: Resizing avatars

Postby 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.
brunoais
Registered User
 
Posts: 626
Joined: Fri Dec 18, 2009 3:55 pm

Re: Resizing avatars

Postby 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.
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am

Re: Resizing avatars

Postby 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:
User avatar
Vinny
Styles Team
Styles Team
 
Posts: 91
Joined: Thu May 20, 2010 4:01 am
Location: Brazil

Re: Resizing avatars

Postby 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.
Sorry for my bad english, still improving.
ecwpa
Registered User
 
Posts: 169
Joined: Mon Jan 24, 2005 2:10 am


Return to [3.0/Olympus] Styling

Who is online

Users browsing this forum: No registered users and 5 guests