Merge branch 'master' into develop
[friendica.git/.git] / mod / photos.php
index 30d3728..45e7136 100644 (file)
@@ -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, '<div class="icon prev"></div>'] ;
+               }
 
                $photo = [
                        'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
@@ -1669,8 +1675,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;