IMPORTANT! The server may go down soon - possibly permanently. Please read the latest post in Announcements and News

I strongly advise all users using my server for their web site to make alternative arrangements.

Outgoing mail is disabled because of the malware on the server. No new forum registrations are currently possible, and mail to the forum administrator will not work.

Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Yet Another Dayfile Reader (PHP)

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

Moderators: daj, TNETWeather

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

Re: Yet Another Dayfile Reader (PHP)

Postby nowind » Sun Aug 05, 2018 8:53 pm

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: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Sun Aug 05, 2018 11:44 pm

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Mon Aug 06, 2018 9:02 am

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: 8
Joined: Thu Feb 02, 2017 8:22 pm
Weather Station: Davis Vantage Vue
Operating System: Win 10

Re: Yet Another Dayfile Reader (PHP)

Postby nowind » Mon Aug 06, 2018 3:27 pm

@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: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Mon Aug 06, 2018 11:58 pm

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: 8
Joined: Thu Feb 02, 2017 8:22 pm
Weather Station: Davis Vantage Vue
Operating System: Win 10

Re: Yet Another Dayfile Reader (PHP)

Postby nowind » Wed Aug 08, 2018 10:49 am

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: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

*** IMPORTANT UPDATES ***

Postby beteljuice » Sun Sep 16, 2018 11:23 pm

*** 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: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

IMPROVEMENTS

Postby beteljuice » Sun Oct 07, 2018 1:47 am

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: 5194
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby mcrossley » Sun Oct 07, 2018 7:14 am

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: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Sun Oct 07, 2018 10:17 am

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: 377
Joined: Thu Jun 19, 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)

Postby Paul C » Fri Oct 12, 2018 6:24 pm

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

User avatar
Mapantz
Posts: 500
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Yet Another Dayfile Reader (PHP)

Postby Mapantz » Fri Oct 12, 2018 8:39 pm

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
Image

User avatar
Paul C
Posts: 377
Joined: Thu Jun 19, 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)

Postby Paul C » Sat Oct 13, 2018 8:27 am

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

User avatar
beteljuice
Posts: 2483
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Yet Another Dayfile Reader (PHP)

Postby beteljuice » Sat Oct 13, 2018 8:11 pm

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 Oct 14, 2018 9:43 pm, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
Paul C
Posts: 377
Joined: Thu Jun 19, 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)

Postby Paul C » Sun Oct 14, 2018 5:04 pm

Version 3.1

2014 !!

Had been working great for years

Will try a new version this evening


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 5 guests