summaryrefslogtreecommitdiff
path: root/widgets/weather/update_weather.php
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 19:24:54 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 19:24:54 +0100
commitf997e3c12313a74339ffa81e7488217f2ec6c06d (patch)
tree2353862891d10a99e01e6418a3d63268f03eed5f /widgets/weather/update_weather.php
parente2ab40154d2adfe5549e6aba7fe067173bd9c54a (diff)
downloadskin-flatplus-f997e3c12313a74339ffa81e7488217f2ec6c06d.tar.gz
skin-flatplus-f997e3c12313a74339ffa81e7488217f2ec6c06d.tar.bz2
update weather widget
Diffstat (limited to 'widgets/weather/update_weather.php')
-rw-r--r--widgets/weather/update_weather.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index 800f3f7b..a35e89f4 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -8,6 +8,7 @@ $locationSkin = $ini_array['LocationSkin'];
$units = $ini_array['Units'];
$degree_sign = $ini_array['DegreeSign'];
$lang = $ini_array['Lang'];
+$convertPoint = $ini_array['ConvertPoint2Comma'];
$api_key = $ini_array['ApiKey'];
include('lib/forecast.io.php');
@@ -24,6 +25,8 @@ if( !$handle = fopen("weather.0.temp", "w") ) {
continue;
}
$temp = round($condition->getTemperature(), 1);
+if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);
fclose($handle);
@@ -57,6 +60,8 @@ foreach($conditions_week as $conditions) {
}
// we only have min & max so we must calc
$temp = round($conditions->getMinTemperature(), 1);
+ if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);
fclose($handle);
@@ -66,6 +71,8 @@ foreach($conditions_week as $conditions) {
continue;
}
// we only have min & max so we must calc
+ if( $convertPoint == 1 )
+ $temp = str_replace(".", ",", $temp);
$temp = round($conditions->getMaxTemperature(), 1);
fwrite($handle, $temp);
fwrite($handle, $degree_sign);