Rain Detail addon page for WD-AJAX-PHP-USA template.
This script is intended to be an addon to the existing WD-AJAX-PHP-USA package. It includes two files:
wxraindetail.php wxraindetail.css
Requirements to use these scripts:
`
o You need to be uploading the dailynoaareport*.htm files via WD to your website.
Current month file is named dailynoaareport.htm
Other months are named dailynoaareportMMYYYY.htm. Note that the
months are not padded so that Jan would simply be like
dailynoaareport12009.htm with no zero padding for the month.
Note that there was a change in format in 2007 that will require updating reports from that time before
so they can be parsed correctly.
To recreate use View → Avg Ext/Noaa Reports → 2nd Tab for Noaa Style Reports.
Select which date you want to recreate in the Select Date to Calculate Field.
Then copy and paste the results into a new file (use notepad or some other editor)
and save the file as mentioned above.
o Need to know where they are located (default normally would be in the web root)
o PHP5`
Settings:
There are some settings that you can make to the script in the settins section:
$SITE[‘viewscr’] = ‘sce’;
Defines the password for the view source command. Default is sce.
$year = “2009”;
Defines which default year to display
$loc = “./”;
Defines where the dailynoaareport*.htm files are located. The above assumes they are in the same level as the script itself.
$season_start = 7;
Defines when the season starts. 1 = Jan, 7 = July
$years_available = array(“2009”,“2008”,“2007”);
Allows you to define which years to allow to show in the drop down selector. To add a year, just add it with "'s around it like you see in the example. If you have less years, then you can remove entries.
Usage:
Basically, you should be able to download the script and associated CSS file, make the settings changes to the settings and it should display when used.
You can pass it an argument like: http://YourWebSite/wxraindetail.php?view=sce
To view the source of the script.
You can also call it with a year=XXXX value to have it use that year for locating and displaying the data.
The script includes a drop down that allows the visitor to select which year to display based upon your settings for the $years_available
array.
Arguments are protected against XSS injection.
Adding to the Template Menu
Instructions need to be added.
History:
`# 2009-03-15 1.0 Inital Release
2009-03-15 1.1 Fixed data parsing in getnoaafile function
2009-03-16 1.2 Corrected form to use PHP Self for action
2009-09-05 1.3 Replaced split with preg_split
2009-09-06 2.0 Replaced collection to fix season logic - Fixed Month day 1 error`
Support:
Support for this script is done via posting an open message to the Weather-Watch forums. Please don’t PM or send email about it.
Download:
Scripts are available on the TNET Weather-Display Project Page
See attachment as well as some have problems unziping the other file
Scripts should be XHTML and CSS complaint.
wxraindetail-2.0.zip (4.51 KB)