X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcontent.php;h=71ed927636623ed5eb504d366772c273b0646256;hb=ea3a6ec6eb35695c52ccfe475485f4d69ec5029c;hp=cec23a91421ad4a23eaea3e78b896581878fb86e;hpb=f1211841587c29c9fafaa27e1dd9c852db860523;p=friendica.git diff --git a/mod/content.php b/mod/content.php index cec23a9142..71ed927636 100644 --- a/mod/content.php +++ b/mod/content.php @@ -11,8 +11,8 @@ // There is no "pagination query", but we will manage the "current page" on the client // and provide a link to fetch the next page - until there are no pages left to fetch. -// With the exception of complex tag and text searches, this prototype is incredibly -// fast - e.g. one or two milliseconds to fetch parent items for the current content, +// With the exception of complex tag and text searches, this prototype is incredibly +// fast - e.g. one or two milliseconds to fetch parent items for the current content, // and 10-20 milliseconds to fetch all the child items. @@ -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 = ((strlen($item['author-avatar'])) ? $a->get_cached_avatar_image($item['author-avatar']) : $item['thumb']); + $profile_avatar = $item['author-avatar']; $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); call_hooks('render_location',$locate); @@ -476,7 +477,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { 'name' => $name_e, 'sparkle' => $sparkle, 'lock' => $lock, - 'thumb' => proxy_url($profile_avatar), + 'thumb' => proxy_url($profile_avatar, false, PROXY_SIZE_THUMB), 'title' => $title_e, 'body' => $body_e, 'text' => $text_e, @@ -485,7 +486,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { 'indent' => '', 'owner_name' => $owner_name_e, 'owner_url' => $owner_url, - 'owner_photo' => proxy_url($owner_photo), + 'owner_photo' => proxy_url($owner_photo, false, PROXY_SIZE_THUMB), 'plink' => get_plink($item), 'edpost' => false, 'isstarred' => $isstarred, @@ -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 = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($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); @@ -859,7 +861,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), 'name' => $name_e, - 'thumb' => proxy_url($profile_avatar), + 'thumb' => proxy_url($profile_avatar, false, PROXY_SIZE_THUMB), 'osparkle' => $osparkle, 'sparkle' => $sparkle, 'title' => $title_e, @@ -869,7 +871,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) { 'indent' => $indent, 'shiny' => $shiny, 'owner_url' => $owner_url, - 'owner_photo' => proxy_url($owner_photo), + 'owner_photo' => proxy_url($owner_photo, false, PROXY_SIZE_THUMB), 'owner_name' => $owner_name_e, 'plink' => get_plink($item), 'edpost' => $edpost,