From 39e4ea033f51083c7d556d5bf0dc04b82edee4de Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 21 May 2026 14:10:11 +0100 Subject: Fix images_per_page for galleriffic pagination to match JS numThumbs:30 Galleriffic JS hardcodes numThumbs:30 in both gallery templates, so the images_per_page used for image_order.tpl page-break dividers must also be 30 rather than cols_per_page * rows_per_page. Co-Authored-By: Claude Sonnet 4.6 --- includes/classes/FisheyeGallery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/classes/FisheyeGallery.php b/includes/classes/FisheyeGallery.php index 16d5b88..b4d7ebc 100755 --- a/includes/classes/FisheyeGallery.php +++ b/includes/classes/FisheyeGallery.php @@ -156,7 +156,10 @@ 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 { - $this->mInfo['images_per_page'] = $this->mInfo['cols_per_page'] * $this->mInfo['rows_per_page']; + // 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']; $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); } -- cgit v1.3