Skip to content

Commit

Permalink
path of photos
Browse files Browse the repository at this point in the history
  • Loading branch information
vanekm committed Aug 29, 2024
1 parent c1a5585 commit 895d9f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Modules/Fykos/EventsModule/CampsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public function getEventPhoto(array $event): string
$fullYear = $event['year'];
}

$photosBasePath = '.media/images/events/' . $eventType . '/rocnik' . $fullYear . '/carousel-photos';
$photosBasePath = './media/images/events/' . $eventType . '/rocnik' . $fullYear . '/carousel-photos';
$photos = glob($photosBasePath . '/*.{jpg,jpeg,png,gif}', GLOB_BRACE);

if (empty($photos)) {
return $this->template->basePath . 'media/images/events/event-missing-photo.png';
return $this->template->basePath . '/media/images/events/event-missing-photo.png';
}

$photo = $photos[array_rand($photos)];
Expand Down

0 comments on commit 895d9f7

Please sign in to comment.