Author Topic: advforecast2.php is not auto updating  (Read 3648 times)

0 Members and 1 Guest are viewing this topic.

Offline suddenincline

  • Member
  • *
  • Posts: 47
    • Inclinemedialive.com
advforecast2.php is not auto updating
« on: February 23, 2011, 08:53:44 PM »
It just does not update on it's own. Not sure what the deal is if I force update from the site it does nothing. If I type out the path to advforcast2.php and force update there it updates and shows back up on the site untill the next update then the whole forecast is gone all over again?

www.inclinemedialive.com

www.inclinemedialive.com/advforecast2.php

thanks---
Jonathan
(ps I am kinda a noob)  \:D/

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php is not auto updating
« Reply #1 on: February 24, 2011, 01:27:56 AM »
Hi Jonathan,

The advforecast2.php script checks to see if it needs to update based on the age of the forecast.txt cache file.  If the file is older than 30 minutes (1800secs), then it will load from the URL you specified (for the point-printable forecast from weather.gov) and save the returned page for future use in forecast.txt.

It then goes on to process that returned page for icons and text.  When the forecast.weather.gov site is providing point-printable forecasts, all the icons and temps and text look fine.  If they were having an issue and substituted a Zone forecast for your point-printable one, then the script changes gears and parses the text forecast returned for key words to indicate which icons to use and the approximate temperature range forecasted in the Zone forecast.  When the point-printable forecast is available again, the script will load it when the cache file age is > 30 minutes.
You can use the ?force=1 on the wxforecast.php page to get it to reload the cache directly.

So.. long winded explanation, now the question:

What is it you are seeing when you suspect the script is not reloading as you expect it to?
Do you have a screen-capture of what it looks like when that happens?

Best regards,
Ken

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 suddenincline

  • Member
  • *
  • Posts: 47
    • Inclinemedialive.com
Re: advforecast2.php is not auto updating
« Reply #2 on: February 24, 2011, 06:22:45 AM »
I was using advforecast2.php on my old website so I reused the files and did not change the printable forcast location in the wxforecast.php file so it was causing big problems so when I forced it directly from the location of the advforecast2.php it would reload but not from the website it self.

So long and impatient story  :oops: I changed the location of the printable forecast in the wxforecast.php file and seems to be working now.

Thanks Ken
You have been lots of help  \:D/

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php is not auto updating
« Reply #3 on: February 24, 2011, 01:53:55 PM »
Hi Jonathan,

When using the template set, you don't need to change the advforecast2.php script, just make the appropriate entries in your Settings.php file for NOAA zone and point-printable forecast the advforecast2.php will pick those Settings.php entries up and use them instead of what is built-in the advforecast2.php script itself.  That way, you can replace the advforecast2.php with an updated copy, and not have to worry about fixing the internal settings in it.. it will just 'plug-'N-play' with the template.
All the support scripts included with the template sets work that way too (except for WU-radar-inc.php, which ONLY uses internal settings).

Best regards,
Ken
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 dasman

  • Forecaster
  • *****
  • Posts: 491
    • Wx Peotone
Re: advforecast2.php is not auto updating
« Reply #4 on: March 08, 2011, 04:12:15 PM »
Hey Ken,

Recently I have been getting an error in the script.  The error comes and goes.  It is:

Notice: Undefined offset: 9 in /home/content/p/e/o/peotone/html/index.php on line 385

Line 385 is the part of my page where the script is.  I did a view source on the page when the error showed and it looked like this:

Code: [Select]
<table width="1050">
<tr><td style="background-color: #99CCFF; border: thin blue solid;">
<table width="1020">
<tr valign="top">
<br />
<b>Notice</b>:  Undefined offset:  9 in <b>/home/content/p/e/o/peotone/html/index.php</b>; on line <b>385</b><br />
<td><b>Today<br /></b><br /><img src="./forecast/images/bkn.jpg" width="55" height="58" alt="Mostly Cloudy" title="Mostly Cloudy" /><br />Mostly<br />Cloudy</td><td><b>Tonight<br /></b><br /><img src="./forecast/images/nra100.jpg" width="55" height="58" alt="Heavy Rain. Chance for Measurable Precipitation 100%" title="Heavy Rain. Chance for Measurable Precipitation 100%" /><br />Heavy<br />Rain</td><td><b>Wednesday<br /></b><br /><img src="./forecast/images/ra80.jpg" width="55" height="58" alt="Rain. Chance for Measurable Precipitation 80%" title="Rain. Chance for Measurable Precipitation 80%" /><br />Rain<br /></td><td><b>Wednesday<br />Night</b><br /><img src="./forecast/images/nrasn50.jpg" width="55" height="58" alt="Chance Rain/Snow. Chance for Measurable Precipitation 50%" title="Chance Rain/Snow. Chance for Measurable Precipitation 50%" /><br />Chance<br />Rain/Snow</td><td><b>Thursday<br /></b><br /><img src="./forecast/images/sn30.jpg" width="55" height="58" alt="Chance Snow. Chance for Measurable Precipitation 30%" title="Chance Snow. Chance for Measurable Precipitation 30%" /><br />Chance<br />Snow</td><td><b>Thursday<br />Night</b><br /><img src="./forecast/images/nsct.jpg" width="55" height="58" alt="Partly Cloudy" title="Partly Cloudy" /><br />Partly<br />Cloudy</td><td><b>Friday<br /></b><br /><img src="./forecast/images/few.jpg" width="55" height="58" alt="Sunny" title="Sunny" /><br />Sunny<br /></td><td><b>Friday<br />Night</b><br /><img src="./forecast/images/nrasn.jpg" width="55" height="58" alt="Slight Chance Rain/Snow" title="Slight Chance Rain/Snow" /><br />Slight Chc<br />Rain/Snow</td><td><b>Saturday<br /></b><br /><img src="./forecast/images/rasn.jpg" width="55" height="58" alt="Slight Chance Rain/Snow" title="Slight Chance Rain/Snow" /><br />Slight Chc<br />Rain/Snow</td><td></td>

Any ideas?
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9244
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php is not auto updating
« Reply #5 on: March 08, 2011, 04:33:38 PM »
Ummm... the line number 385 refers to the PHP line number inside of your index.php (not the view-source number).

What's the PHP expression at line 385 in your index.php?

Best regards,
Ken
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

 

anything