|
ctccbc
|
 |
« on: July 02, 2012, 06:28:29 AM » |
|
I've been using the SWSP script for watches, warnings and advisories on my front page for a few weeks. So far, I've never been able to get more than one headline to appear, even when we have multiple headlines in effect. This was a bit troubling last week when we had a "Special Weather Statement", but it was overriden by a "Air Quality Alert". How do I configure the script to show both headlines?
Thanks, Chris moreheadcityweather.com
|
|
|
|
|
Logged
|
|
|
|
|
Gootch
|
 |
« Reply #1 on: July 02, 2012, 08:46:42 AM » |
|
Hi Chris In my SWSP-config.php file I have this setting set to true and my alerts display on seperate lines i dont know if that is what you are looking for but it works for me. This should be set to true line 25 on my file $newLine = true; // true=a new line for each type of alert false=string alerts types Hope that helps Andy I've been using the SWSP script for watches, warnings and advisories on my front page for a few weeks. So far, I've never been able to get more than one headline to appear, even when we have multiple headlines in effect. This was a bit troubling last week when we had a "Special Weather Statement", but it was overriden by a "Air Quality Alert". How do I configure the script to show both headlines?
Thanks, Chris moreheadcityweather.com
|
|
|
|
|
Logged
|
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy. ~Einstein 
|
|
|
|
Curly
|
 |
« Reply #2 on: July 02, 2012, 09:05:53 AM » |
|
That is a limitation of that script. It only shows the top alert in the alert box but it should show all alerts for that location when clicked.
The script gets one alert title for a location on the first page fetch from the NWS and that is from the WFO page with the color coded map with the legend. Looking at the map and the color coded legend, there is only ONE alert for each color. Now the alert box has the alert title for each location and that is 'set in stone' and used in the alert box.
That first WFO page that was already fetched also has the links to all other alerts for that location and then the script fetches the data at each one of those links. At times, the NWS gets bogged down (under various conditions), and downloading that data could take up to several seconds to get one alert. That doesn't seem long but getting multiple alerts could take a minute or so. To put all of the alert titles in the alert box, the page with the alert box would not load until the script finishes processing all of the alerts in that period of time. That would drive most visitors away from that page....
This is why there is one alert title per location.
|
|
|
|
|
Logged
|
|
|
|
|
Gootch
|
 |
« Reply #3 on: July 02, 2012, 11:19:18 AM » |
|
Question for Curly
Hi Curly
I was wondering what code would be used to print a message at the bottom of the alert window that says "Click on county name for more details" or something to that effect.
Thank You Andy
|
|
|
|
|
Logged
|
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy. ~Einstein 
|
|
|
|
Curly
|
 |
« Reply #4 on: July 02, 2012, 01:59:34 PM » |
|
I was wondering what code would be used to print a message at the bottom of the alert window that says "Click on county name for more details" or something to that effect. A mouse-over shows "Click for details". If you want to add the text to the bottom of the alert box, open SWSP-core.php Find the following lines: foreach($sec_alrts as $sak => $sav) { // formatted data string for all alerts $alertBoxText .= $sav; }
Replace those lines with these: foreach($sec_alrts as $sak => $sav) { // formatted data string for all alerts $alertBoxText .= $sav; } $alertBoxText = $alertBoxText . " <br /> Click on county name for more details\n";
Save the file and upload it. The next update will show the change.
|
|
|
|
|
Logged
|
|
|
|
|
Curly
|
 |
« Reply #5 on: July 02, 2012, 05:45:34 PM » |
|
This isn't good.
The NWS changed everything this afternoon and their SWSP doesn't exists at this time. So far the maps are still there! I'm still searching for it.
|
|
|
|
|
Logged
|
|
|
|
|
DaculaWeather
|
 |
« Reply #6 on: July 02, 2012, 06:00:30 PM » |
|
your script appears to still be working for me.
|
|
|
|
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
n3ouc
|
 |
« Reply #7 on: July 02, 2012, 06:08:21 PM » |
|
The maps are there but the text part of the script shows no information found..  Mike
|
|
|
|
|
Logged
|
Mike Stanton Air Products Campus Weather 
|
|
|
|
DaculaWeather
|
 |
« Reply #8 on: July 02, 2012, 06:09:06 PM » |
|
I see my HWO from the script but that's it.
|
|
|
|
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
Curly
|
 |
« Reply #9 on: July 02, 2012, 06:10:17 PM » |
|
Your WFO must have their page intact. If you select another WFO, it's showing no alerts.
|
|
|
|
|
Logged
|
|
|
|
|
DaculaWeather
|
 |
« Reply #10 on: July 02, 2012, 06:10:42 PM » |
|
Yes.
|
|
|
|
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
SoMDWx
|
 |
« Reply #11 on: July 02, 2012, 06:11:39 PM » |
|
Crap! Does this mean the SWSAlerts scripts MUST be changed also?
|
|
|
|
|
Logged
|
|
|
|
|
DaculaWeather
|
 |
« Reply #12 on: July 02, 2012, 06:13:45 PM » |
|
Yes
|
|
|
|
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
Curly
|
 |
« Reply #13 on: July 02, 2012, 06:19:17 PM » |
|
Crap! Does this mean the SWSAlerts scripts MUST be changed also? Found a fix for now!The southern region headquarters still has this data so a line change can fix this. Open SWSP-core.php Find this line: $NWSurl = 'http://forecast.weather.gov'; // NWS URL Replace it with this line: $NWSurl = 'http://www.srh.noaa.gov'; // NWS URL Older versions may have a different URL listed. If you have an older version, Find each instance of this: $NWSurl = 'http:// Replace the entire line with this: $NWSurl = 'http://www.srh.noaa.gov'; // NWS URL
|
|
|
|
« Last Edit: July 02, 2012, 07:04:00 PM by Curly »
|
Logged
|
|
|
|
|
ctccbc
|
 |
« Reply #14 on: July 02, 2012, 07:20:25 PM » |
|
That fixes the actual script, but will it also fix the alert box? Seems like it hasn't changed here. We have a Hazardous Weather Outlook in effect and it doesn't show it.
Thanks, Chris moreheadcityweather.com
|
|
|
|
|
Logged
|
|
|
|
|
DaculaWeather
|
 |
« Reply #15 on: July 02, 2012, 07:24:14 PM » |
|
You da man!  Great job Curly!!!
|
|
|
|
« Last Edit: July 02, 2012, 07:27:59 PM by DaculaWeather »
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
DaculaWeather
|
 |
« Reply #16 on: July 02, 2012, 07:28:55 PM » |
|
I've discovered that the southern Region seems to have much more data like this than the other regions.
|
|
|
|
|
Logged
|
Steve Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP  
|
|
|
|
ctccbc
|
 |
« Reply #17 on: July 02, 2012, 07:33:16 PM » |
|
Nevermind, the Hazardous Weather Outlook just appeared in my alert box! Now to fix the forecast and the marine forecast!
|
|
|
|
|
Logged
|
|
|
|
|
gwwilk
|
 |
« Reply #18 on: July 02, 2012, 07:34:34 PM » |
|
Crap! Does this mean the SWSAlerts scripts MUST be changed also? Found a fix for now!The southern region headquarters still has this data so a line change can fix this. Open SWSP-core.php Find this line: $NWSurl = 'http://forecast.weather.gov'; // NWS URL Replace it with this line: $NWSurl = 'http://www.srh.noaa.gov'; // NWS URL Older versions may have a different URL listed. If you have an older version, Find each instance of this: $NWSurl = 'http:// Replace the entire line with this: $NWSurl = 'http://www.srh.noaa.gov'; // NWS URL I used the NWS Central Region's Data by changing the above line to $NWSurl = 'http://www.crh.noaa.gov'; // NWS URL and the script is working here as well.
|
|
|
|
« Last Edit: July 02, 2012, 07:36:10 PM by gwwilk »
|
Logged
|
|
|
|
|
dasman
|
 |
« Reply #19 on: July 02, 2012, 07:37:03 PM » |
|
The SWSP is working again for me with "NO" fix on my part. It is divine intervention. http://www.peotoneweather.com/niadvisory.php.
|
|
|
|
|
Logged
|
Dave Sommerfed Peotone Illinois USA CW7762, KILPEOT1 NWS COOP, CoCoRaHS, Spotter Network 
|
|
|
|
Curly
|
 |
« Reply #20 on: July 02, 2012, 07:38:33 PM » |
|
They sure are giving us the run around....
Seems to be late for an April Fools joke.
|
|
|
|
|
Logged
|
|
|
|
|
gwwilk
|
 |
« Reply #21 on: July 02, 2012, 07:47:43 PM » |
|
How do we flush the cache with these scripts, Curly?
|
|
|
|
|
Logged
|
|
|
|
|
Curly
|
 |
« Reply #22 on: July 02, 2012, 08:00:44 PM » |
|
How do we flush the cache with these scripts, Curly?
Find the cache folder that is set at $dataFolder in the SWSP-config.php file and then delete the file SWSPdatacache.php in that cache folder.
|
|
|
|
|
Logged
|
|
|
|
|
DougW
|
 |
« Reply #23 on: July 02, 2012, 08:07:37 PM » |
|
Curly, your so good you must have 'scared' your script into working  Doug
|
|
|
|
« Last Edit: July 02, 2012, 08:11:04 PM by DougW »
|
Logged
|
|
|
|
|
|
|