{source}

<?php

setlocale(LC_TIME, ‚en_US.UTF-8‘);
//setlocale(LC_TIME, ‚de_DE.UTF-8‘);

function curl_download($Url){

if (!function_exists(‚curl_init‘)){
die(‚Sorry cURL is not installed!‘);
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_REFERER, „http://www.example.org/yay.htm“);
curl_setopt($ch, CURLOPT_USERAGENT, „MozillaXYZ/1.0“);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch);
curl_close($ch);

return $output;

}

$country = curl_download(‚http://virtualx-geo.appspot.com/country-list/country/cldr/‘ . substr(setlocale(LC_TIME, 0), 0, 5) . ‚/country.json‘);
$country = json_decode($country);

$content = curl_download(‚http://orgel.deutscher-orgelbau.de/cms/konzerte/102/json‘);
$content = json_decode($content);

for($x=0;$x<count($content);$x++) {

echo ‚<p style=“float:right;margin-top:30px;“><img src=“http://orgel.deutscher-orgelbau.de/imagePool/image/‘ . $content[$x]->thumbId . ‚“ /></p>‘;
echo ‚<p>‘ . strftime(„%A, %d. %B %G, %H:%M“, strtotime($content[$x]->datum)) . ‚ Uhr</p>‘;
echo ‚<p><i>‘ . $content[$x]->ort . ‚, ‚ . $content[$x]->standort . ‚</i></p>‘;
echo ‚<h2 style=“color:#D30F27″>‘ . $content[$x]->titel . ‚</h2>‘;
echo (($content[$x]->freitext != “) ? ‚<p>‘ . $content[$x]->freitext . ‚</p>‘ : “);
echo (($content[$x]->url != ‚http://‘) ? ‚<p>→ <a href=“‚ . $content[$x]->url . ‚“ target=“_blank“>‘ . ‚Informationen zur Orgel‘ . ‚</a></p>‘ : “);
echo ‚<p>Anschrift: ‚ . $content[$x]->adresse1 . (($content[$x]->adresse2 != “) ? ‚, ‚ . $content[$x]->adresse2 : “) . ‚, ‚;
echo $content[$x]->plz . ‚ ‚ . $content[$x]->ort . (($country->{$content[$x]->land} != “) ? ‚, ‚.$country->{$content[$x]->land} : “);
echo ‚</p>‘ . (($x<(count($content) – 1)) ? ‚<p style=“height:1px;background:#D30F27;margin:30px 0 0;“></p>‘ : “);

}

?>

{/source}