Skip to content

Commit 9aafd7d

Browse files
committed
Issue #64: Only display the current pin on the picture page
Previous attempt to fix #64 introduced another bug. The map on the picture page now contains info from all images of the album. On this page we expect to see info (pin/thumbnail) from the current image only. This quick fix adds a sql limit condition to the query if the image_id param exists (I assume that it means we come from the picture page?). Note that it would be more efficient not to join in this case.
1 parent bda5b43 commit 9aafd7d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

include/functions_map.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ function osm_get_items($page)
186186
// SUBSTRING_INDEX(TRIM(LEADING '.' FROM `path`), '.', 1) full path without filename extension
187187
// SUBSTRING_INDEX(TRIM(LEADING '.' FROM `path`), '.', -1) full path with only filename extension
188188

189+
190+
if (isset($page['image_id'])) $LIMIT_SEARCH .= 'i.id = ' . $page['image_id'] . ' AND ';
191+
189192
$query="SELECT i.latitude, i.longitude,
190193
IFNULL(i.name, '') AS `name`,
191194
IF(i.representative_ext IS NULL,

0 commit comments

Comments
 (0)