Page 29 of 55

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 05 Aug 2018 8:53 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 05 Aug 2018 11:44 pm
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 ?

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 06 Aug 2018 9:02 am
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!

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 06 Aug 2018 3:27 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Mon 06 Aug 2018 11:58 pm
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 !!!

Re: Yet Another Dayfile Reader (PHP)

Posted: Wed 08 Aug 2018 10:49 am
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:

*** IMPORTANT UPDATES ***

Posted: Sun 16 Sep 2018 11:23 pm
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:

IMPROVEMENTS

Posted: Sun 07 Oct 2018 1:47 am
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 ....

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 07 Oct 2018 7:14 am
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....

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 07 Oct 2018 10:17 am
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:

Re: Yet Another Dayfile Reader (PHP)

Posted: Fri 12 Oct 2018 6:24 pm
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Fri 12 Oct 2018 8:39 pm
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.

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 13 Oct 2018 8:27 am
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

Re: Yet Another Dayfile Reader (PHP)

Posted: Sat 13 Oct 2018 8:11 pm
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 !!!!

Re: Yet Another Dayfile Reader (PHP)

Posted: Sun 14 Oct 2018 5:04 pm
by Paul C
Version 3.1

2014 !!

Had been working great for years

Will try a new version this evening