Naar de startpagina van deze website
Naar de startpagina van deze website

District TerElst Waverheide - Gouw Opsinjoor




Gebruik dit stukje php-code om links op je website te plaatsen.
<?php
function object2array($object){
$return = NULL;

if(is_array($object)){
	foreach($object as $key => $value)
	$return[$key] = object2array($value);
}else{
	$var = get_object_vars($object);

if($var){
	foreach($var as $key => $value)
	$return[$key] = ($key && !$value) ? NULL : object2array($value);
	}
	else return $object;
	}
return $return;
}


$today = date("Ymd");
$xml = simplexml_load_file("http://scoutnet.be/xml/A32.xml?a=$today");
if (!$xml){exit("Failed to open A32.xml.<br />");}

$myarray = object2array($xml);

$num_marker = count($myarray['A32']['marker']);

echo "<table class=\"snsample\">\n";
for($i = 0; $i < $num_marker; $i++) {
if (($myarray['A32']['marker'][$i]['@attributes']['domain']!='nodomain')&&($myarray['A32']['marker'][$i]['@attributes']['domain']!='')){
	$mylink="<a href='http://www.{$myarray['A32']['marker'][$i]['@attributes']['domain']}'>".utf8_decode($myarray['A32']['marker'][$i]['@attributes']['groupname'])."</a>";
}else{
	$mylink="<a href='http://{$myarray['A32']['marker'][$i]['@attributes']['name']}.scoutnet.be'>".utf8_decode($myarray['A32']['marker'][$i]['@attributes']['groupname'])."</a>";
}
if ($myarray['A32']['marker'][$i]['@attributes']['groupID']!=''){
	$mygroupID='['.$myarray['A32']['marker'][$i]['@attributes']['groupID'].']';
}else{
	$mygroupID='';
}

echo "<tr><td>$mylink</td><td>$mygroupID</td><td>".utf8_decode($myarray['A32']['marker'][$i]['@attributes']['city'])."</td></tr>\n";
}
echo "</table>\n";
?>

Dit is het resultaat:

De Hellevelders[A3201G]Duffel
Sint-Jan In d Olie[A3202G]Vremde
O.L.V. Ridders - Ten Bosch[A3204G]Lint
Sint-Lucia[A3204M]Sint-Katelijne-Waver
Sint-Katrien[A3205M]Sint-Katelijne-Waver
Akabe Wadoeda[A3207G]Duffel
Roeland[A3220S]Onze-Lieve-Vrouw-Waver
Jan Breydel[A3223S]Sint-Katelijne-Waver
Berthoutridders[A3277S]Duffel

Je kan deze data ook tonen op een google map.


Hulp nodig? aarzel dan niet om ons te contacteren.
© Scoutnet 2024