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

Haine et Dendre - Les Scouts




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/HD.xml?a=$today");
if (!$xml){exit("Failed to open HD.xml.<br />");}

$myarray = object2array($xml);

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

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

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

Dit is het resultaat:

Unité Saint-Stanislas[HD001]Mons
Unité Saint-Charles[HD002]Mons
Unité Scoute de Casteau[HD003]Casteau (Soignies)
Unité Charles de Foucauld[HD004]Hyon
Unité Scoute de Cuesmes[HD006]Cuesmes
Unité Scoute de Sirault[HD008]Sirault
Haine et Dendre[HD009]Mons
Unité des Sangliers[HD014]Saint-Ghislain
Unité Scoute Petit-Dour[HD023]Dour
Unité Scoute de l'Obrecheuil[HD024]Saint-Denis (Ht.)

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