data as $weather) { $wetter[$i]['wochentag'] = $weather->day; $suchArr = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); $ersetzArr = array('Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'); $wetter[$i]['wochentag'] = str_replace($suchArr, $ersetzArr, $wetter[$i]['wochentag']); $wetter[$i]['zustand'] = $weather->condition; $wetter[$i]['tiefsttemperatur'] = $weather->tempmin; $wetter[$i]['hoechsttemperatur'] = $weather->tempmax; $wetter[$i]['icon'] = $weather->icon; $i++; } if(isset($temp) && $temp !=0) $wetter[0]['temperatur'] = GetValue($temp); $tableAktuell = ""; $tableAktuell .= ""; $tableAktuell .= "
"; $tableAktuell .= "Aktuell:
\n"; $tableAktuell .= $wetter[0]['zustand']."
\n"; if(isset($temp) && $temp !=0) $tableAktuell .= "Temperatur: ".GetValue($temp)." °C
\n"; if(isset($feuchte) && $feuchte !=0) $tableAktuell .= "rel. Luftfeuchte: ".GetValueFormatted($feuchte)."
"; if(isset($wind) && $wind !=0) $tableAktuell .= "Wind: ".GetValueFormatted($wind)."
"; if(isset($luftdruck) && $luftdruck !=0) $tableAktuell .= "Luftdruck: ".GetValueFormatted($luftdruck)."
"; if(isset($hoeheNN) && $hoeheNN !=0) $tableAktuell .= "Höhe ü. NN: ".$hoeheNN." m"; $tableAktuell .= "
\"".$wetter[0]['zustand']."\"\n"; $tableAktuell .= "
"; $tableTage = ""; $tableTage .= ""; $tableTage .= ""; $tableTage .= "
"; $tableTage .= "".$wetter[0]['wochentag']."
\n"; $tableTage .= $wetter[0]['zustand']."
\n"; $tableTage .= "min. ".$wetter[0]['tiefsttemperatur']." °C
max. ".$wetter[0]['hoechsttemperatur']." °C

"; $tableTage .= "\"".$wetter[0]['zustand']."\"\n"; $tableTage .= "
"; $tableTage .= "".$wetter[1]['wochentag']."
\n"; $tableTage .= $wetter[1]['zustand']."
\n"; $tableTage .= "min. ".$wetter[1]['tiefsttemperatur']." °C
max. ".$wetter[1]['hoechsttemperatur']." °C

"; $tableTage .= "\"".$wetter[1]['zustand']."\"\n"; $tableTage .= "
"; $tableTage .= "".$wetter[2]['wochentag']."
\n"; $tableTage .= $wetter[2]['zustand']."
\n"; $tableTage .= "min. ".$wetter[2]['tiefsttemperatur']." °C
max. ".$wetter[2]['hoechsttemperatur']." °C

"; $tableTage .= "\"".$wetter[2]['zustand']."\"\n"; $tableTage .= "
"; $imgKarte = Sys_GetURLContent('http://www.dwd.de/dyn/app/ws/maps/'.$warnung); $imagePfad = IPS_GetKernelDir()."webfront\\user\\WetterFtpDWD\\warnungen\\".$warnung; $fp = fopen($imagePfad, "wb+"); fwrite($fp, $imgKarte); fclose($fp); $image = imagecreatefromgif($imagePfad); list($width, $height) = getimagesize($imagePfad); $newWidth = $width * $factorWetterwarnung; $newHeight = $height * $factorWetterwarnung; $imageResized = ImageCreateTrueColor($newWidth, $newHeight); $transparenz = ImageColorTransparent($image, imagecolorexact($image, 255, 255, 255)); for($i=0; $i<$height; $i++) { for($j=0; $j<$width; $j++) { $pos = imagecolorat($image, $j, $i); $index = imagecolorsforindex($image, $pos); $rgb = $index["red"] + $index["green"] + $index["blue"]; if($rgb == "0") { $weiss = imagecolorresolve($image, 255, 255, 255); imagesetpixel($image, $j, $i, $weiss); } } } ImageColorTransparent($imageResized, $transparenz); ImageCopyResampled($imageResized, $image, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); imagegif($imageResized, $imagePfad); $berichtHeute = file_get_contents("../WetterFtpDWD/berichte/berichtHeute.txt"); $berichtHeute = preg_replace('/\b[A-Z]{1}+[a-z]{4,}\b.*([:].*)/', "", $berichtHeute); //$berichtHeute = preg_replace('/Letzte Aktualisierung: ([\d]{2}.[\d]{2}.[\d]{4}, [\d]{2}.[\d]{2} Uhr)/', "", $berichtHeute); $berichtMorgen = file_get_contents("../WetterFtpDWD/berichte/berichtMorgen.txt"); $berichtMorgen = preg_replace('/\b[A-Z]{1}+[a-z]{4,}\b.*([:].*)/', "", $berichtMorgen); $berichtUebermorgen = file_get_contents("../WetterFtpDWD/berichte/berichtUebermorgen.txt"); $berichtUebermorgen = preg_replace('/\b[A-Z]{1}+[a-z]{4,}\b.*([:].*)/', "", $berichtUebermorgen); $berichtTag4 = file_get_contents("../WetterFtpDWD/berichte/berichtTag4.txt"); $berichtTag4 = preg_replace('/\b[A-Z]{1}+[a-z]{4,}\b.*([:].*)/', "", $berichtTag4); $berichtGesamt = $berichtHeute; if($berichtanzahl == 2) $berichtGesamt = $berichtHeute . $berichtMorgen; if($berichtanzahl == 3) $berichtGesamt = $berichtHeute . $berichtMorgen . $berichtUebermorgen; if($berichtanzahl == 4) $berichtGesamt = $berichtHeute . $berichtMorgen . $berichtUebermorgen . $berichtTag4; if($berichtGesamt == "") { $berichtGesamt = "Der Wetterbericht steht momentan nicht zur Verfügung!"; } ?>
Vorhersage für die nächsten 3 Tage
karte
Wetteraukreis
Wetterbericht