From 8b66329a8f3705e7ccf868093ee2debaa8e4bdca Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 17 Jun 2014 20:45:53 -0700 Subject: add photo count to photo album list --- include/photos.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/photos.php') diff --git a/include/photos.php b/include/photos.php index 65532e6c2..de4a9173a 100644 --- a/include/photos.php +++ b/include/photos.php @@ -264,7 +264,7 @@ function photos_albums_list($channel,$observer) { $sql_extra = permissions_sql($channel_id); - $albums = q("SELECT distinct album from photo where uid = %d and ( photo_flags = %d or photo_flags = %d ) $sql_extra order by created desc", + $albums = q("SELECT count( distinct resource_id ) as total, album from photo where uid = %d and ( photo_flags = %d or photo_flags = %d ) $sql_extra group by album order by created desc", intval($channel_id), intval(PHOTO_NORMAL), intval(PHOTO_PROFILE) @@ -279,7 +279,8 @@ function photos_albums_list($channel,$observer) { $ret['success'] = true; foreach($albums as $k => $album) { $entry = array( - 'text' => $album['album'], + 'text' => $album['album'], + 'total' => $album['total'], 'url' => z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album['album']), 'urlencode' => urlencode($album['album']), 'bin2hex' => bin2hex($album['album'])); -- cgit v1.2.3