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

0 Members and 1 Guest are viewing this topic.

Offline tstorm

  • Contributor
  • ***
  • Posts: 141
    • Harpers Ferry Weather
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

Offline stormwatch

  • Senior Contributor
  • ****
  • Posts: 182
    • Carolina StormWatch Weather
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.
CoCoRaHS NC-BR-1
CW0803
Advanced Spotter

Offline saratogaWX

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

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
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.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline saratogaWX

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

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 ke9lz

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


Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Thanks again for all you do for us!


+1 on that, Ken! You sure make this "hobby" easy to enjoy! Thank you, Sir!

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1314
  • BismarckWeather.net
    • BismarckWeather.net
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
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline AWL

  • Forecaster
  • *****
  • Posts: 727
    • Ardmore Weather Live
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.
« Last Edit: July 03, 2012, 10:08:30 PM by DougW »

Offline saratogaWX

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

  • Welcome to my area!
  • Forecaster
  • *****
  • Posts: 1647
  • In Loving Memory Of Hooker The Weather Dog !
    • Smyth-Grayson Weather
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!


     Best Regards
     Wayne

CWOP CW8217
KVAWHITE22 Wunderground   Davis VUE &  Davis Vantage Pro 2  /   Dedicated Server
GR Level 3 ,Level 2 AE Radars  Weather Display 10.37P  Mid Atlantic Weather Network Member
SkyWarn & Spotter Network 6092

Offline saratogaWX

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

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather
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
Mike Stanton
Air Products Campus Weather

Offline saratogaWX

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

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather
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
Mike Stanton
Air Products Campus Weather

Offline saratogaWX

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

  • Forecaster
  • *****
  • Posts: 1187
  • Boltek, Win7 Pro, ToA
    • TiggrWeather Phoenix
Nice, Ken - very nice. As always!   =D&gt;
John
W7JKG

Offline cospringswx

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




Ryan 

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

Offline n3ouc

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather
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
Mike Stanton
Air Products Campus Weather

Offline saratogaWX

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

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather
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
Mike Stanton
Air Products Campus Weather

Offline W Thomas

  • Welcome to my area!
  • Forecaster
  • *****
  • Posts: 1647
  • In Loving Memory Of Hooker The Weather Dog !
    • Smyth-Grayson Weather
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!


     Best Regards
     Wayne

CWOP CW8217
KVAWHITE22 Wunderground   Davis VUE &  Davis Vantage Pro 2  /   Dedicated Server
GR Level 3 ,Level 2 AE Radars  Weather Display 10.37P  Mid Atlantic Weather Network Member
SkyWarn & Spotter Network 6092

Offline saratogaWX

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

  • Contributor
  • ***
  • Posts: 123
    • Air Products Campus Weather

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
« Last Edit: July 04, 2012, 10:05:52 PM by n3ouc »
Mike Stanton
Air Products Campus Weather

Offline saratogaWX

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