I love this mod, looks great. I made some slight modifications to what the theme looks like for the weather block.

I added a current time row and kept the reported on time, switched a couple rows around; hope you like it(see below).

function theme_weather($metar) {
  $icao = variable_get('weather_icao', 'EDDH');
  $icao_name = variable_get('weather_icao_name', 'Hamburg-Fuhlsbuettel');
  $content .= '<strong>'.$icao_name.'</strong>';
  $content .= '<br>';
  $content .= '<br>';
  $image = _weather_get_image($metar);
  $content .= '<div style="text-align:center;"><img src="';
  $content .= $image['filename'];
  $content .= '" alt="'.$image['alt_text'].'" width="64" height="64" /></div>';
  $content .= '<small>'.t('Current Date & Time: ').'</small>';
  $content .= '<br>';
  $content .= '<u>'.date("D, m/d/y - g:ia").'</u>';
  $content .= '<br>';
  $content .= '<ul><li>';
  $content .= '<b>'.t('Temp: %temperature',
    array('%temperature' => _weather_format_temperature($metar['temperature']))).'</b>';
  $content .= '</li><li>';
  $content .= _weather_format_condition($metar);
  $content .= '</li><li>';
  $content .= t('Wind: %wind',
    array('%wind' => _weather_format_wind($metar['wind'])));
  $content .= '</li><li>';
  $content .= t('Pressure: %pressure',
    array('%pressure' => _weather_format_pressure($metar['pressure'])));
  $content .= '</li><li>';
  $content .= t('Rel. Humidity: %rel_humidity',
    array('%rel_humidity' =>
      _weather_format_relative_humidity($metar['temperature'], $metar['dewpoint'])));
  $content .= '</li><li>';
  $content .= t('Visibility: %visibility',
    array('%visibility' => _weather_format_visibility($metar['visibility'])));
  $content .= '</li></ul>';
  $content .= '<small>'.t('Reported on: ').'</small>';
  $content .= '<br>';
  $content .= '<small>'.format_date($metar['reported_on']).'</small>';
  return $content;
}

Comments

toddy’s picture

Assigned: Unassigned » toddy
Status: Active » Closed (fixed)

Hi,

I'm glad you like the module, and thanks for your suggestions. I've added the "Reported on:" text. However, I did not switch the lines, as I think that the current conditions make sense to be displayed as the first list item. Moreover, I didn't see the need to abbreviate "Temperature", as there is enough space in that line. And third, I don't think that having a current time is appreciated by many people. If you want the current time to be displayed on the pages, I'm sure there's a module for that, too.

However, an updated tarball should be available soon.

Regards,
Tobias