array( "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" ) ) ); $url = 'http://nominatim.openstreetmap.org/search?q='. urlencode($_GET['location']) . '&format=json'; $citiesJson = file_get_contents($url, false, $streamContext); $cities = json_decode($citiesJson); $_SESSION['lat'] = $cities[0]->lat; $_SESSION['lon'] = $cities[0]->lon; $_SESSION['location'] = htmlspecialchars($_GET['location']); } include('header.php'); echo '

Événements à '. EVENT_RADIUS .' km autour de '. $_SESSION['location'] . '

'; $feedUrl = 'https://www.agendadulibre.org/events.rss?tag=monnaie-libre&near[distance]='. EVENT_RADIUS . '&near[location]=['. $_SESSION['lat'] . ','. $_SESSION['lon'] . ']'; $content = @file_get_contents($feedUrl); $x = new SimpleXmlElement($content); echo ''; echo '

Ces événements sont importés automatiquement depuis l\'Agenda du libre

'; echo '

Contacter d\'autres junistes près de '. $_SESSION['location'] . '

'; echo '

Consulter la doc de OpenStreetMap API pour voir comment récupérer les descriptions des pins des groupes locaux de la Framacarte.

'; echo '

Groupe de discussion par mail du groupe de Vannes

'; $offers = $gchange->getNearbyOffers($_SESSION['lat'], $_SESSION['lon'], RADIUS); echo '

Annonces à '. RADIUS . ' km autour de '. $_SESSION['location'] .'

'; echo '
    '; foreach ($offers as $offer) { $description = isset($offer->_source->description) ? ' title="'. substr($offer->_source->description, 0, 30) . '"' : ''; echo '
  1. ' . $offer->_source->title . ' ('. $offer->_source->city . ')
  2. '; } echo '
'; $users = $cesiumPlus->getNearbyUsers($_SESSION['lat'], $_SESSION['lon'], RADIUS); echo '

Nouveaux utilisateurs à '. RADIUS . ' km autour de '. $_SESSION['location'] .'

'; echo ''; foreach ($users as $user) { $date = new DateTime(); $date->setTimestamp($user->_source->time); echo ' '; } echo '
'. $date->format('j') . ' ' . moisFr($date->format('n')) . ' ' . $date->format('Y') . ' ' . $user->_source->title . '
'; include('footer.php');