* */ use Friendica\Core\Addon; use Friendica\Core\Cache; function googlemaps_install() { Addon::registerHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); logger("installed googlemaps"); } function googlemaps_uninstall() { Addon::unregisterHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); logger("removed googlemaps"); } function googlemaps_location($a, &$item) { if(! (strlen($item['location']) || strlen($item['coord']))) { return; } if ($item['coord'] != ""){ $target = "http://maps.google.com/?q=".urlencode($item['coord']); } else { $target = "http://maps.google.com/?q=".urlencode($item['location']); } if ($item['location'] != "") { $title = $item['location']; } else { $title = $item['coord']; } $item['html'] = ''.$title.''; }