Project:Weather
Version:6.x-5.7
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi,

Would it be possible to add an option to remove the "Reported on" feature from the block?

For the time being I'll just edit the module file but it'd be nice to have that option.

Cheers,
Mike

Comments

#1

Well, it would be possible of course, but I'm not sure it's a good idea. The data of some locations can be quite outdated, in some cases even a few days.

#2

Could something be added so that it's only displayed after a given/chosen amount of time? What you mentioned is really valid, but often won't apply :)

If I get some time, I'll try to look into it sometime

#3

Wow, just realized how unclear my last message was. Let me try again:

Couldn't we add a checkbox in settings that would say

Only display "Reported on" info when data is greater than 24 hours old.

Or it could be 12 hours. Or customizable. Whatever seems right. The point is that this "Reported on" info is only useful when the conditions aren't current. Otherwise, it's unnecessary clutter :)

#4

Mhen, it's bad form, but I added a simple template fix that solved it for me:

In weather.tpl.php, find

  <?php if (isset($weather['reported_on'])): ?>
    <small>
      <?php print t('Reported on:'); ?><br />
      <?php print $weather['reported_on']; ?>
    </small>
  <?php endif ?>

And replace it with

  <?php if (isset($weather['reported_on']) && strtotime($weather['reported_on']) < time() - 21600): ?>
    <small>
      <?php print t('Reported on:'); ?><br />
      <?php print $weather['reported_on']; ?>
    </small>
  <?php endif ?>

I used 21600 seconds, since I only wanted it to show if the weather data hadn't been updated in 6 hours. Under normal circumstances, it's hourly, so this works for me. Either means the weather station is broken, or I've had some sort of cron-tastrophe.

Hopefully this helps someone else! Cheers all!

nobody click here