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,16 +122,16 @@ function mes_balise_Repartition2($tag) {
if ($GLOBALS[MES]["repartition2"] != false) {
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);
$evenementCount = count($evenementArray);
$evenementParRegionMap = array();
for($i = 0; $i < $evenementCount; $i++) {
$evenement = $evenementArray[$i];
$region_id = 0;
if (array_key_exists("region", $evenement["properties"])) {
$region_id = $evenement["properties"]["region_id"];
}
if (array_key_exists("region_id", $evenement)) {
$region_id = $evenement["region_id"];
}
if (array_key_exists("id_".$region_id, $evenementParRegionMap)) {
$evenementParRegionMap["id_".$region_id][] = $evenement;
} else {
@ -183,4 +183,4 @@ function mes_balise_Repartition2($tag) {
function mes_compare($a, $b) {
$coll = collator_create( 'fr_FR' );
return collator_compare($coll, $a, $b);
}
}

View File

@ -4,10 +4,10 @@
<BOUCLE_sousregions(DATA){source tableau, #VALEUR{sousregions}}>
<h4 class="spip">#VALEUR{name}</h4>
<ul>
<BOUCLE_evenements(DATA) {source tableau, #VALEUR{evenements}}{par properties/start_time}>
[(#SET{evt,#VALEUR|table_valeur{properties}})]
<BOUCLE_evenements(DATA) {source tableau, #VALEUR{evenements}}{par start_time}>
[(#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)]]
<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})]
</li>
</BOUCLE_evenements>