fix filepath

This commit is contained in:
Ben Goldsworthy 2023-07-20 17:10:16 +00:00
parent b9395cf5e3
commit 6f222d4c98

View file

@ -5,7 +5,7 @@
$embedMissing = null; $embedMissing = null;
if (preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath)) { if (preg_match("/\[\[([^\]]+)\]\]/", $checkin->note, $filepath)) {
if (preg_match("/\.webm/", $filepath[1])) { if (preg_match("/\.webm/", $filepath[1])) {
$hasEmbed = 'video'; $hasEmbed = 'videos';
$trip_slug = preg_replace( '/[^A-Za-z0-9-]+/', '-', strtolower( $trip->name ) ); $trip_slug = preg_replace( '/[^A-Za-z0-9-]+/', '-', strtolower( $trip->name ) );
if (file_exists(public_path() . "/" . $trip_slug . "/" . $hasEmbed . "/" . $filepath[1])) { if (file_exists(public_path() . "/" . $trip_slug . "/" . $hasEmbed . "/" . $filepath[1])) {
$path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1]; $path = "/" . $trip_slug . "/" .$hasEmbed . "/" . $filepath[1];
@ -49,7 +49,7 @@
<span class="checkin-icon">🖼️</span> <span class="checkin-icon">🖼️</span>
@endif @endif
@if($hasEmbed) @if($hasEmbed)
@if($hasEmbed === 'video') @if($hasEmbed === 'videos')
<span class="checkin-icon @if($embedMissing) checkin-icon--missing @endif">&#128249;</span> <span class="checkin-icon @if($embedMissing) checkin-icon--missing @endif">&#128249;</span>
@endif @endif
@if($hasEmbed === 'audio') @if($hasEmbed === 'audio')