WxUSRadars-HAniS Version 3 (20150820) 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 included 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. Version 3 includes /HAniS/hanis_min.js version 2.5 which enables limited smoothing of pixels in images, and allows the user to select the number of images to display. When 'AutoRefresh' is 'ON', the 'Refresh' button is not present in Version 3. -- CAUTION -- Please read this entire document and carefully follow the instructions before you install this package on your website. -- FILE LIST --- Version 20120820 Files Included: i) wxusradars-hanis3.php ii) inc-wxusradars-hanis3.php. iii) wxusradar-hanis-iframe3.php iv) wxusradars-hanis3.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, replacing the previous HAniS Version 2.4 with Version 2.5. If 'hanis.js' is present on your site you may safely delete it. Only '/HAniS/hanis_min.js' is required to run this HAniS-dependent script. -- SETTINGS -- You should edit the Settings in 'wxusradars-hanis3.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 = false; // 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 ############################ New in Version 2 ########################## $pauseSeconds = 2; // Pause on last image, in seconds $animRate = 20; // Frame Rate of animation: 5 is glacial, 10 is slow, 15 is leisurely, 20 is good, and 50 is fast - set with integer $numbImages = 12; // Default number of Radar Images to Animate - 3 to around 25 ############################ New in Version 3 ########################## $smoothingOn = true; // Enable image smoothing - new in HAniS 2.5 /*********************** End Settings ***************************/ These are the defaults for 'wxusradars-hanis3.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-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-hanis2.php' and 'inc-wxusradars-hanis3.php'. As another benefit of this change, editing of 'selected="selected"' is no longer required. The main file, 'wxusradars-hanis3.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. Additionally the scripts each now have the ability to display their source using '?sce=view' in order to assist with debugging. 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-hanis3.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