From a92ecfd892bed30522d0351cb6d300008f92d53d Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 8 Jan 2018 20:30:18 +0000 Subject: [PATCH] lib/php/maps.php --- etc/dbq/pub.php | 2 +- lib/php/maps.php | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/etc/dbq/pub.php b/etc/dbq/pub.php index 164a88bf..d725af38 100644 --- a/etc/dbq/pub.php +++ b/etc/dbq/pub.php @@ -9,6 +9,6 @@ if ($html) { } $DBQ['pub'] = [ - 'row_parse_post' => !$html ? null : function(&$r,&$t) { Maps::html($r); }, + 'row_parse_post' => !$html ? null : function(&$r,&$t) { Maps::row($r); }, ]; ?> diff --git a/lib/php/maps.php b/lib/php/maps.php index ae3f7d0b..ef3b3d27 100644 --- a/lib/php/maps.php +++ b/lib/php/maps.php @@ -1,28 +1,35 @@ ' - .'' + $r['maps'] = Maps::html($r['latitude'],$r['longitude']); + unset($r['latitude'],$r['longitude']); + } + + public static function html($latitude,$longitude) { + if (empty($latitude)) return; + if (empty($longitude)) return; + return '' + .'' .''; } -- 2.47.3