]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
do page offsets correctly (depending on display type)
authorEvan Prodromou <evan@prodromou.name>
Thu, 20 Nov 2008 11:41:37 +0000 (06:41 -0500)
committerEvan Prodromou <evan@prodromou.name>
Thu, 20 Nov 2008 11:41:37 +0000 (06:41 -0500)
darcs-hash:20081120114137-84dde-6d55cab81e0b23628cf9aa0360b9de2f866ba186.gz

lib/gallery.php

index 4f4de51d81f78aa04dd90599bbb11e049a469560..855d710c79f475be46cbf93f81d634ea8200d9f3 100644 (file)
@@ -20,6 +20,8 @@
 
 if (!defined('LACONICA')) { exit(1); }
 
+require_once(INSTALLDIR.'/lib/profilelist.php');
+
 # 10x8
 
 define('AVATARS_PER_PAGE', 80);
@@ -81,9 +83,11 @@ class GalleryAction extends Action {
                $other = new Profile();
                
                list($lst, $usr) = $this->fields();
-               
-               $offset = ($page-1)*AVATARS_PER_PAGE;
-               $limit = AVATARS_PER_PAGE + 1;
+
+               $per_page = ($display == 'list') ? PROFILES_PER_PAGE : AVATARS_PER_PAGE;
+
+               $offset = ($page-1)*$per_page;
+               $limit = $per_page + 1;
                
                if (common_config('db','type') == 'pgsql') {
                        $lim = ' LIMIT ' . $limit . ' OFFSET ' . $offset;