TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 07:55:41 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 143
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 69
  • Total: 69

Avatar by URL not working in Article Comments

Started by lurkalot, February 15, 2018, 10:32:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lurkalot

I have just noticed, the avatars don't show in article comments. Only when using the "Specify avatar by URL" option. (screenshot below).

tino

Quote from: lurkalot on February 15, 2018, 10:32:44 PM
I have just noticed, the avatars don't show in article comments. Only when using the "Specify avatar by URL" option. (screenshot below).

That works for me. Can you let me know the url you used?

Actually it only doesn't work when I have image_proxy_enabled and I visit the site whilst it is http, that causes everything to get in to a bit of a mess. Not sure if that is a valid set up though, as I wouldn't expect to enable image proxy and still have the site http.

lurkalot

Quote from: tino on February 16, 2018, 10:53:41 AM
Quote from: lurkalot on February 15, 2018, 10:32:44 PM
I have just noticed, the avatars don't show in article comments. Only when using the "Specify avatar by URL" option. (screenshot below).

That works for me. Can you let me know the url you used?

Actually it only doesn't work when I have image_proxy_enabled and I visit the site whilst it is http, that causes everything to get in to a bit of a mess. Not sure if that is a valid set up though, as I wouldn't expect to enable image proxy and still have the site http.

Must admit, I was using my local testbed.  Not sure I had image proxy switched on in SMF though, will have to check that.  The avatars were working everywhere else though as far as I can tell.  Will check this again in a while.

@rjen

I checked my testsite and I have the same problem:

For a user where the Avatar is a 'standard one' from the forum, it shows in the comments. I am using an uploaded avatar that is NOT displayed in the comments.

The link used in the comments is that: https://test.fjr-club.nl/avatars/ , it seems to link to the folder, not the actual uploaded image...

I also checked it in 1.3R and there it was working fine.
On the site: SSL with Image proxy fully enabled...
Deactivating the image proxy makes no difference: problem stays
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

So it fails when linked to a image uploaded to the forum? Or it fails when specifing a image uploaded to a local ( to it ) url?

tino

As you both seem to have reported different errors.

lurkalot

Quote from: tino on February 16, 2018, 09:32:44 PM
As you both seem to have reported different errors.

The uploaded ones work, the stock smf ones work, but if you add one via url it doesn't show in comments, but shows everywhere else in the portal.

tino

Ok, well the error the @rjen reported I've managed to emulate.

tino

Line 736 of Sources/TPortal.php should be
$avatar = $avatar == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=tpmod;sa=tpattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'https://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar'], ENT_QUOTES) . '" alt="" class="avatar" border="0" />');


lurkalot

http://avatars.simplemachinesweb.com/smf/avatar_124590_1499841922.gif

You can see this image, yes?

If I add that url to my profile it won't show in the article comments, but does show in the article author info, and all other blocks which use an avatar. 

If I use the secure version https://avatars.simplemachinesweb.com/smf/avatar_124590_1499841922.gif

The avatar displays everywhere including the comments.