X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=9bc870ca13fe34265dac0fbf5d08071c1d7f33af;hb=a54fea313ff93b43ae0c691df2a8cf9c8c363006;hp=30d3728d36865db24d5d14441daec2752894d308;hpb=2e97cbe728f5f8cfc12dd5588a8a0846a0bbe2b7;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 30d3728d36..9bc870ca13 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1231,9 +1231,11 @@ function photos_content(App $a) $prevlink = ''; $nextlink = ''; - /// @todo This query is totally bad, the whole functionality has to be changed - // The query leads to a really intense used index. - // By now we hide it if someone wants to. + /* + * @todo This query is totally bad, the whole functionality has to be changed + * The query leads to a really intense used index. + * By now we hide it if someone wants to. + */ if (!Config::get('system', 'no_count', false)) { $order_field = defaults($_GET, 'order', ''); if ($order_field === 'posted') { @@ -1268,8 +1270,10 @@ function photos_content(App $a) } } - if (count($ph) == 1) + if (count($ph) == 1) { $hires = $lores = $ph[0]; + } + if (count($ph) > 1) { if ($ph[1]['scale'] == 2) { // original is 640 or less, we can display it directly @@ -1281,6 +1285,7 @@ function photos_content(App $a) } $album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']); + $tools = null; $lock = null; @@ -1307,8 +1312,9 @@ function photos_content(App $a) ]); } - if ($prevlink) + if ($prevlink) { $prevlink = [$prevlink, ''] ; + } $photo = [ 'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], @@ -1532,14 +1538,10 @@ function photos_content(App $a) continue; } - $redirect_url = 'redir/' . $item['cid']; - - if (local_user() && ($item['contact-uid'] == local_user()) - && ($item['network'] == NETWORK_DFRN) && !$item['self']) { - $profile_url = $redirect_url; + $profile_url = Contact::MagicLinkById($item['cid']); + if (strpos($profile_url, 'redir/') === 0) { $sparkle = ' sparkle'; } else { - $profile_url = $item['url']; $sparkle = ''; } @@ -1669,8 +1671,9 @@ function photos_content(App $a) $twist = false; foreach ($r as $rr) { //hide profile photos to others - if (!$is_owner && !remote_user() && ($rr['album'] == L10n::t('Profile Photos'))) + if (!$is_owner && !remote_user() && ($rr['album'] == L10n::t('Profile Photos'))) { continue; + } $twist = !$twist;