Skip to main content
Topic: External avatars are not resized in menubar (Read 1505 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

External avatars are not resized in menubar

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.

Re: External avatars are not resized in menubar

Reply #1
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
Bugs creator.
Features destroyer.
Template killer.

Re: External avatars are not resized in menubar

Reply #2
Chrome 35 and FF 30.

In page source I see that size comes with image:

Re: External avatars are not resized in menubar

Reply #3
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:-))
Bugs creator.
Features destroyer.
Template killer.

Re: External avatars are not resized in menubar

Reply #4
Thanks for quick fix :)

 

Re: External avatars are not resized in menubar

Reply #5
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
Bugs creator.
Features destroyer.
Template killer.