You are here

weather.tpl.php in Weather 6.5

Same filename and directory in other branches
  1. 7.3 weather.tpl.php
  2. 7 weather.tpl.php
  3. 7.2 weather.tpl.php

File

weather.tpl.php
View source
<div class="weather">
  <p><strong><?php

print $weather['real_name'];
?></strong></p>
  <div style="text-align:center;">
    <img src="<?php

print $weather['image']['filename'];
?>" <?php

print $weather['image']['size'];
?> alt="<?php

print $weather['condition'];
?>" title="<?php

print $weather['condition'];
?>" />
  </div>
  <ul>
    <li><?php

print $weather['condition'];
?></li>
    <?php

if (isset($weather['temperature'])) {
  ?>
      <?php

  if (isset($weather['temperature_windchill'])) {
    ?>
        <li><?php

    print t("Temperature: !temperature1, feels like !temperature2", array(
      '!temperature1' => $weather['temperature'],
      '!temperature2' => $weather['temperature_windchill'],
    ));
    ?></li>
      <?php

  }
  else {
    ?>
        <li><?php

    print t("Temperature: !temperature", array(
      '!temperature' => $weather['temperature'],
    ));
    ?></li>
      <?php

  }
  ?>
    <?php

}
?>
    <?php

if (isset($weather['wind'])) {
  ?>
      <li><?php

  print t('Wind: !wind', array(
    '!wind' => $weather['wind'],
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['pressure'])) {
  ?>
      <li><?php

  print t('Pressure: !pressure', array(
    '!pressure' => $weather['pressure'],
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['rel_humidity'])) {
  ?>
      <li><?php

  print t('Rel. Humidity: !rel_humidity', array(
    '!rel_humidity' => $weather['rel_humidity'],
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['visibility'])) {
  ?>
      <li><?php

  print t('Visibility: !visibility', array(
    '!visibility' => $weather['visibility'],
  ));
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['sunrise'])) {
  ?>
      <li><?php

  print $weather['sunrise'];
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['sunset'])) {
  ?>
      <li><?php

  print $weather['sunset'];
  ?></li>
    <?php

}
?>
    <?php

if (isset($weather['metar'])) {
  ?>
      <li><?php

  print t('METAR data: !metar', array(
    '!metar' => '<pre>' . wordwrap($weather['metar'], 20) . '</pre>',
  ));
  ?></li>
    <?php

}
?>
  </ul>
  <?php

if (isset($weather['location'])) {
  ?>
    <small>
      <?php

  print t('Location of this weather station:');
  ?><br />
      <?php

  print $weather['location'];
  ?>
    </small>
    <br />
  <?php

}
?>
  <?php

if (isset($weather['reported_on'])) {
  ?>
    <small>
      <?php

  print t('Reported on:');
  ?><br />
      <?php

  print $weather['reported_on'];
  ?>
    </small>
  <?php

}
?>
</div>