deformed-offering

Free Weather Website Templates

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

Many of these scripts are now available on GitHub at https://github.com/ktrue

Buy Me A Coffee If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.

This page was updated Friday, 23-Oct-2009 3:40 PM

Weather Display/PHP/AJAX Website Template Set - FAQ

The following may be helpful for you if you're encountering issues with installation or operation of the WD/PHP/AJAX template set. This FAQ is derived from questions/answers on the Weather-Display Forum thread.

Q1: What Weather-Display files need to be uploaded for my Carterlake/PHP/AJAX website?
Q2: My template shows some funny characters like '' in various pages. How can I fix that?
Q3: My wxastronomy.php page is showing bad dates for Solar/Lunar events. How can I fix that?
Q4: The wxtrends.php page shows a hodge-podge of dates on my trends. How can I fix that?
Q5: I like just one of the Themes and would like to lock it in for my site. How do I do that?
Q6: My webpage looks strange or no thermometer image is showing. How do I fix that?
Q7: My Canada wxindex.php and wxradar.php are slow to load. How can I fix that?
Q8: My World-ML template doesn't show translations. How can I fix that?
Q9: How can I have WDL and MML switch languages in my World-ML template?
Q10: What cache files are used with the templates?
Q11: What AJAX tags are available in ajaxWDwx.js?

Q1: What Weather-Display files need to be uploaded for my Carterlake/PHP/AJAX website?

A1: From a WD perspective, these are the files that need to be uploaded regularly by WD to make the templates work with AJAX (as distributed):

  • testtags.txt uploaded via WD custom webpage setup to testtags.php
  • clientraw.txt (by the clientrawrealtimeftp)

Graphics: (used in wxgraphs.php)

  • curr24hourgraph.gif
  • curr72hourgraph.gif
  • monthtodate.gif

Graphics: (used in wxtrends.php page)

  • dirplot.gif

Graphics: (used in wxastronomy.php .. these are optional and will be shown if present)

  • moonicon.gif
  • moondetail1.gif
  • moondetail2.gif

To have the 'feels like' word appear on the dashboard, you'll need to enable the creation of conditionscolourword.gif and set the WD "Upload a small gizmo" to active so that %heatcolourword% will be evaluated in WD. Otherwise it will show as '---' underneath the big temperature display in the ajax-dashboard on the wxindex.php page.

Make sure that file#1 in Customise Internet and File Creation has an upload schedule, this will ensure that the "Time of Next Update" will have a valid value and will not return an PHP Notice: error.

Q2: My template shows some funny characters like '' in various pages. How can I fix that?

A2: This is most likely caused by uploading the .php, .html, .txt files in FTP BINARY mode. In Binary mode, the text files may contain a unicode marker at the start of the file, which will be removed if uploaded in FTP ASCII mode.

All the files in the template set (except for the graphics [*.jpg, *.gif, *.png]) should be uploaded with FTP ASCII mode. The graphics files need to be uploaded in FTP BINARY mode.

Q3: My wxastronomy.php page is showing bad dates for Solar/Lunar events. How can I fix that?

A3: You may need to replace your wxastronomy.php page from a more recent distribution. It includes code that allows the WD solar/lunar dates to be in languages other than English. You can include in your Settings.php the lookup table for the month names in your language like this:

$SITE['monthNames'] = array(  // Danish for wxastronomy page .. replace with month names in your language
 'januar','februar','marts','april','mai','juni',
 'juli','august','september','october','november','december'
 );

Hint: the exact names of the months can be copied from the language-LL.js files for the specific language you run your weather PC (the one that runs Weather-Display). Just substitute your language abbreviation for the LL in the filename above. Example: for Polish, use language-pl.js as the source.

Q4: The wxtrends.php page shows a hodge-podge of dates on my trends. How can I fix that?

A4: Make the appropriate configuration to your Settings.php file:

$SITE['WDdateMDY'] = true; // for WD date format of month/day/year.  =false for day/month/year
$SITE['timeOnlyFormat'] = 'g:ia';  // USA format h:mm[am|pm\ or 'H:i' for Euro format
$SITE['dateOnlyFormat'] = 'd-M-Y'; // for 31-Mar-2008 or 'd/m/Y' for Euro format

If your WD uploads dates in the format of month/day/year (USA) then set $SITE['WDdateMDY'] = true;
if your WD uploads dates in the format of day/month/year (World) then set $SITE['WDdateMDY'] = false;

Q5: I like just one of the Themes and would like to lock it in for my site. How do I do that?

A5: Use the Theme Switcher on your website to pick the color scheme and width (narrow or wide) you like best. Note the name of the weather-screen-[color]-[width].css file that is used (like weather-screen-blue-narrow.css) and copy that value into the Settings.php file for $SITE['CSSscreen'] = 'weather-screen-blue-narrow.css'; (assuming you'd picked the Blue, Narrow look).
Then change $SITE['allowThemeSwitch'] = false; to turn off the Theme Switcher. Folks will see only the theme you picked.
You can always set $SITE['allowThemeSwitch'] = true; to reenable the Theme Switcher.

Q6: My webpage looks strange or no thermometer image is showing. How do I fix that?

A6: Make sure you edit your website with a PHP-aware editor (or use Windows Notepad). Some older HTML editors insist on inserting HTML code where you may not want it. Also be sure to upload the .php, .txt, .html pages with FTP ASCII mode to prevent the funny unicode marker characters.
Make sure that on key common pages like Settings.php, common.php, top.php and thermometer.php that the very first 5 characters in the file are <?php with no spaces or blank lines in front of that, otherwise you may get a PHP "Warning: unable to write header" message.

Q7: My Canada wxindex.php and wxradar.php are slow to load. How can I fix that?

Both the wxindex.php and the wxradar.php pages in the Canada template set use the ec-radar.php script to download and cache the HTML and images from the EC website. Sometimes, that's a slow process for your webserver and it can lead to delays in loading your page while the images are being cached.

My suggestion is to have WD 'preload' the cache for you so your visitors won't have to normally wait so long when visiting those pages. To have WD do this:

  1. On the WD main screen, open Control Panel, FTP&Connections, HTTP Download TAB.
  2. Select Setup #1, #2 or #3 (whichever is unused).
  3. Press 'Download every 5 minutes'
  4. In URL of file to download, type 'http://your.website.com/wxradar.php" and press Add to list
  5. in URL of file to download, type 'http://your.website.com/wxindex.php" and press Add to list
  6. Put Tick marks next to the two file names in the URL box.
  7. in Local filename to use type 'canada-index.htm' and press Add to list (local file name)
  8. in Local filename to use type 'canada-radar.htm' and press Add to list (local file name)
  9. Turn on the "Downloads On" switch, press Test, Save and OK

Q8: My World-ML template doesn't show translations. How can I fix that?

A8: This can be caused by either of two things:

  1. Make sure your Weather-Display is running in English. The World-ML translation functions won't work unless the WD language is in English. Also make sure your ajaxWDwx.js language area is in English.
  2. Make sure you've installed the 4 files associated with each language in the same directory as your Settings.php:
    • language-LL.txt
    • language-LL.js
    • plaintext-parser-lang-LL.txt
    • wxabout-LL.html
    where LL is the abbreviation for a supported language. Download and install a language pack from the install page if needed.

Q9: How can I have WDL and MML switch languages with my World-ML template?

A9: This solution was created by Jozef of http://www.joske-online.be/, and we thank him for inventing and sharing this method!

WDL and WD-AJAX-PHP-World-ML (a perfect wedding)

First thing to do: configure wdlconfig.xml to your needs.
See if WDL is looking the way you want.

Done ??

Now the easy part:
open wdlconfig.xml with your favorite text-editor
between <language></language> put english and save the file as wdlconfig-en.xml
between <language></language> put danish and save the file as wdlconfig-dk.xml
between <language></language> put dutch and save the file as wdlconfig-nl.xml
between <language></language> put finnish and save the file as wdlconfig-fi.xml
between <language></language> put greek and save the file as wdlconfig-el.xml
between <language></language> put italian and save the file as wdlconfig-it.xml
between <language></language> put norwegian and save the file as wdlconfig-no.xml
between <language></language> put spanish and save the file as wdlconfig-es.xml
between <language></language> put swedish and save the file as wdlconfig-se.xml
..and now
open wxlive.php from the WD-AJAX-PHP-World-ML package
find
var pathToConfig = "http://yourdomainhere/wdlconfig.xml";
and change it to
var pathToConfig = "http://yourdomainhere/wdlconfig-<?php echo $SITE['lang']?>.xml";

Upload all the files where they belong, and .....watch the magic

PS.You have to take care the var pathToConfig points to the right place.
If you have an error telling you, you have the wrong serial number, take another look at the file-names.
They MUST be like wdlconfig-xx.xml.

Jozef

You can do exactly the same for your MML, but...greek is not available, so I used english between the tags and save as mmlconfig-el.xml

Q10: What cache files are used with the templates?

A10: The support scripts supplied with the template sets use cache files to store information from websites to speed up the responsiveness of your site and reduce the load on the data source websites. The specific files vary by template so pick your set based on which template you have implemented.
Each of the files listed for your template set must be writable by PHP. Some PHP implementations do not allow files to be created by PHP, so you will have to create a blank files with notepad using the names shown below and upload once to your website. Make sure the permissions on the files are set to 666 so they are writable by PHP.

  • WD-USA template
    • forecast.txt used by advforecast2.php for NOAA forecast
    • uv-forecast.txt used by get-UV-forecast-inc.php for UV forecast from www.temis.nl
    • rss-advisory-ssZnnn.txt used by rss-advisory.php and/or rss-top-warning.php - ssZnnn is replaced by your primary NOAA warning zone in the filename (for PHP4)
    • atom-advisory-ssZnnn.txt used by atom-advisory.php and/or atom-top-warning.php - ssZnnn is replaced by your primary NOAA warning zone in the filename (for PHP5)
    • quakesUSA.txt used by quake-USA.php script for USGS earthquake data
    • radar-status.txt used by radar-status.php for NEXRAD radar radar status
  • WD-Canada, WD-Canada-ML templates
    • ec-forecast-en.txt, ec-forecast-fr.txt used by ec-forecast.php to store forecast information from Environment Canada website in English and French
    • ec-radar-en.txt, ec-radar-fr.txt used by ec-radar.php to store radar information from Environment Canada in English and French. Script also uses files in /radar/ to cache radar images so make sure that directory is writable by PHP.
    • uv-forecast.txt used by get-UV-forecast-inc.php for UV forecast from www.temis.nl
    • quakesCanada-en.txt, quakesCanada-fr.txt used by quake-Canada.php script for seismescanada.rncan.gc.ca earthquake data in English and French
  • WD-World Template
    • WU-forecast.txt used to store forecast information from WeatherUnderground
    • uv-forecast.txt used by get-UV-forecast-inc.php for UV forecast from www.temis.nl
    • meteoalarm-en.txt used by get-meteoalarm-warning.php for European weather alerts
    • quakesWORLD.txt used by quake-WORLD.php for USGS earthquake data
    • quakesUK.txt used by quake-UK.php for earthquake information from www.earthquakes.bgs.ac.uk
  • WD-World-ML Template
    • WU-forecast-LL.txt used to store forecast information from WeatherUnderground. Note: LL is replaced with language code (same as ones listed in $SITE['langavail'] in Settings.php)
    • uv-forecast.txt used by get-UV-forecast-inc.php for UV forecast from www.temis.nl
    • meteoalarm-LL.txt used by get-meteoalarm-warning.php for European weather alerts. Note: LL is replaced with language code (same as ones listed in $SITE['langavail'] in Settings.php)
    • quakesWORLD.txt used by quake-WORLD.php for USGS earthquake data
    • quakesUK.txt used by quake-UK.php for earthquake information from www.earthquakes.bgs.ac.uk
  • Other scripts using cache files that are not included with the templates
    • NDBC-buoydataE.txt, NDBC-buoydataM.txt used by buoy-data.php script to store buoy data in English and Metric units from the NDBC

Q11: What AJAX tags are available in ajaxWDwx.js?

A11:This listing is available for download here, and reproduced below.

Current AJAX tag list for ajaxWDwx.js (Version 2.19 - 03-Jul-2009) 

These tag names can appear ONCE per HTML page (otherwise only the first instance on the page will be updated).

Tags should be of format  <span class="ajax" id="..."></span> with the '...' in the id= attribute replaced by
the tagname shown below.  Only <span> tags can be used for this.  Make sure you don't overlap any <span></span>
tags or the results will we unpredictable.

Tagname  : function/variable
----------------Temperature / Humidity --------------------------
ajaxtemp  :  outside temperature
ajaxtempNoU : outside temperature (no units)
ajaxbigtemp : outside temperature with no decimal point
gizmotemp : outside temperature for use in ajax-gizmo.php
ajaxtemparrow : outside temperature trend arrow (rising/falling)
gizmotemparrow : outside temperature trend arrow (rising/falling) for use in ajax-gizmo.php
ajaxtemprate : temperature rate (+/-)/hour
gizmotemprate : temperature rate (+/-)/hour for use in ajax-gizmo.php
ajaxtempmin : minimum temperature for the day
ajaxtempmax : maximum temperature for the day
ajaxthermometer : image file for thermometer.php to display current/min/max temperature graphic

ajaxhumidity : current outside humidity in percent
gizmohumidity : current outside humidity in percent for use in ajax-gizmo.php

ajaxdew : current dew point
gizmodew : current dew point for use in ajax-gizmo.php
ajaxdewmin : minimum dew point for the day
ajaxdewmax : maximum dew point for the day

ajaxhumidex : current humidex
ajaxhumidexmin : minimum humidex for the day
ajaxhumidexmax : maximum humidex for the day

ajaxwindchill : current windchill
ajaxwindchillmin : minimum windchill for the day
ajaxwindchillmax : maximum windchill for the day

ajaxheatidx : current heat index
ajaxheatidxmin : minimum heat index for the day
ajaxheatidxmax : maximum heat index for the day

ajaxfeelslike : the current 'feels like' temperature (windchill, temperature, or humidex
                based on current temperature.
				
ajaxheatcolorword : displays color-coded word describing the temperature and how it feels

ajaxapparenttemp : current apparent temperature
ajaxapparenttempmin : minimum apparent temp for the day
ajaxapparenttempmax : maximum apparent temp for the day

---------------- pressure -----------------------------------
ajaxbaro : current pressure
gizmobaro : current pressure for use in ajax-gizmo.php
ajaxbaroNoU : current pressure with no units
ajaxbarotrend : current pressure trend (+/-)
gizmobarotrend : current pressure trend (+/-) for use in ajax-gizmo.php
ajaxbaroarrow : <img> of rising/falling for barotrend
ajaxbarotrendtext : text (Falling rapidly, Falling Slowly, Steady, Rising Slowly, Rising Rapidly)
gizmobarotrendtext : text (Falling rapidly, Falling Slowly, Steady, Rising Slowly, Rising Rapidly) for use in ajax-gizmo.php
ajaxbaromin : minimum pressure for the day
ajaxbaromax : maximum pressure for the day

---------------- wind    -----------------------------------

ajaxwind : current wind speed (or 'Calm' if wind < 0.1 )
gizmowind : current wind speed (or 'Calm' if wind < 0.1 ) for use with ajax-gizmo.php
ajaxwinduom : display units if wind > 0.1 else hide units
ajaxwindNoU : current wind speed (or 'Calm' if wind < 0.1 ) with no units
ajaxwinddir : current wind direction (or blank if wind < 0.1 and gust < 0.1)
gizmowinddir : current wind direction (or blank if wind < 0.1 and gust < 0.1) for use with ajax-gizmo.php
ajaxwindicon : <img> for wind direction (or "" if wind < 0.1 and gust < 0.1 )
gizmowindicon : <img> for wind direction icon in ajax-gizmo.php
ajaxwindiconwr : <img> for wind direction windrose (or calm image if wind < 0.1 and gust < 0.1 )
ajaxbeaufort : Beaufort Scale text for current wind ('Calm' .. 'Hurricane')
ajaxgust : current gust speed (or 'None' if gust < 0.1)
gizmogust : current gust speed (or 'None' if gust < 0.1) for use with ajax-gizmo.php
ajaxgustuom : display units if wind > 0.1 else hide units
ajaxmaxgust : max gust speed for the last 10 minutes
ajaxwindmaxavg : maximum average wind speed for the day
ajaxwindmaxgust : maximum wind gust for the day
ajaxwindmaxgusttime : time of the maximum wind gust for the day

---------------- Solar/UV    -----------------------------------

ajaxsolar : solar w/m2 (for Davis VP+)
ajaxsolarpct : solar percent of max solar for time/lat/long.(for Davis VP+)

ajaxuv : uv index (for Davis VP+)
gizmouv : uv index (for Davis VP+) for use with ajax-gizmo.php
ajaxuvword : "none" or formatted string about current uv index intensity
gizmouvword : "none" or formatted string about current uv index intensity for use with ajax-gizmo.php

---------------- Rain    -----------------------------------

ajaxrain : rain today 
gizmorain : rain today for use with ajax-gizmo.php 
ajaxrainNoU : rain today with no units
ajaxrainydy : rain yesterday
ajaxrainmo : rain for this month
ajaxrainyr : rain for this year
ajaxrainratehr : current rain rate /hour
ajaxrainratemax : maximum rain rate / hour for today
---------------- Date/Time    -----------------------------------

ajaxdatetime : formatted mm/dd/yyyy hh:mm:ss[am|pm]
ajaxdate : formatted as mm/dd/yyyy
ajaxtime : formatted as hh:mm:ss[am|pm]
gizmodate : formatted as mm/dd/yyyy  for use with ajax-gizmo.php
gizmotime : formatted as hh:mm:ss[am|pm]  for use with ajax-gizmo.php
ajaxndate : formatted as Mon DD, YYYY
ajaxndate2 : formatted as dd-Mon-YYYY
ajaxntime : formatted as HH:MM
ajaxntimess : formatted as HH:MM:SS
ajaxtday : 3 letter Abr of Day  as in Wed
ajaxdname : name of current day as in Wednesday

---------------- Miscellaneous -----------------------------------

ajaxindicator : will flash text enclosed in <span class="ajax" id="ajaxindicator"></span> with flashcolor
	every time the ajaxLoader script is run (even if no conditions have changed).  
	Used as a 'I'm getting the data' indicator.
gizmoindicator: same as ajaxindicator but for use in ajax-gizmo.php
	
ajaxconditionicon : <img> of WD current condition icon from imagedir (small image file)
ajaxconditionicon2 : <img> of WD current condition (large image file)

ajaxcurrentcond : text description .. %weathercond% %Currentsolardescription% with \s replaced by comma
gizmocurrentcond : text description .. %weathercond% %Currentsolardescription% with \s replaced by comma for use in ajax-gizmo.php

ajaxcloudheight : current estimate of cloud height based on temp / humidity / pressure	

 

deformed-offering