From 36c1a021445dde4c5b72b1b34ffbe1b819a8496a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaussoin=20Timoth=C3=A9e?= Date: Tue, 17 Nov 2015 23:11:21 +0100 Subject: [PATCH] Change the getGallery request to have all the pictures published --- app/models/postn/PostnDAO.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/postn/PostnDAO.php b/app/models/postn/PostnDAO.php index 44d0405da..5d5f244ae 100644 --- a/app/models/postn/PostnDAO.php +++ b/app/models/postn/PostnDAO.php @@ -248,20 +248,21 @@ class PostnDAO extends SQL { return $this->run('ContactPostn'); } - function getGallery($from) { + function getGallery($from, $limitf = false, $limitr = false) { $this->_sql = ' select *, postn.aid, privacy.value as privacy from postn left outer join contact on postn.aid = contact.jid left outer join privacy on postn.nodeid = privacy.pkey - where (postn.origin in (select jid from rosterlink where session = :origin and rostersubscription in (\'both\', \'to\'))) - and postn.origin = :aid + where postn.aid = :aid and postn.picture = 1 order by postn.published desc'; + if($limitr !== false) + $this->_sql = $this->_sql.' limit '.(int)$limitr.' offset '.(int)$limitf; + $this->prepare( 'Postn', array( - 'origin' => $this->_user, 'aid' => $from // Another hack ) );