summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-21 14:30:26 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-21 14:30:26 +0100
commita06407d8d25a1179047560dabf9065dd00553f71 (patch)
tree86f5305d98d85fc36a02b89deddc984f2196cb72 /includes
parent39e4ea033f51083c7d556d5bf0dc04b82edee4de (diff)
downloadfisheye-a06407d8d25a1179047560dabf9065dd00553f71.tar.gz
fisheye-a06407d8d25a1179047560dabf9065dd00553f71.tar.bz2
fisheye-a06407d8d25a1179047560dabf9065dd00553f71.zip
Separate pagination counts per gallery style; make galleriffic numThumbs configurable
- rows_per_page/cols_per_page (DB) used only by fixed_grid - total_per_page preference used by auto_flow, simple_list, matteo — shown as one shared field with the style-appropriate label; falls back to old rows_per_page for migration - galleriffic_num_thumbs preference replaces hardcoded numThumbs:30 in JS templates - JS disables hidden style-div inputs on load and switch so only the active style submits Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/classes/FisheyeGallery.php12
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);
}