ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Adrek on June 18, 2014, 02:50:49 pm

Title: External avatars are not resized in menubar
Post by: Adrek on June 18, 2014, 02:50:49 pm
Here it's working fine, don't know where is problem...

When I add external avatar it looks like this (see attached file), when I upload avatar it looks fine, doesn't matter if HTML or JS is resizing image.
I tested it on clean RC1 package.
Title: Re: External avatars are not resized in menubar
Post by: emanuele on June 18, 2014, 03:52:08 pm
What browser are you using?
I remember having some similar problem a long ago with Chrome from time to time.
The size of this particular avatar should be set in index.css by that declaration:
https://github.com/elkarte/Elkarte/blob/6f995a61547b7d178f09562168e979d90f86c402/themes/default/css/index.css#L966
Title: Re: External avatars are not resized in menubar
Post by: Adrek on June 18, 2014, 05:11:53 pm
Chrome 35 and FF 30.

In page source I see that size comes with image:
(http://i.imgur.com/eOxMmDS.png)
Title: Re: External avatars are not resized in menubar
Post by: emanuele on June 18, 2014, 05:29:01 pm
Arg I set the size in the wrong spot... lol
Now I got it!

ETA: there are two ways to fix it, both have their pros and cons.
One is to change the css to:
Code: [Select]
	max-width: 1.5em !important;
max-height: 1.5em !important;
the other is to change in Subs.php:
Code: (find) [Select]
				'title' => (!empty($user_info['avatar']['image']) ? $user_info['avatar']['image'] . ' ' : '') . (!empty($modSettings['displayMemberNames']) ? $user_info['name'] : $txt['account_short']),
to:
Code: (replace with) [Select]
				'title' => (!empty($user_info['avatar']['url']) ? '<img class="avatar" src="' . $user_info['avatar']['url'] . '" alt="" /> ' : '') . (!empty($modSettings['displayMemberNames']) ? $user_info['name'] : $txt['account_short']),

Both work, let's just pick one for now. In the next version it would be nice to throw out some stuff and use css for everything. (Or as much as possible. O:-))
Title: Re: External avatars are not resized in menubar
Post by: Adrek on June 18, 2014, 05:45:09 pm
Thanks for quick fix :)
Title: Re: External avatars are not resized in menubar
Post by: emanuele on June 19, 2014, 05:17:42 pm
Due to another fix I push with the same commit I introduced another bug in boardindex... :-[
Tomorrow I'll try to put together a patch with all the recent changes. ;D