Author Topic: thermometer.php V1.17 from World base - Does it do Imperial/Metric switching?  (Read 218 times)

0 Members and 1 Guest are viewing this topic.

Offline mexbound

  • Senior Member
  • **
  • Posts: 50
I am testing displaying the thermometer.php on my ajax-dashboard6.php. I use Imperial/Metric switching but the thermometer does not switch. I am using "WD" software and the thermometer.php is // Version 1.17 - 14-May-2021. Is the thermometer.php at V1.17 coded to support UOM switching?

This is the code I use in ajax-dashboard6.php to display the thermometer:

<tr>
       <td align="center" valign="top" class="data1" style="text-align: center;border: none">
      <a class="hvr-float-shadow"> <span class="ajax" id="ajaxthermometer">
      <?php $tstr = "Currently $temperature, Max: $maxtemp, Min: $mintemp"; ?>
      <img src="thermometer.php?t=<?php echo strip_units($temperature); ?>" alt="<?php echo $tstr; ?>"
            title="<?php echo $tstr; ?>" height="170" width="54" /> </span></a>
   </td>
</tr>

My site is: https://ajijicweather.com/wxindex.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8398
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Sorry, the current thermometer.php V1.17 does not support imperial/metric switching.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mexbound

  • Senior Member
  • **
  • Posts: 50
I found a version of thermometer.php that is coded for Imperial/Metric switching. I had to update it for PHP 8 but it seems to be working fine. Throwing no errors.

http://www.weather-watch.com/smf/index.php/topic,43750.0.html


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8398
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
That one only works with clientraw.txt (as I remember) so only applies to Weather-Display (or WeeWX with the WeewxWD plugin).  The stock thermometer handles all the other weather software, but not a Metric/Imperial switch.  Nice that his 2010 code can still work with a few fixups :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP