Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

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

Yet Another Dayfile Reader (PHP)

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

Moderator: daj

nowind
Posts: 13
Joined: Thu 02 Feb 2017 8:22 pm
Weather Station: Davis Vantage Vue Pro2
Operating System: Win 10

Re: Yet Another Dayfile Reader (PHP)

Post by nowind »

jlmr731 wrote:
Ugg yes I see that now, also tried with php 5.6 and looked that same :groan:

If there is anything that can be done like debugging let me know Ill try and help out

Even without average of averages I still love your work thanks so much !!!
I don't know if this is solved, but I just found out that if you delete line 749ish (or preferably comment the line with //, just in case):
$alltime = array(1 => '', 2 => '', 3 => '', 4 => '', 5 => ", 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => '');

then you got average of average.

I've tried to find any misreadings/problems, but haven't found any yet. Maybe beteljuice can confirm.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Odd ... you have effectively deleted the declaration and population of of multi-dimensional array - which the latest versions of PHP seem to demand :o - perhaps I shouldn't have 'nulled' it, but then there should be problems elsewhere ..

Do you know what version you are running ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by mcrossley »

In my version of the script I have...

Code: Select all

        $alltime = array(1 => [], 2 => [], 3 => [], 4 => [], 6 => [], 7 => [], 8 => [], 9 => [], 10 => [], 11 => [], 12 => []);
Since each month will be an array of values, but note that syntax will not work pre PHP 5.4.

And it is a rather wonderful combination of both old and new syntax!
nowind
Posts: 13
Joined: Thu 02 Feb 2017 8:22 pm
Weather Station: Davis Vantage Vue Pro2
Operating System: Win 10

Re: Yet Another Dayfile Reader (PHP)

Post by nowind »

@beteljuice: I have version: 5.0 - 18 April 2016 - beteljuice - changes for php 7 compatibility.

My PHP-version: 5.6.30.

This is what I have done:

I was just curious and downloaded version 3.1 and compared it with version 5.0. I used WinMerge to compare the two files. I found only 3 differences, really.

line 751: version 3.1: $alltime = array(1 => '', 2 => '', 3 => '', 4 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => ''); (Same as mcrossley's version)
line 751: version 5: $alltime = array(1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => '');

line 804 version 3.1: if($dataSet != 'winddir') $alltime[$m][] = $thisValue;
line 804 version 5: if($dataSet != 'winddir') $alltime[$m][$d] = $thisValue;

line 951 version 3.1: $seasonTot[$sT][] = $thisValue;
line 951 version 5: $seasonTot[$sT][$d] = $thisValue;

I spotted the difference in line 751, and then I removed 5 =>'' so my version was the same as 3.1. To my surprise the average of average for May was shown.

@beteljuice FYI:
I copied this small script into the file to check any errors:

error_reporting(E_ALL);
ini_set('display_errors', 1);

Warning: Illegal string offset 'short' in .../betel_readDayfile.php on line 1126

This warning comes repeatedly, but I don't think it has anything to do with the average of average problem.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

PHP 5.xx is much more forgiving than the later version(s) !

That is why it is working 'properly' for you :D

You will see MANY posts of older scripts which either hang or just don't give the results they used to - all because of a rash of PHP updates which are not backwardly compatible !!!
Image
......................Imagine, what you will KNOW tomorrow !
nowind
Posts: 13
Joined: Thu 02 Feb 2017 8:22 pm
Weather Station: Davis Vantage Vue Pro2
Operating System: Win 10

Re: Yet Another Dayfile Reader (PHP)

Post by nowind »

beteljuice wrote:
PHP 5.xx is much more forgiving than the later version(s) !

That is why it is working 'properly' for you :D
Yes, and I really appreciate your work! :clap:
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

*** IMPORTANT UPDATES ***

Post by beteljuice »

*** REVISITED AND REVISED ***

FULLY PHP 7 COMPLIANT PLUS SEVERAL BUG FIXES ....

As current users will know, various bits of functionality have fell off during the various upgrades of php7 together with attempted fixes :(

After a lot of assistance (and occassional hinderence) from BCJKiwi we have ironed everything out and fixed some 'old' bugs along the way :clap:

It is STRONGLY recommended that you update at least the main betel_readDayfile

betel_readDayfile - significant coding changes """

betel_dayfile_languages - Spanish added (thank you kocher) EDIT: leaf.gif is now leaf.png - copy in dayfile zip.

How To ... - line number references changed, otherwise the same

css_files - very minor changes, redundant -moz and webkit stuff removed, sunhours 'meter bar' made a bit more orange

DIY - near bottom of css files

Code: Select all

.meterBar {
    display: block;
    height: 16px;
    background-color: #FFD700;
    position: absolute;
    overflow: hidden;
    right: 0px;
}
Ensure that you backup / rename / move your 'working' files !!!

This is not only in case something doesn't work, but you will need to compare files for your settings and any personal tweaks you may have done
:bash:

ALL files available from the front page

I thank you all for your continued interest and patience with this 'project'; although hopefully we now be done :roll:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

IMPROVEMENTS

Post by beteljuice »

The beteljuice has nearly finished some major improvement for Sun Hours display including allowing multiple failure dates so zeros can now be valid, sun possible graph and mouse-over info, plus choice of max hours graph scale length - together with other minor tweaks and a couple of language additions.

If in the event of the forum server folding - I will try to post elsewhere and to a few where I have 'real' mail addresses.

ROUGH TEST PAGE HERE If you ae interested PM me with your real contact mail NOW ....
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by mcrossley »

You have been busy :D I'll be taking a look at the code next week.

One observation, mouse-overs do not work on mobile devices, maybe look at adding touch sensitivity? I'll have a look at the mouse-over on my laptop later....
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

mcrossley wrote:You have been busy :D I'll be taking a look at the code next week.

One observation, mouse-overs do not work on mobile devices, maybe look at adding touch sensitivity? I'll have a look at the mouse-over on my laptop later....
The code is VERY rough and incomplete ATM - stuff mobile devices :bash:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Paul C »

Hi

I have had this running for several years now, but last night I switched hosting companies and it now doesnt work.

I have successfully uploaded my old website and all the files and changed some settings in Cumulus to point the various files to the correct directories, but I cant get my histrocical.php to work which nicely shows all my old data

Can anyone suggest what I need to change or check please

http://www.bramptonweather.co.uk/historical.php

Many thanks
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
Image
Mapantz
Posts: 1774
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Mapantz »

Paul C wrote:Hi

I have had this running for several years now, but last night I switched hosting companies and it now doesnt work.

I have successfully uploaded my old website and all the files and changed some settings in Cumulus to point the various files to the correct directories, but I cant get my histrocical.php to work which nicely shows all my old data

Can anyone suggest what I need to change or check please

http://www.bramptonweather.co.uk/historical.php

Many thanks
A long shot, but.. log in to cpanel ( I presume you have it?) go to select php version, then click switch to php options then look for allow_url_fopen and see if it is set to on. If it isn't, set it to that.
Image
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Paul C »

Thanks

I am using 123reg as my hosting company - it has a control panel but only has listed various php versions. Not want what you mentioned sadly

cheers anyway
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

How old is the version you are using ?

Your host is returning 500 Internal server error: running PHP v7.2.10

Try the latest distribution version (although there may be another along shortly !)

Don't forget to back-up / compare user settings !!!!
Last edited by beteljuice on Sun 14 Oct 2018 9:43 pm, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
Paul C
Posts: 538
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by Paul C »

Version 3.1

2014 !!

Had been working great for years

Will try a new version this evening
Paul C
Brampton, Cumbria, UK
117m ASL
http://www.bramptonweather.co.uk
Image
Post Reply