diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-11-20 06:41:37 -0500 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-11-20 06:41:37 -0500 |
commit | d84c89a873c2d32a6564edafc413877d7e3a1774 (patch) | |
tree | da378ddb83f9a3d0e8f04a759a8f319630f9de1b | |
parent | aab4228b53c41f9f34200ba69a8f89303fd648f0 (diff) |
do page offsets correctly (depending on display type)
darcs-hash:20081120114137-84dde-6d55cab81e0b23628cf9aa0360b9de2f866ba186.gz
-rw-r--r-- | lib/gallery.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gallery.php b/lib/gallery.php index 4f4de51d8..855d710c7 100644 --- a/lib/gallery.php +++ b/lib/gallery.php @@ -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; |