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.
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
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
Monday, 03-Jul-2023 8:13 PM
PHP/AJAX Website Template Set - Optional Add-on Features
Adding a new page to your site
You can easily add pages with new functions to your template set. The general process is:
- Make a copy of your wxnewpage.php and save it as a new page name.
- Edit the new page and insert the needed HTML/PHP for the content.
- Save and upload the new page to your site.
- Validate the HTML on the new page by viewing on your website using your browser and clicking on the Valid XHTML link at the page bottom.
- Correct any XHTML errors found and repeat steps 3 and 4 until the page is 'clean'
- Add the new file to your menu so it will show on all pages in the site.
For sites NOT using the flyout menu,
Edit the menubar.php and add a new <li><a></a></li> entry to the list. Then upload the menubar.php and the page now appears on your website.
For sites using the flyout menu,
Edit flyout-menu.xml and add the link as a new <item> entry, then upload the flyout-menu.xml to your website. The page should appear as a new link in your flyout menu.
Adding a Buoy page
- Download a copy of the buoy-data.php distribution.
- Configure the buoy-data.php and mybuoy-*.txt file for your area according to the instructions.
- Upload the buoy-data.php, buoy-data-config.txt, the mybuoy-*.txt and *.jpg image file selected.
- Create a new page from a copy of wxnewpage.php as shown above.
- In your new page add
<?php
$doPrintBUOY = false;
include("buoy-data.php");
print $BUOY_CSS;
?>
just before the </head> <body> tags.
- In the <div id="main-copy'> </div> area of the page add
<div id="main-copy">
<h1>Buoy data</h1>
<?php
print $BUOY_MAP;
print $BUOY_TABLE;
?>
</div><!-- end main-copy -->
where you'd like the buoy data map and table to appear.
- Upload your new page, test it, then add it to your menubar.php.
Using your existing Carterlake .css files
You can reuse your existing installed Carterlake weather-screen.css and weather-print.css with this template set if you add in some new CSS to support the ajax-dashboard and ajax-sidebar.
- Open your current weather-screen.css in an editor.
- Add the following near the end of the file:
/* ##### ajaxSidebar ##### */
.ajaxSidebar {
background-color:#FFFFFF;
border: none;
width: 114px;
}
.ajaxSidebar h2 {
font-size: 12pt;
color: #FFFFFF;
background-color: #CC6600;
text-align: center;
margin-right: 6px;
}
.ajaxSidebar .meas {
font : x-small Arial, Helvetica, sans-serif;
color : #000000;
text-align : right;
background-color: #FFFFFF;
width: 35%;
}
.ajaxSidebar .data {
font : 9pt Arial, Helvetica, sans-serif;
color : #0000FF;
text-align : left;
background-color: #FFFFFF;
}
.ajaxSidebar td {
border: none;
background-color: #FFFFFF;
}
.ajaxDashboard {
font-size: 96%;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.ajaxDashboard .datahead {
font-size: 100%;
font-weight: bold;
color: #FFFFFF;
background-color: #CC6600;
text-align: center;
}
.ajaxDashboard .data1 {
color: #000000;
font-size: 100%;
border-bottom: 1px solid #CCCCCC;
background-color: #FFFFFF;
text-align: left;
}
.ajaxDashboard td {
border: none;
background-color: #FFFFFF;
}
- Do the same with weather-print.css.
- Upload weather-screen.css and weather-print.css to your website
- Edit Settings.php to change the CSS settings to read
$SITE['CSSscreen'] = 'weather-screen.css'; // Classic design
$SITE['CSSprint'] = 'weather-print.css';
- Save Settings.php and upload to your website.
Adding a reCAPTCHA contact form to your site
Use the download and instructions at the reCAPTCHA contact form script page to use Google reCAPTCHA to protect a contact form. Download the contact-template version.
Adding the WeatherUnderground History page to your site
Sadly, on 18-May-2019, WeatherUnderground turned off the ability to download the CSV data that the script depended on.
As such, the WU-History script is no longer operating and is discontinued.
Adding a page to display WXGRAPHIC Logos to your site
Download wxlogo.zip and customize the settings area for your WXGraphic installation.
// #######################
// # Begin settings
// #######################
# Town will be printed from Settings.php setting $SITE['location']
# uncomment $town if you want to set town here
#$town = 'Long Beach, WA';
# set weather web site URL here
$web_site = 'http://www.642weather.com/weather/';
# set logo PHP script URL here
$logo_url = 'http://www.642weather.com/weather/wxlogo/logo.php';
// #######################
// # End settings
// #######################
If you haven't already installed WXGraphic, here is how to install the weather graphic script in a very basic way for WD users.
download wxgraphic_6.3.zip from here.
unzip the file wxgraphic_6.3.zip on your computer using folder names option.
edit the file config.txt
change $data_file_path = '/your/path/to/data/file/'; to your relative path to clientraw.txt like
$data_file_path = './clientraw.txt';
upload the folder 'wxgraphic' and everything in it to your web server so it appears as
http://www.yourwebsite.com/wxgraphic/
Note: If you are using PHP 5.6+, you will likely need to add the statement:
default_charset = "ISO-8859-1"
to your php.ini in your document root. PHP5.6+ defaults to an internal character encoding of UTF-8 and will display the °F 'funny' without this setting.
test
http://www.yourwebsite.com/wxgraphic/wxgraphic.php and you should see a default image with your current weather station data.
Once you get it working you can fine tune the other settings and adjustments, refer to the included README.txt in the WXGraphic .zip distribution file.
Thanks to Mike Challis for this sample wxlogo.php and instructions.
Updating Language plugins to templates
The World template has the most current language translation files in the main distribution ZIP file, but you may find it more convenient to simply download the language-LL.zip file to update a single language.
- Download the language-LL.zip file from the install page to your local offline copy of the World-ML website.
- Run WinZip (or other ZIP file program) to unzip the files into the same directory as the wxindex.php page.
- Upload the four unzipped -LL language files to your website.
Map of Affiliated Regional Weather Network Stations
The Affiliated Regional Weather Networks now have collected data from over 1600 members and you can display it on a Google map with clickable markers that pop open with current conditions and links to the personal weather station website and regional networks. Plugins for the V2 and V3 AJAX/PHP templates are available on the scripts page.
CoCoRaHS Map Display
If you are a data contributing member to CoCoRaHS (Community Collaborative Rain, Hail and Snow Network), you can use this add-on page to display your (and your county/parish) data on your site.
Note: this script only works for USA CoCoRaHS stations in the lower 48 states and Alaska (Hawaii uses the new format map :( )
Download: wxcocorahs.zip (Version 1.00 - 10-Jan-2018) and do configuration in wxcocorahs.php page.