Author Topic: NWS website changed .. advforecast2.php V3.03 02-Jul-2012 now available  (Read 20253 times)

0 Members and 1 Guest are viewing this topic.

Offline Gordon

  • Senior Member
  • **
  • Posts: 79
Nice work Ken...but I lost my drop down city forecast selector:

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!
Gordon
Davis Vantage Pro2 Plus
WeatherLink 2.0

Offline azkiwi

  • Contributor
  • ***
  • Posts: 131
    • Maricopa, Sonoran Desert, Arizona
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

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

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 800
    • Southern Maryland Weather
Nice work Ken...but I lost my drop down city forecast selector:

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
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6546
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Nice work Ken...but I lost my drop down city forecast selector:

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

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6546
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
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

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
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline azkiwi

  • Contributor
  • ***
  • Posts: 131
    • Maricopa, Sonoran Desert, Arizona
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

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


Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6546
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
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
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline capeweather

  • Administrator
  • Forecaster
  • *****
  • Posts: 1262
    • http://www.capeweather.com
Thanks again Ken! You rock!

Chris
Cape Coral, Florida
Website: http://www.capeweather.com
Website: http://www.fortmyersweather.net

Offline dasman

  • Forecaster
  • *****
  • Posts: 422
    • Wx Peotone
Ken the new version Validates and the T-storm is correct as well.  Thanks Again!
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline K4KMG

  • Contributor
  • ***
  • Posts: 106
    • K4KMG.com
Working great here.
Thanks Ken
K4KMGWeather.com
Living 'Off Grid" in Central Florida. Pics at k4kmg.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 1908
    • SouthEast Lincoln, NE Weather
Works right out of the box, and validates!  Thanks, Ken =D&gt;
Regards, Jerry Wilkins
gwwilk@inebraska.com

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6546
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Thanks folks :)

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

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Gordon

  • Senior Member
  • **
  • Posts: 79
Nice work Ken...but I lost my drop down city forecast selector:

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...
Gordon
Davis Vantage Pro2 Plus
WeatherLink 2.0

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2131
  • Space Academy for Educators
    • Robbinsdale Middle School Weather
Version 3 working here too.

thanks Master Ken

Vantage Pro Plus 6163
Robbinsdale, MN 55422@ 45 degrees North Latitude.

You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline AWL

  • Forecaster
  • *****
  • Posts: 611
V3.04 working here. Thanks again for all your hard work.

Doug

Offline Andy G

  • Senior Contributor
  • ****
  • Posts: 284
    • SunPrairieWeather.com
3.04 working here just wish it was forecasting a little cooler temps.

Thanks Ken
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4062
    • Colorado Springs Weather
Working here as well. Thanks again Ken for  everything you do!!!

http://hayskansasweather.com/wxforecast.php




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Hikvision HD IP Camera

Offline SoMDWx

  • Forecaster
  • *****
  • Posts: 800
    • Southern Maryland Weather
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
« Last Edit: July 03, 2012, 12:42:54 PM by SoMDWx »
Jim Wyman
Southern Maryland Weather
http://somdweather.com
http://scit.somdweather.com

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4062
    • Colorado Springs Weather
Only thing thats wrong with mine is the high temps and no rain :roll:




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Hikvision HD IP Camera

Offline ke9lz

  • De Pere - Athelstane Weather
  • Contributor
  • ***
  • Posts: 124
    • De Pere Weather
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
 
« Last Edit: July 03, 2012, 01:18:46 PM by ke9lz »
Steve (KE9LZ)
Athelstane Weather
Blitzortung 1177, 1565


Offline K4KMG

  • Contributor
  • ***
  • Posts: 106
    • K4KMG.com
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
Living 'Off Grid" in Central Florida. Pics at k4kmg.com

Offline ke9lz

  • De Pere - Athelstane Weather
  • Contributor
  • ***
  • Posts: 124
    • De Pere Weather
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
Steve (KE9LZ)
Athelstane Weather
Blitzortung 1177, 1565


Offline Silversword

  • --Stan Y.
  • Forecaster
  • *****
  • Posts: 437
    • Up Country Maui Weather
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
Stan Y. - KH6HHG - Maui, Hawaii --- Blitzortung ID: 993 --- FlightRadar24 ID: F-PHOG1
Weather Display 10.37s Build 70
WDL 6.05
MS Windows 7 Pro
Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Davis Vantage Pro 2+ Wireless
1-Wire Lighting
Webcam: Axis 211

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4062
    • Colorado Springs Weather
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.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Hikvision HD IP Camera

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6546
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
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
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP