From f057cc3a70dd7435b4e9e8a2a07406f0f25e3f2a Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 4 Jan 2011 00:06:36 -0800 Subject: [PATCH] missing pagination in photo collections --- mod/photos.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index f29c393869..e811ca3957 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -766,9 +766,10 @@ function photos_content(&$a) { intval($owner_uid), dbesc($album) ); - if(count($r)) + if(count($r)) { $a->set_pager_total(count($r)); - + $a->set_pager_itemspage(20); + } $r = q("SELECT `resource-id`, `id`, `filename`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", @@ -817,6 +818,8 @@ function photos_content(&$a) { } $o .= '
'; + $o .= paginate($a); + return $o; } @@ -1107,9 +1110,10 @@ function photos_content(&$a) { intval($a->data['user']['uid']), dbesc( t('Contact Photos')) ); - if(count($r)) + if(count($r)) { $a->set_pager_total(count($r)); - + $a->set_pager_itemspage(20); + } $r = q("SELECT `resource-id`, `id`, `filename`, `album`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' @@ -1147,5 +1151,6 @@ function photos_content(&$a) { } $o .= '
'; } + $o .= paginate($a); return $o; }