Utilisation de events plutot que map.json

This commit is contained in:
Vincent Calame 2019-03-06 01:26:18 +01:00 committed by root
parent e4d009ed5f
commit 1a4156232b
2 changed files with 8 additions and 8 deletions

View File

@ -122,15 +122,15 @@ function mes_balise_Repartition2($tag) {
if ($GLOBALS[MES]["repartition2"] != false) { if ($GLOBALS[MES]["repartition2"] != false) {
return $GLOBALS[MES]["repartition2"]; return $GLOBALS[MES]["repartition2"];
} }
$url_evenements = 'http://www.agendadulibre.org/maps.json?future=false&tag='.$tag; $url_evenements = 'http://www.agendadulibre.org/events.json?future=false&tag='.$tag;
$evenementArray = json_decode(file_get_contents($url_evenements), true); $evenementArray = json_decode(file_get_contents($url_evenements), true);
$evenementCount = count($evenementArray); $evenementCount = count($evenementArray);
$evenementParRegionMap = array(); $evenementParRegionMap = array();
for($i = 0; $i < $evenementCount; $i++) { for($i = 0; $i < $evenementCount; $i++) {
$evenement = $evenementArray[$i]; $evenement = $evenementArray[$i];
$region_id = 0; $region_id = 0;
if (array_key_exists("region", $evenement["properties"])) { if (array_key_exists("region_id", $evenement)) {
$region_id = $evenement["properties"]["region_id"]; $region_id = $evenement["region_id"];
} }
if (array_key_exists("id_".$region_id, $evenementParRegionMap)) { if (array_key_exists("id_".$region_id, $evenementParRegionMap)) {
$evenementParRegionMap["id_".$region_id][] = $evenement; $evenementParRegionMap["id_".$region_id][] = $evenement;

View File

@ -4,10 +4,10 @@
<BOUCLE_sousregions(DATA){source tableau, #VALEUR{sousregions}}> <BOUCLE_sousregions(DATA){source tableau, #VALEUR{sousregions}}>
<h4 class="spip">#VALEUR{name}</h4> <h4 class="spip">#VALEUR{name}</h4>
<ul> <ul>
<BOUCLE_evenements(DATA) {source tableau, #VALEUR{evenements}}{par properties/start_time}> <BOUCLE_evenements(DATA) {source tableau, #VALEUR{evenements}}{par start_time}>
[(#SET{evt,#VALEUR|table_valeur{properties}})] [(#SET{evt,#VALEUR})]
<li>[[(#GET{evt/start_time}|nom_jour)] (#GET{evt/start_time}|affdate_jourcourt)[ à (#GET{evt/start_time}|heures)][:(#GET{evt/start_time}|minutes)]] <li>[[(#GET{evt/start_time}|nom_jour)] (#GET{evt/start_time}|affdate_jourcourt)[ à (#GET{evt/start_time}|heures)][:(#GET{evt/start_time}|minutes)]]
<a href="http://www.agendadulibre.org/events/[(#GET{evt/id})]">[(#GET{evt/name})]</a> <a href="http://www.agendadulibre.org/events/[(#GET{evt/id})]">[(#GET{evt/title})]</a>
à [(#GET{evt/city})] à [(#GET{evt/city})]
</li> </li>
</BOUCLE_evenements> </BOUCLE_evenements>