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.

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.

Latest postings about Saratoga-weather.org Weather PHP scripts on Twitter

follow Saratoga-Weather.org PHP script updates on Twitter

This page was updated Wednesday, 02-Sep-2009 11:31 AM

Weather Display/PHP/AJAX Website Template Set - How they work

Each main webpage (named wx... )in the template set is comprised of a set of included files used by each page, and an area for the unique content for that page. This makes it very easy to change content on all pages in the site by changing one of the common files. The overall structure of the HTML for each page is the original Carterlake template design (which was also used in my AJAXed version) -- all the original style markups have been retained, and this PHP version is compatible with your existing Carterlake CSS files (weather-screen.css, weather-print.css). This template set just modularizes the HTML into common sections for ease of website maintenance and allowing the webmaster to ensure a common look/feel across all pages in the website.

Cautions

With the ease of website maintenance provided by the included-file structure comes a few gotchas you need to keep in mind:

  1. A PHP error on any of the common included pages will make your website unviewable until you fix the error. Those pages are: Settings.php, common.php, top.php, header.php, menubar.php, footer.php and the ajax-gizmo.php. Moral: be careful to use correct PHP syntax when changing any PHP in the common files.
  2. A HTML syntax error in a common file (top.php, header.php, menubar.php ,and footer.php) will probably result in an unexpected appearance of your website pages. Moral: validate any changes using the W3C validator (available via link at the bottom of each page) and correct any HTML errors.
    The template and sample wx... pages all validate as XHTML 1.0-Transitional.
  3. A PHP error or HTML error on any wx... page will affect that page only.
  4. Be sure to edit all the .php pages using a PHP-aware HTML editor (or notepad) .. some editors (like older versions of Microsoft FrontPage) may modify the pages in unexpected ways and produce strange results. Not all editors may be capabible of displaying the local page in WYSIWIG format.
  5. Be sure to upload the PHP files to your website using FTP ASCII mode .. using FTP BINARY mode may cause failures. Most modern HTML editors with FTP built-in have this capability.
  6. As distributed, the template files are expected to be located in the document root of your website and the required subdirectories located below the document root. It is possible to use the templates from a subdirectory if the identical directory substructure is maintained and you continue to have URL and FILE relative addressing consistent (as it is now). You may be required to make additional changes that are not documented in the instructions if you wish to use the templates in a subdirectory.
  7. Make a local backup of your current website site before you start installation, and backup frequently as you work on installation/integration into your website. This is especially important if you have a WD/Carterlake website already and are going to convert to this included-file template .. read the installation information to prevent unwanted overwrites of your existing files.

webpage structure for the wx... pages

Sample page structure

The user-viewable pages in the template set all start with wx followed by a descriptive name. This is to allow both new template users and those upgrading from the original Carterlake/AJAX HTML pages to have a site that can 'coexist' with any existing wxN.html/wxN.php pages while the transition to the new template is in process.

Key files used in the template and present in any viewable page in the site are (in order of use on the viewable page):

Settings.php
This PHP file contains no HTML, only PHP settings for variables that are used to control site appearance and actions of other scripts.
Details on Common Settings in Settings.php | USA specific | Canada specific | World specific
common.php
This PHP file contains functions that may be used on any page in the website.
top.php
This contains initial HTML for the page <doctype>, <html>, <head>, the <meta> tags, the <link> tags for the CSS and favicon, the JavaScript includes for ajaxWDwx.js and optionally the ajaxgizmo.js for gizmo rotation display, and sets the <title> for the page. The closing </head> and starting <body> statements are on the individual viewable website page so that you can add unique <head></head> items on a per-page basis if you wish. Very useful for scripts that require a CSS inclusion just for that page.
header.php
This PHP file includes all the HTML necessary to start the <body> section of the page, and the heading of the website. This includes the <div id="header"> and <div class="subheader"> areas, and will optionally include the ajax-gizmo.php for rotating conditions display (controlled by the $showGizmo = true; in the main page)..
ajax-gizmo.php
This PHP uses the weather conditions variables in testtags.php to format a current conditions set of displays which are then revealed one-at-a-time by the ajaxgizmo.js JavaScript. The conditions are also updated dynamically via AJAX using ajaxWDwx.js JavaScript. Make sure the ajaxWDwx.js script is configured to find your clientraw.txt and for the desired units (English or Metric).
menubar.php
This PHP file includes the content for <div class="leftSideBar"> for the navigation links and any other content you'd like to include in the left sidebar area. Since the menu is generated dynamically, a change in page links here is reflected throughout the website -- this make it very easy to add a page/change a page name/remove a page from your website. You can change the HTML below the menu to include extra content below the navigation menu (but still in the LeftSideBar area). See the menubar.php configuration page.
footer.php
This PHP file includes the <div id="footer"> content for display at the bottom of each page on the site. It also includes the closing </body> and </html> statements. You can place content here that can be displayed in the footer area and/or at the bottom of the content area on each page in the site.

The Canada-ML and World-ML (multilanguage) distributions have additional documentation here.

Continued on the download and installation page.

deformed-offering