Welcome to the Cumulus Support forum.
Latest Cumulus MX release 3.27.1 (build 3263) - 21 November 2023
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
Latest Cumulus MX release 3.27.1 (build 3263) - 21 November 2023
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
Top 10 Records Page
Moderator: daj
- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Top 10 Records Page
To stop hi-jacking the other thread, I thought I 'd start a new one for the Top 10 page.
<edit 04/07/18>
Updated to version 2.1, the script can now be directly embedded in a content page, it no longer includes the page structure.
You can see my version here.
I have put together a generic page to demo the script here
The main content script source code is here.
And the source for the generic page content showing how to use the script is here.
</edit>
This was inspired by Dans (captzero - brisbaneliveweather) pioneering work, though I developed my code independently.
It is still a work in progress, take it and alter it to your wishes.
If you want to retain colour gradients but alter them, I used this site to generate the code.
It may be worth reading the 'other thread' for a bit of background.
<edit 04/07/18>
Updated to version 2.1, the script can now be directly embedded in a content page, it no longer includes the page structure.
You can see my version here.
I have put together a generic page to demo the script here
The main content script source code is here.
And the source for the generic page content showing how to use the script is here.
</edit>
This was inspired by Dans (captzero - brisbaneliveweather) pioneering work, though I developed my code independently.
It is still a work in progress, take it and alter it to your wishes.
If you want to retain colour gradients but alter them, I used this site to generate the code.
It may be worth reading the 'other thread' for a bit of background.
Last edited by mcrossley on Wed 04 Jul 2018 8:08 pm, edited 3 times in total.
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
Hi Mark
what values do I put in db_ro_details.php ? localhost,database,password, etc ?
but I don't know the syntax.
Thanks
what values do I put in db_ro_details.php ? localhost,database,password, etc ?
but I don't know the syntax.
Thanks
-
- Posts: 3033
- Joined: Sat 13 Aug 2011 9:33 am
- Weather Station: Ecowitt HP2551
- Operating System: Windows 10 64bit
- Location: Burnham-on-Sea
- Contact:
Re: Top 10 Records Page
Whatever is required to access your MySQL database on your server.
In my case
Good idea to make this file read/write by User only using CHMOD or Filezilla to change permissions.
In my case
Code: Select all
<?php
// The server host name or number running your MySQL database
// usually 127.0.0.1 or localhost will suffice
$dbhost = "localhost";
//
// The username used to log-in to your database server
$dbuser ="UserName";
//
// The password used to log-in to your database server
$dbpassword ="Password";
//
// The name of the MySQL database we will store the tables in
$database ="dmjsyste_cumulus";
?>
-
- Posts: 74
- Joined: Mon 23 Aug 2010 5:04 pm
- Weather Station: Davis Vantage Pro 2
- Operating System: Windows XP
- Location: Cornwall, England
- Contact:
Re: Top 10 Records Page
Mark
Another excellent script - thanks.
Just one query, how come the Min Wind Chill value is identical to Min Temp?
A coincidence or have I missed something?
Thanks once again for your inspirational scripts - I am learning a lot.
Another excellent script - thanks.
Just one query, how come the Min Wind Chill value is identical to Min Temp?
A coincidence or have I missed something?
Thanks once again for your inspirational scripts - I am learning a lot.
- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Top 10 Records Page
I don't know, I need to go and look at the data more closely. My "all time" records in Cumulus show the same thing, so I think the DB is right - as far as it goes.
Edit: I think those really low temps were overnight when the wind tends to drop to zero (or the anemometer is frozen up!)
I also need to look at why my lowest humidity is coming up as 100%!
Edit: I think those really low temps were overnight when the wind tends to drop to zero (or the anemometer is frozen up!)
I also need to look at why my lowest humidity is coming up as 100%!
- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Top 10 Records Page
OK, the humidity problem is caused by the day file table having the high/low humidity fields defined as varchar(3) so SQL was performing a text based sort (100 < [anything above 19]). I have amended the ImportCumulusFile script to declare them as decimal(4,1) to fix this.
For my own table, as I have a Davis which only supplies integer humidity values I have changed my field definitions to int(3) and that has sorted the problem out. (That is a hint for those that do not know, you can change table field types on the fly so long as the data contained in them is compatible. You do not have to drop the whole table and recreate it)
For my own table, as I have a Davis which only supplies integer humidity values I have changed my field definitions to int(3) and that has sorted the problem out. (That is a hint for those that do not know, you can change table field types on the fly so long as the data contained in them is compatible. You do not have to drop the whole table and recreate it)
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
Hmm confusing I get a ERROR - Bad Select Statement (1) error I use the old databse from David (the first one) http://apeldoorn.tk/weer/top10.php
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
I think the error is caused due I've no solardata in them 

- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Top 10 Records Page
The script is written for the DB schema as defined in ImportCumulusFile v2.0 or later. But any data you do not have, just delete or comment out those lines in the $dataArrays object - they will then not appear on the final web page either.
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
Thanks Mark I give it a try and will update de database later , will the new database not affect my older scripts ?
- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Top 10 Records Page
It may do, I'd suggest doing a parallel install first with different table names. Then check your old scripts one at a time against the new tables. Once you are happy you can then either drop the old tables and carry on with the new, or if you want to retain the original names you can drop the old and rename the new tables to the old names. (don't forget to also change the ImportCumulusFiles script to reflect the old names again if you do this).
Edit: On reading back that explanation is as clear as mud!
Edit: On reading back that explanation is as clear as mud!
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
Thanks for your advice , I saw the new database contains a lot more data so its time to step over
- nitrx
- Posts: 1297
- Joined: Sun 13 Dec 2009 1:21 pm
- Weather Station: WH1080
- Operating System: Windows 10
- Location: Apeldoorn The Netherlands
- Contact:
Re: Top 10 Records Page
LOL I think I better setup an extra database I keep get errors
I also don't understand this
in the code above he table is selected but in the oter queries the is no table selected
Or is this usual 
I also don't understand this
Code: Select all
$query = "SELECT LogDate, ROUND($fld, $dec) " .
'FROM Dayfile'.
Code: Select all
$query = 'SELECT MAX(LogDate) AS date_to, COUNT(*) cnt ' .
'FROM (' .

- mcrossley
- Posts: 11962
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Buster Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Top 10 Records Page
Ron the second one is a compound query, you feed the results from one query into another, so the outer 'from' is referring to the results of the inner query rather than a table, it is sometimes the only way of getting the data aggregated how you want it.