Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 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

Post Reply
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

Yet Another Dayfile Reader (PHP)

Post by beteljuice »

Yet Another Dayfile Reader (PHP)

Release..V7.1.4 Fully php7 compliant (?) - 14 Jan 2021
BUG FIX - Seasonal table leap year problem and 'cookies' code updated.

>Large< . . . . >750 px wide< . . . . >700 px wide< with buttons ... .>700 px wide<

*NEW* .. >700 px wide< in CuMX 10.3+ template

You should be happy with general logic and PHP.
You should be uploading your dayfile.txt to 'the web' on a regular basis.
You should have a good understanding of your own data and spot any anomalies or glitches.
You should be able to follow comments and have little (If any) instruction ! - Cumulus, saratogaWX and WeatherByYou examples in "How To" file.

It can be used as a stand-alone or dropped into a suitable site template.
It can 'read' saratogaWX templates for language and $SITE Units Of Measure decisions.
It can 'read' Weather By You templates for language decisions.

beteljuice_7_1_4.zip
Main file - betel_readDayfile - bug fix in Seasonal leap year

Distribution Contains:
  • Three 'default' holders which use
    Three different css files. (plus meteo template css)
    betel_readDayfile.php

    language translations file ...
    • cs (milos.jirik)
      de (KarlS)
      en (anon)
      es (kocher)
      fi (mikkimii)
      fr (laulau)
      it (BCJKiwi)
      nl (nitrx)
      no (sutne)
      pl (pernaczy)
      pt (BCJKiwi)
    "How To" text file.
    Six graphic files (daffodil.png, hatch2.jpg, leaf.png, snowflake.png, sun.png, raindrop.png)

ALL files should be edited / saved as UTF-8 no BOM

Most dayfile data has been represented, and any unwanted options can easily be 'turned off'.

For ease of updates - main files as stand alone downloads. [They ARE included in distribution above].


betel_dayfile_languages_7_1.zip
betel_datasummary_css_7_1.zip
betel_Dayfile_HowTo_7_1_1.zip
Known limitations:
  • Unable to show * (incomplete data advisory) for Daylight Hours.
    Will give unreliable calculations for 'false' data which is 0 or 0.0 instead of null.
*NEW* additional file NOT in distro - CuMX 10.3+ / Neil Thomas template example ...

yadr.zip


Anyone can 'play', but the beteljuice will NOT be answering any 'general' enquiries along the lines of "How do I ..." and "I want ...".

If you have unexpected figures - PLEASE check / clean-up your dayfile.txt

Edit: "Forgot To Mention"
If allowed vistors to the page will have their display unit preferences remembered by cookies for 30 days.

You can change the 'button' style menu for a 'drop-down'. (NO 'post' option)

Code: Select all

$buttons = true; // true = button options, false = dropdown options
You can change the default table from 'daily' to 'seasonal'. (or you can 'post' ?pane= ....)

Code: Select all

// which default 'table' do we want ?
if (!isset($_REQUEST["pane"])) {
    $pane = 0; // 0 default - show 'daily', 1 - show 'seasonal'
} else {
    $pane = $_REQUEST["pane"];
}
You can change the default content from Max Temp to ..... (or 'post' ?data=.... )

Code: Select all

// right at the bottom !!
if (isset($_GET['data'])) {
    $dataSet = $_GET['data'];
} else {
    $dataSet = 'maxtemp'; // default dataset
}
Edit: Dec 2019 ...
There are many things that can be 'tweaked', refer to 'How To' and comments in script.
A further suggestion from BCJKiwi for the SANITIZE list.
Just a thought about heatdays and cooldays.

I added these to the SANITIZE list quite a long time ago.
Why?
Well it seems to me that if the value on any one day is zero, then by definition it is NOT a heating day NOR a cooling day.
This change makes the average values make more sense to me.
You do not have the required permissions to view the files attached to this post.
Last edited by beteljuice on Tue 24 Aug 2021 9:51 pm, edited 79 times in total.
Image
......................Imagine, what you will KNOW tomorrow !
water01
Posts: 3201
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

OK accepted the challenge!!

Here is mine minus UV and Solar, showing C, in, mph and mb as defaults and picking up dayfile.txt in default weather directory.

http://www.dmjsystems.co.uk/weather/basic.php
David
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 »

Your 2011 Jan => Mar data needs cleaning up ;)
Now try 'dropping' it in your own site style 'template' ..
Image
......................Imagine, what you will KNOW tomorrow !
water01
Posts: 3201
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

Don't actually have data for 2011 Jan,Feb,Mar as only started in Apr 2011, so I put in 3 dummy lines to make some other code work.

Code: Select all

01/01/11,0.0,0,17:44,9.1,23:44,20.2,18:14,1012.8,17:14,1014.6,23:14,0.0,00:00,0.0,0.0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
01/02/11,0.0,0,17:44,9.1,23:44,20.2,18:14,1012.8,17:14,1014.6,23:14,0.0,00:00,0.0,0.0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
01/03/11,0.0,0,17:44,9.1,23:44,20.2,18:14,1012.8,17:14,1014.6,23:14,0.0,00:00,0.0,0.0,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Your wish is my command http://www.dmjsystems.co.uk/weather/basic.php NB not edited into my menu system yet, next task, but need some breakfast!!

EDIT have now tidied up dayfile.txt for Jan, Feb, Mar.
David
Image
User avatar
jdc
Posts: 142
Joined: Tue 19 Jun 2012 8:51 pm
Weather Station: Davis VP2 : Instromet
Operating System: Win 10
Location: Portsoy,.
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by jdc »

I have broken the layout when I add my .css (which has some same names in it) and reduce width in this q&d include page here.
I had to add a font size to '#table_container table td,table th' as data table font remained large.

Functionality is spot on, data totals/averages are correct (compare with my page from db) - I would just need to sort out styling.
I only removed 'UV' and altered menu_split number.

Very nice, BTW!
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 »

@ jdc

Your columns are too narrow (or font too large !)
See baro entries (table 'breaks' container width) or where * has been added (table cells wrap)

In YOUR table_name css you need to remove your height attribute.
BTW - Your baro seems to be absolute from 18th Dec ?

I need to modify the menu 'break' code - it has given you an extra line although there is nothing to be put there.
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

Re: Yet Another Dayfile Reader (PHP)

Post by beteljuice »

@ David

hmm .......
Should I make all the 'content' of the 'title' transparent or fill with white ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx »

I've a headache atm but http://apeldoorn.tk/weer/basic.php works fine even with decimal comma's 8-) have to translate and validate the data thanks for sharing Betel :geek: .


EDIT al values are rounded to nul after the decimal , have to dinner now
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 »

@ Ron - a pleasure as always, I wait for you to break it languagewise :lol:

Looks like I've got to double-check the way I create the 'season' o/p - sigh ..
EDIT al values are rounded to nul after the decimal , have to dinner now
EDIT: Bu**er - I thought forgot it isn't always . dec separator.
.. BIG problems .. don't go any further Ron .. unless you just want to play with translations.

have to pub now :?
Last edited by beteljuice on Sat 01 Feb 2014 7:20 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nitrx »

As I said I've an headace will try tthe translations asap if you need my dayfile its here for testing http://www.apeldoorn.tk/weer/dayfile.txt (I also miss december 2009 bon appetit :lol:
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by laulau »

Hi,
Here is mine http://meteo.laurentmey.fr/Viewdayfile/dayfileb.php
I've a problem with "Vent" give me an error
Warning: number_format() expects parameter 1 to be double, string given in /homez.764/laurentmp/www/meteo/Viewdayfile/betel_readDayfile.php on line 510
ok with "Rafale" :oops:
Was working in prévious version.
You should put kilometers in translation section ;) !
Laurent

Image
water01
Posts: 3201
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by water01 »

beteljuice wrote:@ David

hmm .......
Should I make all the 'content' of the 'title' transparent or fill with white ?
Well personally I like it, looks very clean and unfussy.
David
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 »

@ Laurent

Native km/h bug - to fix
Do mean eg. Kilometres ? - I had a Damn Yankee moment, sorry !

@ David

I was thinking about the dropdown selector(s) when the background 'interferes' ...
Image
......................Imagine, what you will KNOW tomorrow !
mikkimii
Posts: 42
Joined: Fri 23 Mar 2012 3:17 pm
Weather Station: Davis VP2
Operating System: Windows 7 x64 Pro
Location: Vilppula, Finland

Re: Yet Another Dayfile Reader (PHP)

Post by mikkimii »

nitrx wrote: EDIT al values are rounded to nul after the decimal , have to dinner now
I have same issue here. Here is my testing in Finnish and Leuven template: http://www.phpoint.fi/leka446/weather2/index.php?p=900 (Sorry, my host is veeery slow at this moment) :evil:

I change UV to Max. Solar radiation.

Now I need few (read at least 10) beers :lol:
Br,
Mika
Image
nossis
Posts: 89
Joined: Wed 28 Nov 2012 6:12 am
Weather Station: Davis Vantage Pro 2
Operating System: Win 10
Location: Perth AU
Contact:

Re: Yet Another Dayfile Reader (PHP)

Post by nossis »

Thanks a heap!
I have been looking at others who had similar with great admiration and dreamed that I could to. You have made my day!

Test page http://members.iinet.net.au/~nossis/weather/basic.php

I will see if I am clever enough to adjust the colorings. We get a bit hot here.

Lost the anemometer in 2013 as the data shows.
Also will investigate why not getting UV index values, had the instrument as of early 2013.

Barry
Post Reply