Bug in Updated temp_c_block.php

Hello,

i found two bugs in the Updated temp_c_block.php from 2024-04-15.
In line #320 the temp_trend is always forced to -0.3°C. I think it was missed to comment out after testing.

# ------------------- temp trend
$arrow  = $trend_txt = '';  $weather["temp_trend"] = -0.3;
if (array_key_exists ('temp_trend', $weather) && $weather["temp_trend"] <> 'n/a') 

and in line #290 the arrow for the humidity_trend is showing always even when the humidity_trend = “n/a”

This can be fixed by adding “&& $weather[“humidity_trend”] <> ‘n/a’” to the if array exist clause.

if(array_key_exists("humidity_trend",$weather)&& $weather["humidity_trend"] <> 'n/a')
     {  if     ( $weather["humidity_trend"] > 0) { $arrow       = '&uarr;';}
        elseif ( $weather["humidity_trend"] < 0) { $arrow       = '&darr;';}
        else                                     { $arrow       = '';}
}

Greetings from Austria
Martin

2 Likes

Hi Martin,

Thanks for finding this, I replaced the download also.
Best regards,
Wim

2 Likes

A change was necessary for missing arrow when there is no humidity trend.
New version on-line.