From 88ac326caffb25fb24271b60e2b6beadc2458a1c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 12 Jan 2017 12:32:31 +0100 Subject: we should actually check for existance of a given album at this place. this query can probably be more simple though --- Zotlabs/Module/Photos.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index d201e631e..c0fce1007 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -695,7 +695,6 @@ class Photos extends \Zotlabs\Web\Controller { \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; - /* $r = q("SELECT resource_id, max(imgscale) AS imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 and photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id", intval($owner_uid), @@ -710,16 +709,12 @@ class Photos extends \Zotlabs\Web\Controller { } else { goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address']); } - */ - \App::set_pager_itemspage(60); - if($_GET['order'] === 'posted') $order = 'ASC'; else $order = 'DESC'; - - + $r = q("SELECT p.resource_id, p.id, p.filename, p.mimetype, p.imgscale, p.description, p.created FROM photo p INNER JOIN (SELECT resource_id, max(imgscale) imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY resource_id) ph ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale) -- cgit v1.2.3