From: Nicolas Boisselier Date: Mon, 8 Jan 2018 20:30:18 +0000 (+0000) Subject: lib/php/maps.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=a92ecfd892bed30522d0351cb6d300008f92d53d;p=nb.git lib/php/maps.php --- 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 '' + .'' .''; }