Author Topic: wxraintrending and wxglobalwarming scripts and php 8 and 8.1  (Read 1374 times)

0 Members and 1 Guest are viewing this topic.

Offline hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
has any one got these scripts wxraintrending and wxglobalwarming  working on php 8 or 8.1
when i tried php 8 last night i got a error 500 with wxraintrending and wxglobalwarming  gave a blank screen  have reverted back to 7.4

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #1 on: July 18, 2022, 06:37:44 PM »
I'd need to see the source for those pages (with any of the scripts included that are NOT basic Saratoga template scripts).

Please add them to a .zip file and post it, and I'll take a look.
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 hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #2 on: July 18, 2022, 06:57:22 PM »
Hi Ken
i can only find 2 files which i have attached as a zip
Thanks
Harold

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #3 on: July 18, 2022, 07:50:24 PM »
I've found the issue in these two scripts .. oddly enough, the same un-quoted constants in both.

The original code was
Code: [Select]
$uomTemp = $SITE[uomTemp]; // set here in case gizmo is not used
$uomRain = $SITE[uomRain]; // set here in case gizmo is not used
$imagesDir = $SITE[imagesDir];  // set here in case gizmo is not used
with the fix being
Code: [Select]
$uomTemp = $SITE['uomTemp']; // set here in case gizmo is not used
$uomRain = $SITE['uomRain']; // set here in case gizmo is not used
$imagesDir = $SITE['imagesDir'];  // set here in case gizmo is not used

and original of
Code: [Select]
$year = $today[year];
$month = $today[mon];
$day = $today[mday];
and the fix being
Code: [Select]
$year = $today['year'];
$month = $today['mon'];
$day = $today['mday'];

It was the same for wxglobalwarming.php and wxraintrending.php
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 hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #4 on: July 19, 2022, 02:37:04 PM »
That has sorted these scripts out and run ok

Thanks for that Ken

Harold

Offline Weerstation

  • Member
  • *
  • Posts: 43
    • Westland De Poel
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #5 on: October 07, 2022, 08:05:41 AM »
 [tup] =D>

Thanks Guys  [tup]

Got my page working again PHP 8.1.10

 \:D/

Offline hcorrin

  • Contributor
  • ***
  • Posts: 128
    • Ballaugh Weather
Re: wxraintrending and wxglobalwarming scripts and php 8 and 8.1
« Reply #6 on: October 07, 2022, 02:57:06 PM »
Hi
I was finding the wxraintrending.php was not showing the footer
I found by commenting out lines 274 and 275 (yearrn) and lines 278 and 279 (monthrn) allowed the footer to show
this was then giving two lots of units so I removed "  . $uomRain" from lines 295 and 334
it appears to be working ok
have attached my PHP as a txt file

Harold