Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.2.4 build 3060 - 10 December 2019.
    Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

    See the Wiki for downloading either version.

    Top 10 Records Page

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

    Moderator: daj

    User avatar
    mcrossley
    Posts: 5805
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Top 10 Records Page

    Post by mcrossley » Tue 03 Oct 2017 7:59 am

    Fixed, though I see my phone is now in a time warp, it updated this morning to the Oreo 5th October 2017 update! :lol:

    MeteoBisignano
    Posts: 79
    Joined: Mon 09 Mar 2015 10:45 am
    Weather Station: wh3080
    Operating System: windows
    Location: Cosenza

    Re: Top 10 Records Page

    Post by MeteoBisignano » Sat 07 Oct 2017 9:29 am

    Hi guys
    after updating my file squil in the import phase I give error 500
    I downloaded the latest version of importcumulusfile.php and toptens.php
    who helps me solve it?

    User avatar
    mcrossley
    Posts: 5805
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Top 10 Records Page

    Post by mcrossley » Sat 07 Oct 2017 6:44 pm

    You will need to look in your web servers error log for a clue. Failing that you will need to enable full error reporting in the script. I'm away on holiday at the mo, so support from me is going to be patchy/intermittent.

    colinpb
    Posts: 86
    Joined: Thu 10 Nov 2011 8:14 pm
    Weather Station: VP2+SHT31+DFars+Solar+AeroCone
    Operating System: Windows 10
    Location: Hemel Hempstead, Hertfordshire, UK

    Re: Top 10 Records Page

    Post by colinpb » Sun 08 Oct 2017 10:13 am

    Installed Top 10 records, and I have a query regards this years records. I was expecting to see all records broken in 2017 showing in blue, however only one in September for smallest pressure change is showing. Is this how it’s meant to be; if so is there a way to turn on all records broken for 2017?
    To see how my records look, go to the the system info page; which I use for testing.

    Colin

    User avatar
    mcrossley
    Posts: 5805
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Top 10 Records Page

    Post by mcrossley » Sun 08 Oct 2017 5:32 pm

    The highlight's are for the last 30 days, or this year depending on the record type. You can change the 30 day period somewhere near the top of the source code. I don't have access to that at the mo to check though.

    To do "this year" for all records would be more involved as the SQL queries themselves return the highlight flag.

    colinpb
    Posts: 86
    Joined: Thu 10 Nov 2011 8:14 pm
    Weather Station: VP2+SHT31+DFars+Solar+AeroCone
    Operating System: Windows 10
    Location: Hemel Hempstead, Hertfordshire, UK

    Re: Top 10 Records Page

    Post by colinpb » Sun 08 Oct 2017 7:27 pm

    Mark

    I thought that's how it was working. My old Access produced top ten records changing for the current year, but on numerous pages. Your work is far superior.

    Thank you

    Colin

    sfws
    Posts: 466
    Joined: Fri 27 Jul 2012 11:29 am
    Weather Station: Final post in top ten topic
    Operating System: Tempermental Win. 10 PC
    Location: Moving

    Re: Top 10 Records Page

    Post by sfws » Mon 09 Oct 2017 7:59 am

    I have not looked up Mark's source, and I recall that I made many changes for my version as discussed with Mark at the time.
    I have found I used

    Code: Select all

    $recentHighlight = $monthNum * 31; // number of days (+1) of recent records to highlight, initialised at approximate equivalent for number of days so far this year
    Colin
    I suspect $recentHighlight is the variable name that Mark chose, and as you can see from my comment I have approximated it to highlight everything this year by multiplying it by the values shown ($monthNum will be 10 for October). PHP does have ability to report a date in the number of days this year format (it is 'z') so with hindsight that would be better way to define the maximum number of days old that require the highlight.

    Code: Select all

    $recentHighlight = new DateTime ("now") -> format("z");
    As Mark says for many tables recent test is in the SQL, the first two items in the select are what appears in the table and the third is a condition that determines if it is highlighted. Again I modified mine to compare just year by writing

    Code: Select all

    "DATE_FORMAT(LogDate, '%Y') = DATE_FORMAT('$lastDateOnDB', '%Y') ";
    but I suspect Mark uses a different variable name in RH side, and there are a lot of queries to edit (even more in my version).

    colinpb
    Posts: 86
    Joined: Thu 10 Nov 2011 8:14 pm
    Weather Station: VP2+SHT31+DFars+Solar+AeroCone
    Operating System: Windows 10
    Location: Hemel Hempstead, Hertfordshire, UK

    Re: Top 10 Records Page

    Post by colinpb » Tue 10 Oct 2017 3:54 pm

    As it is works on rolling days, If I up the 32 to 366 it’s giving me all the records so far for 2017. However as there’s still October/November and December 2017 to left check, it showing records from 2016. So I’m getting pretty much what I want. A fix would be to change previous years records to black as top 10 moves to current year.

    Colin

    User avatar
    BeaumarisWX
    Posts: 197
    Joined: Mon 09 Apr 2012 2:38 pm
    Weather Station: Davis VP2 Plus - 24hr FARS
    Operating System: Windows 10 Home (64bit)
    Location: Beaumaris Tasmania
    Contact:

    Re: Top 10 Records Page

    Post by BeaumarisWX » Tue 10 Oct 2017 9:37 pm

    When I want to highlight current year I use this, works perfect every time:

    Code: Select all

    $dayNumber = date("z");        // Day Number of current Year eg. ( 284 ) for today 2017/10/11
    $recentHighlight = $dayNumber; // number of days (so far in current year) of recent records to highlight 
    
    regards,
    Tony

    Mrc
    Posts: 32
    Joined: Mon 11 Apr 2016 12:39 pm
    Weather Station: Weatherwise WS-1090
    Operating System: Windows 10
    Location: Finland

    Re: Top 10 Records Page

    Post by Mrc » Sat 17 Mar 2018 1:42 pm

    Hi. This is first time i try to do anything with MYSQL and of course it didn't work. I created MYSQL database in my web hosting and then edited the ImportCumulusFile and CumulusMX settings with same passwords etc..

    Host name <--- my local host

    Port <-- cumulusmx port, cumulusmx only, not in the ImportCumulusFile

    User name <--- user name from MYSQL database i created

    Password <--- <--- password from MYSQL database i created

    Database name <---- <--- database name from MYSQL database i created

    So these are identical with CumulusMX and ImportCumulusFile. I saved settings in CumulusMX and tried to create dayfile but it only says: Error: Lost connection to MySQL server during query.
    I have uploaded the edited ImportCumulusFile and Cumulus already uploads the dayfile. What have i done wrong? I tried web hosting passwords and mysql passwords etc but always end up with same error.

    User avatar
    mcrossley
    Posts: 5805
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Top 10 Records Page

    Post by mcrossley » Sat 17 Mar 2018 4:09 pm

    Normally remote access directly to your MySQL database will be disabled, you have to add the IP address that that server sees from your CumulusMX host to the allowed remote servers list.

    In the PHP import script, because it runs on the same server as your database, leave the host at the default "127.0.0.1" or "localhost" settings.

    Mrc
    Posts: 32
    Joined: Mon 11 Apr 2016 12:39 pm
    Weather Station: Weatherwise WS-1090
    Operating System: Windows 10
    Location: Finland

    Re: Top 10 Records Page

    Post by Mrc » Sat 17 Mar 2018 6:39 pm

    I added IP address to MYSQL remote access but still have same error :groan:

    Mrc
    Posts: 32
    Joined: Mon 11 Apr 2016 12:39 pm
    Weather Station: Weatherwise WS-1090
    Operating System: Windows 10
    Location: Finland

    Re: Top 10 Records Page

    Post by Mrc » Thu 10 May 2018 4:27 pm

    Sorry again for stupid questions but why my top 10 page looks like this: PK!ߤÒlZ [Content_Types].xml ¢( ´”ËnÂ0E÷•ú‘·Ub袪*‹>–-Ré{Vý’Ǽþ¾QU‘ l"%3÷Þ3VƃÑÚšl µw%ë=–“^i7+Ù×ä-d&á”0ÞAÉ6€l4¼½L60#µÃ’ÍS Oœ£œƒXøŽ*•V$z3„ü3à÷½Þ—Þ%p)Oµ^ “²×5}nH"dÙsÓXg
    and the list goes on.. I have no idea what to do..

    User avatar
    mcrossley
    Posts: 5805
    Joined: Thu 07 Jan 2010 9:44 pm
    Weather Station: Davis VP2
    Operating System: Stretch Lite rPi
    Location: Wilmslow, Cheshire, UK
    Contact:

    Re: Top 10 Records Page

    Post by mcrossley » Fri 11 May 2018 10:58 am

    Do you have a link to the page?

    Mrc
    Posts: 32
    Joined: Mon 11 Apr 2016 12:39 pm
    Weather Station: Weatherwise WS-1090
    Operating System: Windows 10
    Location: Finland

    Re: Top 10 Records Page

    Post by Mrc » Fri 11 May 2018 11:27 am

    mcrossley wrote:Do you have a link to the page?
    Yes: http://kesis.info/Saa/Top10.php

    Post Reply