Help Please with new site using Carterlake/AJax/PHP scripts

Hi everyone, I am a new forum member and also new to the hobby. I purchased my first computer in the 70’s and adding Weather to list of interests seemed natural. I have a Vantage Pro2 Plus and have downloaded and installed the PHP templates from Ken’s excellent site. I still have much to do before my site is fully functional but it’s getting closer every day.

http://www.seasonsweather.com

My immediate concern is the display of current data. Although WD is uploading testtags.php correctly (with temperature in oF, pressure in in., wind speed in MPH), everything is displaying in metric. I have triple checked Setup.php and the settings all seem to be correct. It has to be something I have missed. If anyone has a suggestion, it would be much appreciated.

Thanks much,
Wendell

in ajaxWDwx.js

change

var useunits = 'M'; // 'E'=USA(English) or 'M'=Metric

to

var useunits = 'E'; // 'E'=USA(English) or 'M'=Metric

Jozef

Thanks Jozef,

That code did need to be changed, but it still did not correct the problem. Below is the section of code from ajaxWDwx.js , do you see anything else which might need changing?

var flashcolor = ‘#00CC00’; // color to flash for changed observations RGB
var flashtime = 2000; // miliseconds to keep flash color on (2000 = 2 seconds);
var reloadTime = 5000; // reload AJAX conditions every 5 seconds (= 5000 ms)
var maxupdates = 0; // Maxium Number of updates allowed (set to zero for unlimited)
// maxupdates * reloadTime / 1000 = number of seconds to update
var clientrawFile = ‘/clientraw.txt’; // location of clientraw.txt relative to this page on website
var ajaxLoaderInBody = false; // set to true if you have <body onload=“ajaxLoader(…”
var imagedir = ‘./ajax-images’; // place for wind arrows, rising/falling arrows, etc.
var useunits = ‘E’; // ‘E’=USA(English) or ‘M’=Metric
var useKnots = false; // set to true to use wind speed in Knots (otherwise
// wind in km/hr for Metric or mph for English will be used.
var useMPS = false; // set to true for meters/second for metric wind speeds, false= km/h
var useMPH = false; // set to true to force MPH for both English and Metric units
var useFeet = false; // set to true to force Feet for height in both English and Metric
var showUnits = true; // set to false if no units are to be displayed
var thermometer = ‘./thermometer.php’; // script for dynamic thermometer PNG image (optional)
// optional settings for the Wind Rose graphic in ajaxwindiconwr as wrName + winddir + wrType
var wrName = ‘wr-’; // first part of the graphic filename (followed by winddir to complete it)
var wrType = ‘.png’; // extension of the graphic filename
var wrHeight = ‘58’; // windrose graphic height=
var wrWidth = ‘58’; // windrose graphic width=
var wrCalm = ‘wr-calm.png’; // set to full name of graphic for calm display (‘wr-calm.gif’)
// – end of settings -------------------------------------------------------------------------

I have noticed that if I click on HOME which reloades index.php, the correct units are displayed for a few seconds and then it again changes to Metric. It usually changes even before an update is received.

Again, all suggestions are appreciated.

Wendell

Check this section in Settings.php maybe.

###########################################################################

ajax-dashboard, ajax-sidebar settings (will override defaults in

the scripts themselves when included in this site

###########################################################################
$SITE[‘uomTemp’] = ‘°F’;
$SITE[‘uomBaro’] = ’ inHg’;
$SITE[‘uomWind’] = ’ mph’;
$SITE[‘uomRain’] = ’ in’;
$SITE[‘uomPerHour’] = ‘/hr’;

Your posted code above looks the same as mine.

–Dave

Thanks Dave,

Yeah, I checked the settings.php file first, and it is just like what you posted. I did miss the changes in ajaxWDwx.js which Jozef pointed out. I really though the change in the .js file would solve the problem, but it didn’t.

I appreciate your effort and suggestion. If you have any others they would be welcome.

Thanks,
Wendell

Thanks to all who helped. Suddenly the units are displaying correctly. It must have been the change in ajaxWDwx.js suggested by Jozef. I just don’t understand why it took 3 hours before displaying correctly. Possible my browser cache was not cleared?

Wendell

If you change a JavaScript and the page doesn’t have in the section the

	<meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />

(which the template doesn’t have by default), then it’s likely that a ‘shift-reload’ would be needed to refresh the browser cached version of the JavaScript.

Glad it all worked out for you :slight_smile:

I’ve added your site to the list of WD/AJAX/PHP template sites.

Best regards,
Ken