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

toddy’s picture

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.

patcon’s picture

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

patcon’s picture

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 :)

patcon’s picture

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!

toddy’s picture

Assigned: Unassigned » toddy
Status: Active » Closed (won't fix)

In the current branch 7.x-2.x, there is no longer a "Reported on".