WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: saratogaWX on July 02, 2012, 09:55:55 PM

Title: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 02, 2012, 09:55:55 PM
Whew... testing finished and advforecast2.php V3.03 02-Jul-2012 now supports the revised NWS pages.

For V3 template users .. use the updates page (http://saratoga-weather.org/wxtemplates/updates.php) for Base-USA 02-Jul-2012

For V2 template users and non-template users, the script page (http://saratoga-weather.org/scripts-carterlake.php#advforecast) has the download link.

Best regards,
Ken

ps.. I've locked the other thread so folks won't be confused :)
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 09:59:57 PM
Thanks Ken. I'm glad everyones got theirs up and running. I cant get mine going :-(
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: gwwilk on July 02, 2012, 10:02:46 PM
That was fast work, Ken.  Many thanks! =D> =D> =D>
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:05:26 PM
I've changed the lines but it still displays Saratoga

 $NOAAZone = 'KSZ031';  // change this line to your NOAA warning zone.
// set $fileName to the URL for the point-printable forecast for your area
 $fileName = "http://forecast.weather.gov/MapClick.php?CityName=Hays&state=KS&site=DDC&textField1=38.8866&textField2=-99.298&e=1&TextType=2";//
$iconDir = './forecast/images/';
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$cacheFileDir = './';      // default cache file directory

I dont understand
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cienega32 on July 02, 2012, 10:13:44 PM
I was locked out of the other thread while composing this (short version):

95% perfect for me (v2 templates) - 'Tstrms' is now 'Thunderstorms' which pushes off the page when the forecast has them all thru-out like I do this week.

Thanks Ken for the rapid response! I noticed the problem this morning and just now went to your site and found the update.


Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: McLouthWX on July 02, 2012, 10:15:59 PM
Many thanks for your lightening quick response, Ken. My site is 100% again.

Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:17:55 PM
How you guys do it?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:23:54 PM
How you guys do it?
I don't know. I just copied over my advforecast2.php and everything worked. You sure you didn't change anything in your Settings.php file?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:27:17 PM
How you guys do it?
I don't know. I just copied over my advforecast2.php and everything worked. You sure you didn't change anything in your Settings.php file?

You copied the new advforecast2.php to your server to replace the old one? Any you made these changes to the new one...
 $NOAAZone = 'KSZ031';  // change this line to your NOAA warning zone.
// set $fileName to the URL for the point-printable forecast for your area
 $fileName = "http://forecast.weather.gov/MapClick.php?CityName=Hays&state=KS&site=DDC&textField1=38.8866&textField2=-99.298&e=1&TextType=2";//
$iconDir = './forecast/images/';
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$cacheFileDir = './';      // default cache file directory

Any more changes that I have to do?

Thanks
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 02, 2012, 10:28:53 PM
1st  Ken thanks for your rapid fix =D> \:D/

I have the script up and running.  I did however notice that my page no longer Validates HTML 1.0 transitional.  The error seems to be the way the coding from the script displays in the page it is called from.  I went to your site and you have the same validation issue on yours.  my page is http://www.peotoneweather.com/ (http://www.peotoneweather.com/).  Don't get me wrong...Im happy the way it is (working), I just wanted to let you know incase you didn't already.

Thanks again Ken.  Y0u the MAN.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:29:43 PM
Mine displays this

http://www.hayskansasweather.com/wxforecast.php
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:31:25 PM
How you guys do it?
I don't know. I just copied over my advforecast2.php and everything worked. You sure you didn't change anything in your Settings.php file?

You copied the new advforecast2.php to your server to replace the old one? Any you made these changes to the new one...
 $NOAAZone = 'KSZ031';  // change this line to your NOAA warning zone.
// set $fileName to the URL for the point-printable forecast for your area
 $fileName = "http://forecast.weather.gov/MapClick.php?CityName=Hays&state=KS&site=DDC&textField1=38.8866&textField2=-99.298&e=1&TextType=2";//
$iconDir = './forecast/images/';
$iconType = '.jpg';        // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
$cacheFileDir = './';      // default cache file directory

Any more changes that I have to do?

Thanks
No, I didn't touch a thing in the new advforecast2.php file. All of the settings in your Settings.php file will override those in the new advforecast2.php file. The only time you need to edit anything in the new file is if you are using it as a stand alone.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 02, 2012, 10:33:36 PM
Ken... got them working. one question. The NWS is using the full word "thunderstorms" which they never did. Now when all the days have thunderstorm, the table expands larger than it should. Is that word being substituted by the script?

They use to use Tstms or something.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:33:56 PM
So just copy the new advforecast2.php to my server to override the old one?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:35:45 PM
So just copy the new advforecast2.php to my server to override the old one?
That's what I did!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:36:38 PM
So just copy the new advforecast2.php to my server to override the old one?
That's what I did!

Not working like that for me
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:37:35 PM
Weird :sad:
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:45:27 PM
So just copy the new advforecast2.php to my server to override the old one?
That's what I did!

Not working like that for me
Are you absolutely sure you are using the correct version of the new file?

http://saratoga-weather.org/advforecast2.php?sce=view (http://saratoga-weather.org/advforecast2.php?sce=view)

The only reason I ask is because those cities showing on your website right now aren't even the ones showing in the array in the new version of the file - so I have no idea where they are coming from.



Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:49:35 PM
So just copy the new advforecast2.php to my server to override the old one?
That's what I did!

Not working like that for me
Are you absolutely sure you are using the correct version of the new file?

http://saratoga-weather.org/advforecast2.php?sce=view (http://saratoga-weather.org/advforecast2.php?sce=view)

The only reason I ask is because those cities showing on your website right now aren't even the ones showing in the array in the new version of the file - so I have no idea where they are coming from.






Yes. Just copy that to notepad and overwrite the old advforecast2? Correct
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:51:40 PM
Looking back, I see the cities in your dropdown list are actually the default cities set in the original Settings.php file provided with Ken's base template zip file:

 "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",

what do lines 178 - 186 of your settings.php file show right now?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 02, 2012, 10:52:41 PM
Got all of mine working. Thanks for getting  me pointed in the right direction Ken and thank you for everything you do for us.
I just wish they wouldn't the full word Thunderstorms!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 10:56:27 PM
Looking back, I see the cities in your dropdown list are actually the default cities set in the original Settings.php file provided with Ken's base template zip file:

 "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",

what do lines 178 - 186 of your settings.php file show right now?

This...

$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 10:57:16 PM
Got all of mine working. Thanks for getting  me pointed in the right direction Ken and thank you for everything you do for us.
I just wish they wouldn't the full word Thunderstorms!
Looks Good, glad you got it working!  =D>
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:00:07 PM
Lines 164-167 say this...

# fcsturlNWS is the point-printable forecast URL from http://www.weather.gov/ (used by advforecast2.php)
$SITE['fcsturlNWS']      = 'http://forecast.weather.gov/MapClick.php?CityName=Hays&state=KS&site=DDC&textField1=38.8782&textField2=-99.3188&e=1&TextType=2';
$SITE['fcsticonsdir'] = './forecast/images/'; // NOAA-style icons for NWS, WU, WXSIM forecast scripts
$SITE['fcsticonstype']= '.jpg'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Moose Whisperer on July 02, 2012, 11:03:11 PM
Looking back, I see the cities in your dropdown list are actually the default cities set in the original Settings.php file provided with Ken's base template zip file:

 "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",

what do lines 178 - 186 of your settings.php file show right now?

This...

$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",

hmmm... that might be where the problem is. Somehow your settings.php file wasn't overriding the forecast properly.

Try copying all of your original settings from your old advforecast2.php into the corresponding lines of your Settings.php file and see if that works.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 02, 2012, 11:03:25 PM
Ryan,
You dont do anything with notepad with the new version. You just copy it directly over the old file in your website directory by ftp'ing over it. It should work fine as long as you didnt change anything in your settings.php file.

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 02, 2012, 11:04:22 PM
Ryan,

Since you're using the V3 template set, you can just replace your existing advforecast2.php with the updated copy. All the customization for the script is already in your Settings.php in your template and no additional script changes to advforecast2.php are needed.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 02, 2012, 11:06:36 PM
Got all of mine working. Thanks for getting  me pointed in the right direction Ken and thank you for everything you do for us.
I just wish they wouldn't the full word Thunderstorms!
Looks Good, glad you got it working!  =D>
Thanks Derek! Me too! Not exactly the way I wanted to spend the evening on my vacation but hey, at least I could fix it!!!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:06:54 PM
Ryan,

Since you're using the V3 template set, you can just replace your existing advforecast2.php with the updated copy. All the customization for the script is already in your Settings.php in your template and no additional script changes to advforecast2.php are needed.

I did this Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: capeweather on July 02, 2012, 11:11:40 PM
Ken,
I was forced to update to the new NWS changes from version 1 to 3 and noticed a small bug to specify the forecast update. I think line 39 needs to be changed from:

//$forecastupdate  This is the time of last update

to

//$forecastupdated  This is the time of last update

Im setting up a custom forecast layout and was referencing those switches.

By the way, thanks for resolving the problem so quickly!

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:12:21 PM
Ryan,
You dont do anything with notepad with the new version. You just copy it directly over the old file in your website directory by ftp'ing over it. It should work fine as long as you didnt change anything in your settings.php file.

Mike

Not for me it don't
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:15:36 PM
I copied it over the old one and come up with this.. http://www.hayskansasweather.com/wxforecast.php

I never touched settings.php
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: WeatherBeacon on July 02, 2012, 11:19:02 PM

Thanks immensely, Ken! =D>
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:20:27 PM
Kind of strange everyone has it working but me :sad:
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 02, 2012, 11:20:58 PM
Ryan,
In your Settings.php you have
Code: [Select]
$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",
);
 You can change that to
Code: [Select]
/*
$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",
);

//*/
then the ONE forecast you have configured for Hayes, KS will appear instead.

Also, the Settings.php file is the one used.. there is no settings.php (with a lower-case S) used by the templates.
Linux/*nix servers pay attention to upper/lower case letters in file names .. Windows systems do not.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 02, 2012, 11:22:36 PM
I think we should all pitch in and make a donation on Ken's site. He's worth every penny we currently pay him!  :grin:

He just got one from me!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:27:56 PM
Ryan shakes Ken's hand. THANKS ALOT that did it for me!!!!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 02, 2012, 11:50:07 PM
I think we should all pitch in and make a donation on Ken's site. He's worth every penny we currently pay him!  :grin:

He just got one from me!

Agreed!! He just got one from me too!!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 03, 2012, 12:03:25 AM
He got one from me as well!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: gwwilk on July 03, 2012, 12:05:04 AM
And me.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 12:22:41 AM
Thanks folks!  As I say on the site, the scripts are free for all, and the support of them is my hobby, but it is nice to receive a bit to defray the cost of hosting (and buy a bit of weather stuff now and again :) )
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cienega32 on July 03, 2012, 12:53:27 AM
My "Thunderstorms" table overrun is fixed.

In this section:
Code: [Select]
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
           print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>


I changed it to this:
Code: [Select]
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
 
// fixes tstorms in main forecast page
    
$forecasticons[$i] = preg_replace('|Thunderstorms|','T-storms',$forecasticons[$i]);
           print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>


I'm sure it ain't proper but it do work for me.

Doesn't seem to validate. Closing slash for '<img src ' seems to not parse?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: andro700 on July 03, 2012, 02:07:01 AM
A stupid question. I am using version 2. What do in need to do to fix this issue?

Chuck
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: gwwilk on July 03, 2012, 06:55:59 AM
Thanks for the change, Pat.  Unfortunately it didn't improve my forecast.  Where do I get those T-Storms? :grin:

How do we fix the validation failure for the unclosed <img tag that throws 9 errors?
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Dr Obbins on July 03, 2012, 07:22:57 AM
Your quick response is much appreciated Ken!  =D&gt;  \:D/

One thing though. The page has a minor validation error.
Code: [Select]
Error Line 699, Column 298: end tag for "img" omitted, but OMITTAG NO was specified

…ce for Measurable Precipitation 40%" ><br />Scattered<br />Thunderstorms</span…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: gwwilk on July 03, 2012, 07:39:14 AM
Your quick response is much appreciated Ken!  =D&gt;  \:D/

One thing though. The page has a minor validation error.
Code: [Select]
Error Line 699, Column 298: end tag for "img" omitted, but OMITTAG NO was specified

…ce for Measurable Precipitation 40%" ><br />Scattered<br />Thunderstorms</span…



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

It appears to be closed in the relevant line of code:
Code: [Select]
                        $t = preg_replace('|<img src="([^"]+)" (border="0") alt="([^"]+)">|i',
                          "<img src=\"\\1\" style=\"border: none;\" alt=\"\\3\" title=\"\\3\" />",$t);
I think the <img line is constructed OK, but maybe one of the 'fixups' after this line, ~415-416, seems to be trashing the end tag?  Does anyone have a fix?  I don't :-?, but I'm sure Ken will.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Andy Thompson on July 03, 2012, 08:15:07 AM
OK, so that is why the forecast is all screwed up.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 03, 2012, 08:17:13 AM
My "Thunderstorms" table overrun is fixed.

In this section:
Code: [Select]
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
           print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>


I changed it to this:
Code: [Select]
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
 
// fixes tstorms in main forecast page
    
$forecasticons[$i] = preg_replace('|Thunderstorms|','T-storms',$forecasticons[$i]);
           print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>


I'm sure it ain't proper but it do work for me.

Doesn't seem to validate. Closing slash for '<img src ' seems to not parse?

Great work Pat, your fix has been added to my pages! Thanks a ton!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cutty Sark Sailor on July 03, 2012, 08:39:55 AM
Great Fix! I made one minor change to 'tidy' my page slightly, Changed the "8pt" style to "9px"...
Code: [Select]
for ($i=0;$i<count($forecasticons);$i++) {
// fixes tstorms in main forecast page
    $forecasticons[$i] = preg_replace('|Thunderstorms|','T-Storms',$forecasticons[$i]);

            print "<td style=\"width: 11%;\"><span style=\"font-size: 9px;\">$forecasticons[$i]</span></td>\n";
          }
which balanced the row a bit...

Sunday night brief power surge totally screwed up the little HP s5510f used as my server... after I finally convinced
it that it actually did have a 'C' drive, and Windows was, in fact, NOT on 'D' drive, I then had this weird, conicidental,
forecast page problem... talk about hair pulling!!!.
Thanks Guys and Gals!
Cheers!
Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: ed2kayak on July 03, 2012, 08:43:51 AM
Thanks for TS fix,
I'm getting 9 validation errors also.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Gordon on July 03, 2012, 08:49:37 AM
Nice work Ken...but I lost my drop down city forecast selector:

http://www.oldlineweather.com/wxforecast.php (http://www.oldlineweather.com/wxforecast.php)

Even with a fresh copy of the update with no modifications it's still a no-show.

Any insight is appreciated!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: azkiwi on July 03, 2012, 09:03:59 AM
Hi all,
user pointed out to me forecast wasn't working, so I did some digging and found this thread and the new advforecast2.php file.   Had some issues in getting it, when i clicked the download, it did a text display, so i saved the page.  Had to use wordpad to format the layout.  Then found addition info had been inserted in line 1, so i removed it and loaded it to my test bed.

I get this response - and have no idea even where to begin looking...
<br />
<b>Parse error</b>:  syntax error, unexpected ';' in <b>/virtual/users/e14384-17518/web/advforecast2.php</b> on line <b>122</b><br />


my test bed is way out of date data-wise, but it's here
test.azkiwis.net (http://test.azkiwis.net)

will someone please take a look and tell me where to go to fix it?
I was previously using v3.00  of 12 Mar 2011

Thanks

Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: SoMDWx on July 03, 2012, 09:33:47 AM
Nice work Ken...but I lost my drop down city forecast selector:

http://www.oldlineweather.com/wxforecast.php (http://www.oldlineweather.com/wxforecast.php)

Even with a fresh copy of the update with no modifications it's still a no-show.

Any insight is appreciated!

Hello From So. MD!
  There is an array in the code near the top which you can uncomment that allows for a dropdown list of the towns/cities you'd like to have a forecast for. There is a set of cities already there that Ken has pre-populated from CA. You just need to eliminate the lines you don't need and inerst the data for the cities of interest.

Jim
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 09:34:57 AM
Nice work Ken...but I lost my drop down city forecast selector:

http://www.oldlineweather.com/wxforecast.php (http://www.oldlineweather.com/wxforecast.php)

Even with a fresh copy of the update with no modifications it's still a no-show.

Any insight is appreciated!
Hi Gordon,

Your advforecast2.php has
Code: [Select]
/*
$NWSforecasts = array(
.. just change it to
Code: [Select]
//*
$NWSforecasts = array(
and your selector should be enabled again.
I'd put the selector inside /* */ comments so folks wouldn't use my default selectors if they had not customized the script itself.

Best regards,
Ken

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 09:40:40 AM
Hi all,
user pointed out to me forecast wasn't working, so I did some digging and found this thread and the new advforecast2.php file.   Had some issues in getting it, when i clicked the download, it did a text display, so i saved the page.  Had to use wordpad to format the layout.  Then found addition info had been inserted in line 1, so i removed it and loaded it to my test bed.

I get this response - and have no idea even where to begin looking...
<br />
<b>Parse error</b>:  syntax error, unexpected ';' in <b>/virtual/users/e14384-17518/web/advforecast2.php</b> on line <b>122</b><br />


my test bed is way out of date data-wise, but it's here
test.azkiwis.net (http://test.azkiwis.net)

will someone please take a look and tell me where to go to fix it?
I was previously using v3.00  of 12 Mar 2011

Thanks

Ken

Hi Ken,

With a parse error, it's not possible to see the source remotely (since the parse error precludes execution of the entire script).

Since you'd had issues doing the download using the ?sce=view option, I'd suggest you try the updates tool which will create a .zip file with the source included in the file.  Just save and extract advforecast2.php from there as a good starting point.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: azkiwi on July 03, 2012, 09:44:10 AM
Ah. moment of enlightenment.
I think the way I got the code was dangerous, bad at least.   Digging thru Ken's site, I found the .zip with everything in it, so d/l'd, unpacked, loaded, tested, and it worked, right out of the box.

As usual it seems to be me -- knowing where I want to go, what I want to do, but lacking the code skills to really understand.

Thanks Ken for your update!

(another) Ken





I get this response - and have no idea even where to begin looking...
<br />
<b>Parse error</b>:  syntax error, unexpected ';' in <b>/virtual/users/e14384-17518/web/advforecast2.php</b> on line <b>122</b><br />


my test bed is way out of date data-wise, but it's here
test.azkiwis.net (http://test.azkiwis.net)

will someone please take a look and tell me where to go to fix it?
I was previously using v3.00  of 12 Mar 2011

Thanks

Ken

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 10:28:43 AM
For the adventurous, I've posted at pre-release V3.04 with two fixes:
1) the infamous validation errata (unclosed <img tags) from the NWS
2) shortening 'Thunderstorm' to 'T-Storm' so the icons won't overflow.

Test version at http://saratoga-weather.org/advforecast2-test.php?sce=view

Let me know how that works out and I'll finish the packaging for release :)

Thanks folks for spotting the stuff needing additional fixing .. I was rushing like crazy to get the parsing working and neglected to check the XHTML 1.0-Strict validation before release.. the -test version above does validate clean :)
Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: capeweather on July 03, 2012, 10:41:40 AM
Thanks again Ken! You rock!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 03, 2012, 10:45:39 AM
Ken the new version Validates and the T-storm is correct as well.  Thanks Again!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: K4KMG on July 03, 2012, 10:47:23 AM
Working great here.
Thanks Ken
K4KMGWeather.com
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: gwwilk on July 03, 2012, 10:55:49 AM
Works right out of the box, and validates!  Thanks, Ken =D&gt;
Title: Re: NWS website changed .. advforecast2.php V3.04 03-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 11:09:33 AM
Thanks folks :)

I've released 3.04 version .. let me know if any errors pop up with this one :)

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Gordon on July 03, 2012, 11:14:02 AM
Nice work Ken...but I lost my drop down city forecast selector:

http://www.oldlineweather.com/wxforecast.php (http://www.oldlineweather.com/wxforecast.php)

Even with a fresh copy of the update with no modifications it's still a no-show.

Any insight is appreciated!
Hi Gordon,

Your advforecast2.php has
Code: [Select]
/*
$NWSforecasts = array(
.. just change it to
Code: [Select]
//*
$NWSforecasts = array(
and your selector should be enabled again.
I'd put the selector inside /* */ comments so folks wouldn't use my default selectors if they had not customized the script itself.

Best regards,
Ken



Well that was easy! Thanks Ken...and thanks for your reply as well Jim...
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: chief-david on July 03, 2012, 11:14:19 AM
Version 3 working here too.

thanks Master Ken

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: AWL on July 03, 2012, 11:33:32 AM
V3.04 working here. Thanks again for all your hard work.

Doug
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Andy G on July 03, 2012, 11:37:48 AM
3.04 working here just wish it was forecasting a little cooler temps.

Thanks Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 03, 2012, 12:22:45 PM
Working here as well. Thanks again Ken for  everything you do!!!

http://hayskansasweather.com/wxforecast.php
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: SoMDWx on July 03, 2012, 12:41:11 PM
Ken,
  If I wasn't married...    :shock:   Who said that?


Seriously, we can't say enough to thank you for all that you have done to keep everything going.... The script works like a champ!

Regards,

Jim
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 03, 2012, 12:51:03 PM
Only thing thats wrong with mine is the high temps and no rain :roll:
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: ke9lz on July 03, 2012, 01:13:02 PM
Hi Ken,  I was able to update one of my sites with the new version without a hitch but having problems with this site http://weather.athelstanewi.com/ .  I get this error message (Warning: strpos() [function.strpos]: Offset not contained in string in /home/content/s/t/e/stevemcd/html/weather/advforecast2.php on line 474).  I have not updated this site to your new ver 3 as of yet but since it was modded with an alternative dashboard and using VWS, I chose to leave it alone since it was working very well (kind of like if it isn't broke, don't fix it).  Anyway, do I need to update the site to ver 3 to use this script?  Turning out to be a bad week as the computer that updates the site also took a dump ](*,)

Steve
 
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: K4KMG on July 03, 2012, 02:03:59 PM
Steve, not sure if it's what your looking for but Ken posted links to Ver3 AND Ver2 script updates in the first post of this thread.

Tom
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: ke9lz on July 03, 2012, 02:16:26 PM
Hi Tom, Yes, I am using the ver 2 script pulled from Ken's site.  Guess it is something I am doing wrong within the site.

Thanks, Steve
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Silversword on July 03, 2012, 03:21:04 PM
Hi Steve,

You might want to edit in the Settings area in the advforecast2.php to reflect your NOAA area site.  I did that and it seems to work for me using ajax V2 but I am in the process of updating to V3.

Hope it works out for you.

--Stan Y.
  Maui, Hawaii
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 03, 2012, 03:23:33 PM
This worked for me



Quote
 

--------------------------------------------------------------------------------

Ryan,
In your Settings.php you have
Code:

$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",
);

  You can change that to
Code:

/*
$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
  "CAZ513|Saratoga|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"CAZ513|Los Gatos|http://forecast.weather.gov/MapClick.php?CityName=Los+Gatos&state=CA&site=MTR&textField1=37.2267&textField2=-121.974&e=0&TextType=2",
"CAZ513|Cupertino|http://forecast.weather.gov/MapClick.php?CityName=Cupertino&state=CA&site=MTR&textField1=37.3231&textField2=-122.031&e=0&TextType=2",
"CAZ513|Sunnyvale|http://forecast.weather.gov/MapClick.php?CityName=Sunnyvale&state=CA&site=MTR&textField1=37.3689&textField2=-122.035&e=0&TextType=2",
"CAZ513|Santa Clara|http://forecast.weather.gov/MapClick.php?CityName=Santa+Clara&state=CA&site=MTR&textField1=37.3542&textField2=-121.954&e=0&TextType=2",
"CAZ513|San Jose|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ508|Mountain View|http://forecast.weather.gov/MapClick.php?CityName=Mountain+View&state=CA&site=MTR&textField1=37.3861&textField2=-122.083&TextType=2",
"CAZ529|Santa Cruz|http://forecast.weather.gov/MapClick.php?CityName=Santa+Cruz&state=CA&site=MTR&textField1=36.9742&textField2=-122.03&e=0&TextType=2",
"CAZ006|San Francisco|http://forecast.weather.gov/MapClick.php?CityName=San+Francisco&state=CA&site=MTR&textField1=37.775&textField2=-122.418&e=0&TextType=2",
);

//*/
 then the ONE forecast you have configured for Hayes, KS will appear instead.

Also, the Settings.php file is the one used.. there is no settings.php (with a lower-case S) used by the templates.
Linux/*nix servers pay attention to upper/lower case letters in file names .. Windows systems do not.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 03:23:53 PM
Hi Ken,  I was able to update one of my sites with the new version without a hitch but having problems with this site http://weather.athelstanewi.com/ .  I get this error message (Warning: strpos() [function.strpos]: Offset not contained in string in /home/content/s/t/e/stevemcd/html/weather/advforecast2.php on line 474).  I have not updated this site to your new ver 3 as of yet but since it was modded with an alternative dashboard and using VWS, I chose to leave it alone since it was working very well (kind of like if it isn't broke, don't fix it).  Anyway, do I need to update the site to ver 3 to use this script?  Turning out to be a bad week as the computer that updates the site also took a dump ](*,)

Steve
 
Hi Steve,
I ran http://weather.athelstanewi.com/wxforecast.php?force=1&debug=y and did a view-source on the page which shows
Quote
<!-- advforecast2.php (multi) - V3.04 - 03-Jul-2012 -->
<!-- NWS URL: /http://forecast.weather.gov/MapClick.php?CityName=Athelstane&state=WI&site=GRB&textField1=45.43&textField2=-88.09&e=0&TextType=2 -->
<!-- zone=WIZ013 -->
<!-- Network error: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) --><!-- loading ./cache/forecast-WIZ013-0.txt -->
The issue is the bad URL (with a leading /) .. delete the leading slash and the URL should work for you.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: tstorm on July 03, 2012, 03:29:03 PM
Thanks Ken!  I've notice that in the text doesn't center itself under the icon anymore (at least I thought it did before) for NWS Short Term Weather Forecast.  See attached png
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: stormwatch on July 03, 2012, 03:32:23 PM
Many thanks Ken for your quick and efficient fix for BOTH V2 and V3 for those of us that haven't made the switch to V3 yet. :grin:  Almost there with V3 finally though!

Tom M.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 03:49:41 PM
Thanks Ken!  I've notice that in the text doesn't center itself under the icon anymore (at least I thought it did before) for NWS Short Term Weather Forecast.  See attached png
I think that's the styling applied by Scott to that area in the alternative dashboard.  The native script and wxforecast.php in the templates do show the text centered.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cienega32 on July 03, 2012, 03:50:19 PM
Thanks Ken!  I've notice that in the text doesn't center itself under the icon anymore (at least I thought it did before) for NWS Short Term Weather Forecast.  See attached png

That's in the dashboard formatting towards the end of that script. If you go toward the end of that script and find the table titled "Short Term Weather Forecast", adding a text-align: center to the 'style=" ' line, it'll square up.

At least for my old 4.2 version it does, that is.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 03:51:37 PM
Many thanks Ken for your quick and efficient fix for BOTH V2 and V3 for those of us that haven't made the switch to V3 yet. :grin:  Almost there with V3 finally though!

Tom M.
You're welcome, Tom.  Keep plugging at the V3 upgrade.. when finished, it will make maintenance updates much easier for you with the updates page tool (http://saratoga-weather.org/wxtemplates/updates.php).  :)

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: ke9lz on July 03, 2012, 04:03:35 PM
Hi Ken and thanks.  Deleted the / and all is well.  I need to get at updating that site to ver 3 to make things easier.  Now to try to get into the computer at the cabin remotely to see if I can get it back on track!  Thanks again for all you do for us!

Steve
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cienega32 on July 03, 2012, 04:05:27 PM
Thanks again for all you do for us!


+1 on that, Ken! You sure make this "hobby" easy to enjoy! Thank you, Sir!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: 92merc on July 03, 2012, 09:42:05 PM
Ok, I've updated my V2.  But how do I get everything centered again?  I tried copying and pasting most of what I thought I needed from the old file.

http://www.bismarckweather.net/forecast/advforecast2.php
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: AWL on July 03, 2012, 10:02:11 PM
Maybe...
  <div align="center">
      <?php
       $doIncludeNWS = true;
       include("advforecast2.php"); ?>  
      </div>

Doug

*Your page is set up differently than mine so that probably wont work.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 03, 2012, 10:38:52 PM
Doug is on the right track..
Rather than modifying the advforecast2.php page, just make a new page using your template, then just put
Code: [Select]
<?php
       $doIncludeNWS 
true;
       include(
"advforecast2.php"); ?>
where you want to have the forecast appear.

That way, it's easy on you to replace advforecast2.php script if the NWS changes their website again and an update is necessary.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W Thomas on July 04, 2012, 03:13:56 PM
Not to change the subject but has anyone else noticed a link in red to the NWS Hazardous weather outlook??
The night after I made the change I didn't notice it but yesterday I did.. I can see the link plain as day in the src view of my page but when I look at the code I cannot find it for the life of me!  Maybe something generated by the nws ??Not sure at this time LOL

FWIW here is what I see

http://www.smythweather.net/wxforecast.php

Thanks everyone!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 04:44:44 PM
If you mean the 'Hazardous Weather Outlook' link in red on your page, that is generated automatically by advforecast2.php from the point-printable forecast by the NWS .. it links to the official bulletin on the weather.gov website.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 06:28:12 PM
Ken,
Did the NWS mess with something again? All of the icons are gone from all of my weather station Web sites. The text is still formatted correctly but all icon positions are a red X.. #-o

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 06:34:27 PM
You're getting redirected to the Zone forecast with a message
Quote
The "Forecast At A Glance" icons, hourly weather graph feature, Spanish version, and temperatures in Celsius are temporarily not available for this location for technical reasons. We apologize for any inconvenience.

I'll have to see why the Zone parsing isn't working as expected.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 06:38:08 PM
I'm really sorry to bother you with this on a holiday. Please dont dig too hard if you have other plans. Its not life or death! 

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 06:58:18 PM
Ok, two issues with the script handling your setup.

First, you need to use a Forecast Zone in your setup.. you have  'PAC077' and you should have 'PAZ061' .. you can't get a failover forecast from a County Zone.

Second, the Eastern Region part of the website has a subtle difference in HTML in the Zone forecast.

Try changing your Zone to PAZ061, and change advforecast2.php from
Code: [Select]
if(preg_match('|class=\'blue|i',$html) ) {
  $start = strpos($html, '3 Day History:',$startgrab);
} else {
  $start = strpos($html, '<br><b>',$startgrab);
}
to
Code: [Select]
if(preg_match('|class=\'blue|i',$html) ) {
  $start = strpos($html, '3 Day History:',$startgrab);
} else {
  $start = $startgrab;
}
then the Zone failover forecast should work automatically while the point-printable forecast is not available.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: jgillett on July 04, 2012, 07:00:47 PM
Nice, Ken - very nice. As always!   =D&gt;
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: cospringswx on July 04, 2012, 07:11:25 PM
Not to change the subject but has anyone else noticed a link in red to the NWS Hazardous weather outlook??
The night after I made the change I didn't notice it but yesterday I did.. I can see the link plain as day in the src view of my page but when I look at the code I cannot find it for the life of me!  Maybe something generated by the nws ??Not sure at this time LOL

FWIW here is what I see

http://www.smythweather.net/wxforecast.php

Thanks everyone!

Mine is red too and also underlined.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 07:18:47 PM
Ken,
I went through and changed as you instructed. The text portions of the forecast did come back but still do not have icons. Seems it is calling for gif icons instead of png...   :roll:

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 07:32:37 PM
That means you've enabled the Meteotriviglio .gif icons for presentation.  The default icons for the script are .jpg (the new icons on the NWS site are .png, but have the same names.

In your Settings.php you have
Code: [Select]
$SITE['fcsticonstype']= '.gif'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
and if you've not installed that icon set, change it to
Code: [Select]
$SITE['fcsticonstype']= '.jpg'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 07:51:49 PM
That means you've enabled the Meteotriviglio .gif icons for presentation.  The default icons for the script are .jpg (the new icons on the NWS site are .png, but have the same names.

In your Settings.php you have
Code:
$SITE['fcsticonstype']= '.gif'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
and if you've not installed that icon set, change it to
Code:
$SITE['fcsticonstype']= '.jpg'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/

Ken, I have been using the meteotreviglio icons for the better part of a year and I did not change anything from when it was working this morning. It seems the point forecast may use a different icon set than the overide zone forecast. Your expecting to see png for instance and they are only providing jpg in the overide forecast.. 

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W Thomas on July 04, 2012, 08:05:36 PM
If you mean the 'Hazardous Weather Outlook' link in red on your page, that is generated automatically by advforecast2.php from the point-printable forecast by the NWS .. it links to the official bulletin on the weather.gov website.

Yes sir ! That is the one I was referencing :)
Guess I'm not seeing things lol

Thanks for the info Ken!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 09:22:57 PM
That means you've enabled the Meteotriviglio .gif icons for presentation.  The default icons for the script are .jpg (the new icons on the NWS site are .png, but have the same names.

In your Settings.php you have
Code:
$SITE['fcsticonstype']= '.gif'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/
and if you've not installed that icon set, change it to
Code:
$SITE['fcsticonstype']= '.jpg'; // default type='.jpg' -- use '.gif' for animated icons from http://www.meteotreviglio.com/

Ken, I have been using the meteotreviglio icons for the better part of a year and I did not change anything from when it was working this morning. It seems the point forecast may use a different icon set than the overide zone forecast. Your expecting to see png for instance and they are only providing jpg in the overide forecast.. 

Mike
Very strange.. the Zone code is somehow generating links like
Code: [Select]
<img src="../forecast/images/ntsra20.gif" height="58" width="55" alt="Thunder storm" title="Thunder storm" /> instead of
Code: [Select]
<img src="./forecast/images/ntsra20.gif" height="58" width="55" alt="Thunder storm" title="Thunder storm" /> so it would find it in the /a/forecast/images/ directory instead of looking at /forecast/images/ directory.  Don't know why it's doing this, but I'll keep investigating.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 09:32:33 PM

Very strange.. the Zone code is somehow generating links like
Code:
<img src="../forecast/images/ntsra20.gif" height="58" width="55" alt="Thunder storm" title="Thunder storm" />instead of
Code:
<img src="./forecast/images/ntsra20.gif" height="58" width="55" alt="Thunder storm" title="Thunder storm" />so it would find it in the /a/forecast/images/ directory instead of looking at /forecast/images/ directory.  Don't know why it's doing this, but I'll keep investigating.

Well that at least gives me an idea on how to get er running for now. I'll just create the directory where it is looking for it.  Its a start at least.. Thanks Ken!

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 10:20:48 PM
Yep, found it.. very subtle error in the Zone forecast code would screw up the address.

Try changing advforecast2.php
Code: [Select]
function make_icon($day,$textforecast) {
  global $Conditions,$Status,$iconDir,$iconType;
to
Code: [Select]
function make_icon($day,$textforecast) {
  global $Conditions,$Status,$iconType;
  $iconDir = '/forecast/images/'; // will be substituted correctly by main script
and that should preserve your relative addressing.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: n3ouc on July 04, 2012, 10:42:12 PM
Ken,
You are amazing!  That fix worked perfectly and all is well with the world once again.  =D&gt;

I would have never found that!

Is this going to mean another version change?

Take Care Ken and Happy Fourth Of July!

Mike
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 04, 2012, 10:46:14 PM
Yes, but likely tommorrow.. Got more testing to do, and 4th of July PBS concert to watch tonight.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 05, 2012, 04:06:03 PM
Ok, last update to the script for a while.  I've tested it with sample point-printable and zone forecasts from each NWS region (WRH, CRH, ERH, SRH, ARH, HRH) and all work fine.  If there are alerts in your region (red text below the icons and above the detailed forecast), then the output will fail XHTML 1.0-Strict validation due to a deliberate inclusion of a target="_blank" in the <a> link .. it validates (like the basic template set with XHTML 1.0-Transitional however.

Latest version:  advforecast2.php V3.05 - 05-Jul-2012

V3 template users: use the update tool page (http://saratoga-weather.org/wxtemplates/updates.php) for Base-USA (05-Jul-2012)
Standalone/V2 templates: use the scripts page (http://saratoga-weather.org/scripts-carterlake.php#carterlake) for download.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W3DRM on July 06, 2012, 02:36:33 PM
Ken,

Just a note to add my thanks to all of your efforts keeping us informed and updating the code that keeps our website visitors happy!

As a result of this latest NWS change, I have finally taken the time to upgrade my code to V3. I have been putting it off for months now and finally decided it was time to bite the bullet and "just do it"... Rather than try to upgrade from V2 to V3 I decided to start all over from scratch. It took me several hours of work last night but now, with your update feature, it will be easy to keep current.

BTW - a small donation has also been sent in appreciation for all you do for us who are less technically inclined...

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 06, 2012, 03:02:37 PM
Hi Don,
You're very welcome!  Thank YOU for your donation too.
I'm glad you've updated to the V3 template set, and you're correct -- maintenance on it will be much easier now that you can use the update page to get a customized set of updates needed to be 'current'.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W3DRM on July 06, 2012, 03:52:17 PM
Hi Don,
You're very welcome!  Thank YOU for your donation too.
I'm glad you've updated to the V3 template set, and you're correct -- maintenance on it will be much easier now that you can use the update page to get a customized set of updates needed to be 'current'.

Best regards,
Ken

And someday, I'll even get around to (you know those round-to-its) installing Weather Display, purchase a Boltek lightning detector, and add UV/Solar & FARS to my VP2. All are on my wish list of things to be done (AKA my Wx Station/Website Bucket List). I just don't have the time and cash to put it all together at the present time.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 11:30:07 AM
I still have a small issue on the forecast.  It just popped up this morning.  Below is a screen shot.  This is V3.05.  Missing icon? Also has validation error:

Validation Output: 1 Error
Line 270, Column 158: end tag for "img" omitted, but OMITTAG NO was specified…pan><img src="/images/wtf/down.gif" border="0" alt="Falling Temperatures"></td>



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Line 270, Column 84: start tag was here…yle="color: #FF0000;">95 &deg;F</span><img src="/images/wtf/down.gif" border="…


(http://www.peotoneweather.com/photos/advo.png)

The page is at

http://www.peotoneweather.com/nwsforecast.php (http://www.peotoneweather.com/nwsforecast.php)

Dave
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 12:14:30 PM
Not sure why the wtf is in the output on line 270:


Quote
262.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Sunday<br />Night</b><br /><img src="./forecast/images/nsct.jpg" width="55" height="58" alt="Partly Cloudy" title="Partly Cloudy" /><br />Partly<br />Cloudy</span></td>
263.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Monday<br /></b><br /><img src="./forecast/images/sct.jpg" width="55" height="58" alt="Mostly Sunny" title="Mostly Sunny" /><br />Mostly<br />Sunny</span></td>
264.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Monday<br />Night</b><br /><img src="./forecast/images/nfew.jpg" width="55" height="58" alt="Mostly Clear" title="Mostly Clear" /><br />Mostly<br />Clear</span></td>
265.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Tuesday<br /></b><br /><img src="./forecast/images/sct.jpg" width="55" height="58" alt="Mostly Sunny" title="Mostly Sunny" /><br />Mostly<br />Sunny</span></td>
266.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Tuesday<br />Night</b><br /><img src="./forecast/images/nsct.jpg" width="55" height="58" alt="Partly Cloudy" title="Partly Cloudy" /><br />Partly<br />Cloudy</span></td>
267.<td style="width: 11%;"><span style="font-size: 8pt;"><b>Wednesday<br /></b><br /><img src="./forecast/images/sct.jpg" width="55" height="58" alt="Mostly Sunny" title="Mostly Sunny" /><br />Mostly<br />Sunny</span></td>
268. </tr>
269. <tr valign ="top" align="center">
270. <td style="width: 11%;">Hi <span style="color: #FF0000;">95 &deg;F</span><img src="/images/wtf/down.gif" border="0" alt="Falling Temperatures"></td>
271.<td style="width: 11%;">Lo <span style="color: #0033CC;">70 &deg;F</span></td>
[/quote]

shouldn't it be

Quote
><img src="./forecast/images/down.gif       
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W3DRM on July 07, 2012, 12:34:20 PM
The "down.gif" image file  is apparently located on the NWS website (http://forecast.weather.gov/images/wtf/down.gif).

I'm not sure exactly what the significance of the down arrow is though.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: capeweather on July 07, 2012, 12:52:00 PM
Anybody know how to change the spacing between the icons? I'd like to make them just a touch wider so they are not crunched together. Tried messing around with the code but no luck.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: DaculaWeather on July 07, 2012, 12:58:00 PM
Anybody know how to change the spacing between the icons? I'd like to make them just a touch wider so they are not crunched together. Tried messing around with the code but no luck.
There are a couple of lines of code from my page, mess with the width percentages:

        <?php
          for ($i=0;$i<count($forecasticons);$i++) {
 // fixes tstorms in main forecast page
    $forecasticons[$i] = preg_replace('|Thunderstorms|','T-storms',$forecasticons[$i]);
           print "<td style=\"width: 11%;\">$forecasticons[$i]</td>\n";
          }
        ?>
          </tr>
          <tr valign ="top" align="center">
          <?php
          for ($i=0;$i<count($forecasticons);$i++) {
            print "<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
          }
          ?>
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 01:07:31 PM
Quote
The "down.gif" image file  is apparently located on the NWS website (http://forecast.weather.gov/images/wtf/down.gif).

I'm not sure exactly what the significance of the down arrow is though.

It is also in the image folder:

http://www.peotoneweather.com/forecast/images/down.gif (http://www.peotoneweather.com/forecast/images/down.gif)

(http://www.peotoneweather.com/forecast/images/down.gif)

Not sure what significance this has!

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W3DRM on July 07, 2012, 01:10:07 PM
I just noticed that I don't see the down.gif image any longer on the NWS site for Peotone, IL. I wonder if it is something the NWS programmers are doing to fine-tune the new pages?

http://forecast.weather.gov/MapClick.php?CityName=Peotone&state=IL&site=LOT&textField1=41.3316&textField2=-87.7963&e=0 (http://forecast.weather.gov/MapClick.php?CityName=Peotone&state=IL&site=LOT&textField1=41.3316&textField2=-87.7963&e=0)

EDIT: I see the new forecast time shown on the NWS webpage is 11:55am CDT. The Peotone wx website is still showing the older 10:54am CDT image. It may look okay once the website updates.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 01:17:00 PM
How often does the advforecast update?  It is still trying to use the missing .gif on my site.  Im sure in a couple minutes when the script updates my page will look normal again (until another down.gif is used)!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: W3DRM on July 07, 2012, 01:21:41 PM
How often does the advforecast update?  It is still trying to use the missing .gif on my site.  Im sure in a couple minutes when the script updates my page will look normal again (until another down.gif is used)!

Not sure, but I am wondering if perhaps the old page is being cached and thus, the reason why it doesn't show the latest update?

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 01:23:30 PM
Exactly...oK forecast updated and script display on site is back to normal and it validates.  hopefully no more falling temps in the forecast.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 07, 2012, 01:31:15 PM
Grrr... it's that 'Temperatures Rising'/'Temperatures Falling' transient thing .. they didn't put the down.gif/up.gif files in the new /images/wtf/small directory (which we translate to /forecast/images to match the old locations), but instead left it in the /images/wtf directory.

Try changing lines
Code: [Select]
                  $forecasticons[$i] = preg_replace('|/images/wtf/small|Uis',
                   '/forecast/images',$forecasticons[$i]);
//                   $forecasticons[$i] = preg_replace('|/images/wtf|Uis',
//                   '/forecast/images',$forecasticons[$i]);
to
Code: [Select]
                  $forecasticons[$i] = preg_replace('|/images/wtf/small|Uis',
                   '/forecast/images',$forecasticons[$i]);
                   $forecasticons[$i] = preg_replace('|/images/wtf|Uis',
                   '/forecast/images',$forecasticons[$i]);
and I think the rest of the parsing will handle that.

Unfortunately, Peotone's forecast for this afternoon doesn't have the 'Temperatures Falling' indicator in it anymore so I can't test it :(

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: capeweather on July 07, 2012, 01:32:12 PM
Tried increasing and decreasing but no change. Wonder if my css is overriding my changes. Thoughts?

Anybody know how to change the spacing between the icons? I'd like to make them just a touch wider so they are not crunched together. Tried messing around with the code but no luck.
There are a couple of lines of code from my page, mess with the width percentages:

        <?php
          for ($i=0;$i<count($forecasticons);$i++) {
 // fixes tstorms in main forecast page
    $forecasticons[$i] = preg_replace('|Thunderstorms|','T-storms',$forecasticons[$i]);
           print "<td style=\"width: 11%;\">$forecasticons[$i]</td>\n";
          }
        ?>
          </tr>
          <tr valign ="top" align="center">
          <?php
          for ($i=0;$i<count($forecasticons);$i++) {
            print "<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
          }
          ?>

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 01:39:45 PM
Quote
Unfortunately, Peotone's forecast for this afternoon doesn't have the 'Temperatures Falling' indicator in it anymore so I can't test it


Go figure!  My Temp is at 98F and if you look at GR3 http://www.peotoneweather.com/gr3/br248.php (http://www.peotoneweather.com/gr3/br248.php)  A lake breeze will drop the Temps here in about an hour.  They already fell in Waukegan, Chicago, and Lansing Airport.  Lansing airport is 15-20 miles to my NE.


Ill change the code anyway.

Thanks Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 07, 2012, 02:20:40 PM
Ok, played around a bit more with the script.  In addition to the above mod, I changed
Code: [Select]
                         $t = preg_replace('|<img src="([^"]+)" .* title="([^"]+)" >|i',
                          "<img src=\"\\1\" style=\"border: none;\" alt=\"\\3\" title=\"\\3\" />",$t);
to
Code: [Select]
                         $t = preg_replace('|<img src="([^"]+)".*alt="([^"]+)">|i',
                          "<img src=\"\\1\" style=\"border: none;\" alt=\"\\2\" title=\"\\2\" />",$t);

That will transform
Quote
<img src="/images/wtf/down.gif" border="0" alt="Falling Temperatures">
<img src="/images/wtf/up.gif" border="0" alt="Rising Temperatures">
to proper XHTML like
Quote
<img src="./forecast/images/down.gif" style="border: none;" alt="Falling Temperatures" title="Falling Temperatures" />
<img src="./forecast/images/up.gif" style="border: none;" alt="Rising Temperatures" title="Rising Temperatures" />

I did the testing by inserting the HTML in the cache file and seeing the results :)

I'll put out (yet) another release of advforecast2.php today with those fixes.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: dasman on July 07, 2012, 02:26:40 PM
Sorry Ken!

I did not mean to cause you even more grief then you encountered over the holiday!

Dave
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 07, 2012, 02:45:29 PM
No problem, Dave .. I hate it when stuff is broken too!  Fortunately, the NWS website changes occur very infrequently and the basic script was stable for almost a year.  I'm looking forward to more updates as the NWS new website design rolls down to the Regional NWS sites (likely the Zone parsing will change again), but that's another day...

advforecast V3.06 is now released with the temperature rise/fall graphics fixed (I hope :) )

Come and get the update at the usual places:

V2 template/Standalone use:   scripts page (http://saratoga-weather.org/scripts-carterlake.php#carterlake)
V3 template:  updates page (http://saratoga-weather.org/wxtemplates/updates.php) (7-Jul-2012, Base-USA)

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: ed2kayak on July 07, 2012, 03:57:51 PM
Thanks Ken.
At least it keeps your skills fresh. :-)
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 07, 2012, 03:59:59 PM
Thanks, Ed ... :lol:
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: edpnjax on July 07, 2012, 04:22:35 PM
Tried increasing and decreasing but no change. Wonder if my css is overriding my changes. Thoughts?

Anybody know how to change the spacing between the icons? I'd like to make them just a touch wider so they are not crunched together. Tried messing around with the code but no luck.
There are a couple of lines of code from my page, mess with the width percentages:

        <?php
          for ($i=0;$i<count($forecasticons);$i++) {
 // fixes tstorms in main forecast page
    $forecasticons[$i] = preg_replace('|Thunderstorms|','T-storms',$forecasticons[$i]);
           print "<td style=\"width: 11%;\">$forecasticons[$i]</td>\n";
          }
        ?>
          </tr>
          <tr valign ="top" align="center">
          <?php
          for ($i=0;$i<count($forecasticons);$i++) {
            print "<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
          }
          ?>


Don't think it's in your CSS.  I'm trying to do the same thing with this code and am having the same trouble..... and I have removed all CSS from the equation in testing and still have the problem.

If you figure it out, please post the fix here!
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Cutty Sark Sailor on July 07, 2012, 04:48:56 PM
Anybody know how to change the spacing between the icons? I'd like to make them just a touch wider so they are not crunched together. Tried messing around with the code but no luck.
Font size is part of the issue:
Try Below to get something like the image:
(http://ourspecial.net/twinhollies/fcsticons.jpg)
Down about line 832 in advforecast2.php:
Code: [Select]
<td align="center">&nbsp;
           <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr valign ="top" align="center">
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
// fixes tstorms in main forecast page
    
$forecasticons[$i] = preg_replace('|Thunderstorms|','T-Storms',$forecasticons[$i]);

            print 
"<td style=\"width: 11%;\"><span style=\"font-size: 9px; color:#101070; line-height:1.3em;\">$forecasticons[$i]</span></td>\n";
          }
        
?>

          </tr>
          <tr valign ="top" align="center">
          <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
            print 
"<td style=\"width: 11%; font-size:11px; font-weight:600;\">$forecasttemp[$i]</td>\n";
          }
          
?>

          </tr>
        </table>
     </td>
   </tr>
</table>
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on July 07, 2012, 10:16:07 PM
While it is perfectly ok to modify any of my scripts for your own use, I'd like to suggest a couple of ideas to help minimize your efforts to keep your template-based site working with new releases of the scripts as they become available.
I do tend to treat all the support scripts in the templates as 'just replaceable' without mods on your site since the major configuration is done in Settings.php for things like advforecast2.php.

So.. to simplify your future maintenance, consider a slight mod to wxforecast.php to replace
Code: [Select]
<div id="main-copy">
         <?php 
 $doIncludeNWS true// handle advforecast2.php include
 $doIncludeWU  true// handle WU-forecast include also
 $doInclude    = true// handle ec-forecast and WXSIM include also
 $doPrint    = true//  ec-forecast.php setting
 include_once($SITE['fcstscript']); ?>


with
Code: [Select]
<div id="main-copy">
         <?php 
 $doIncludeNWS true// handle advforecast2.php include
 $doIncludeWU  true// handle WU-forecast include also
 $doInclude    = true// handle ec-forecast and WXSIM include also
 $doPrint    = false//  ec-forecast.php setting
                 
$doPrintNWS false// suppress printing of advforecast2.php
 include_once($SITE['fcstscript']); ?>


which will give all $forecast... variables filled in for you to print yourself.

In the bottom of advforecast2.php, the code to print can be copied to the wxforecast.php page and you can play around with the layout all you like AND not have to refit your mods when a newer advforecast2.php gets released (as it will when the NWS website changes...).

Here's the 'printing-part' of the advforecast2.php script you can include in your page
Code: [Select]
<?php
}
print 
$Status;
// if the forecast text is blank, prompt the visitor to force an update

if (strlen($forecasttext[0])<and $PrintMode ) {
  if(!isset(
$PHP_SELF)) { $PHP_SELF $_SERVER['PHP_SELF']; }
  echo 
'<br/><br/>Forecast blank? <a href="' $PHP_SELF '?force=1">Force Update</a><br/><br/>';

}
?>

  <table width="640" style="border: none;">
    <tr align="center">
      <td><b>National Weather Service Forecast for: </b><span style="color: green;">
           <?php echo $forecastcity?></span><br />
        Issued by: <?php echo $forecastoffice?>
      </td>
    </tr>
    <tr>
      <td align="center">Updated: <?php echo $forecastupdated?>
          </td><!--end forecastupdated-->
    </tr>
    <?php echo $ddMenu ?>
    <tr>
  <td align="center" style="font-size: 18px; margin: 0px auto;"><b><?php echo $NOAAlocation?></b></td>
    </tr>
    <tr>
      <td align="center">&nbsp;
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr valign ="top" align="center">
        <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
            print 
"<td style=\"width: 11%;\"><span style=\"font-size: 8pt;\">$forecasticons[$i]</span></td>\n";
          }
        
?>

          </tr>
          <tr valign ="top" align="center">
          <?php
          
for ($i=0;$i<count($forecasticons);$i++) {
            print 
"<td style=\"width: 11%;\">$forecasttemp[$i]</td>\n";
          }
          
?>

          </tr>
        </table>
     </td>
   </tr>
</table>
  <p><?php 
  
if($forecastwarnings <> '') {
  print $forecastwarnings;
  }
?>
&nbsp;</p>

<table style="border: 0" width="640">
        <?php
          
for ($i=0;$i<count($forecasttitles);$i++) {
        print 
"<tr valign =\"top\" align=\"left\">\n";
            print 
"<td style=\"width: 20%;\"><b>$forecasttitles[$i]</b><br />&nbsp;<br /></td>\n";
            print 
"<td style=\"width: 80%;\">$forecasttext[$i]</td>\n";
                print 
"</tr>\n";
          }
        
?>

   </table>

<p>&nbsp;</p>
<p>Forecast from <a href="<?php if($usingFile) {
 echo 
htmlspecialchars($backupfileName);
 } else {
  echo 
htmlspecialchars($fileName);
 } 
?>
">NOAA-NWS</a>
for <?php echo $forecastcity?>. <?php echo $usingFile?>
<?php if($iconType <> '.jpg') {
print "<br/>Animated forecast icons courtesy of <a href=\"http://www.meteotreviglio.com/\">www.meteotreviglio.com</a>.";

?>

</p>

Hope this helps...

Best regards,
Ken

Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Farmtalk on October 20, 2012, 10:16:13 AM
I have been trying to get the dropdown menu to appear on my script but can't seem to get it right. Here is my code, does anyone see anything wrong with it???

Thanks! 8-)

Quote
// ZONE|Location|point-forecast-URL  (separated by | characters
"WVZ027|Bickmore, WV |http://forecast.weather.gov/MapClick.php?lat=38.38356&lon=-81.11049700000001&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Clay, WV |http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Dille, WV |http://forecast.weather.gov/MapClick.php?lat=38.46621&lon=-80.85732289999998&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Indore, WV|http://forecast.weather.gov/MapClick.php?lat=38.36090&lon=-81.15931699999999&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Ivydale, WV |http://forecast.weather.gov/MapClick.php?lat=38.53556&lon=-81.03499999999997&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Lizemores, WV |http://forecast.weather.gov/MapClick.php?lat=38.33399&lon=-81.1751099&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Maysel, WV |http://forecast.weather.gov/MapClick.php?lat=38.48593&lon=-81.1126102&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Nebo, WV|http://forecast.weather.gov/MapClick.php?lat=38.63454&lon=-81.04260909999999&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Procious, WV |http://forecast.weather.gov/MapClick.php?lat=38.47040&lon=-81.2208&unit=0&lg=english&FcstType=text&TextType=2",
);
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on October 20, 2012, 11:34:53 AM
It would help to have the URL of your website that is showing the issue :)

If you are doing that change in the advforecast2.php script itself, the be aware that the code
Code: [Select]
// V3.00 -- this following array can be used for multiple forecasts in standalone mode
//  for template use, add a $SITE['NWSforecasts'] entry in Settings.php to have these entries.
//  to activate the definitions below, replace the /* with //* to uncomment the array definition
/*
$NWSforecasts = array(
 // the entries below are for testing use.. replace them with your own entries if using the script
 // outside the AJAX/PHP templates.
// ZONE|Location|point-forecast-URL  (separated by | characters
"WVZ027|Bickmore, WV |http://forecast.weather.gov/MapClick.php?lat=38.38356&lon=-81.11049700000001&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Clay, WV |http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Dille, WV |http://forecast.weather.gov/MapClick.php?lat=38.46621&lon=-80.85732289999998&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Indore, WV|http://forecast.weather.gov/MapClick.php?lat=38.36090&lon=-81.15931699999999&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Ivydale, WV |http://forecast.weather.gov/MapClick.php?lat=38.53556&lon=-81.03499999999997&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Lizemores, WV |http://forecast.weather.gov/MapClick.php?lat=38.33399&lon=-81.1751099&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Maysel, WV |http://forecast.weather.gov/MapClick.php?lat=38.48593&lon=-81.1126102&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Nebo, WV|http://forecast.weather.gov/MapClick.php?lat=38.63454&lon=-81.04260909999999&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Procious, WV |http://forecast.weather.gov/MapClick.php?lat=38.47040&lon=-81.2208&unit=0&lg=english&FcstType=text&TextType=2",
);
//*/
is contained in a multi-line PHP comment starting with the /* line and terminated by the //*/ line.

Change the line /* to //* and the multi-line PHP comment will not be recognized, so the code below it will be processed.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Farmtalk on October 20, 2012, 12:02:01 PM
Sorry Ken,

www.fitzweather.com/advforecast2.php (http://www.fitzweather.com/advforecast2.php)

It works fine other than the dropdown menu dosen't show
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on October 20, 2012, 12:35:40 PM
You just have to disable the multiline comment surrounding the code by changing
Code: [Select]
/*
$NWSforecasts = array(
to
Code: [Select]
//*
$NWSforecasts = array(

Then the dropdown list will display.

Best regards,
Ken
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Farmtalk on October 20, 2012, 12:38:37 PM
Thank you Ken!! :grin: That fixed it right up!!!

Can't thank you enough! 8-)
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: saratogaWX on October 20, 2012, 12:46:41 PM
You're welcome :)

Make sure that the FIRST entry in the array is the one for your default forecast .. it will be used instead of what you might have put in the
Code: [Select]
$NOAAZone = 'WVZ027';  // change this line to your NOAA warning zone.
// set $fileName to the URL for the point-printable forecast for your area
 $fileName = "http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2";

So I'd suggest you change
Code: [Select]
"WVC087|Amma|http://forecast.weather.gov/MapClick.php?lat=38.56701&lon=-81.268509&unit=0&lg=english&FcstType=text&TextType=2",
"WVC097|Buckhannon|http://forecast.weather.gov/MapClick.php?lat=38.99399&lon=-80.23202759999998&unit=0&lg=english&FcstType=text&TextType=2",
"WVC039|Charleston|http://forecast.weather.gov/MapClick.php?lat=38.34982&lon=-81.6326234&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Clay|http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2",
"WVC039|Clendenin|http://forecast.weather.gov/MapClick.php?lat=38.48871&lon=-81.34817450000003&unit=0&lg=english&FcstType=text&TextType=2",

to
Code: [Select]
"WVZ027|Clay|http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2",
"WVC087|Amma|http://forecast.weather.gov/MapClick.php?lat=38.56701&lon=-81.268509&unit=0&lg=english&FcstType=text&TextType=2",
"WVC097|Buckhannon|http://forecast.weather.gov/MapClick.php?lat=38.99399&lon=-80.23202759999998&unit=0&lg=english&FcstType=text&TextType=2",
"WVC039|Charleston|http://forecast.weather.gov/MapClick.php?lat=38.34982&lon=-81.6326234&unit=0&lg=english&FcstType=text&TextType=2",
"WVZ027|Clay|http://forecast.weather.gov/MapClick.php?lat=38.46280&lon=-81.0802&unit=0&lg=english&FcstType=text&TextType=2",
"WVC039|Clendenin|http://forecast.weather.gov/MapClick.php?lat=38.48871&lon=-81.34817450000003&unit=0&lg=english&FcstType=text&TextType=2",
to have your Clay, WV appear as the default forecast displayed.

Also, don't use the WVC... codes .. they have no backup Zone forecast associated with them.  Only use the WVZ... codes otherwise if the point-printable forecast is not available, the Zone forecast fallback will not be available either.
Title: Re: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available
Post by: Farmtalk on October 20, 2012, 12:52:00 PM
Thanks again! I will change those!!!  :-) :-) Really appreciate it!