Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.3 build 3059 - 04 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    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: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 11:46 am

    Yet Another Dayfile Reader (PHP)

    Release..V7.1.1 Fully php7 compliant (?)
    MAJOR CHANGES TO SEASONAL DATA (Dec, Jan, Feb were attributed to wrong year)
    Rainfall, EVT, WindRun display changed to show year / season totals / avg
    Optional: Rain Days summary included with rainfall

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

    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.

    6th Aug 2019- v7.1.1
    beteljuice_7_1_1 .zip
    • Main file - betel_readDayfile - rebuilt - major changes to Seasonal stuff
      How To - line number references updated,
    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_readDayfile_7_7_1.zip
    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.
    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
    }
    
    You do not have the required permissions to view the files attached to this post.
    Last edited by beteljuice on Sat 26 Oct 2019 10:49 pm, edited 67 times in total.
    Image
    ......................Imagine, what you will KNOW tomorrow !

    water01
    Posts: 1558
    Joined: Sat 13 Aug 2011 9:33 am
    Weather Station: WH1081
    Operating System: Windows 7 64bit HP SP1
    Location: Somewhere in the USA
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by water01 » Sat 01 Feb 2014 12:23 pm

    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

    User avatar
    beteljuice
    Posts: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 12:31 pm

    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: 1558
    Joined: Sat 13 Aug 2011 9:33 am
    Weather Station: WH1081
    Operating System: Windows 7 64bit HP SP1
    Location: Somewhere in the USA
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by water01 » Sat 01 Feb 2014 1:02 pm

    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.

    User avatar
    jdc
    Posts: 142
    Joined: Tue 19 Jun 2012 8:51 pm
    Weather Station: Davis VP2 : Instromet
    Operating System: Win 10 : Win XP
    Location: Berwick-upon-Tweed, England.
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by jdc » Sat 01 Feb 2014 2:49 pm

    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: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 4:21 pm

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

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 4:26 pm

    @ 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: 1298
    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 » Sat 01 Feb 2014 4:28 pm

    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: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 4:35 pm

    @ 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: 1298
    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 » Sat 01 Feb 2014 4:49 pm

    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: 524
    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 » Sat 01 Feb 2014 5:22 pm

    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: 1558
    Joined: Sat 13 Aug 2011 9:33 am
    Weather Station: WH1081
    Operating System: Windows 7 64bit HP SP1
    Location: Somewhere in the USA
    Contact:

    Re: Yet Another Dayfile Reader (PHP)

    Post by water01 » Sat 01 Feb 2014 7:15 pm

    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.

    User avatar
    beteljuice
    Posts: 2791
    Joined: Tue 09 Dec 2008 1:37 pm
    Weather Station: None !
    Operating System: ex XP SP3 - now W10 laptop grr
    Location: Dudley, West Midlands, UK

    Re: Yet Another Dayfile Reader (PHP)

    Post by beteljuice » Sat 01 Feb 2014 7:30 pm

    @ 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 » Sat 01 Feb 2014 9:52 pm

    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: 68
    Joined: Wed 28 Nov 2012 6:12 am
    Weather Station: Station closed
    Operating System: none at present
    Location: No fixed Address

    Re: Yet Another Dayfile Reader (PHP)

    Post by nossis » Sat 01 Feb 2014 10:29 pm

    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
    Barry
    Station Closed (Travelling around Australia)

    Post Reply