aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-13 13:23:21 -0800
committerzotlabs <mike@macgirvin.com>2017-01-13 13:23:21 -0800
commite843d27f8c4cd3ecabc3598a92db0c814f4d0ed7 (patch)
tree7167338b5bf32a471b6c48a9df9e9eb9f1e5c7a8 /include
parent4f1e4ffa70f5a822367eafec914ff8853561210d (diff)
parent8ea0b2051a2f037ee67571c01b816b3a286fb5ee (diff)
downloadvolse-hubzilla-e843d27f8c4cd3ecabc3598a92db0c814f4d0ed7.tar.gz
volse-hubzilla-e843d27f8c4cd3ecabc3598a92db0c814f4d0ed7.tar.bz2
volse-hubzilla-e843d27f8c4cd3ecabc3598a92db0c814f4d0ed7.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include')
-rw-r--r--include/photos.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/photos.php b/include/photos.php
index 8496c2c86..7ddbe43b9 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -464,10 +464,15 @@ function photos_albums_list($channel, $observer, $sort_key = 'album', $direction
$sort_key = dbesc($sort_key);
$direction = dbesc($direction);
- $albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and photo_usage IN ( %d, %d ) $sql_extra group by album order by $sort_key $direction",
- intval($channel_id),
- intval(PHOTO_NORMAL),
- intval(PHOTO_PROFILE)
+ //$albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and photo_usage IN ( %d, %d ) $sql_extra group by album order by $sort_key $direction",
+ // intval($channel_id),
+ // intval(PHOTO_NORMAL),
+ // intval(PHOTO_PROFILE)
+ //);
+
+ // this query provides the same results but might perform better
+ $albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and os_storage = 1 $sql_extra group by album order by $sort_key $direction",
+ intval($channel_id)
);
// add various encodings to the array so we can just loop through and pick them out in a template
@@ -490,6 +495,8 @@ function photos_albums_list($channel, $observer, $sort_key = 'album', $direction
}
}
+ App::$data['albums'] = $ret;
+
return $ret;
}