summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-21 19:03:41 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-21 19:03:41 +0100
commit29a585bd7b8290d7b54818594e8b5130bf453983 (patch)
tree3a92fa57463f64ffadcab36341532e6949560304
parent00298bd4460d9f0cd1fc56d572489bdcb52492c4 (diff)
downloadfisheye-29a585bd7b8290d7b54818594e8b5130bf453983.tar.gz
fisheye-29a585bd7b8290d7b54818594e8b5130bf453983.tar.bz2
fisheye-29a585bd7b8290d7b54818594e8b5130bf453983.zip
Fix prev/next image navigation: call loadCurrentImage and use getAll not getAssoc
image_lookup_inc.php was never calling loadCurrentImage() so previous/next image IDs were never populated. Also fixed loadCurrentImage to use getAll() instead of getAssoc() — getAssoc keys by first column so numeric $rows[$i] indexing always failed to find the current image. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xincludes/classes/FisheyeGallery.php2
-rwxr-xr-xincludes/image_lookup_inc.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/includes/classes/FisheyeGallery.php b/includes/classes/FisheyeGallery.php
index c321d99..1c89b34 100755
--- a/includes/classes/FisheyeGallery.php
+++ b/includes/classes/FisheyeGallery.php
@@ -187,7 +187,7 @@ class FisheyeGallery extends FisheyeBase {
INNER JOIN `".BIT_DB_PREFIX."liberty_files` lf ON ( lf.`file_id`=la.`foreign_id` )
WHERE fgim.`gallery_content_id` = ?
ORDER BY fgim.`item_position`, fi.`content_id` ";
- if( $rows = $this->mDb->getAssoc($query, [ $this->mContentId ] ) ) {
+ if( $rows = $this->mDb->getAll($query, [ $this->mContentId ] ) ) {
$tempImage = new FisheyeImage();
for( $i = 0; $i < count( $rows ); $i++ ) {
if( $rows[$i]['image_id'] == $pCurrentImageId ) {
diff --git a/includes/image_lookup_inc.php b/includes/image_lookup_inc.php
index 61e0bab..9c9823b 100755
--- a/includes/image_lookup_inc.php
+++ b/includes/image_lookup_inc.php
@@ -33,6 +33,9 @@ if( empty( $_REQUEST['gallery_id'] ) ) {
// the image is considered the primary content, however the gallery is useful
if( !empty($_REQUEST['gallery_id']) && is_numeric($_REQUEST['gallery_id']) ) {
$gGallery = FisheyeGallery::lookup( $_REQUEST );
+ if( is_object( $gGallery ) && $gGallery->isValid() ) {
+ $gGallery->loadCurrentImage( $gContent->mImageId );
+ }
$gBitSmarty->assign('gGallery', $gGallery);
$gBitSmarty->assign('galleryId', $_REQUEST['gallery_id']);
}