diff --git a/private/lib/gui/HTMLHelper.php b/private/lib/gui/HTMLHelper.php index 88f9c1c..f632ef8 100644 --- a/private/lib/gui/HTMLHelper.php +++ b/private/lib/gui/HTMLHelper.php @@ -36,36 +36,38 @@ class HTMLHelper { public static function getMeteoBlock(){ $config = GlobalVariables::get("config"); - $cont = file_get_contents($config->files->meteoCache); - $json = json_decode($cont); - - $todayImgUrl = " http://openweathermap.org/img/w/".$json->list[0]->weather[0]->icon.".png"; - $todayTemp = $json->list[0]->main->temp; - $todayMax = $json->list[0]->main->temp_max; - $todayMin = $json->list[0]->main->temp_min; - - $tomorrowImgUrl = " http://openweathermap.org/img/w/".$json->list[1]->weather[0]->icon.".png"; - $tomorrowTemp = $json->list[1]->main->temp; - $tomorrowMax = $json->list[1]->main->temp_max; - $tomorrowMin = $json->list[1]->main->temp_min; - - - ?> -
Meteo Napoli
-
-
-
Oggi
-
°
-
Max: °
-
Min: °
-
-
Domani
-
°
-
Max: °
-
Min: °
+ if(file_exists($config->files->meteoCache)){ + $cont = file_get_contents($config->files->meteoCache); + $json = json_decode($cont); + + $todayImgUrl = " http://openweathermap.org/img/w/".$json->list[0]->weather[0]->icon.".png"; + $todayTemp = $json->list[0]->main->temp; + $todayMax = $json->list[0]->main->temp_max; + $todayMin = $json->list[0]->main->temp_min; + + $tomorrowImgUrl = " http://openweathermap.org/img/w/".$json->list[1]->weather[0]->icon.".png"; + $tomorrowTemp = $json->list[1]->main->temp; + $tomorrowMax = $json->list[1]->main->temp_max; + $tomorrowMin = $json->list[1]->main->temp_min; + + + ?> +
Meteo Napoli
+
+
+
Oggi
+
°
+
Max: °
+
Min: °
+
+
Domani
+
°
+
Max: °
+
Min: °
+
-
-