Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 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

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: 12697
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Thanks David, you may want to change the number of decimal places on your annual rain records as I set them to integer for mm (and comment out the solar records)
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Top 10 Records Page

Post by PaulMy »

I have taken Mark's code and have my top_10.php working but noticed the highest Hours Sun are all at 9.9. I have checked the MySQL database and that is the highest recorded there, however the dayfile has quite a number with 10.0 and more. Is there something in the ImportCumulusFile that I need to change to have it import correctly? All the other imported data seems to be valid.

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
User avatar
mcrossley
Posts: 12697
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

I'll takes look later Paul, it sounds like another case of a text vs. numeric sort. Odd that it is working on my page though.
tobyspond
Posts: 252
Joined: Fri 24 Jun 2011 5:57 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Lamoine, Maine, USA

Re: Top 10 Records Page

Post by tobyspond »

Paul,

Check to see which version of the ImportCumulus file you are using; earlier version did not have the correct number of decimal places, which results in a limit of 9.9 and check your mysql table to make sure that field is set to decimal 3,1. Next recreate the table and that should fix the problem.

Kerry
User avatar
JennyLeez
Posts: 314
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Top 10 Records Page

Post by JennyLeez »

PaulMy wrote:I have taken Mark's code and have my top_10.php working but noticed the highest Hours Sun are all at 9.9. I have checked the MySQL database and that is the highest recorded there, however the dayfile has quite a number with 10.0 and more. Is there something in the ImportCumulusFile that I need to change to have it import correctly? All the other imported data seems to be valid.
Paul
Hi Paul,
I was using version 1 of ImportCumulusFile and also had a column of 9.9 for sunshine hours. I altered the decimal to 3.1 as Kerry suggested but to no avail. I also had a column of zeros for the Low humidity :(
From reading some of the other posts I decided to leave version 1 intact as I did not want to muck up my historical highcharts. I created a second database and using ImportCumulusFile V2 (calling it ImportCumulsFilev2.php for want of something more original) updated that. Then just changed the database name, username, password to that database in the top10s script.
This has fixed both the sunshine hours and humidity values. Here is my attempt:
http://wairoa.net/weather/top10s.htm

Many many thanks Mark. I love this new page. Not only is the information interesting for readers but the colours are cool.

Cheers
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
User avatar
PaulMy
Posts: 3777
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Top 10 Records Page

Post by PaulMy »

I had downloaded an old version and now updated to v.2.4 and that works well. I have the Top_10 on my http://www.komokaweather.com Station Historical. Having a bit of an issue on the Saratoga templates site and still working on that.

Thanks Mark, Kerry and Jenny
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
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: Top 10 Records Page

Post by nitrx »

It seems that de database wil not been overwritten when a correction is made in the past I changed a record windgust in feb 2011 but the old value stayed in the database and my top10.php, I've changed it in the d manually ( I did upload the dayfile.txt and executed the import.php script..)
User avatar
mcrossley
Posts: 12697
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Ron, rather than overwriting every time, the script imports new or missing entries, so you could delete that day in the table and run the import again - probably easier to do as you did and amend a single entry though.

Edit: That is not quite true, actually the script does try and import all the data each time, but as there is a unique key on the date the insert of any data that already exists silently fails, but that lookup and failure happens really quickly compared with inserting a new row. The net effect is the same, only missing and new entries are added to the table.
Last edited by mcrossley on Sun 27 Oct 2013 5:12 pm, edited 1 time in total.
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: Top 10 Records Page

Post by nitrx »

Aha , thanks for the explanation Mark
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Top 10 Records Page

Post by rogerthn »

Many thanks Mark!
I do note have anything ready to be shown for the public yet but maybe my function dateUpdated could be useful for other?

Code: Select all

// Get date of first or last update
function dateUpdated($what = "first") {
  global $dayFileTableName;
  if ( $what == "first" ) {
    $query = "SELECT min(LogDate) FROM $dayFileTableName";
  } else {
    $query = "SELECT max(LogDate) FROM $dayFileTableName";
  }
  $result = mysql_query($query);
  if (!$result) {
    die('ERROR - Bad Select Statement (4) - ' . mysql_error());
  }
  $row = mysql_fetch_row($result);
  return $row[0];
}
Usage can be as below

Code: Select all

Records began <?php echo dateUpdated("first"); ?>, last update <?php echo dateUpdated("last"); ?>.
Image
User avatar
mcrossley
Posts: 12697
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

Thanks, I'm sure some people will find this useful.
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Top 10 Records Page

Post by rogerthn »

Besides start and end date from DB I can now display top N records :D
e.g. http://minegen.myftp.org/weather/top10s.php?limit=15

Search for $limit in source and please note that

Code: Select all

'LIMIT 10'
needs to be replaced with

Code: Select all

"LIMIT $limit"
Image
User avatar
N0BGS
Posts: 205
Joined: Sat 10 Nov 2012 2:26 am
Weather Station: Davis Vantage Pro 2
Operating System: Win10vm,VMWare ESXi 7.0
Location: Hermon, Maine USA
Contact:

Re: Top 10 Records Page

Post by N0BGS »

Interesting.

I'd like to be able to see your source code but the source link returns a blank page.

--Kurt
Blitzortung Station 1809
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Top 10 Records Page

Post by rogerthn »

N0BGS wrote:Interesting.

I'd like to be able to see your source code but the source link returns a blank page.

--Kurt
Strange that you get a blank page, maybe you are able to download http://minegen.myftp.org/weather/top10s.zip?
Image
User avatar
mcrossley
Posts: 12697
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Top 10 Records Page

Post by mcrossley »

N0BGS wrote: the source link returns a blank page.
--Kurt
Same here, response header = Content-Length: 0
Post Reply