From b88fb4ca9dc58c5796c5c799a4b992f51bf0d165 Mon Sep 17 00:00:00 2001 From: Franzz Date: Wed, 13 May 2026 10:41:01 +0200 Subject: [PATCH] Fix isMobile trigger and add more details on media --- lib/Spot.php | 11 ++++++++--- src/components/project.vue | 1 + src/components/projectMediaLink.vue | 16 ++++++++++++---- src/components/projectPopup.vue | 10 +++++----- src/components/projectPost.vue | 4 ++-- src/styles/_page.project.feed.scss | 2 +- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/lib/Spot.php b/lib/Spot.php index 530fb8c..f5294f8 100755 --- a/lib/Spot.php +++ b/lib/Spot.php @@ -283,7 +283,8 @@ class Spot extends Main $asMessage['subtype'] = 'message'; } - //Get Geo-positioned Medias + //Get Geo-positioned Medias + //FIXME Make more efficient than requesting images twice from DB $asMedias = $this->getMedias('taken_on', $asMediaIds); $asGeoMedias = $this->getMedias('posted_on', $asMediaIds, true); foreach($asGeoMedias as &$asGeoMedia) { @@ -292,8 +293,6 @@ class Spot extends Main $asGeoMedia['id'] = $iId; $asGeoMedia['type'] = 'media'; - $asGeoMedia['lat_dms'] = self::decToDms($asGeoMedia['latitude'], 'lat'); - $asGeoMedia['lon_dms'] = self::decToDms($asGeoMedia['longitude'], 'lon'); $asGeoMedia['medias'] = array_values(array_filter($asMedias, function($asMedia) use ($iId) { return $asMedia['id_media'] == $iId; })); @@ -428,6 +427,12 @@ class Spot extends Main $this->addTimeStamp($asMedia, strtotime($asMedia[$sTimeRefField]), $asMedia['timezone']); $this->addTimeStamp($asMedia, strtotime($asMedia['taken_on']), $asMedia['timezone'], 'taken_on'); $this->addTimeStamp($asMedia, strtotime($asMedia['posted_on']), $asMedia['timezone'], 'posted_on'); + + if($asMedia['latitude'] != '' && $asMedia['longitude'] != '') { + $asMedia['lat_dms'] = self::decToDms($asMedia['latitude'], 'lat'); + $asMedia['lon_dms'] = self::decToDms($asMedia['longitude'], 'lon'); + } + unset($asMedia['taken_on']); unset($asMedia['posted_on']); } diff --git a/src/components/project.vue b/src/components/project.vue index a4fc7a0..fb67690 100644 --- a/src/components/project.vue +++ b/src/components/project.vue @@ -336,6 +336,7 @@ export default { this.popup.content .provide('lang', this.lang) .provide('consts', this.consts) + .provide('isMobile', this.isMobile) .mount($Popup); }, closePopup() { diff --git a/src/components/projectMediaLink.vue b/src/components/projectMediaLink.vue index 061d82a..3872060 100644 --- a/src/components/projectMediaLink.vue +++ b/src/components/projectMediaLink.vue @@ -1,11 +1,13 @@