WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: mexbound on July 17, 2021, 08:14:47 AM

Title: thermometer.php V1.17 from World base - Does it do Imperial/Metric switching?
Post by: mexbound on July 17, 2021, 08:14:47 AM
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
Title: Re: thermometer.php V1.17 from World base - Does it do Imperial/Metric switching?
Post by: saratogaWX on July 17, 2021, 10:44:15 AM
Sorry, the current thermometer.php V1.17 does not support imperial/metric switching.
Title: Re: thermometer.php V1.17 from World base - Does it do Imperial/Metric switching?
Post by: mexbound on July 17, 2021, 05:17:14 PM
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

Title: Re: thermometer.php V1.17 from World base - Does it do Imperial/Metric switching?
Post by: saratogaWX on July 17, 2021, 10:48:11 PM
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 :)