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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

Post Reply
weerstationmenaldum
Posts: 4
Joined: Mon 11 Nov 2013 8:19 pm
Weather Station: Davis vantage vue
Operating System: windows 7
Location: Menaldum

Re: Top 10 Records Page

Post by weerstationmenaldum »

I read it several times but :?

I have to do something with db_ro_details.php?
We tried make a db_o_details.php with the information from reply 2 and 3 but no succes.
Sorry for al the questions.

I hope i can make this work
water01
Posts: 3246
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

Post by water01 »

water01 wrote:Whatever is required to access your MySQL database on your server.

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";

?>
Good idea to make this file read/write by User only using CHMOD or Filezilla to change permissions.
Did you do as this says i.e. "localhost", "your MySQL Database USERNAME", "your MySQL Database PASWORD" and finally "your MySQL Database NAME"?
David
Image
User avatar
JennyLeez
Posts: 316
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 »

Good Day,
I am somewhat confused with what I am reporting for the Max Solar radiation.
My ‘Bright Days’ are less than my ‘Dull Days’ but if I unhide the hidden one, this is correct.

Code: Select all

array(603,'HighSolarRad','Maximum Solar Radiation W/m&sup2;<br>(Bright Days)',true,0,'cSolarH'),  // table fixed!
 array(603,'CAST(HighSolarRad AS UNSIGNED)','Maximum Solar Radiation W/m&sup2;',true,0,'cSolarH'), // need to fix dayfile table, using varchar!
Could someone please explain what ‘CAST’ means and why this one is correct and the one below is not. From my understanding both should be reading the same column.

http://wairoa.net/weather/top10s_new.htm

Many thanks in advanced
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
User avatar
mcrossley
Posts: 12756
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 »

Hi Jenny

It is because older versions of PHP script that created the SQL tables, created the solar radiation filed as a character field rather than numeric. So when you try and sort string values 1000 is less than 99 for instance. The cast converts the strings to numbers before MySQL sorts them.

You can used the 'fixed' version if you update your table definition and change HighSolarRad from varchar(5) to decimal(5,1). You should be able to do this without losing any data (I did) - though it would be a good idea to back up unless you want to import all the data again if something messes up.
User avatar
JennyLeez
Posts: 316
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 »

Many thanks, that fixed it.

One more question please although only eye candy really.
Row 4 and 8 are creating an empty last box as I am using borders.
Row 6 and 9 are fine.
Is there an easy fix to remove the empty box otherwise no worries.
I realise I can remove the borders but I would prefer not to if possible.

http://wairoa.net/weather/top10s.htm

Thanks you for this script. It is one of my favourite pages :)

Cheers
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
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: Top 10 Records Page

Post by beteljuice »

Query ...

Looking at Jennys page > smallest daily pressure change.

The lowest figure is negative (-3.5), which is shown as a lesser change than zero (0), shouldn't the figure have been made absolute before sorting ?, and are similar (change) figures been handled the same ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12756
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 »

JennyLeez wrote:Many thanks, that fixed it.
Great.
JennyLeez wrote: One more question please although only eye candy really.
Row 4 and 8 are creating an empty last box as I am using borders.
Row 6 and 9 are fine.
Is there an easy fix to remove the empty box otherwise no worries.
I realise I can remove the borders but I would prefer not to if possible.

http://wairoa.net/weather/top10s.htm
Looking at the code there is an error, and each partial row should have empty boxes to the end!
The code

Code: Select all

            for ($x = $currCell; $x < $cells; $x++) {
                // add any empty cells to pad the row
                echo '<td>&nbsp;</td>';
            }
should be

Code: Select all

            for ($x = $currCell; $x <= $cells; $x++) {
                // add any empty cells to pad the row
                echo '<td>&nbsp;</td>';
            }
JennyLeez wrote: Thanks you for this script. It is one of my favourite pages :)
I'm glad you like it, the original idea wasn't mine of course!
beteljuice wrote: Looking at Jennys page > smallest daily pressure change.

The lowest figure is negative (-3.5), which is shown as a lesser change than zero (0), shouldn't the figure have been made absolute before sorting ?, and are similar (change) figures been handled the same ?
Hmm, looks more like duff data? The script simply takes (today's high press) - (today's low pressure).
So on 2012-11-03 the lowest pressure reading must greater than the highest.

I'd also be a bit suspicious of all those zero values. Normally you get some variation in a day, even if it is only random fluctuation in the sensor of at least 0.1hPa
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: Top 10 Records Page

Post by beteljuice »

Mark wrote:Hmm, looks more like duff data? The script simply takes (today's high press) - (today's low pressure).
So on 2012-11-03 the lowest pressure reading must greater than the highest.

I'd also be a bit suspicious of all those zero values. Normally you get some variation in a day, even if it is only random fluctuation in the sensor of at least 0.1hPa
Looks like Jenny fixed something - no negative or zero values now ;)

http://wairoa.net/weather/top10s.htm
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
JennyLeez
Posts: 316
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 »

Good morning,

Sorry the below just added more small empty cell to the other rows :(

Code: Select all

for ($x = $currCell; $x <= $cells; $x++) {
                // add any empty cells to pad the row
                echo '<td>&nbsp;</td>';
            }
So I put it back. No matter, all good :)

@ Beteljuice, yes I fixed the mess and thank you for pointing it out :)

Cheers
Jenny
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
User avatar
mcrossley
Posts: 12756
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 »

Jenny, it does add empty cells, I think that strictly the number of cells on each row should be the same (unless some are spanning more than one column). Most browsers seem to cope OK though if a row is incomplete.

If you want to get rid of the empty boxes, then the 'proper' way would be to over ride the style on the empty cells to suppress the outline. The hack would be to comment out the "echo '<td>&nbsp;</td>'" line.
User avatar
JennyLeez
Posts: 316
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 »

Yep that did it :)

Many many thanks, looks much better :)

Cheers
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
User avatar
PaulMy
Posts: 3830
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 »

Yours looks very nice Jenny. Well done!

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
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: Top 10 Records Page

Post by Dennisdg »

Folks

I'm trying to get Marks Top10 Records Page to display correctly. I think I have two problems remaining.
1. I get

'Warning: Cannot modify header information - headers already sent by (output started at /home/gglpcouk/public_html/new_2.php:1) in /home/gglpcouk/public_html/new_2.php on line 73

Warning: Cannot modify header information - headers already sent by (output started at /home/gglpcouk/public_html/new_2.php:1) in /home/gglpcouk/public_html/new_2.php on line 74

Warning: Cannot modify header information - headers already sent by (output started at /home/gglpcouk/public_html/new_2.php:1) in /home/gglpcouk/public_html/new_2.php on line 75'

Copy of lines 73,74,75
73 header('Content-type: text/html; charset=utf-8;');
74 header('Cache-Control: access plus 1 hour, private');
75 header('Expires:' . gmdate('D,d M Y H:i:s', time() + 3600) . ' GMT');


2. The font size of the results are too large, how can I correct this?

Attached is a zip file with a screen shot of this problem together with the page code.

Thanks in advance
You do not have the required permissions to view the files attached to this post.
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
User avatar
mcrossley
Posts: 12756
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 »

Dennis, I've had another look at your page and there is a problem with the page structure.

You now seem to have all the page header tags within the page body. The page header section only has an empty <style> section. All the meta tags and style section with code in it is being put within your page body section.
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: Top 10 Records Page

Post by Dennisdg »

Mark,

Thanks for looking at this again.

I have to admit this is beyond me. I thought I'd just added my navigation bar links to the code. I'll try and understand your reply.
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
Post Reply