Hallo Rainer
Ich nehm mal an, du meinst mit „Chaos“ die auskommentierten Zeilen, ansonsten hab ich die wetter.php nur an meine Gegebenheiten angepaßt.
<!--
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<style type="text/css">html, body { margin: 0; padding: 30; font: normal 14px verdana; color: #FFFFFF; background: #27292b; }</style>
<style type="text/css"> body { -moz-user-select: none; -khtml-user-select: none; user-select: none; }</style>
<style type="text/css">div { position:absolute; width:700px; height:100px; }</style>
</head><body>
<?php
// Funktionsaufruf z.B.: $wetter = website_wetter("08141", "Germany", "/user/WetterIcons/", "de");
function website_wetter($plz, $land, $icons_src="/", $sprache="de", $ort="")
{
$icons_google = "/ig/images/weather/";
if($ort != "")
{
$station = $ort;
}
else
{
$station = $plz."-".$land;
}
$api = simplexml_load_string(utf8_encode(file_get_contents("http://www.google.com/ig/api?weather=".$station."&hl=".$sprache)));
//print_r($api);
$wetter = array();
// Allgemeine Informationen
$wetter['stadt'] = $api->weather->forecast_information->city->attributes()->data;
$wetter['datum'] = $api->weather->forecast_information->forecast_date->attributes()->data;
$wetter['zeit'] = $api->weather->forecast_information->current_date_time->attributes()->data;
// Aktuelles Wetter
$wetter[0]['zustand'] = $api->weather->current_conditions->condition->attributes()->data;
$wetter[0]['temperatur'] = $api->weather->current_conditions->temp_c->attributes()->data;
$wetter[0]['luftfeuchtigkeit'] = $api->weather->current_conditions->humidity->attributes()->data;
$wetter[0]['luftfeuchtigkeit'] = str_replace("Feuchtigkeit", "rel.Luftfeuchte", $wetter[0]['luftfeuchtigkeit']);
$wetter[0]['wind'] = $api->weather->current_conditions->wind_condition->attributes()->data;
$wetter[0]['icon'] = str_replace($icons_google, $icons_src, $api->weather->current_conditions->icon->attributes()->data);
// Wettervorhersage heute, morgen, in zwei und in drei Tagen ($wetter[1] bis $wetter[4])
$i = 1;
foreach($api->weather->forecast_conditions as $weather)
{
$wetter[$i]['wochentag'] = $weather->day_of_week->attributes()->data;
$wetter[$i]['zustand'] = $weather->condition->attributes()->data;
$wetter[$i]['tiefsttemperatur'] = $weather->low->attributes()->data;
$wetter[$i]['hoechsttemperatur'] = $weather->high->attributes()->data;
$wetter[$i]['icon'] = str_replace($icons_google, $icons_src, $weather->icon->attributes()->data);
$i++;
}
return $wetter;
}
$wetter = website_wetter("08141", "Germany");
echo "<table>";
echo "<tr><td style='width:220px;'>";
echo "<strong>Aktuell:</strong><br/>
";
echo $wetter[0]['zustand']."<br/>
";
echo "Temperatur: ".$wetter[0]['temperatur']." °C<br/>
";
echo "min. ".$wetter[1]['tiefsttemperatur']." °C <br/> max. ".$wetter[1]['hoechsttemperatur']." °C<br/>";
echo $wetter[0]['luftfeuchtigkeit']."<br/>";
echo $wetter[0]['wind']."<br/>";
echo "</td>";
echo "<img src=\"http://www.google.com/ig/images/weather".$wetter[0]['icon']."\" alt=\"".$wetter[0]['zustand']."\" />
";
echo "<td style='width:180px;'>";
echo "<strong>".$wetter[2]['wochentag']."</strong><br/>
";
echo $wetter[2]['zustand']."<br/>
";
echo "min. ".$wetter[2]['tiefsttemperatur']." °C <br/> max. ".$wetter[2]['hoechsttemperatur']." °C<br/><br/>";
echo "<img src=\"http://www.google.com/ig/images/weather".$wetter[2]['icon']."\" alt=\"".$wetter[2]['zustand']."\" />
";
echo "</td>";
echo "<td style='width:180px;'>";
echo "<strong>".$wetter[3]['wochentag']."</strong><br/>
";
echo $wetter[3]['zustand']."<br/>
";
echo "min. ".$wetter[3]['tiefsttemperatur']." °C <br/> max. ".$wetter[3]['hoechsttemperatur']." °C<br/><br/>";
echo "<img src=\"http://www.google.com/ig/images/weather".$wetter[3]['icon']."\" alt=\"".$wetter[3]['zustand']."\" />
";
echo "</td>";
echo "<td style='width:180px;'>";
echo "<strong>".$wetter[4]['wochentag']."</strong><br/>
";
echo $wetter[4]['zustand']."<br/>
";
echo "min. ".$wetter[4]['tiefsttemperatur']." °C <br/> max. ".$wetter[4]['hoechsttemperatur']." °C<br/><br/>";
echo "<img src=\"http://www.google.com/ig/images/weather".$wetter[4]['icon']."\" alt=\"".$wetter[4]['zustand']."\" />
";
echo "</td></tr>";
echo "</table>";
$imgKarte = Sys_GetURLContent("http://www.dwd.de/dyn/app/ws/maps/LZ_x_x_0.gif");
$imagepfad = IPS_GetKernelDir()."webfront/user/WetterIcons/LZ_x_x_0.gif";
$fp = fopen($imagepfad, "wb+");
fwrite($fp, $imgKarte);
fclose($fp);
$factor = 0.8;
list($width, $height) = getimagesize($imagepfad);
$new_width = $width * $factor;
$new_height = $height * $factor;
$image_p = imagecreatetruecolor($new_width, $new_height);
$img = imagecreatefromgif($imagepfad);
imagecopyresampled($image_p, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
ImageGif($image_p, $imagepfad);
$berichtHeute = file_get_contents("../user/WetterReinsdorf/berichte/berichtHeute.txt");
if($berichtHeute == "")
{
$berichtHeute = "Der Wetterbericht steht momentan nicht zur Verfügung!";
$berichtMorgen = "";
}
?>
<div style="left:30px; top:0px;"><h1>Wetter Reinsdorf</h1></div>
<div style="left:30px; top:270px;"><h1>Wetterwarnungen Sachsen</h1></div>
<div style="left:550px; top:270px;"><h1>Wetterbericht fuer heute und morgen</h1></div>
<div style="left:550px; top:0px;"><h1>Wettervorhersage für die nächsten 3 Tage</h1></div>
<div style="left:30px; top:350px;"><img src='/user/WetterIcons/LZ_x_X_0.gif'></div>
<div style="left:30px; top:350px;"><img src='/user/WetterIcons/sachsen.png'></div>
<div style="left:220px; top:600px;"><img src='/user/WetterIcons/warnungHellblau.png'></div>
<div style="left:240px; top:600px; font: normal 11px verdana;">Keine Warnungen</div>
<div style="left:220px; top:625px;"><img src='/user/WetterIcons/warnungGelb.png'></div>
<div style="left:240px; top:625px; font: normal 11px verdana;">Wetterwarnungen</div>
<div style="left:220px; top:650px;"><img src='/user/WetterIcons/warnungOrange.png'></div>
<div style="left:240px; top:650px; font: normal 11px verdana;">Warnung vor markantem Wetter</div>
<div style="left:220px; top:675px;"><img src='/user/WetterIcons/warnungRot.png'></div>
<div style="left:240px; top:675px; font: normal 11px verdana;">Unwetterwarnung</div>
<div style="left:220px; top:700px;"><img src='/user/WetterIcons/warnungLila.png'></div>
<div style="left:240px; top:700px; font: normal 11px verdana;">Warnung vor extremem Unwetter</div>
<div style="left:550px; top:350px;"><?php echo $berichtHeute?></div>
</body></html>
Gruß computerpap