Author Topic: PHP 8.1 and ajax-dashboard6.php - new deprecated notices  (Read 3511 times)

0 Members and 1 Guest are viewing this topic.

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #25 on: April 06, 2022, 02:29:37 PM »
Hey Ken,

Have another issue, this time it is the radar status. You can see the radar status in the yellow box.
https://www.goblesweather.com/wxgr3hanis-dbZ.php

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #26 on: April 06, 2022, 03:08:17 PM »
You're peeling them out of the woodwork, Chuck. :)

Try this and see if that fixes the issue.
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #27 on: April 06, 2022, 03:16:28 PM »
And again it fixed it. But will keep an eye on it. Will let you know if I find anything else.  ;)

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #28 on: April 06, 2022, 03:32:29 PM »
I pushed the radar-status.php V1.19 to the distribution.. thanks again, Chuck.
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #29 on: April 07, 2022, 03:37:06 PM »
Found another issue with the Version 4 advforecast. Here is the error,
Quote
Fatal error: Uncaught ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in /home/goblesweather/www/www/advforecast2-V4.php:687 Stack trace: #0 /home/goblesweather/www/www/advforecast2-V4.php(687): strpos('', '<td colspan="2"...', 1) #1 /home/goblesweather/www/www/ajax-dashboard6.php(206): include_once('/home/gobleswea...') #2 /home/goblesweather/www/www/index.php(89): include_once('/home/gobleswea...') #3 {main} thrown in /home/goblesweather/www/www/advforecast2-V4.php on line 687

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #30 on: April 07, 2022, 03:46:08 PM »
That's likely caused by a failure to get the forecast from weather.gov site.  Check your cache/forecast-WAC033-0.txt file for text.

Run the advforecast2-V4.php?force=1 on your site to refresh the cache.
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #31 on: April 08, 2022, 12:49:32 PM »
Hate to do this again but check out my metar page https://www.goblesweather.com/wxmetar.php. Several warnings and deprecated issues.

Chuck

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1177
  • BismarckWeather.net
    • BismarckWeather.net
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #32 on: April 08, 2022, 02:13:40 PM »
Interesting.  I'm running PHP 8.1.3.  Upgraded earlier in the week from 8.0.  I'm not having any issues with my METAR page.  GoDaddy hosting.

https://www.bismarckweather.net/wxmetar.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #33 on: April 08, 2022, 02:28:11 PM »
I am using ICDSoft hosting. I think I just fixed it. I had a metar that was not active. I will watch it  and see how it goes.

Chuck

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 782
  • #conligwx
    • conligwx.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #34 on: April 08, 2022, 06:52:36 PM »
I am using ICDSoft hosting. I think I just fixed it. I had a metar that was not active. I will watch it  and see how it goes.

Chuck

I think you still have issues on your site:  https://www.goblesweather.com/check-fetch-times.php
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #35 on: April 11, 2022, 01:53:09 PM »
Yes I do. I have several pages that do not like PHP 8.1. Here is a list of pages that I have issue with. I am not sure if it is my PHP settings on my webhost or is it the script needs a modification to fix these issue. Plus I need to contact the author of the scripts to see what they say. I know some of them are older scripts.  I would appreciate any help possible.

https://www.goblesweather.com/wxaqirssV2.php

https://www.goblesweather.com/wxhilowavg.php

https://www.goblesweather.com/wxraintemptrends.php

https://www.goblesweather.com/wxextremes.php

https://www.goblesweather.com/wxastronomy.php
This script has jpgraph used by sunposa.php. There are issues with jpgraph with PHP8.1. I have updated to Version 10.4 and it did help out some.

https://www.goblesweather.com/wx_lvn_wxsimD.php

https://www.goblesweather.com/wxgraphicalfc.php
The fault occurs when you choose 3-4 days and then the fault stays on the page. When you initially open it up there is no fault.

Thanks,
Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #36 on: April 11, 2022, 04:30:56 PM »
Ah... those scripts are generally not mine, except for the worldextremes.php script which you should update from https://saratoga-weather.org/scripts-NWSmisc.php#NWSEXTR

The others will either have to be fixed by their authors or by you using the error_log as a guide on what to fix.
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 ConligWX

  • Forecaster
  • *****
  • Posts: 782
  • #conligwx
    • conligwx.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #37 on: April 11, 2022, 06:09:24 PM »
you must have a different wxastronomy.php than me perhaps?

mine works under 8.1.4

https://www.conligwx.org/wxastronomy.php
« Last Edit: April 11, 2022, 06:22:27 PM by ConligWX »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2550
    • SouthEast Lincoln, NE Weather
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #38 on: April 11, 2022, 06:30:50 PM »
The 'wxgraphicalforecast.php' script is mine, but I haven't upgraded my site's PHP to 8.1 so I don't have any way to reliably debug the script.

I'll work on it as time permits, but the $SITE[] and $SESSION[] arrays are problematic.  My efforts thus far have been in vain.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2550
    • SouthEast Lincoln, NE Weather
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #39 on: April 11, 2022, 07:07:15 PM »
Well, I apparently used a shortcut with this script and never noticed the error that was present in my version of PHP, 7.4.

I think I've sorted the problems and that the script behaves as intended.

A new wxgraphicalfc.zip is available on my scripts page.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #40 on: April 12, 2022, 12:24:41 PM »
Is there a way to force a update to the worldextremes script? My page is not working correctly it is blank.

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #41 on: April 12, 2022, 01:16:38 PM »
Yes, include ?force=1 on the URL of the page displaying the contents of worldextremes.php.

Looking at view-source:https://www.goblesweather.com/worldextremes.php shows the script is working correctly.  Keep in mind, the script doesn't directly display anything.. it just loads the appropriate variables for you to print/echo the contents on your page.

For example, my own page uses
Code: [Select]
<div id="main-copy">
<?php include_once("worldextremes.php");
print 
"<div class=\"story\">\n";
print 
"<h1>Weather Extremes for $reportDate</h1>\n";
print 
"<p>&nbsp;</p>\n";
gen_display("World"." (omitting $omittedCountry)",$worldhigh,$worldlow,$worldprecip);

gen_display("Canada",$countryhigh,$countrylow,$countryprecip);

gen_display("USA (lower 48)",$usahigh,$usalow,$usaprecip);

list(
$glhigh,$gllow,$glprecip) = scan_for($worldStations,"United States","AK",$tUOM,$rUOM);
gen_display("Alaska"."",$glhigh,$gllow,$glprecip);

gen_display("California",$statehigh,$statelow,$stateprecip);

list(
$glhigh,$gllow,$glprecip) = scan_for($worldStations,"United States","HI",$tUOM,$rUOM);
gen_display("Hawaii"."",$glhigh,$gllow,$glprecip);

print 
"<p><small><strong>Data from <a href=\"https://www.cpc.ncep.noaa.gov/products/cadb/\">NOAA Climate Prediction Center</a>.  ";
print 
"worldextremes.php script by <a href=\"/scripts-NWSmisc.php#NWSEXTR\">Saratoga-weather.org</a></strong></small><br/>"."\n";
print 
"Raw-data CSV file <a href=\"".gen_url($utcUse)."\">Download</a></p>\n";

print 
"</div>\n";

function 
gen_display($legend,$hightemp,$lowtemp,$precip) {
print "<h2>$legend</h2>\n";
print "<table style=\"border: none;\">\n";
print "<tr><td><span style=\"color: red\"><strong>High Temperature:</strong></span></td><td>$hightemp</td></tr>\n";
print "<tr><td><span style=\"color: blue\"><strong><br/>Low Temperature:</strong></span></td><td><br/>$lowtemp</td></tr>\n";
print "<tr><td><span style=\"color: green\"><strong><br/>Precipitation:</strong></span></td><td><br/>$precip</td></tr>\n";
print "</table>\n";
print "<p>&nbsp;</p>\n";
}
?>

</div><!-- end main -->
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 383
    • Gobles Weather Page
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #42 on: April 12, 2022, 01:46:44 PM »
Thanks Ken did not realize I had to put all that with the include. Page is working now. This will be a work in progress. My astronomy page was done by Bashewa and TNET so that script is going to be a challenge. I changed back to the more basic page. Working on JPgraph with Broadstairs. I emailed Murry on the raintemptrends, wxnoaarecords scripts. Waiting on a answer from him. My local AQI was done by Relay. My wxsim is done by Wim. So will have to get a hold of him.

Thanks,
Chuck

Offline yamiacaveman

  • Forecaster
  • *****
  • Posts: 388
    • Penn Lake Weather
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #43 on: October 02, 2022, 12:50:24 PM »
Hey ConligWX Who wroe your wxastromy.php script? Mineis by Kevin Reedand not working in 8.1

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 782
  • #conligwx
    • conligwx.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #44 on: December 30, 2022, 06:34:13 PM »
Hey ConligWX Who wroe your wxastromy.php script? Mineis by Kevin Reedand not working in 8.1

belated I know, my appologies.

Quote
// Version 1.01 - 22-Jan-2012 - fixes for mixed date format translations.

#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #45 on: December 30, 2022, 06:40:21 PM »
I’ve updated the ajax-dashboard6.php, ajaxWDwx3.js and cloud-base.php in release 6.95f in the legacy-scripts on my site.
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 DW7240

  • Senior Contributor
  • ****
  • Posts: 216
    • The Vicarage Weather Feed
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #46 on: December 31, 2022, 04:05:52 PM »
Hi,

I have noticed since updating to php 8.1 that 1 or 2 scripts don't work, but on the whole and with much gratitude to those involved with upkeeping the scripts, the update went smoothly.  One script that is completely down is the "include-wxastronomy.php"  I have read that users have reverted back to the original script and had little to no issues, my version attached worked with php 7, but fails to load with current php version.  Any help or advice would be appreciated, otherwise as I said above, transition to newer php no issues.

Thanks. Nick. dw7240.com


Offline mexbound

  • Senior Member
  • **
  • Posts: 61
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #47 on: December 31, 2022, 04:32:43 PM »
I noticed that in the latest ajax-dashboard6.php 695f there are still some ${ variables.

Offline Vasco

  • Senior Member
  • **
  • Posts: 64
    • PWS
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #48 on: December 31, 2022, 04:42:31 PM »
Any help or advice would be appreciated

Is this any help?
Oregon Scientific WMR200 + Weather Display in Windows 10

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 8766
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: PHP 8.1 and ajax-dashboard6.php - new deprecated notices
« Reply #49 on: December 31, 2022, 06:42:03 PM »
That wasn't the problem.. it was some older code in getMoonInfo() and a few Notice errata.  Now fixed and works with PHP 8.1
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