Avatar on index

Guides & Snippets for phpBB3.
Try the Snippets here and share Your own Snippets

Re: Avatar on index

Post by Fire-Fox »

I did replace the "xx" with your width and height :)

Re: Avatar on index

Post by Makis »

Not working this way, I still get the avatar in its full size.
I tried also min width and hight by %

:) Thanks a lot anyway.

Re: Avatar on index

Post by Fire-Fox »

refresh your template?

Re: Avatar on index

Post by Makis »

I ALWAYS do

Re: Avatar on index

Post by Stoker »

Fire-Fox, please post a demo where you have this working.

Re: Avatar on index

Post by Makis »

Maybe we must change something inside this code in “index.php”

Code: Select all

'USER_AVATAR'   => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
I think Stoker knows

Re: Avatar on index

Post by Fire-Fox »

Don't think so, that part is controlled from ACP where you define your width/height on all avatar. if thats what you are aften, then yes you change it from the ACP

General -> Board Configuration -> Avatar Settings

@Stoker

I don't have any demo it was just my logical thinking that said to me it should be so, and i know now it don't work...
Last edited by Fire-Fox on 05 Apr 2010, 20:38, edited 1 time in total.

Re: Avatar on index

Post by Stoker »

Fire-Fox, that has absolutely nothing to do with anything in this topic.
Incorrect help is not better than no help.
Please make sure you know what you are talking about before writing!

Makis wrote:Maybe we must change something inside this code in “index.php”

Code: Select all

'USER_AVATAR'   => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
I think Stoker knows
You are absolutely right. Try this code instead:

Code: Select all

'USER_AVATAR'   	=> ($user->data['user_avatar']) ? get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], ($user->data['user_avatar_width'] > $user->data['user_avatar_height']) ? 50 : (50 / $user->data['user_avatar_height']) * $user->data['user_avatar_width'], ($user->data['user_avatar_height'] > $user->data['user_avatar_width']) ? 50 : (50 / $user->data['user_avatar_width']) * $user->data['user_avatar_height']) : '',
Change the number 50 to something else if you prefer.

Re: Avatar on index

Post by Makis »

Thank a lot for one more time Stoker! :D and
the results are:

Image

[blink]Thanks[/blink]

Re: Avatar on index

Post by Makis »

Dear Stoker, I don’t know if it’s too much to ask one more thing.
After I made, with your help, the (Avatar on index) snippet I noticed that the users names under the (Registered users) and (Users active over the last 24 hours) became smaller too, at least 1 pt.
My knowledge isn’t enough to understand why this happened.

I will appreciate your answer.
Thanks :)