X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontent.php;h=71ed927636623ed5eb504d366772c273b0646256;hb=ea3a6ec6eb35695c52ccfe475485f4d69ec5029c;hp=c2b1546bf1799653c163353dc29206f475e9e24c;hpb=c770b00d6d3cc9628ad48a6f72cce527dda68b44;p=friendica.git diff --git a/mod/content.php b/mod/content.php index c2b1546bf1..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); @@ -615,7 +616,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { $comment_lastcollapsed = true; } - $redirect_url = $a->get_baseurl($ssl_state) . '/redir/' . $item['cid'] ; + $redirect_url = 'redir/' . $item['cid'] ; $lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) @@ -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);