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 Tuesday, 02-Jan-2024 8:53 AM

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 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 Weather-Display 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 template doesn't show translations. How can I fix that?
Q9: How can I have Weather-Display WDL and WML switch languages in my Canada/World template?
Q10: What cache files are used with the templates?
Q11: Can the nifty Weather-Display alternative dashboards and other WD scripts be used with VWS/Cumulus/WeatherLink?
Q12: My template on altervista.org doesn't show forecasts/alerts. How to fix?
Q13: My template language select doesn't work. How to fix?

Q1: What Weather-Display files need to be uploaded for my 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 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 Weather-Display 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, Settings-weather.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 Weather-Display '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 template doesn't show translations. How can I fix that?

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

  1. Make sure your ajax[WXsftw]wx.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 Weather-Display WDL and WML switch languages with my World template?

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

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 (Base-USA, Base-Canada, Base-World).
The Settings.php $SITE['cacheFileDir'] entry controls where the cache files are to be written. At initial installation, the default is to the ./cache directory.
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.

  • Base-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
    • 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
    • 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
  • Base-Canada template
    • 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
  • Base-World 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 (the buoy-data.php script uses the ./ directory for it's cache files)

Q11: Can the nifty Weather-Display alternative dashboards and other WD scripts be used with VWS/Cumulus/WeatherLink?

A11: The short answer is "probably not". The reason is that Weather-Display offers a host of historical and auxillary data tags used by those scripts/dashboards that are not provided in Cumulus, VWS or WeatherLink, so there's no source of the data used by those alternative dashboards and analysis scripts when using weather software other than Weather-Display. It works both ways.. there are some nice Cumulus scripts from folks that won't work with Weather-Display, VWS or WeatherLink either.

Q12: altervista.org site forecast/alerts not working. How to fix?

A12: By default, all altevista.org websites disallow connections to external websites needed for forecast/alert data.
The fix is fairly simple:

  • logon to the altervista.org control panel for your site.
  • Select Resources
  • Select PHP Settings
  • On "Server to server connections" area
    select "External access without restrictions"
    and click "Save"

Your site should now be able to access the external web resources to be fully functional.
Note: you may have to wait a bit for various cache files to expire to get fresh data.

Q13: My language select doesn't work. How to fix?

A13: The language select feature for Base-Canada and Base-World depends on php having a php.ini setting of 'request_order = "GP"' to propogate $_GET and $_POST queries into the $_REQUEST global. Some PHP hosters do not have that default set.
The fix is fairly simple:

  • follow your hoster's instructions to add the following to your site's php.ini file:
    request_order = "GP"
    or if php.ini change is not allowed:
  • then use the following at the top of Settings.php just after the opening <?php line:
    # shim to replace missing 'request_order = "GP"' in php.ini settings
    if(isset($_SERVER['QUERY_STRING']) ) {
      parse_str($_SERVER['QUERY_STRING'],$Tquery);
      foreach ($Tquery as $key => $val) {$_REQUEST[$key] = $val; }
    }
    

Your site should now allow the language select function to operate correctly.

 

deformed-offering