WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: cirrus on January 19, 2022, 12:39:26 AM
-
I just started seeing these notices, after doing todays Saratoga script updates:
Deprecated: Function strftime() is deprecated in /home/thedalle/public_html/altdash6/ajax-dashboard6.php on line 419
Deprecated: Function strftime() is deprecated in /home/thedalle/public_html/altdash6/ajax-dashboard6.php on line 420
Deprecated: Function strftime() is deprecated in /home/thedalle/public_html/altdash6/ajax-dashboard6.php on line 421
Deprecated: Function strftime() is deprecated in /home/thedalle/public_html/altdash6/ajax-dashboard6.php on line 425
ajax-dashboard6.php
lines 418 - 425:
strftime() is now deprecated with PHP 8.1 and will not work at all in a future PHP 9
I'm using @ for now to suppress those deprecated notices
if (!isset($avgmonthrain1) or $avgmonthrain1 == '') {
$avgmonthrain1 = ${'avrain' . @strtolower(strftime("%b"))};
if(isset(${'avsnow' . @strtolower(strftime("%b"))}) ) {
$avgmonthsnow1 = ${'avsnow' . @strtolower(strftime("%b"))};
} else {
$avgmonthsno1 = 0;
}
$avgmonthtemp1 = ${'avtemp' . @strtolower(strftime("%b"))};
Regards, Kevin
-
Yes, I spotted that deprecation also as I'm rummaging through the scripts doing fixups for PHP 8.1.
I'm doing all my currently released standard scripts first, then I'll move on to the legacy ones I distribute from my site.
The strftime() issue will also happen on the mesonet-map and global-map scripts, and I'll have updates for them soon.
-
Yes, I spotted that deprecation also as I'm rummaging through the scripts doing fixups for PHP 8.1.
I'm doing all my currently released standard scripts first, then I'll move on to the legacy ones I distribute from my site.
The strftime() issue will also happen on the mesonet-map and global-map scripts, and I'll have updates for them soon.
Sounds good, Ken.. Thank You [tup]
Best Regards, Kevin
-
Here is the errors I am getting since I updated to PHP 8.1. I have updated all of my saratoga pages. I am running ajax-dashboard.
https://www.goblesweather.com/index.php (https://www.goblesweather.com/index.php)
Fatal error: Uncaught Error: Undefined constant "month" in /home/goblesweather/www/www/AltAjaxDashboardConfig6.php:187 Stack trace: #0 /home/goblesweather/www/www/ajax-dashboard6.php(78): include_once() #1 /home/goblesweather/www/www/index.php(89): include_once('/home/gobleswea...') #2 {main} thrown in /home/goblesweather/www/www/AltAjaxDashboardConfig6.php on line 187
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
-
Please post your AltAjaxDashboardConfig6.php as AltAjaxDashboardConfig6.txt here.. the errors are in that file.
-
Here you go Ken. I have several errors on different pages I have to look into as well.
-
Change
$month = $today[month];
$day = $today[mday];
to $month = $today['month'];
$day = $today['mday'];
For the Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
.. that may be in another script (as an ini_set('allow_url_include','1'); ) or may be lurking in your .htaccess file .. I suspect the latter since loading https://www.goblesweather.com/Settings.php shows the error message (and it shouldn't show anything but a blank/zero content page). Check .htaccess file for that.
-
Looks like I have some work to do to get my pages php 8.1 compliant. Thanks for the fix.
Chuck
-
Here are the errors on my ajax-dashboard6.php that are showing up on my main page.
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 240
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 289
Deprecated: Function strftime() is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 327
Deprecated: Function strftime() is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 328
Deprecated: Function strftime() is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 329
Here is another fatal error on the page.
Fatal error: Uncaught Error: Attempt to assign property "date" on null in /home/goblesweather/www/www/ajax-dashboard6.php:3238 Stack trace: #0 /home/goblesweather/www/www/ajax-dashboard6.php(1212): getMoonInfo() #1 /home/goblesweather/www/www/index.php(89): include_once('/home/gobleswea...') #2 {main} thrown in /home/goblesweather/www/www/ajax-dashboard6.php on line 3238
Wish I knew how to fix the errors. I hate to keep on asking for help.
Chuck
-
You seem to be running Version 6.95c - 19-Apr-2019 of the alt-ajaxdashboard6.php.
Try downloading 6.95e which is fixed for PHP8.1 (https://saratoga-weather.org/legacy-scripts/AltAjaxDashboard695e.zip)
It's likely easier to install and customize the new version than to find all the errors I'd fixed in the old version :)
-
Sorry did not realize there was a new version of the dashboard. I will download it and edit it it as needed.
Thanks,
Chuck
Sent from my iPhone using Tapatalk
-
I updated to 6.95e. I have a couple of issues. First trying to find the current conditions. It is showing png as my image but should be jpg. Cannot find where to change that setting.
The next thing is deprecated errors under in my tides section under ajaxdashboard6.php script.
Warning: Undefined array key 2 in /home/goblesweather/www/www/ajax-dashboard6.php on line 3592
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 3592
Warning: Undefined array key 2 in /home/goblesweather/www/www/ajax-dashboard6.php on line 3593
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 3593
Warning: Undefined array key 2 in /home/goblesweather/www/www/ajax-dashboard6.php on line 3592
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 3592
Warning: Undefined array key 2 in /home/goblesweather/www/www/ajax-dashboard6.php on line 3593
Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/goblesweather/www/www/ajax-dashboard6.php on line 3593
Warning: Undefined variable $string in /home/goblesweather/www/www/ajax-dashboard6.php on line 3649
Here is the link to my homepage.
https://goblesweather.com/ (https://goblesweather.com/)
-
It's likely that the tide data is not being found and that's why the messages about 3592/3593 lines are happening. I don't use/have the tide data, so I can't help with that other than to have you shut off the messages by changing
#error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
error_reporting(E_ALL);
ini_set('display_errors','1');
to error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
#error_reporting(E_ALL);
ini_set('display_errors','1');
For the 3649 error, change function time_till_tide($time) {
// takes a time diff like 6740 secs and formats to '1 hour, 52 minutes'
$hrs = (int) intval($time / 3600);
to function time_till_tide($time) {
// takes a time diff like 6740 secs and formats to '1 hour, 52 minutes'
$string = '';
$hrs = (int) intval($time / 3600);
-
hi
just tried a test version https://www.hc-iom.co.uk/WD-AJAX3/index.php and got these errors note still using 7.4 PHP
at top of page
Notice: A non well formed numeric value encountered in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 480
Notice: A non well formed numeric value encountered in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 481
Tide section gives similar numbers as already posted
i have added the amendment already posted so the other error went
Daytime Records
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Nitetime Records
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
if the error lines are swapped the errors disappear but the daytime nighttime records give NaNC
have left with full errors for time being
-
hi
just tried a test version https://www.hc-iom.co.uk/WD-AJAX3/index.php and got these errors note still using 7.4 PHP
at top of page
Notice: A non well formed numeric value encountered in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 480
Notice: A non well formed numeric value encountered in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 481
Tide section gives similar numbers as already posted
i have added the amendment already posted so the other error went
Daytime Records
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Nitetime Records
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
Notice: Undefined variable: rtemp in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
Notice: Undefined variable: rtfdate in /home/storage/129/3316129/user/htdocs/WD-AJAX3/ajax-dashboard6.php on line 3003
NaNC
if the error lines are swapped the errors disappear but the daytime nighttime records give NaNC
have left with full errors for time being
I think the 480/481 errata are caused by having the units be in testtags.php for $dayrn = ' 0.0 mm'; // today's rain
$monthrn = '0.0 mm'; // rain so far this month
$yearrn = '215.8 mm'; // rain so far this year
you can fix that by either turning off the units in WD or changing the lines from $rndiff = $monthrn - $avgmonthrain1; // calculate difference in rain vs avg
$rndiff_mtd = $monthrn - $avg_mtd_rain; // calculate difference in rain vs avg month-to-date
to $rndiff = strip_units($monthrn) - $avgmonthrain1; // calculate difference in rain vs avg
$rndiff_mtd = strip_units($monthrn) - $avg_mtd_rain; // calculate difference in rain vs avg month-to-date
The ones for 3003 are likely a failure of the regex to parse your data from testtags. The regex if(preg_match('!^([\-\.\d]+)\s*([F|C])\s+on:\s+(.*)$!',$rtfdata,$M)) {
is expecting something like mine:
$mcoldestdayonrecord = '50.9F on: Mar 05 2022';
$mcoldestnightonrecord = '41.5F on: Mar 06 2022';
and what it is getting from your testtags.php is $mcoldestdayonrecord = '50.0°C on: 31 Mar 2022';
$mcoldestnightonrecord = '50.0°C on: 06 Mar 2022';
which fails the parsing due to the (unexpected) '°'.
Change the regex to be if(preg_match('!^([\-\.\d]+).*([F|C])\s+on:\s+(.*)$!',$rtfdata,$M)) {
and it will likely work with your data.
-
My condition icon is pointing to png. All the settings I see are jpg. Trying to figure out where to find why it is showing png. Also my temps have decimal points on my main page.
Chuck
-
In your Settings.php, you have
$SITE['fcsticonstype']= '.png';
and that is also set for the conditions icon.
Change it back to $SITE['fcsticonstype']= '.jpg';
or, if you want to keep the large icons for the forecast, then change ajax-dashboard6.php if (isset($SITE['fcsticonstype'])) { $condIconType = $SITE['fcsticonstype']; }
to # if (isset($SITE['fcsticonstype'])) { $condIconType = $SITE['fcsticonstype']; }
to avoid the override by Settings.php.
The temperature data from testtags.php has one decimal point -- you need to leave that so the Metric/Imperial display switch with JavaScript will correctly change the values as appropriate.
-
Hi
thanks Ken those mods have sorted the errors described
Harold
-
Seems like the DualImage I am getting intermittent issue with the icons. You can see it on my main page and my NOAA forecast page.
https://www.goblesweather.com/index.php (https://www.goblesweather.com/index.php)
When you right click on the broken icon and open in a new tab here is what it shows.
Deprecated: Implicit conversion from float 21.5 to int loses precision in /home/goblesweather/www/www/DualImage.php on line 498
Warning: Cannot modify header information - headers already sent by (output started at /home/goblesweather/www/www/DualImage.php:498) in /home/goblesweather/www/www/DualImage.php on line 345
PNG IHDRVV4 pHYs+ IDATxeٲeIr=b};ͩ*z@bh2 "e0@?7d'@ %졺+;p_|}7OٵN{·V}rZj;;߬RRU"e'RR]&* jD{eVKA ԔO/pxͫ1"$\گHA !( ( @@A :SR= jAS X92!>MsgKɴDIyqBg2ږ&DH HvBۿI %"S)w8LSgJrES7{]]^`tO4q#Kjj@x'ӷ^<C=B@*FCR>!%h "Cj@AR @ V"ED 0Pŝ_{dz *}0&ݫ"7SyKI9X)\: GZ@D@a\qxiႀ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=MP:ك'/7'?/zXHLj2Abʄ;r]?NWXH8AK4NAT05XqKOQdB[mAG &HG'~ԣ'?zxuUdWIPꋟ_ٍrh?z=w,.%5 aTkɑE[f * gЃ)~שM4pqbI6P d Gbvx7=1N|Tˊ}?MEe4l{o ]doA-*EЮHi}JT{Q>)UeݱDMQ[6U Uy@(`4d۔xt"?^':XׯWկɘ@T,Rr@!f!M)0'zex3#C{ `;B"!AqBfh֘eoG^$ӺVETۀE*sL)?>=/nw#爀wɶt@""H*jK[" ܵX(cZ8!(ApG Sa,YCr-* 2uݪ?ł&&]Hu=jP ܓkKiL3xI49 k%;Y* ~<uNpy0/]:D.,hd'#Pp iZ9T)m`ҵVzZ˦l52.;;לq)Emfc셐0RU! a6:#t/1w!K7ëTB2vˍ]pASEk*0S6 7M -c?hHIC0|?8fbV]κR͔B4&TI)u>x3)x9w'?|ݷexRՋ_$uQi*4 J2$!u=T4є7% 'sN]ʤQzaHB.Y)9t8w6Oe}L, "ڧ{*H D-%Znwxf)t'"193:VQ5b,FX-8ēx Fe-jaDQ}AL ATTNh8I-H:;RYȔDm>:"*e4Hfbt!on.)?v$pݬ%e{Tq/`H(:ND7RSSM>VDTJ^gMd`ܯ)F5Zu,k mw6W(@44TRˣ,4q'wr>.'ߤns'AtL=d}ԋ '\&nt]ojЌi1eIfZܳR,z̦ Y-ۂ留KhR p0|1 &dB8f?߬bUȤ)($T慩5I8rO65Ba ]v J G^WSl<V㤳^">vOhCF/j=J'(Dzz6供Uje`.MZ̋R{nd`8:+ei,mV- Z ]˄f`lW ڢk]zp0F-u ):)7|˓̕\ɮ{ث?8-QKkATHdѤo}|8!#o˻9:RשƛlvH;%Z\RANr bNV$9X5.]HzRڭ=i>9;wt:rPFw;kXTۇi!NZuUg5anV/5ޑ̓87V AIENDB`
-
Ahh.. PHP 8.1 is a gift that keeps on giving (Deprecated errata).
Download from here (https://saratoga-weather.org/DualImage.php?sce=view) and try it (V1.04)
-
It worked. Will keep an eye on it. Yea 8.1 is a constant work in progress. JPgraph is half working with PHP 8.1. There is a version 10 of JPgraph out there. I have it running on my server. Mostly the Rain, Windspeed, Barometer graphs are not working. Will post it on JPgraph thread.
Chuck
-
Great.. I've pushed the change to the Base-USA distribution. Keep me posted if more strangeness shows up :)
-
What version of JPGraph are you using?
I have v4.3.1.
http://cvweather.org/wxgraphs/wxgraphs_test.html and http://cvweather.org/wxastronomy.php
do not work with PHP 8.1
I reverted back to PHP 7.4 to test and they run OK.
-
I have version 10.4. Here is the link. https://github.com/mitoteam/jpgraph (https://github.com/mitoteam/jpgraph). I am starting a thread on Weather-Watch. But here is a link to my jpgraph test page and you can see the Windspeed, Barometer, and Rain graphs are broken.
Chuck
-
Thanks, I'll check it out.
-
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 (https://www.goblesweather.com/wxgr3hanis-dbZ.php)
Chuck
-
You're peeling them out of the woodwork, Chuck. :)
Try this (https://saratoga-weather.org/radar-status.php?sce=view) and see if that fixes the issue.
-
And again it fixed it. But will keep an eye on it. Will let you know if I find anything else. ;)
Chuck
-
I pushed the radar-status.php V1.19 to the distribution.. thanks again, Chuck.
-
Found another issue with the Version 4 advforecast. Here is the error,
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
-
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.
-
Hate to do this again but check out my metar page https://www.goblesweather.com/wxmetar.php (https://www.goblesweather.com/wxmetar.php). Several warnings and deprecated issues.
Chuck
-
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
-
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 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
-
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/wxaqirssV2.php)
https://www.goblesweather.com/wxhilowavg.php (https://www.goblesweather.com/wxhilowavg.php)
https://www.goblesweather.com/wxraintemptrends.php (https://www.goblesweather.com/wxraintemptrends.php)
https://www.goblesweather.com/wxextremes.php (https://www.goblesweather.com/wxextremes.php)
https://www.goblesweather.com/wxastronomy.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/wx_lvn_wxsimD.php)
https://www.goblesweather.com/wxgraphicalfc.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
-
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.
-
you must have a different wxastronomy.php than me perhaps?
mine works under 8.1.4
https://www.conligwx.org/wxastronomy.php
-
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.
-
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 (https://www.gwwilkins.org/wxgraphicalfc.php).
A new wxgraphicalfc.zip is available on my scripts page (https://www.gwwilkins.org/gwwScripts.php).
-
Is there a way to force a update to the worldextremes script? My page is not working correctly it is blank.
Chuck
-
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 (https://saratoga-weather.org/wxextremes.php) uses <div id="main-copy">
<?php include_once("worldextremes.php");
print "<div class=\"story\">\n";
print "<h1>Weather Extremes for $reportDate</h1>\n";
print "<p> </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> </p>\n";
}
?>
</div><!-- end main -->
-
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
-
Hey ConligWX Who wroe your wxastromy.php script? Mineis by Kevin Reedand not working in 8.1
-
Hey ConligWX Who wroe your wxastromy.php script? Mineis by Kevin Reedand not working in 8.1
belated I know, my appologies.
// 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.
-
Ive updated the ajax-dashboard6.php, ajaxWDwx3.js and cloud-base.php in release 6.95f in the legacy-scripts on my site.
-
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
-
I noticed that in the latest ajax-dashboard6.php 695f there are still some ${ variables.
-
Any help or advice would be appreciated
Is this (https://www.wxforum.net/index.php?topic=44475.msg452124#msg452124) any help?
-
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
-
I noticed that in the latest ajax-dashboard6.php 695f there are still some ${ variables.
D'Oh.. there are some. Have to fix that. Sorry.
And fixed for PHP 8.2.0 Updated 695f ajax-dashboard6.php in the legacy-scripts (https://saratoga-weather.org/scripts-legacy.php#scott) area on my site.
-
i put the updated wxatronomy on but shows a warning error under the moon https://www.hc-iom.co.uk/WD-AJAX3/wxastronomy.php top right i think it should be showing a number compared to https://www.hc-iom.co.uk/WD-AJAX1/wxastronomy.php
the moon transit was not showing but used this suggestion https://www.wxforum.net/index.php?topic=44475.25
-
Ahh.. I'd replaced part of the computations and it doesn't include Lunation. I've made it conditional now to avoid the warning message.
-
Hey Ken,
Many Many thanks to you, this makes me very happy !! it's the starter files that are the most important to get working and once again you've pulled the rabbit out of the hat.
A very happy new year to you my friend, you spend your own time helping others - Your Awesome !!
Thanks again, Nick. dw7240.com.
P.S. I have noticed other scripts that are not working like they should, but I'll hold off for now.