Author Topic: Adding NWS forecast to Settings.php  (Read 631 times)

0 Members and 1 Guest are viewing this topic.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Adding NWS forecast to Settings.php
« on: October 22, 2018, 10:34:55 PM »
I am trying to add another city to the NWS forecasts on this page http://cospringsweather.com/wxforecast.php. I have added the printable URL within Settings.php and my site will not load. Is there another place that I need to add this. It has been a long time since I have messed with this page.





Ryan 

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

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Adding NWS forecast to Settings.php
« Reply #1 on: October 23, 2018, 01:14:13 PM »
I see your current Settings.php has
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.
  "COZ085|Colorado Springs,CO|http://forecast.weather.gov/MapClick.php?lat=38.92431&lon=-104.72045606489473&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ081|Woodland Park,CO|http://forecast.weather.gov/MapClick.php?lat=38.99388&lon=-105.05692943199966&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ083|Canon City,CO|http://forecast.weather.gov/MapClick.php?lat=38.44098&lon=-105.24244796499966&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ085|Manitou Springs,CO|http://forecast.weather.gov/MapClick.php?lat=38.85971&lon=-104.91719883399969&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ082|Pike's Peak Summit,CO|http://forecast.weather.gov/MapClick.php?lat=38.84054&lon=-105.04441604199968&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ040|Denver,CO|http://forecast.weather.gov/MapClick.php?lat=39.73915&lon=-104.98469734299971&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ035|Estes Park,CO|http://forecast.weather.gov/MapClick.php?lat=40.3772&lon=-105.5217&unit=0&lg=english&FcstType=text&TextType=2",
  "COZ032|Breckenridge,CO|http://forecast.weather.gov/MapClick.php?lat=39.4816&lon=-106.0383&unit=0&lg=english&FcstType=text&TextType=2",
  "COC097|Aspen,CO|http://forecast.weather.gov/MapClick.php?lat=39.1911&lon=-106.8175&unit=0&lg=english&FcstType=text&TextType=2",
 
);
which seems to work just fine.
When you added a new entry, did you remember the opening and closing double-quote marks followed by a comma?
If not, then it would be a PHP syntax error in Settings.php, and since that is included in ALL the wx...php pages, your site would be 'down' until the syntax error is corrected.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: Adding NWS forecast to Settings.php
« Reply #2 on: October 23, 2018, 03:18:23 PM »
Got it working Ken. Don't know what happened last night. I added the quotation and the comma at the end and it would not work. I added this "COZ032|Grand Lake,CO|https://forecast.weather.gov/MapClick.php?lat=40.2512&lon=-105.821&unit=0&lg=english&FcstType=text&TextType=2" , and seems to be working fine now. Thanks for the insight.




Ryan 

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

 

anything