Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.11.4 (build 3133) - 25 May 2021 (please see announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

PHP Web 'viewer' for Cumulus NOAA Style reports

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by tmabell »

Okay it is still crashing. I'm attaching the current version with that edit so there is no confusion.
Select a Year or Month report

Fatal error: Uncaught TypeError: Unsupported operand types: string * int in C:\www\Noaa-Reports-New.php:277 Stack trace: #0 {main} thrown in C:\www\Noaa-Reports-New.php on line 277
Noaa-Reports-New.php.txt
You do not have the required permissions to view the files attached to this post.

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

Fatal error: Uncaught TypeError: Unsupported operand types: string * int
OK. PHP8 no longer supports my 'dirty ' string to numeric fix either.

This a very, very, bad news. the beteljuice has gazillions of code that uses it :(

... back to this plot ;)

Code: Select all

//change 
$first_year = $first_year *1;

//modified
$first_year = intval($first_year);
Image
......................Imagine, what you will KNOW tomorrow !

tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by tmabell »

Wowzers! :o That change induced a slew of warnings, the extent of which I cannot report due to the fact that we got caught in a loop of repeating the same warnings over and over. They wouldn't stop. I had to stop the server to keep the error log from growing exponentially. Here is what keeps repeating continually:
Select a Year or Month report

Warning: Undefined array key "0999" in C:\www\Noaa-Reports-New.php on line 517
Warning: Trying to access array offset on value of type null in C:\www\Noaa-Reports-New.php on line 517
Warning: Trying to access array offset on value of type null in C:\www\Noaa-Reports-New.php on line 517
Warning: Undefined array key "0999" in C:\www\Noaa-Reports-New.php on line 517
I'll keep at this but I would like to wait until I can use my off-line test machine, if that's alright with you. That will be first thing tomorrow morning as i am not at home now. (I run my own Apache server located there). And if it would work better we can work through pm's or email so as not to fill up this thread. Let me know your thoughts.

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

Hmmph ....

the beteljuice uses:

for ($y = $now_year; $y >= $first_year; $y--) { // in two places

I have proven $now_year is a number (using !is_char(), because is_numeric() returns true if string looks like a number)
Edit: the beteljuice is a numpty - should have used is_string() - :evil:
We have ensured that $first_year is a number by using intval()

Yet at least one if not both of the loops is 'counting' down from "0999" to "0000" in PHP8 :bash:
The actual error messages are being produced by the second loop.

I need to think how to debug this one .....

Look for approx. your line 350

Code: Select all

	} // END year step through
 
 
 
// Now PREPARE the reports

// change to
	} // END year step through
 print_r($nav_build);
 exit;
 
// Now PREPARE the reports

This will show what the first loop has done, and the prog will quit before producing 36000 lines of errors :lol:

No rush ... PM me when you've done it please.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

PHP8 Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

Sorry about the delay ...

After a testing time with Tom (tmabell) a few edits to make the prog PHP8 compliant. ;)

No need to to update unless you have to, although it IS backwards compatible.

New zip in first post
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 3212
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice »

Brian - BCJKiw, reminded me of another tweak that we did for his version which tackles the degree symbol problem. :?

Added to the new(er) download ... ;)
Image
......................Imagine, what you will KNOW tomorrow !

Post Reply