----- To configure alert.php 1. Set $display = "yes" or "no" - this tells the script if you want to display any messages alert or default. 2. Set $sound = "yes" or "no" - this tells the script if you want the alert tones to be played when a watch/warning has been issued. 3. $my_file = "summary.txt" - this tells the script what file to use that contains the watch/warning text (default is summary.txt). 4. $default_string="...." - this is what you want displayed when there are no watches or warnings issued. You can leave it null ("") if you dont want to display any "clear weather" bulletins. You may also change any of the font or text attributes (color, size etc.). NOTE: If you change the text size be sure to change the frame height (discussed below) or the text may not be completely displayed (too big for the frame). The default color for this text is "green". 5. $statement_string="...." - this is what you want displayed when a weather statement has been issued. Follow the same instructions as $default_string above. The default color for this text is "blue". 6. $advisory_string="...." - this is what you want displayed when a weather advisory has been issued. Follow the same instructions as $default_string above. The default color for this text is "amber". 7. $watch_string="...." - this is what you want displayed when a watch has been issued. Follow the same instructions as $default_string above. The default color for this text is "yellow". 8. $warning_string="...." - this is what you want displayed when a warning has been issued. Follow the same instructions as $default_string above. The default color for this text is "red". 9. $table="...." - for browsers that do not support transparent frames this defines the attributes for the table that will be created instead. Follow standard HTML table configuration settings. This is where you might need to change the height value of the table, if you change the font size of your display strings (you will probably need to change this by trial and error until you find a frame size suitable to fit the font size). Change the bgcolor value to match your background color or add a background image to match the image this frame will be covering. NOTE: If you add a " (quote mark) inside the string it must first be proceeded with a \ (slash mark) for the script to work correctly. 10. Make sure your default "good weather" text does not contain the words watch, warning, advisory or outlook. Having any of these words in the default text will cause the script to set the string and color to the word it finds. For instance if your default text says something like "At the current time there are no watches, warnings or advisories" you will need to change your Instawarn configuration to create a default text to be something without those words like "There are no active weather alerts at this time" or something similar. End of setup for alert.php Adding the script to your page: Copy the file you just completed modifying (alert.php) to your server in the same directory as your summary.txt file. Copy and paste the following code into your webpage at the location where you want the alert banner:
Change src="http://mypage/alert.php" to match the path to the alert.php file on your server. NOTE: If you changed the height or width for the table in the php file be sure to set the height and width settings to the same values in this code. Copy the alert.wav file attached to this e-mail to your server. Your modifications are complete, you should now have dynamically modifying text shown in the browser's status area on your page that will change depending upon the current weather bulletins in the summary.txt file. NEW - NEW - NEW To have the banner re-check the summary.txt file and update the warning messages without requiring the user to refresh the page all you need to do is add the following lines between the and statements in the PHP file: In the first line "content=" is the number of seconds to wait until it reloads, but you probably already know that. The value is set for 1 minute (60 seconds) and you can change it to whatever you want. When the timer hits the set time the PHP script will re-run, check the summary.txt file again and refresh the warning banner automatically without user intervention. For any suggestions, comments, help or gripes please e-mail me with the subject: alert php script. Thank you, Ken As always use this script and webpage change at your own risk, absolutely no warrantees are expressed or implied as to the operation of or capability of this code to function in any given circumstance. Any problems or ramifications which might arise from the use of this code are entirely the responsibility of the user.