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.

This page was updated Sunday, 09-Mar-2014 4:42 PM

PHP/AJAX Website Template Set - Settings.php - Base-World

The configuration for Settings.php discussed here is for the Base-World Specific template set.

<?php
############################################################################
# Sitewide configuration - website style and features
############################################################################

$SITE['CSSscreen']        = 'weather-screen-blue-narrow.css'// Default screen 800px design
//   Note: $SITE['CSSscreen'] will be overridden if the Theme Switch (below) is enabled.
//   To lock your site to use only one CSS as specified in $SITE['CSSscreen'], just
//   turn off the Theme Switcher.
$SITE['CSSprint']        = 'weather-print-php.css';
#
#$SITE['CSSscreen']        = 'weather-screen.css'; // Classic design
#$SITE['CSSprint']        = 'weather-print.css';

# Mike Challis' Theme Switch configuration
$SITE['allowThemeSwitch']   = true;  // set to false to disable the use of Theme Switcher 
$SITE['CSSscreenDefault'] = 'weather-screen-blue.css'// leave -narrow or -wide off this .. just change color here
$SITE['CSSwideOrNarrowDefault'] = 'narrow'// 'narrow' or 'wide'
# CSSsettings_mode
# sets allowable user style select options:
# 1 user can select style and screen width (show style select and screen width select)
# 2 user can select styles only (hide screen width select)
# 3 user can select screen width only (hide style select)
$SITE['CSSsettings_mode'] = 1;  // set to 1, 2 or 3

$SITE['flyoutmenu'] = true// set to false to use the menu list inside menubar.php instead

$SITE['charset']        = 'ISO-8859-1'// default character set for webpages (iso-8859-1=latin)
#
# Multilanguage support 
#
$SITE['lang'] = 'en';                // default language for website to use
$SITE['allowLanguageSelect'] = true// set to false to disable the use of language selector
$SITE['useLanguageFlags'] = true;    // true=show flags, false=show language 2-char abbreviations
$SITE['languageSelectDropdown'] = true// true=show dropdown list for languages, false=show linear flags list
$SITE['languageSelectButton'] = false;  // true=show 'Set' button for language select, false=use onchange to submit
$SITE['langavail'] = array('en',     // select languages to offer here.  Use comments to remove languages
// array('en', should be first entry on line above
  
'af',  // afrikaans
  
'bg',  // bulgarian
//  'ct', // 'catalan',
  
'dk'// 'danish',
  
'nl'// 'dutch',
  
'fi'// 'finnish',
  
'fr'// 'french',
//  'ga', // 'irish',
  
'de'// 'german',
  
'el'// 'greek',
  
'he'// 'hebrew',
  
'hu'// 'hungarian',
  
'it'// 'italian',
  
'no'// 'norwegian',
  
'pl'// 'polish',
  
'pt'// 'portuguese',
  
'ro'// 'romanian',
  
'es'// 'spanish',
  
'se'// 'swedish',
);
// if your software uploads almanac dates using a language OTHER THAN English, please put the month
// names in your language to replace the English ones below.  This is used primarily by the
// wxastronomy.php page for the local dates of moon phases, solistices, and equinoxes
$SITE['monthNames'] = array(  // for wxastronomy page .. replace with month names in your language 
'January','February','March','April','May','June',
'July','August','September','October','November','December'
);
// example:
//$SITE['monthNames'] = array(  // Danish for wxastronomy page .. replace with month names in your language
//'januar','februar','marts','april','maj','juni',
//'juli','august','september','oktober','november','december'
//);

############################################################################
# Sitewide configuration - Station location, identity and date/time info
############################################################################

$SITE['organ']            = 'World Multilingual Website with PHP &amp; AJAX';
$SITE['copyr']            = '&copy; ' date("Y",time()) . ', Your Weather Website';
$SITE['location']       = 'Somewhere, Some Country';
$SITE['email']            = 'mailto:somebody@somemail.org';
# Station location: latitude, longitude, cityname
$SITE['latitude']        = '37.27153397';    //North=positive, South=negative decimal degrees
$SITE['longitude']        = '-122.02274323';  //East=positive, West=negative decimal degrees
$SITE['cityname']        = 'Saratoga';

$SITE['tz']             = 'America/Los_Angeles'//NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.
//  http://us.php.net/manual/en/timezones.php  has the list of timezone names
//  pick the one that is closest to your location and put in $SITE['tz'] like:
//    $SITE['tz'] = 'America/Los_Angeles';  // or
//    $SITE['tz'] = 'Europe/Brussels';
// note: date format used for PHP parts only.  Weather software dates are not processed
// except on the astronomy page
// $SITE['timeFormat'] = 'D, d-M-Y g:ia T';  // Day, 31-Mar-2006 6:35pm Tz  (USA Style)
// $SITE['timeFormat'] = 'm/d/Y g:ia';      // USA  format 03/31/2006 14:03
$SITE['timeFormat'] = 'd/m/Y H:i';       // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

// $SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd/m/Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format


############################################################################
# Sitewide configuration - support scripts configuration
############################################################################

###########################################################################
# These values should reflect the units-of-measure your weather station
# uses to report the weather data when processing weather tags.
# Note: if you change them here, make sure to make the corresponding
#   changes in the ajax[WXname]wx.js AJAX script also.
###########################################################################
// world Settings 
$SITE['WDdateMDY'] = false// for weather software date format of month/day/year.  =false for day/month/year
$SITE['uomTemp'] = '&deg;C';  // ='&deg;C', ='&deg;F'
$SITE['uomBaro'] = ' hPa';    // =' hPa', =' mb', =' inHg'
$SITE['uomWind'] = ' km/h';   // =' km/h', =' kts', =' m/s', =' mph'
$SITE['uomRain'] = ' mm';     // =' mm', =' in'
$SITE['uomSnow'] = ' cm';     // =' cm', =' in'
$SITE['uomDistance'] = ' km';  // or ' miles' -- used for Wind Run display
$SITE['uomPerHour'] = '/hr';
//
$SITE['imagesDir'] = './ajax-images/';  // directory for ajax-images with trailing slash
// 
$SITE['cacheFileDir']   =  './cache/';   // directory to use for scripts cache files .. use './' for doc.root.dir
// 
$SITE['UVscript']        = 'get-UV-forecast-inc.php'// worldwide forecast script for UV Index
//    comment out above line to exclude UV forecast from dashboard, gizmo and wxuvforecast.php page
//
// if you have WXSIM installed set $SITE['WXSIM'] = true; otherwise set it to false
$SITE['WXSIM']            = true;  // Set to false if you have not installed WXSIM
$SITE['WXSIMscript']     = 'plaintext-parser.php'// script for decoding plaintext.txt into icons
$SITE['defaultlang']    = 'en';   // 'en' for English (WXSIM plaintext-parser.php)

//  fcsturlWU  is used by WeatherUnderground script (WU-forecast.php)
// find the correct URL by going to www.wunderground.com, search for your location and copy the resulting
// URL from your browser location bar into the $SITE['fcsturlWU']  value.
$SITE['fcsturlWU']         = 'http://www.wunderground.com/global/stations/06108.html'// Vamdrup, Denmark
$SITE['fcsticonsdir'] = './forecast/images/'// NOAA-style icons for NWS, WU, WXSIM forecast scripts
$SITE['fcsticonstype']= '.jpg'// default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
// 
// optional multi-city forecasts for WeatherUnderground with WU-forecast V1.26+ ML
// Note: make sure the first entry is the same as your $SITE['fcsturlWU'] contents listed above.
//
//*
$SITE['WUforecasts'] = array(
 
// Location|forecast-URL  (separated by | characters
'Vamdrup|http://www.wunderground.com/global/stations/06108.html'// Vamdrup, Denmark
'Auckland|http://www.wunderground.com/global/stations/93119.html'// Awhitu, Waiuku New Zealand
'Amsterdam|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Amsterdam%2C+Netherlands',
'Paris|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Paris%2C+France',
'Stockholm|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Stockholm%2C+Sweden',
'Oslo|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Oslo%2C+Norway',
'Moscow|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Moscow%2C+Russia',
'Athens|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Athens%2C+Greece',
'Tel Aviv|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Tel+Aviv%2C+Israel',
'Madrid|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Madrid%2C+Spain',
'Helsinki|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Helsinki%2C+Finland',
 
); 
//*/
// in the following section, enable settings for ONE primary forecast organization
// pick which script AND org are to be used for your forecast here: (last uncommented pair will
// be the ones used on the wxforecast.php page and in your dashboard and sidebar

$SITE['fcstscript']    = 'WU-forecast.php';    // Non-USA, Non-Canada Wunderground Forecast Script
$SITE['fcstorg']        = 'WU';    // set to 'WU' for WeatherUnderground

// Uncomment the two lines below to use WXSIM as the ONLY forecast script to use
// $SITE['fcstscript']    = 'plaintext-parser.php';    // WXSIM forecast (if only forecast script)
// $SITE['fcstorg']        = 'WXSIM';    // set to 'WXSIM' for WXSIM forecast

// 
// For Europe only, use the meteoalarm.eu site for your area's watches/warnings on the wxadvisory page
$SITE['EUwarningURL']    = 'http://www.meteoalarm.eu/index3.php?area=DK004&day=0&lang=en_UK';
// EUwarningURL is used by get-meteoalarm-warning-inc.php for EU countries


##########################################################################
# end of configurable settings
##########################################################################
?>

Sitewide configuration - website style and features

 

$SITE['CSSscreen'] = 'weather-screen-blue-narrow.css';
$SITE['CSSprint'] = 'weather-print-php.css';
These settings control which CSS files are to be used for both the screen and print formats.
You may use your own customized version of the Carterlake CSS if you include the unique CSS settings for the ajax-dashboard/ajax-gizmo in your copy of the CSS.
Note: $SITE['CSSscreen'] will be overridden if the Theme Switch (below) is enabled.
To lock your site to use only one CSS as specified in $SITE['CSSscreen'], just turn off the Theme Switcher.
$SITE['allowThemeSwitch'] = true;
This setting controls the use of Mike Challis' Theme Changer. If set to true, then the Theme Changer is enabled and browsers can pick among the color schemes and wide/narrow format.
If set to false, then the Theme Changer is disabled, and the screen style chosen in $SITE['CSSscreen'] is enforced throughout the website.
$SITE['CSSscreenDefault'] = 'weather-screen-orange.css';
$SITE['CSSwideOrNarrowDefault'] = 'narrow';
These settings control the default (first time browsed) look for your website when
$SITE['allowThemeSwitch'] = true; As distributed, the Orange, Narrow screen is the default.
$SITE['CSSscreenDefault'] should be set to 'weather-screen-[color].css' where [color] is
'blue','orange','green','red','teal','silver'
$SITE['CSSwideOrNarrowDefault'] should be set to either 'wide' or 'narrow'
$SITE['flyoutmenu'] = true;
This setting controls the function of the menu system (New with V1.14).
If $SITE['flyoutmenu'] = true; then the flyout-menu system will be used.
If $SITE['flyoutmenu'] = false; then the menubar.php menu system will be used.
$SITE['charset'] = 'ISO-8859-1';
This setting specifies the character set the webpage uses. The default is the Latin set.
$SITE['lang']
This setting controls the default language to be presented from among the choices in $SITE['langavail'].
The default is 'en' (English).
$SITE['allowLanguageSelect']
This setting controls the viewer's ability to change languages.
= true allows the changes,
= false denies the ability to change from the $SITE['lang'] setting below.
$SITE['useLanguageFlags']
This setting controls the display of country flags representing the languages available.
= true shows the flags,
= false will show the two-letter country/language designator instead.
$SITE['languageSelectDropdown'] = true;
This setting controls whether to show the dropdown list for language selection.
= true shows dropdown list for languages
= false shows linear flags list or language name abbreviations based on $SITE['useLanguageFlags'] above.
$SITE['languageSelectButton'] = false;
This setting determines whether to show a 'Set' button for the dropdown language select list.
= true show 'Set' button for language select dropdown list
= false allows the JavaScript 'onchange' event to do a submit when the selection changes in the language dropdown list.
$SITE['langavail']
This setting enables which language translations are to be offered. For each language offered, five files are needed in the website (LL is the language translation identifier):

language-LL.txt - primary translation file
language-LL.js - translation file for the AJAX JavaScript (ajax[WXsftw]wx.js)
ajax-images/flag-LL.gif - flag image for the language
wxabout-LL.html - About page in language LL
plaintext-parser-lang-LL.txt - translation file for the WXSIM forecast (needed if WXSIM is used)

To enable a language, just add the 2-character language code into the array. To remove languages, simply comment out the entry for that language with '//' in the first two columns.
$SITE['monthNames'] = array(
'January','February','March','April','May','June',
'July','August','September','October','November','December'
);
This setting is used by the wxastronomy.php page to parse the lunar/solar dates from Weather-Display.
If your dates on the wxastronomy.php appear correct, there is no need to use this setting.
If the dates are shown in a language other than English, then use this setting to specify the names of the months in your language.
For example, a Danish specification would appear as:
$SITE['monthNames'] = array(
'januar','februar','marts','april','mai','juni',
'juli','august','september','october','november','december'
);

 

 

Sitewide configuration - Station location, identity and date/time

 

$SITE['organ'] = 'World Weather Website with PHP &amp; AJAX';
This specifies the text to use in the Heading area on all pages in the website.
$SITE['copyr'] = '&copy; ' . date("Y",time()) . ', Your Weather Website';
This specifies the Copyright information used in the footer area on all pages in the website. Note that the code shown will automatically display the current year in the copyright notice.
$SITE['location'] = 'Somewhere,Some Country';
This specifies the small subheader on the left of the heading area .. use it to identify your city, state/provence, country.
$SITE['email'] = 'mailto:somebody@somemail.org';
Put the email address you'd like for folks to contact you. This link appears in the footer area on each page.
$SITE['latitude'] = '37.27153397';
$SITE['longitude'] = '-122.02274323';
Set your station location (latitude and longitude) in decimal degrees. Positive numbers for North Latitude and East Longitude. Negative numbers for South Latitude and West Longitude. Sample above is for Saratoga, CA, USA.
$SITE['cityname'] = 'Saratoga';
Set your city/town name here.
$SITE['tz'] = 'America/Los_Angeles';
This setting specifies the time zone for your weather station.
It's very important to get this correctly specified as many webservers don't run with the same local time as your website.
Use http://us.php.net/manual/en/timezones.php for timezone names to use based on your locale.
Pick the one that is closest to your location and put in $SITE['tz'] like:
$SITE['tz'] = 'Pacific/Auckland'; or
$SITE['tz'] = 'Europe/Brussels';
$SITE['timeFormat'] = 'D, d-M-Y g:ia T';
This specifies how to display the long-format date/time on the PHP pages. It is used in a PHP date(); statement to format date/time for display. See the allowed format parameters here.
Use $SITE['timeFormat'] = 'm/d/Y g:ia'; for USA format 03/31/2006 2:03pm
Use $SITE['timeFormat'] = 'd/m/Y H:i'; for Euro format 31/03/2006 14:03
Use $SITE['timeFormat'] = 'Y-m-d H:i'; for ISO format 2006-03-31 14:03
Note: the weather software internal dates on weather variables included via the tags file are NOT processed -- they remain in the format specified with your weather software setup.
$SITE['timeOnlyFormat'] = 'g:ia';
This specifies how time (without date) is to be formatted on the PHP pages.
Use $SITE['timeOnlyFormat'] = 'H:i'; for European 24hr time.
Note: the weather software internal times on weather variables included via the tags are NOT processed -- they remain in the format specified with your weather software setup.
$SITE['dateOnlyFormat'] = 'd-M-Y';
This specifies how date (without time) is to be formatted on the wxtrends.php page.
Note: make sure the $SITE['WDdateMDY'] variable is set correctly otherwise some strange dates will appear on your wxtrends.php page.

 

Sitewide configuration - support scripts configuration

 

$SITE['WDdateMDY'] = false';
This specifies how your weather software is set for internal date format.
Use $SITE['WDdateMDY'] = true'; for weather software internal dates in month/day/year format. (Base-USA)
Use $SITE['WDdateMDY'] = false'; for weather software internal dates in day/month/year format. (Base-Canada, Base-World)
$SITE['uomTemp'] = '&deg;C';
$SITE['uomBaro'] = ' hPa';
$SITE['uomWind'] = ' km/h';
$SITE['uomRain'] = ' mm';
$SITE['uomSnow'] = ' cm';
$SITE['uomDistance'] = ' km';
$SITE['uomPerHour'] = '/hr';
Configure these settings to display the correct text on the ajax-dashboard and ajax-gizmo for your particular units of measure for your website. They should match units with what your weather software uploads in the [WXsftw]tags.php file. These settings are used for the PHP display of the page. The AJAX-enabled contents will overwrite the displays on the dashboard and gizmo with units determined by the ajax[WXsftw]wx.js script settings.
$SITE['imagesDir'] = './ajax-images/';
This specifies the relative FILE location for the images used by the ajax-dashboard, ajax-gizmo and several other scripts in the package. It contains the current conditions icons as well. Weather-Display plugin only: the ajaxWDwx.js script should have the same location specified.
$SITE['cacheFileDir'] = './cache/';
// directory to use for scripts cache files .. use './' for doc.root.dir
$SITE['UVscript'] = 'get-UV-forecast-inc.php';
This variable specifies the script to get the UV forecast for your area. The default setting shown uses your specified latitude and longitude to obtain the UV forecast from KNMI/EMA at www.temis.nl -- this value is used in the ajax-dashboard to display a UV forecast in lieu of a Solar and/or UV sensor on your station.
$SITE['WXSIM'] = true;
$SITE['WXSIMscript'] = 'plaintext-parser.php';
If you have WXSIM operating on your website, this specifies the formatting script to use.
Set $SITE['WXSIM'] = false; if you aren't using WXSIM.
$SITE['defaultlang'] = 'en';
This setting specifies the default language to use for the WXSIM plaintext-parser.php. Please ensure you have the appropriate language plugin file (plaintext-parser-lang-XX.txt) in the same directory as plaintext-parser.php in order to engage this feature. You may also have to change the $SITE['charset'] setting if your language file is not using iso-8859-1 Latin character set.
$SITE['fcsturlWU'] = 'http://www.wunderground.com/global/stations/06108.html';
This setting specifies the Weather Underground URL to use for obtaining your local forecast. It overrides this setting found in the WU-forecast.php script itself.
 
$SITE['fcsticonsdir'] = './forecast/images/';
This specifies the relative FILE location of the icon set used by the forecast scripts ( WU-forecast.php, WXSIM plaintext-parser.php)
$SITE['fcsticonstype'] = '.jpg';
This specifies the file type of the icon set used by the forecast scripts ( WU-forecast.php, WXSIM plaintext-parser.php)
='.jpg'; default - use the NOAA photo-style Saratoga icons.
='.gif'; setting if you have installed the animated forecast icons from www.meteotreviglio.com
$SITE['WUforecasts'] = array(
// Location|forecast-URL (separated by | characters
'Vamdrup|http://www.wunderground.com/global/stations/06108.html', // Vamdrup, Denmark
'Auckland|http://www.wunderground.com/global/stations/93119.html', // Awhitu, Waiuku New Zealand
'Amsterdam|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Amsterdam%2C+Netherlands',
'Paris|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Paris%2C+France',
'Stockholm|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Stockholm%2C+Sweden',
'Oslo|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Oslo%2C+Norway',
'Moscow|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Moscow%2C+Russia',
'Athens|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Athens%2C+Greece',
'Tel Aviv|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Tel+Aviv%2C+Israel',
'Madrid|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Madrid%2C+Spain',
'Helsinki|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Helsinki%2C+Finland',
);

This optional setting allows WU-forecast.php (V1.26+ ML) to offer a selection box on the wxforecast.php page for multiple city forecasts.
Note: make sure the first entry has the same URL as in $SITE['fcsturlWU'].
$SITE['fcstscript'] = 'WU-forecast.php';
$SITE['fcstorg'] = 'WU';
This setting specifies the use of Weather Underground as the forecast source (using the WU-forecast.php script. The forecast icons and text are used by the ajax-dashboard and wxforecast.php page. Optionally, you can use WXSIM for the forecast source by setting
$SITE['fcstscript'] = 'plaintext-parser.php'; and
$SITE['fcstorg'] = 'WXSIM';
This will cause the WXSIM forecast icons to appear in the ajax-dashboard and WXSIM forecast to be used on the wxindex.php and wxforecast.php page.
$SITE['EUwarningURL'] = 'http://www.meteoalarm.eu/index3.php?area=DK004&day=0&lang=en_UK';
This setting is for Europe only. This setting contains the URL to use at the www.meteoalarm.eu site for your area's watches/warnings on the wxadvisory page

In the Base-World template set, you'll notice that the wxradar.php page will need you to add content reflecting your national weather information source. If your site is not in Europe, then you'll need to change the wxadvisory.php page also to use another source for your watch/advisory data.

Don't forget to change the wxabout-LL.html pages for each language you intend to offer on your site. The appropriate page is included by wxabout.php based on the current language selection (LL).

deformed-offering