diff options
Diffstat (limited to 'includes/classes/FisheyeGallery.php')
| -rwxr-xr-x | includes/classes/FisheyeGallery.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/includes/classes/FisheyeGallery.php b/includes/classes/FisheyeGallery.php index b4d7ebc..c321d99 100755 --- a/includes/classes/FisheyeGallery.php +++ b/includes/classes/FisheyeGallery.php @@ -156,10 +156,14 @@ class FisheyeGallery extends FisheyeBase { if( $this->getPreference( 'gallery_pagination' ) == FISHEYE_PAGINATION_POSITION_NUMBER ) { $this->mInfo['num_pages'] = $this->mDb->getOne( "SELECT COUNT( distinct( floor(`item_position`) ) ) FROM `".BIT_DB_PREFIX."fisheye_gallery_image_map` WHERE gallery_content_id=?", [ $this->mContentId ] ); } else { - // galleriffic JS templates hardcode numThumbs:30 — match that here so image_order.tpl page breaks align - $this->mInfo['images_per_page'] = ( $this->getPreference( 'gallery_pagination' ) == FISHEYE_PAGINATION_GALLERIFFIC ) - ? 30 - : $this->mInfo['cols_per_page'] * $this->mInfo['rows_per_page']; + $pagination = $this->getPreference( 'gallery_pagination' ); + if( $pagination == FISHEYE_PAGINATION_GALLERIFFIC ) { + $this->mInfo['images_per_page'] = (int)$this->getPreference( 'galleriffic_num_thumbs', 30 ); + } elseif( in_array( $pagination, [ FISHEYE_PAGINATION_AUTO_FLOW, FISHEYE_PAGINATION_SIMPLE_LIST, FISHEYE_PAGINATION_MATTEO ] ) ) { + $this->mInfo['images_per_page'] = (int)$this->getPreference( 'total_per_page', $this->mInfo['rows_per_page'] ); + } else { + $this->mInfo['images_per_page'] = $this->mInfo['cols_per_page'] * $this->mInfo['rows_per_page']; + } $this->mInfo['num_pages'] = (int)$this->mInfo['num_images'] / $this->mInfo['images_per_page'] + ($this->mInfo['num_images'] % $this->mInfo['images_per_page'] == 0 ? 0 : 1); } |
