Author Topic: UPDATED: Script to Display US and Territories Radar Using HAniS  (Read 19653 times)

0 Members and 1 Guest are viewing this topic.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
This script has been substantially rewritten.  Therefore the old thread has been closed.  The contents of the new 'wxusradars-hanis.txt' readme file is as follows:

This project derives from my GRLevel3 HAniS scripts, and follows the same outlines. It was made possible because of Tom Whittaker's excellent javascript 'HAniS' HTML5 Animation Script which he has so kindly shared with all.

-- CAUTION --
Please read this entire document and carefully follow the instructions before you install this package on your website.

-- FILE LIST ---
Version 20120812 Files Included:
  i)    wxusradars-hanis.php
  ii)   inc-wxusradars-hanis.php.
  iii)   wxusradar-hanis-iframe.php
  iv)      wxusradars-hanis.txt (this file)
  v)      phptest.php
  vi)      /HAniS/hanis_min.js
  vii)   radar-status-getradar.php

The /HAniS directory should be copied to your site's root, if it isn't already present. If it is already present on your site you may safely delete 'hanis.js' from there. Only '/HAniS/hanis_min.js' is required to run this HAniS-dependent script.

-- SETTINGS --
You should edit the Settings in 'wxusradars-hanis.php'. If you want to hide the Auto Refresh capabilities of the script, set '$autoRefresn = false'. When 'autoRefresh = false' the manual 'Refresh' button must be used to refresh the radar display.

The 'autoRefreshOff' Setting determines the default AutoRefresh Setting, 'ON' or 'OFF'.  Turning the default AutoRefresh 'OFF' by Setting '$autoRefreshOff = true;' prevents casual users from loading the page and forgetting it while AutoRefresh is 'ON'.

Settings now include:
/************************* Settings *****************************/
$radar = 'N0R'; // Default radar type is set here
$radarLoc = 'oax'; // IMPORTAMT!!! Default radar location is set here
$imageWidth = 600; // Width of radar images
$iframeWidth = 617; // Default IFrame Width -- adjust as needed
$iframeHeight = 620; // Default IFrame Height -- adjust as needed
$autoRefresh = true; // Use Autorefresh? true or false -- Determines whether AutoRefresh even appears
$autoRefreshTime = 8; // Number of minutes between autorefreshes.  IMPORTANT: use 2, 3, 4, 5, 6, 8, 10, 15, 20, or 30 ONLY!!!
$autoRefreshOff = true; // Begin with Autorefresh Off? true or false -- 'OFF' or 'ON"
$bgndColor = 'silver'; // Set HAniS Background Color Here
$btnColor = 'mediumblue'; // Set Button Color here
$btnTextColor = 'white'; // Set Button Text Color here
/*********************** End Settings ***************************/
These are the defaults for 'wxusradars-hanis.php'.

Change '$radarLoc' to your preferred WFO, and edit anything else to your liking.  You shouldn't need to touch '$imageWidth', '$iframeWidth, or '$iframeHeight'.

When changing any of the '$bgndColor', '$btnColor', or '$btnTextColor' variables only HTML Color Names are passed to 'wxusradar-hanis-iframe.php'. Therefore hex colors, e.g. #0000CC, will show up on the first row of buttons, but not the second. Another option would be to use RGB colors. The legal color names are listed at http://www.w3schools.com/html/html_colornames.asp

The '$autoRefreshTime' allows users to increase the frequency of AutoRefreshes when their radar of interest is updating more frequently because of local weather activity. The longest interval between NWS Ridge Radar updates is 10 minutes, but longer intervals may be selected when the weather is uneventful.  The NWS states that a 4 minute Ridge Radar update is the minimum, but I have observed updates just a minute apart on the Legend.

-- INSTALLATION --
After reviewing and changing the Settings, upload all five scripts to your site along with the /HAniS directory, and add 'wxusradars-hanis.php' to your site's menu. If your site has 'wxusradars-select-hanis.php', you may delete it.  The functionality of this file has been added to 'inc-wxusradars-hanis.php'. As another benefit of this change, editing of 'selected="selected"' is no longer required.

The main file, 'wxusradars-hanis.php', now includes a Stand-Alone option with '$standalone = false' as the default for Saratoga template use.  When '$standalone = true' the script runs outside the Saratoga template.  You could save a script thus modified as 'wxusradars-hanis-SA.php' or some such.

All of the selectors use the same button color options as HAniS and are the same color as the radar control buttons.  The AutoRefresh and Refresh Interval selectors are found inline with the other selectors above the radar location and type.  This was necessary because during a (auto)refresh the entire 'inc-wxradars-hanis.php' must be reloaded so the correct variable parameters are active in order to avoid browser caching of directories.

-- LIMITATIONS --
The included 'phptest.php' will, when run, list all of the important Settings of your webhost's PHP, including PHP version and most importantly whether 'allow_url_fopen' is 'on'.  If it is 'off', the script will fail because it will be unable to get the directory file listings from 'http://radar.weather.gov/ridge' due to strict javascript cross-domain limitations. If 'allow_url_fopen' is 'off', the static map, county, highway, river, and city overlays will show up and be selectable, but no dynamic radar, warnings, or legend layers will appear. You will just see a static map.

If you encounter this condition, you or your webhost's administrators will need to edit your site's 'php.ini' to read 'allow_url_fopen = on'. While running your site with 'allow_url_fopen' 'on' represents a slightly greater security risk, unless your site's users enter their sensitive information such as credit card or social security numbers, this risk should be minimal.  This script contains no user input, so risks from it should be nil.  You should evaluate the remainder of scripts on your web site to determine if they present a significant risk with 'allow_url_fopen' 'on'.

An alternative approach to turning 'allow_url_fopen' 'on' would be to forego AutoRefresh by Setting 'autoRefresh = false;' thus turning off the display of any AutoRefresh options. Then where another site has 'allow_url_fopen' 'on' you would need to point your <iframe> at that site's 'wxusradar-hanis-iframe.php' in 'inc-wxusradars-hanis.php' by changing 'src="./wxusradar-hanis-iframe.php' to, for example, 'src="http://www.gwwilkins/wxusradar-hanis-iframe.php'. Refreshing the radar display could then be done manually by clicking the 'Refresh' button.

AutoRefreshOff will be turned 'OFF' any time a different radar site, radar type, or refresh interval is selected necessitating the user turn it back on. If it were to remain 'ON' subsequent AutoRefreshes would become unreliable.

-- CACHE --
The 'radar-status-getradar.php' is a modification of Ken True's 'radar-status.php' script for a single radar site.  The modified 'radar-status-getradar.php' adds multi-site capabilities to the 'radar-status.php' script.  One side-effect of the multi-site script is that your site's cache directory, as determined by the 'radar-status-getradar.php' $cacheFileDir = './cache/';' entry, will now contain a status file for each radar site loaded by 'wxusradars-hanis.php'.  Periodic housecleaning of your cache directory of these files is optional, especially if your site has limited disk space.

-- ENHANCEMENT --
Prior versions did not display the most recent radar image of the selected site. Version 20150812 now displays the most recent radar image.


Please post any problems, questions, or suggestions to this thread.

Edit 14 August 2015:  An enhanced version with identical functionality but greater flexibility is posted below.

Edit 18 August 2015:  Please see this post regarding the restoration of Ajax-Gizmo functionality.

Edit 20 August 2015:  Version 3 of this script is now available.  It adds HAniS 2.5's ability to smooth images at the pixel level, which shows up at extreme Zoom levels in this script.  Version 3 also adds a selector for the number of images to display, removes the 'Refresh' button when auto-refresh is enabled, and defaults to 'AutoRefresh' 'ON'.  Ajax-Gizmo functionality has been restored thanks to Ken True.  Plesae see the included 'wxusradars-hanis3.txt' file for additional information.

Edit 25 August 2015:  Version 3c2 of this script incorporated  a small change in 'wxusradar-iframe-hanis3.php' to use the Button Color on the toggle buttons.  Tom Whittaker added this to Hanis 2.6 released today.  If changing versions upload all of the scripts after preserving customizations in 'wxusradars-hanis3.php'.  Be sure to update '/HAniS/hanis_min.js' to the latest version.

Edit 26 August 2015:  Version 3c3 corrects typos that prevented proper navigation between radar types.

Edit 5 March 2016:  See below for later version.

Edit 22 February 2017:  The latest version, V5 (20170222) is attached to this thread.
« Last Edit: February 22, 2017, 06:55:44 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline Skyview

  • Forecaster
  • *****
  • Posts: 404
  • Former Aviation Weather Observer
    • Fuquay Varina Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #1 on: August 12, 2015, 02:30:48 PM »
Thanks for providing this. Since it will run standalone I'm going to give it a look and hopefully integrate it to my site.
« Last Edit: August 12, 2015, 02:35:24 PM by Skyview »

Offline n9mfk9

  • Contributor
  • ***
  • Posts: 112
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #2 on: August 12, 2015, 03:53:25 PM »
Hi Jerry,

http://n9mfk.info/cumulus/wxusradars-hanis.php
l have a questions
 what is rock I see I have a choice of  loop or rock but both move?

thanks Beau

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #3 on: August 12, 2015, 04:25:14 PM »
Hi Jerry,

http://n9mfk.info/cumulus/wxusradars-hanis.php
l have a questions
 what is rock I see I have a choice of  loop or rock but both move?

thanks Beau
Good question!

Click on 'Rock' and the images display up to the last active image then display in reverse order down to the first active image, then display up to the last active one, etc.  Clicking on the blue square for an image causes it to turn red as it is inactivated.  Inactive images aren't displayed.  Rocking makes the most sense if you have just a few adjacent active images. 'Rocking' would proceed up and back through those images, and if necessary you could zoom in on a particular location of interest. Of course you can 'Pause' the animation at any time.

These controls are best used with the AutoRefresh button set to 'OFF' because all such customization of image viewing will be lost on a Refresh.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
UPDATED AGAIN: Script to Display US and Territories Radar Using HAniS
« Reply #4 on: August 13, 2015, 01:47:20 PM »
Sorry guys, but this script has undergone another revision to Version 2 (20150813). In a nutshell, Version 2 provides 3 new settings: one for image display frame rate, one for the number of images to display, and one for the seconds to pause after the last image.  The functionality is otherwise identical to Version 20150812.

Here is the new 'wxusradars-hanis2.txt' ReadMe file:

WxUSRadars-HAniS Version 2 (20150813)

This project derives from my GRLevel3 HAniS scripts, and follows the same outlines. It was made possible because of Tom Whittaker's excellent javascript 'HAniS' HTML5 Animation Script which he has so kindly shared with all. Version 2 includes three new variables which control the image frame rate, number of images to display, and the length of pause after the last image has displayed.

-- CAUTION --
Please read this entire document and carefully follow the instructions before you install this package on your website.

-- FILE LIST ---
Version 20120812 Files Included:
  i)    wxusradars-hanis2.php
  ii)   inc-wxusradars-hanis2.php.
  iii)   wxusradar-hanis-iframe2.php
  iv)      wxusradars-hanis2.txt (this file)
  v)      phptest.php
  vi)      /HAniS/hanis_min.js
  vii)   radar-status-getradar.php

The /HAniS directory should be copied to your site's root, if it isn't already present. If it is already present on your site you may safely delete 'hanis.js' from there. Only '/HAniS/hanis_min.js' is required to run this HAniS-dependent script.

-- SETTINGS --
You should edit the Settings in 'wxusradars-hanis2.php'. If you want to hide the Auto Refresh capabilities of the script, set '$autoRefresn = false'. When 'autoRefresh = false' the manual 'Refresh' button must be used to refresh the radar display.

The 'autoRefreshOff' Setting determines the default AutoRefresh Setting, 'ON' or 'OFF'.  Turning the default AutoRefresh 'OFF' by Setting '$autoRefreshOff = true;' prevents casual users from loading the page and forgetting it while AutoRefresh is 'ON'.

Settings now include:
/************************* Settings *****************************/
$radar = 'N0R'; // Default radar type is set here
$radarLoc = 'oax'; // IMPORTAMT!!! Default radar location is set here
$imageWidth = 600; // Width of radar images
$iframeWidth = 617; // Default IFrame Width -- adjust as needed
$iframeHeight = 620; // Default IFrame Height -- adjust as needed
$autoRefresh = true; // Use Autorefresh? true or false -- Determines whether AutoRefresh even appears
$autoRefreshTime = 8; // Number of minutes between autorefreshes.  IMPORTANT: use 2, 3, 4, 5, 6, 8, 10, 15, 20, or 30 ONLY!!!
$autoRefreshOff = true; // Begin with Autorefresh Off? true or false -- 'OFF' or 'ON"
$bgndColor = 'silver'; // Set HAniS Background Color Here
$btnColor = 'mediumblue'; // Set Button Color here
$btnTextColor = 'white'; // Set Button Text Color here
$pauseSeconds = 2; // Pause on last image, in seconds - 0 for no pause
$animRate = 20; // Frame Rate of animation: see below
$numbImages = 12; // Number of Radar Images to Animate - 3 to around 25
/*********************** End Settings ***************************/
These are the defaults for 'wxusradars-hanis2.php'.

Change '$radarLoc' to your preferred WFO, and edit anything else to your liking.  You shouldn't need to touch '$imageWidth', '$iframeWidth, or '$iframeHeight'.

When changing any of the '$bgndColor', '$btnColor', or '$btnTextColor' variables only HTML Color Names are passed to 'wxusradar-hanis-iframe2.php'. Therefore hex colors, e.g. #0000CC, will show up on the first row of buttons, but not the second. Another option would be to use RGB colors. The legal color names are listed at http://www.w3schools.com/html/html_colornames.asp

The '$autoRefreshTime' allows users to increase the frequency of AutoRefreshes when their radar of interest is updating more frequently because of local weather activity. The longest interval between NWS Ridge Radar updates is 10 minutes, but longer intervals may be selected when the weather is uneventful.  The NWS states that a 4 minute Ridge Radar update is the minimum, but I have observed updates just a minute apart on the Legend.

The $pauseSeconds variable indicates the number of seconds to pause after the latest image has been displayed.

The $animRate variable controls the animation frame rate which requires integers only, and the values' results are: 5 is glacial, 10 is slow, 15 is leisurely, 20 is good, and 50 is fast - set with an integer only.

The $numbImages variable displays the number of images to display.

-- INSTALLATION --
After reviewing and changing the Settings, upload all five scripts to your site along with the /HAniS directory, and add 'wxusradars-hanis2.php' to your site's menu. If your site has 'wxusradars-select-hanis.php', you may delete it.  The functionality of this file has been added to 'inc-wxusradars-hanis2.php'. As another benefit of this change, editing of 'selected="selected"' is no longer required.

The main file, 'wxusradars-hanis2.php', now includes a Stand-Alone option with '$standalone = false' as the default for Saratoga template use.  When '$standalone = true' the script runs outside the Saratoga template.  You could save a script thus modified as 'wxusradars-hanis-SA.php' or some such.

All of the selectors use the same button color options as HAniS and are the same color as the radar control buttons.  The AutoRefresh and Refresh Interval selectors are found inline with the other selectors above the radar location and type.  This was necessary because during a (auto)refresh the entire 'inc-wxradars-hanis2.php' must be reloaded so the correct variable parameters are active in order to avoid browser caching of directories.

-- LIMITATIONS --
The included 'phptest.php' will, when run, list all of the important Settings of your webhost's PHP, including PHP version and most importantly whether 'allow_url_fopen' is 'on'.  If it is 'off', the script will fail because it will be unable to get the directory file listings from 'http://radar.weather.gov/ridge' due to strict javascript cross-domain limitations. If 'allow_url_fopen' is 'off', the static map, county, highway, river, and city overlays will show up and be selectable, but no dynamic radar, warnings, or legend layers will appear. You will just see a static map.

If you encounter this condition, you or your webhost's administrators will need to edit your site's 'php.ini' to read 'allow_url_fopen = on'. While running your site with 'allow_url_fopen' 'on' represents a slightly greater security risk, unless your site's users enter their sensitive information such as credit card or social security numbers, this risk should be minimal.  This script contains no user input, so risks from it should be nil.  You should evaluate the remainder of scripts on your web site to determine if they present a significant risk with 'allow_url_fopen' 'on'.

An alternative approach to turning 'allow_url_fopen' 'on' would be to forego AutoRefresh by Setting 'autoRefresh = false;' thus turning off the display of any AutoRefresh options. Then where another site has 'allow_url_fopen' 'on' you would need to point your <iframe> at that site's 'wxusradar-hanis-iframe2.php' in 'inc-wxusradars-hanis2.php' by changing 'src="./wxusradar-hanis-iframe2.php' to, for example, 'src="http://www.gwwilkins/wxusradar-hanis-iframe2.php'. Refreshing the radar display could then be done manually by clicking the 'Refresh' button. The possibility that someone is pointing to '(another.site)/wxusradars-hanis-iframe.php' necessitates the creation of Version 2.

AutoRefreshOff will be turned 'OFF' any time a different radar site, radar type, or refresh interval is selected necessitating the user turn it back on. If it were to remain 'ON' subsequent AutoRefreshes would become unreliable.

-- CACHE --
The 'radar-status-getradar.php' is a modification of Ken True's 'radar-status.php' script for a single radar site.  The modified 'radar-status-getradar.php' adds multi-site capabilities to the 'radar-status.php' script.  One side-effect of the multi-site script is that your site's cache directory, as determined by the 'radar-status-getradar.php' $cacheFileDir = './cache/';' entry, will now contain a status file for each radar site loaded by 'wxusradars-hanis2.php'.  Periodic housecleaning of your cache directory of these files is optional, especially if your site has limited disk space.

-- ENHANCEMENT --
Prior unnumbered versions did not display the most recent radar image of the selected site. Version 1 (20150812) and Version 2 (20150813) now display the most recent radar image.

-- USAGES --
Running 'wxusradars-hanis2.php' as a part of a Saratoga template menu system is the standard use of this script. The '$standAlone' option which is isolated near the top of 'wxusradars-hanis2.php' when set to 'true' provides some interesting possibiilities. For instance, a version of 'wxusradars-hanis2.php' with '$standAlone = true', 'numbImages = 5', '$animRate = 15', and '$pauseSeconds = 0' could be saved as 'wxusradars-hanis2-slow5.php'.  You could then view as a stand-alone the last 5 images of any radar at a slower speed in which case 'Rock' becomes much more useful without suppressing the display of some images. Or if there's some particularly intense weather somewhere you wish to see the development, a version with '$standAlone = true' and 'numbImages = 25' could be saved as 'wxusradars-hanis2-past25.php'.

Or alternatively you could save these or similarly modified scripts with '$standAlone = false' and add them to your menu system. I prefer the cleaner Stand Alone versions that help conserve bandwidth by not loading the Saratoga template. You have many choices.



The zip is attached here, and not to the first post.

Edit 15 August 2015:  I forgot to remove '/HAniS/hanis.js' from this zip.  Feel free to delete it from your site because it's just taking up disk space.

Edit 18 August 2015:  Please see this post regarding the restoration of Ajax-Gizmo functionality.
« Last Edit: August 18, 2015, 06:45:03 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Online ValentineWeather

  • Forecaster
  • *****
  • Posts: 5122
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #5 on: August 15, 2015, 12:46:48 AM »
Jerry have it going, I found  ‘allow_url_fopen’ was ‘off’ in my site’s php.ini like you suspected. Turned on and all is good. Thank you very much for all the time you put in helping figure out my problem, great script.  =D&gt;
Randy

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #6 on: August 15, 2015, 07:52:43 AM »
That's great news, Randy.  :-) Thanks to you for helping sort out the 'allow_url_fopen' issue by putting several '-test' versions up on your site.  Remember that Version 2 is available above if you ever feel the need for more control over HAniS than the defaults in Version 1 (20150812).

(As an aside, the reason 'allow_url_fopen' needs to be 'on' is to read into memory using php's 'file_get_contents()' the dynamic overlay 'http://radar.weather.gov/ridge' Image, Warning, and Legend directory contents.  Without this only the static overlays which never change are displayed by the 'inc-wxusradars-hanis.php' or 'inc-wxusradars-hanis2.php' 'src="./wxusradar-hanis-iframe.php' or 'src="./wxusradar-hanis-iframe2.php'.  Additionally, security issues absolutely prevent javascript execution in a different domain than the original one, so running 'wxusradar-hanis-iframe' or '-iframe2' on another site prevents any AutoRefresh, which uses jQuery and javascript, from occurring.)

(As another aside, I forgot to delete '/HAniS/hanis.js' before I zipped up Version 2 (20150813) above.  Rather than post yet another version, feel free to delete this unnecessary file from your site. It's just taking up disk space.)
« Last Edit: August 15, 2015, 07:58:25 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1153
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #7 on: August 15, 2015, 01:19:45 PM »
(As another aside, I forgot to delete '/HAniS/hanis.js' before I zipped up Version 2 (20150813) above.  Rather than post yet another version, feel free to delete this unnecessary file from your site. It's just taking up disk space.)

Unless one is running your gr3hanis as well, or has it been removed from there, too?
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #8 on: August 15, 2015, 01:39:48 PM »
(As another aside, I forgot to delete '/HAniS/hanis.js' before I zipped up Version 2 (20150813) above.  Rather than post yet another version, feel free to delete this unnecessary file from your site. It's just taking up disk space.)

Unless one is running your gr3hanis as well, or has it been removed from there, too?
'/HAniS/hanis.js' isn't used in either script, John, because their <iframe> codes point to '/HAniS/hanis_min.js' :-)
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1153
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #9 on: August 15, 2015, 01:44:41 PM »
Thanks, Jerry. Just dumped it.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline n9mfk9

  • Contributor
  • ***
  • Posts: 112
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #10 on: August 15, 2015, 01:46:55 PM »
Hi Jerry,
i was just look at some pages that are html5 in ken's code i had these two lines added
Code: [Select]

require_once("Settings.php");
require_once("common.php");
############################################################################
$useHTML5 = true;  // force this page to use HTML5 instead of XHTML 1.0-Transitional
$useUTF8 = true;   // force this page to convert language files to UTF8 for display
#

also where wxusalerts.php come from i not in the zip?


Beau

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #11 on: August 15, 2015, 07:21:53 PM »
Hi Jerry,
i was just look at some pages that are html5 in ken's code i had these two lines added
Code: [Select]

require_once("Settings.php");
require_once("common.php");
############################################################################
$useHTML5 = true;  // force this page to use HTML5 instead of XHTML 1.0-Transitional
$useUTF8 = true;   // force this page to convert language files to UTF8 for display
#

The purpose of this script is to dispense with the Flash display of GRLevel3 images.  My intent is not to create an HTML5 compliant script.  When you add those two lines, validation fails in a number of places.  Maybe someday...

Quote
also where wxusalerts.php come from i not in the zip?


Beau

Read this post carefully, and if you install the script modify the 'include("footer-invalid.php");' to 'include("footer.php");' unless you create a footer without the W3C Validator links. In the absence of 'wxusalerts.php' the 'wxgr3hanis.php' link should display the main NWS page, www.weather.gov, which consists of the alerts map. The 'wxusalerts' script was created from this map and just scrapes it for Saratoga template display.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 209
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #12 on: August 17, 2015, 01:27:14 PM »
Jerry, I'm using wxusradar-hanis2-20150813.zip and I'm having one problem.  When I try to select a different radar site from the drop-down menu, the new site doesn't load.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 209
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #13 on: August 17, 2015, 01:37:36 PM »
Further on my last, while all of the buttons seem to respond, nothing in the frame changes.  The only change I've made is to the directory location of the entire package.  I'm using root/Hanis3.
« Last Edit: August 17, 2015, 02:12:44 PM by tmabell »

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #14 on: August 17, 2015, 02:21:12 PM »
Further on my last, while all of the buttons seem to respond, nothing in the frame changes.  The only change I've made is to the directory location of the entire package.  I'm using root/Hanis3.
The package isn't set up to run from a subdirectory, Tom.  You need to modify the scripts to reflect the change, or run it from the site's root.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 209
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #15 on: August 17, 2015, 02:27:42 PM »
I thought I did : :? but I must have missed something that causes the buttons to work!

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 209
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #16 on: August 17, 2015, 03:26:22 PM »
OK I reverted back to installing it in root/Hanis but still have that issue.

*EDIT*  My mistake (which comes as no surprise) this goes in the root not root+Hanis as the Gr3 scripts do.  It's working now.  Thank you!
« Last Edit: August 17, 2015, 03:30:34 PM by tmabell »

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1153
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #17 on: August 18, 2015, 02:40:22 PM »
Thought I'd bug you over here, Jerry. Takes your mind off the other problem (maybe).

Stan and I are having the same problem with the gizmo on our Ridge pages. Only "Updated" and the time flash green (the time is actually updating). Nothing else is displaying or, of course, updating.
Both pages validate OK.

http://dwayneyamato.com/wx/wxusradars-hanis2.php
http://tiggrweather.net/wxusradars-hanis2.php

Thanks.
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #18 on: August 18, 2015, 04:24:15 PM »
I see now that's a universal problem with my HAniS-based scripts, John.  There's something about them that's prevents the variable rotation from displaying in the ajax-gizmo.  'Inspect'ing in Chrome I see that all of the variables are created normally.  It's just that the style of display is 'none' for all of them (see attachment).

I'm not sure why this is occurring, but if it bothers you enough you can always set '$showGizmo = false;' in 'wxusradars-hanis.php' or 'wxusradars-hanis2.php'.  I've done a quick web search for similar problems, and I've come up empty.  There are references to AJAX calls shutting off jQuery, but not vice versa.  I'll keep my eyes open for a solution.
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6727
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #19 on: August 18, 2015, 05:38:27 PM »
On both http://dwayneyamato.com/wx/wxusradars-hanis2.php and http://tiggrweather.net/wxusradars-hanis2.php
the ajaxgizmo.js script is not loaded, so the conditions will NOT rotate or display.  The ajax-gizmo.php generates the HTML with style="display:none;" defaults for all the <span class="ajaxcontentn">...</span> entries and relies on the ajax-gizmo.js to find the one entry, change it to 'display: block', then back to 'display:none' so each entry is "revealed" in turn.

If the ajaxgizmo.js script is not loaded, none of the gizmo entries will display (as you are seeing).  It's normally loaded by top.php based on $showGizmo = true; in the page.

If you change the HAnIS page from
Code: [Select]
include("top.php");
$showGizmo = true; // Set to false to exclude the gizmo
to
Code: [Select]
$showGizmo = true; // Set to false to exclude the gizmo
include("top.php");
then it will likely work as expected :)
« Last Edit: August 18, 2015, 05:45:29 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Online ValentineWeather

  • Forecaster
  • *****
  • Posts: 5122
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #20 on: August 18, 2015, 06:05:36 PM »
Yes that worked , Thanks much Ken.  =D&gt;
Randy

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #21 on: August 18, 2015, 06:13:40 PM »
Perfect, Ken. Thanks! =D&gt;

The Master to the rescue again!
« Last Edit: August 18, 2015, 06:23:09 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline jgillett

  • Forecaster
  • *****
  • Posts: 1153
  • unnamed weather station, Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #22 on: August 18, 2015, 07:03:09 PM »
Nailed it, Ken - as always.

Thanks very much :!:   :grin:
John
W7JKG
BUY FROM AMAZON  HERE... Thank You! :-)

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1979
    • SouthEast Lincoln, NE Weather
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #23 on: August 20, 2015, 09:04:12 AM »
Version 3 of this script is now available.  It adds HAniS 2.5's ability to smooth images at the pixel level, which shows up at extreme Zoom levels in this script.  Version 3 also adds a selector for the number of images to display, removes the 'Refresh' button when auto-refresh is enabled, and defaults to 'AutoRefresh' 'ON'.

Plesae see the included 'wxusradars-hanis3.txt' file for additional information.

Edit 2015 August 20:  The original zip contained references to my test version which I forgot to update when I saved it as a production version.   :oops: The attached version is the correct one.  Modified files are 'wxusradars-hanis3.php' and 'inc-wxusradars-hanis3.php'

Edit2 2015 August 20:  The button alignment scheme in 'inc-wxusradars-hanis3.php' was flawed.  The attached 'inc-wxusradars-hanis3a.php' contains ONLY a revised include file that addresses this problem.

Edit3 2015 August 20:  The timer values in 'inc-wxusradars-hanis3a.php' were used for testing, and refresh much more frequently than the indicated times.  'inc-wxusradars-hanis3b.zip' contains the proper timer settings.
« Last Edit: August 25, 2015, 02:34:11 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Online ValentineWeather

  • Forecaster
  • *****
  • Posts: 5122
Re: UPDATED: Script to Display US and Territories Radar Using HAniS
« Reply #24 on: August 20, 2015, 10:13:14 AM »
Thanks Jerry works great on my end.
Randy