*
*
*/
function openstreetmap_install() {
register_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location');
logger("installed openstreetmap");
}
function openstreetmap_uninstall() {
unregister_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location');
logger("removed openstreetmap");
}
function openstreetmap_location($a, &$item) {
$location = '';
$coord = '';
$location = (($item['location']) ? '' . $item['location'] . '' : '');
if($item['coord']) {
$coords = explode(' ', $item['coord']);
if(count($coords) > 1) {
$coord = '' . $item['coord'] . '' ;
}
}
if(strlen($coord)) {
if($location)
$location .= '
(' . $coord . ')';
else
$location = '' . $coord . '';
}
$item['html'] = $location;
return;
}