diff --git a/index.php b/index.php index 5af49c2..e2d601d 100644 --- a/index.php +++ b/index.php @@ -161,6 +161,8 @@ $detailTotal = 0; $detailIndex = 0; $prevPhotoId = 0; $nextPhotoId = 0; +$firstPhotoId = 0; +$lastPhotoId = 0; $detailSectionId = 0; $photoTopics = []; if ($photo) { @@ -191,6 +193,10 @@ if ($photo) { } } $detailTotal = count($detailPhotos); + if ($detailTotal > 0) { + $firstPhotoId = (int)$detailPhotos[0]['id']; + $lastPhotoId = (int)$detailPhotos[$detailTotal - 1]['id']; + } foreach ($detailPhotos as $i => $p) { if ((int)$p['id'] !== $activePhotoId) { continue; @@ -615,8 +621,8 @@ function outputWatermarked(string $path, string $mime): never