X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontent.php;h=71ed927636623ed5eb504d366772c273b0646256;hb=ea3a6ec6eb35695c52ccfe475485f4d69ec5029c;hp=49cff74d2d9f4e4eac2ffcce3529f87fafcabc55;hpb=8ec424325375aa923c7d2d78ac8ddcc352f09cff;p=friendica.git diff --git a/mod/content.php b/mod/content.php index 49cff74d2d..71ed927636 100644 --- a/mod/content.php +++ b/mod/content.php @@ -416,11 +416,12 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { else $profile_link = zrl($profile_link); - $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); - if(($normalised != 'mailbox') && (x($a->contacts[$normalised]))) - $profile_avatar = $a->contacts[$normalised]['thumb']; + // Don't rely on the author-avatar. It is better to use the data from the contact table + $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner); + if ($author_contact["thumb"]) + $profile_avatar = $author_contact["thumb"]; else - $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb'])); + $profile_avatar = $item['author-avatar']; $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); call_hooks('render_location',$locate); @@ -787,11 +788,12 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { else $profile_link = zrl($profile_link); - $normalised = normalise_link((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); - if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) - $profile_avatar = $a->contacts[$normalised]['thumb']; + // Don't rely on the author-avatar. It is better to use the data from the contact table + $author_contact = get_contact_details_by_url($item['author-link'], $profile_owner); + if ($author_contact["thumb"]) + $profile_avatar = $author_contact["thumb"]; else - $profile_avatar = $a->remove_baseurl(((strlen($item['author-avatar']) && $diff_author) ? $item['author-avatar'] : $thumb)); + $profile_avatar = $item['author-avatar']; $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); $dislike = ((x($dlike,$item['uri'])) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); @@ -805,9 +807,9 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $shiny = ""; if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) - $shiny = 'shiny'; + $shiny = 'shiny'; - // + // localize_item($item);