Community Support

A few lines to add "Outdated" message on tooltip over maps.  

Eminent Member

Hi there and Pierre,

This is a small contribution to code: a snippet that you could put on includes/classes/MapBaseHelper.php file about line 730, that allows you to show a "Outdated" message if the last retrieved data from certain weather station on map is older than 3 hours (you can easily change that setting, editing the "if" sentence.

$date->setTimezone(new \DateTimeZone($station['loc_timezone']));
$nowtime = date_create(); // now
$nowtime->setTimezone(new \DateTimeZone($station['loc_timezone']));

$ht1 = date_timestamp_get($date);
$ht2 = date_timestamp_get($nowtime);
$difference = abs($ht2 - $ht1);
if($difference > 10800){
$msgdesact = '<b>[Outdated]</b>';
} else {
$msgdesact = '';
$lr = $lr . '&nbsp; ' . $msgdesact . '&nbsp; ' . $date->format('d-m-Y H:i');


This topic was modified 2 years ago by daguilera

David Aguilera-Riquelme (@davidagriq). - an Open Chilean hobbyist weather network

Posted : 03/01/2020 4:23 am

To participate, please connect first!