Project

General

Profile

Bug #2520 » weather_widget.diff

Delekhan, 08/29/2017 06:53 PM

View differences:

widgets/weather/update_weather.php 2017-08-23 14:20:25.000000000 +0200
$condition = $forecast->getCurrentConditions($latitude, $longitude, $units, $lang);
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.0.temp", "w") ) {
print "can't create file!\n";
continue;
}
$temp = round($condition->getTemperature(), 1);
if( $convertPoint == 1 )
......
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".summary", "w") ) {
print "can't create file!\n";
continue;
}
fwrite($handle, $conditions->getSummary());
fclose($handle);
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".tempMin", "w") ) {
print "can't create file!\n";
continue;
}
// we only have min & max so we must calc
$temp = round($conditions->getMinTemperature(), 1);
......
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".tempMax", "w") ) {
print "can't create file!\n";
continue;
}
// we only have min & max so we must calc
$temp = round($conditions->getMaxTemperature(), 1);
......
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".precipitation", "w") ) {
print "can't create file!\n";
continue;
}
fwrite($handle, $conditions->getPrecipitationProbability());
fclose($handle);
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".precipitationType", "w") ) {
print "can't create file!\n";
continue;
}
if( $conditions->getPrecipitationProbability() > 0 )
fwrite($handle, $conditions->getPrecipitationType());
......
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.".$index.".icon", "w") ) {
print "can't create file!\n";
continue;
}
fwrite($handle, $conditions->getIcon());
fclose($handle);
    (1-1/1)