Browse Source

Change the getGallery request to have all the pictures published

pull/90/head
Jaussoin Timothée 10 years ago
parent
commit
36c1a02144
  1. 9
      app/models/postn/PostnDAO.php

9
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
)
);

Loading…
Cancel
Save