cloudy cloudy

Author Topic: River/Lake Height Display addon page for WD-AJAX-PHP-USA  (Read 43181 times)

0 Members and 1 Guest are viewing this topic.

Offline Silversword

  • --Stan Y.
  • Posts: 964
  • Maui, Hawaii
  • OS/Browser:
  • Win NT 6.2
  • Firefox 22.0
    • Up Country Maui Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #300 on: July 16, 2013, 04:50:53 PM »
Thanks Dan for that info.  John G. has been working on this issue for me and resolved the square on the map issue.  Had to edit the location to Hawaii and not NY.  But still have other issues.  The cron job seems to be working but some other issues with the fetch and config files seems to be the issue for now.

Got the http://www.dwayneyamato.com/wx/wxriverpage2.php working for trouble shooting for Dennis to see what is up with my site.

Thanks you all for trying to resolve my issue with this project.

--Stan Y.
  Maui, Hawaii
WD 10.37s Bld 72
WDL 6.05

Dell Optiplex GX280-Intel Pentium 4 CPU 3.00GHz, 4 GB RAM
Webcam: Axis 211
Wx Sta: Davis Vantage Pro 2+

Offline gwwilk

  • Posts: 681
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 42.0.2311.135
    • Southeast Lincoln Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #301 on: May 08, 2015, 07:02:48 PM »
We've had some local flooding over the past few days, so my interest in the wxriverpage script has been heightened as well.  I was frustrated when the 'Trend' arrows were all blue horizontal ones even though the levels have been fluctuating markedly.

My simple fix for the problem, which boiled down to a failed 'strtotime($old)' statement in a 'while' loop, was to use this code:
Code: [Select]
// Get reading from 1 hour ago, then do some math.
if($trend==1){
$data1= strtotime($ObsTime) - (60 * 60);
$k=0;
$old = 999999999999;
while($data1<$old){
$k++;
$old = (string)$xmlData["$riverid"]->observed->datum[$k]->valid;
}
instead of:
Code: [Select]
// Get reading from 1 hour ago, then do some math.
if($trend==1){
$data1= strtotime($ObsTime) - (60 * 60);
$k=0;
$old = 999999999999;
while($data1<strtotime($old)){
$k++;
$old = (string)$xmlData["$riverid"]->observed->datum[$k]->valid;
}
The while loop was never entered because 'strtotime($old)' was always null when a time was used.  Dennis had changed to the 99999999999 string in his latest iteration of this script, but somehow he left the 'strtotime($old)' in place.  Even when a proper future date was entered as the initial '$old', the 'strtotime($old)' remained null.  Only when 'while($data1<strtotime($old)){' was changed to 'while($data1<$old){' did my trend arrows begin showing proper directional information.
« Last Edit: May 08, 2015, 07:04:36 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline gwwilk

  • Posts: 681
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 42.0.2311.135
    • Southeast Lincoln Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #302 on: May 12, 2015, 05:18:51 PM »
As our streams are now back in their banks and with little immediate chance of rain, the NWS is backing off on forecasting most of our local river heights.  This has left errors in any forecast with less than seven valid entries.

A fix for this in 'riverdetail.php' is to add a check for a valid forecast entry before attempting to display one by changing
Code: [Select]
while($i<$j+7){ ?>
to
Code: [Select]
while($xmlData->forecast->datum[$i]->valid && $i<$j+7){ ?>

This eliminates riverdetail.php's attempt to display seven forecasts when less than seven exist.  This forecast currently shows 4 forecast entries, but as time progresses they will dwindle to none after tomorrow, May 13.
« Last Edit: May 12, 2015, 05:21:19 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline EastMasonvilleWX

  • Posts: 252
  • Masonville, NY
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Firefox 37.0
    • East Masonville Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #303 on: May 16, 2015, 12:05:28 PM »
Jerry,

If you do not mind I would like to add these changes to my site and then, add them to the actual release of the script. I am extremely limited in time, but I would like to help keep this script going.

Thank you for looking into this, and making the changes you did. Hopefully this will help others out too!

Thanks,
-Dennis
East Masonville Weather
Upstate New York
http://eastmasonvilleweather.com


Offline gwwilk

  • Posts: 681
  • Lincoln, NE
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 42.0.2311.152
    • Southeast Lincoln Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #304 on: May 16, 2015, 12:18:54 PM »
Jerry,

If you do not mind I would like to add these changes to my site and then, add them to the actual release of the script. I am extremely limited in time, but I would like to help keep this script going.

Thank you for looking into this, and making the changes you did. Hopefully this will help others out too!

Thanks,
-Dennis
By all means do so, Dennis.  Thank you for the script.  It's my go-to page for local stream conditions when we're having storms in the area and I feel lost without it.  While its complexity is often beyond me, I can often troubleshoot small bits here and there when the error messages point me in the right direction.  Like they say, 'Even a blind hog finds an acorn once in a while.' :)
Regards, Jerry Wilkins
gwwilk@inebraska.com

Offline Backyard Weather

  • Posts: 12
  • Bucks County, PA
  • OS/Browser:
  • Win NT 6.3
  • Mozilla compatible
    • BackYard Weather
Re: River/Lake Height Display addon page for WD-AJAX-PHP-USA
« Reply #305 on: May 16, 2015, 03:07:22 PM »
After making a change published under this forum I noticed my readings now in the negatives???? I was at Washington's crossing earlier today and the water is there...and looks deep near the gauge......

 

cumulus