News: When asking for support, it helps us and you, if you read the Posting Guidelines

Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

April 02, 2020, 09:13:12 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 189572
  • Total Topics: 20808
  • Online Today: 502
  • Online Ever: 917
  • (January 21, 2020, 09:02:26 AM)
Users Online
Users: 0
Guests: 506
Total: 506

Author Topic: Avatar by URL not working in Article Comments  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

Offline tino

  • Developer
  • *
  • Posts: 1737
Re: Avatar by URL not working in Article Comments
« Reply #10 on: February 16, 2018, 03:16:18 PM »
Works via the proxy for me, can you see if the fix I posted fixes your issue also?

Offline @rjen

  • Support Team
  • *
  • Posts: 2013
    • FJR-club Nederland
Re: Avatar by URL not working in Article Comments
« Reply #11 on: February 16, 2018, 03:17:51 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.

Just tried that. URL avatar IS showing on my test site...
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline lurkalot

  • Administrator
  • *
  • Posts: 6468
    • Camera Craniums
Re: Avatar by URL not working in Article Comments
« Reply #12 on: February 16, 2018, 03:32:33 PM »
I'm not using proxy, it's just a local http test site.

Offline tino

  • Developer
  • *
  • Posts: 1737
Re: Avatar by URL not working in Article Comments
« Reply #13 on: February 16, 2018, 03:41:25 PM »
I'm not using proxy, it's just a local http test site.

Can you try the fix a few posts back. It should sort it as both issues are linked

Offline lurkalot

  • Administrator
  • *
  • Posts: 6468
    • Camera Craniums
Re: Avatar by URL not working in Article Comments
« Reply #14 on: February 16, 2018, 04:02:11 PM »
Sort it, as in remove them? I don't seem to have any avatars in comments now. Also the new post image has popped up. should I be seeing this as I was the one who posted?

Offline tino

  • Developer
  • *
  • Posts: 1737
Re: Avatar by URL not working in Article Comments
« Reply #15 on: February 16, 2018, 04:12:13 PM »
Sort it, as in remove them? I don't seem to have any avatars in comments now. Also the new post image has popped up. should I be seeing this as I was the one who posted?

It didn’t remove them for me. I guess you either didn’t edit it correctly or I posted the wrong thing.

It’s adding the $avatar == after the first = and before the ‘’

Offline lurkalot

  • Administrator
  • *
  • Posts: 6468
    • Camera Craniums
Re: Avatar by URL not working in Article Comments
« Reply #16 on: February 16, 2018, 04:41:44 PM »
As far as I can see I've edited it correctly. Attached below.

Offline @rjen

  • Support Team
  • *
  • Posts: 2013
    • FJR-club Nederland
Re: Avatar by URL not working in Article Comments
« Reply #17 on: February 17, 2018, 02:50:06 AM »
I'm not using proxy, it's just a local http test site.

Can you try the fix a few posts back. It should sort it as both issues are linked

I tried your fix too, and the result is that in the first comment the Avatar shows, but in the second comment (same user) it does NOT...

Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info

Offline tino

  • Developer
  • *
  • Posts: 1737
Re: Avatar by URL not working in Article Comments
« Reply #18 on: February 17, 2018, 03:32:56 AM »
Try this code
Code: [Select]
if ($image_proxy_enabled && !empty($row['avatar']) && stripos($row['avatar'], 'http://') !== false)
      $avatar = '<img src="'. $boardurl . '/proxy.php?request=' . urlencode($row['avatar']) . '&hash=' . md5($row['avatar'] . $image_proxy_secret) .'" alt="&nbsp;" />';
else
      $avatar = $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="&nbsp;"  />' : '') : (stristr($row['avatar'], 'https://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar'], ENT_QUOTES) . '" alt="&nbsp;" />');

Offline @rjen

  • Support Team
  • *
  • Posts: 2013
    • FJR-club Nederland
Re: Avatar by URL not working in Article Comments
« Reply #19 on: February 17, 2018, 04:31:19 AM »
Try this code
Code: [Select]
if ($image_proxy_enabled && !empty($row['avatar']) && stripos($row['avatar'], 'http://') !== false)
      $avatar = '<img src="'. $boardurl . '/proxy.php?request=' . urlencode($row['avatar']) . '&hash=' . md5($row['avatar'] . $image_proxy_secret) .'" alt="&nbsp;" />';
else
      $avatar = $row['avatar'] == '' ? ($row['ID_ATTACH'] > 0 ? '<img src="' . (empty($row['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="&nbsp;"  />' : '') : (stristr($row['avatar'], 'https://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '" alt="&nbsp;" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $smcFunc['htmlspecialchars']($row['avatar'], ENT_QUOTES) . '" alt="&nbsp;" />');

That fixes the problem for me.
Running TP1.6.4 on SMF2.0 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 RC2
Want to check what php version I am testing on? See: PHP Info