meteotemplate php 8.0/8.1

panxabuida
Newbie
Newbie
Posts: 4
Joined: Thu Jan 16, 2020 11:55 pm
Location: Ontinyent - valencia
Station model: PCE-FWS-20
Software: cumulus
Contact:

Re: meteotemplate php 8.0/8.1

Post by panxabuida » Thu Feb 16, 2023 11:38 pm

Good night guys;
my service provider is going to drop support for php7.4 and
I spend hours and hours reading your suggestions and changes.
I have updated with the latest davidefa files but I can't get the station status and station block to work, stopping to update the database but it does update the current block.
my pay is panxabuida.es

What can I do or what can I look at?

thank you

spd2612
Forecaster
Forecaster
Posts: 165
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-5000/GW1100
Software: ECOWITT Plugin
Contact:

Re: meteotemplate php 8.0/8.1

Post by spd2612 » Thu Feb 16, 2023 11:58 pm

Well all the updated need to be put together in a pre release
It does work im using php 8.1
Keep in mind you may have to sacrifice some of the third party blocks and plugins but that time was coming some of those developers have moved on
David has been a real asset to keeping Meteotemplate still running
If you have done Dave's
updates and still have issues some debugging may have to be done if you dont know how just ask there are a lot of good people on here that can tell you how
Good luck


Good luck
Image

Ambient Weather WS-5000
Ultrasonic Anemometer
Thermo-Hygrometer Sensor WH31E
Soil Moisture Sensor WH31SM
Lightning Detection WH31L

User avatar
lemimi
Advisor
Advisor
Posts: 86
Joined: Wed Dec 12, 2018 3:31 pm
Location: France - Normandie
Station model: Brandson 304557
Contact:

Re: meteotemplate php 8.0/8.1

Post by lemimi » Fri Feb 17, 2023 9:25 am

Hello,
To update some of my programs written in php and rather than correct errors line by line, I recently discovered Rector.
It does help! Even if that does not accomplish everything.
It is a program that automatically upgrades and refactors your application's PHP code.
See here: https://github.com/rectorphp/rector
and even online directly: https://www.phptools.online/php-checker
More info by searching for Rector PHP 8 with your favorite search engine.
Do not forget to put or switch your local or remote server to php 8: a program that runs in php 8 may not work at all in 7 and even less in 5!
If that can help...
Good day... Michel

panxabuida
Newbie
Newbie
Posts: 4
Joined: Thu Jan 16, 2020 11:55 pm
Location: Ontinyent - valencia
Station model: PCE-FWS-20
Software: cumulus
Contact:

Re: meteotemplate php 8.0/8.1

Post by panxabuida » Sat Feb 18, 2023 2:01 am

spd2612 wrote: Thu Feb 16, 2023 11:58 pm Well all the updated need to be put together in a pre release
It does work im using php 8.1
Keep in mind you may have to sacrifice some of the third party blocks and plugins but that time was coming some of those developers have moved on
David has been a real asset to keeping Meteotemplate still running
If you have done Dave's
updates and still have issues some debugging may have to be done if you dont know how just ask there are a lot of good people on here that can tell you how
Good luck


Good luck
thanks for the comment.
I started again from scratch, left everything as it was with the backup copy and installed the files modified by davidefa one by one from the first php v1 to v 1.1 and now it's working.
some blocks don't work as expected but none important.
I'll be in php 8.0 for a few days and I'll go to php8.1 and even php 8.2 if possible.

Thanks again for the help, especially for Davidafe.

livefeed
Observer
Observer
Posts: 20
Joined: Sat Jan 26, 2019 6:05 am
Location: Lusby, MD
Station model: Davis pro 2
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by livefeed » Tue Mar 07, 2023 8:39 pm

Any help here would be much appreciated as I'm pulling my hair out!
The display of my webpage is completely messed up. I have updated all the files as mentioned earlier in this thread I've even tried a brand new fresh install, but the page layout using Safari on a Mac or chrome looks a mess even on a PC. Were is the problem? is it in the database or in the files as like I said with a clean install, I get the same output.

http://www.nitram-media.com/weather
PHP 8.1
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Wed Mar 08, 2023 8:42 am

Please describe as exact as possible, what you did.
Looks, like some formatting is missing.

Regards
Image

User avatar
lemimi
Advisor
Advisor
Posts: 86
Joined: Wed Dec 12, 2018 3:31 pm
Location: France - Normandie
Station model: Brandson 304557
Contact:

Re: meteotemplate php 8.0/8.1

Post by lemimi » Wed Mar 08, 2023 8:47 am

Good morning,
Your address with HTTP points to HTTPS.
If I force from my browser to open without security, your site is displayed normally.
Good day... Michel

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Wed Mar 08, 2023 8:54 am

Indeed... :D
But seems, that some blocks are still not updated (endless spinner) for PHP 8.x.

Regards
Image

livefeed
Observer
Observer
Posts: 20
Joined: Sat Jan 26, 2019 6:05 am
Location: Lusby, MD
Station model: Davis pro 2
Software: Meteobridge
Contact:

Re: meteotemplate php 8.0/8.1

Post by livefeed » Wed Mar 08, 2023 7:42 pm

Thank you all that replied, yes is was a http-https setting.
I have now updated plugins and all should be working, Thank again.
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: meteotemplate php 8.0/8.1

Post by meteoesine » Sun Mar 19, 2023 7:08 am

Hello,
checking for any ?errors this warning appears to me. How can i fix it?
many tnx in advance

Warning: Undefined variable $moreclouds in /.../template/scripts/headerMetar.php on line 832

if ($moreclouds == "yes") {
$returner = "$returner$cumulus";
} else {
$returner = false;
}
return $returner;
}

and also if running headerMetar.php
Warning: Undefined variable $baseURL in /home/cldvlwax/public_html/template/scripts/headerMetar.php on line 36
Warning: Undefined variable $baseURL in /home/cldvlwax/public_html/template/scripts/headerMetar.php on line 42


P.S. @FSC830 scripts are already installed
/header.php
/scripts/functions.php
/scripts/headerMetar.php
/homepage/css/themeSetter.php
/homepage/blocks/current/currentBlock.php
Attachments
Screenshot - 19_03_2023 , 08_07_03.jpg
Screenshot - 19_03_2023 , 08_07_03.jpg (26.6 KiB) Viewed 727 times
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Sun Mar 19, 2023 9:01 am

Hm, may that I did find this after uploading the last archive, but my file is slightly different.
Here its not line 832, but line 835:

Code: Select all

if ((isset($moreclouds)) && ($moreclouds == "yes")) {
The $baseURL issue was not seen at my site yet!?
Need to investigate this.

But when calling your site

Code: Select all

https://meteoesine.it/template/indexDesktop.php?errors
no errors are thrown!?

Regards
Image

User avatar
meteoesine
Forecaster
Forecaster
Posts: 166
Joined: Sun Aug 20, 2017 4:08 pm
Location: Esine, Valcamonica (BS) - Italy
Station model: Davis Pro2+
Software: Meteobridge nano
Contact:

Re: meteotemplate php 8.0/8.1

Post by meteoesine » Sun Mar 19, 2023 12:43 pm

true, I noticed it too after cleaning the pc with ccleaner ... :shock: :?
:arrow: https://meteoesine.it
ham wx aprs/cwop: IW2LAO-13

Image

User avatar
atari
Observer
Observer
Posts: 11
Joined: Tue Sep 05, 2017 11:54 pm
Location: Paraćin
Station model: ws2315
Software: weewx,cumulus
Contact:

Re: meteotemplate php 8.0/8.1

Post by atari » Mon Mar 20, 2023 12:50 am

updated currentBlock.php not woking on my config,Im using v18, good work 8-)
tested & runing on php8.2
Image

FSC830
Forecaster
Forecaster
Posts: 139
Joined: Thu Aug 02, 2018 11:40 am
Station model: Davis Vantage Pro2
Software: Meteobridge

Re: meteotemplate php 8.0/8.1

Post by FSC830 » Mon Mar 20, 2023 7:49 am

Hi,
"not working" is not a good description, what exactly is wrong?
Looking at your site https://neutrino-digital.com/template/i ... on=21.4173 currentBlock seems working as designed!?

Regards
Image

User avatar
atari
Observer
Observer
Posts: 11
Joined: Tue Sep 05, 2017 11:54 pm
Location: Paraćin
Station model: ws2315
Software: weewx,cumulus
Contact:

Re: meteotemplate php 8.0/8.1

Post by atari » Mon Mar 20, 2023 8:28 am

On v18 its working showing meteo data, but whan i try to update it show only time, all senzor are gone.
Btw Im using cumulus to send data to web.
Image

Post Reply