Sandaysoft

Support forum for Cumulus weather station software
It is currently Mon May 20, 2013 5:47 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 4:21 am 
Offline
User avatar

Joined: Wed Oct 21, 2009 11:19 am
Posts: 280
Location: Bayswater, Australia
Weather Station: La Crosse WS-2355
Operating System: Windoze 7
Thanks David, I'll try that. Just a bit frustrating to get everything compliant and then find
something that works ok but doesn't comply because of the vagaries of html!
I think my main trouble is I don't understand why <br /> isn't allowed in this instance.
W3C doesn't make it clear to me at all...

Here are links to my original and current dayfile:

Original without fields 17&18:
http://weather.gktnet.com/data/dayfile%20-%20copy.txt

New file with fields 17&18 added and filled with dummy values:
http://weather.gktnet.com/data/dayfile.txt

It doesn't really matter from my perspective now, as I've filled in the values for all the dates prior to 25-Jan-10,
but others may have the same problem and they might have a longer dayfile.txt

Bye for now.

_________________
Graeme.
http://weather.gktnet.com/cumulus/index.htm
Image


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 9:23 am 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
GraemeT wrote:
Thanks David, I'll try that. Just a bit frustrating to get everything compliant and then find
something that works ok but doesn't comply because of the vagaries of html!
I think my main trouble is I don't understand why <br /> isn't allowed in this instance.
W3C doesn't make it clear to me at all...

Originally I thought it was because I was using formatting tags in the <head> section, however I moved the script into the <body> section and still had the same issue. W3C certainly does not make it clear why it is not allowed. I can replace the <br/> with <span> and then use CSS to display in blocks, but again it gets rejected. To be honest, it is better not to have script in the HTML -- far better to call it from a file anyway. I only included it in the HTML to try and keep things as simple as I could as part of the package

Quote:
It doesn't really matter from my perspective now, as I've filled in the values for all the dates prior to 25-Jan-10,
but others may have the same problem and they might have a longer dayfile.txt

It's odd, as I have seen several installations now and none have had this problem :? My day file has 540 entires and only about 15 of the new longer line and it was ok. I will have a look at yours later, out of interest.

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 10:59 am 
Offline
User avatar

Joined: Wed Oct 21, 2009 11:19 am
Posts: 280
Location: Bayswater, Australia
Weather Station: La Crosse WS-2355
Operating System: Windoze 7
A revelation!

Out of interest I tried enclosing the offending line as below:

Code:
// <![CDATA[
    colNames:['Date','Highest<br/>Gust<br/>(mph)','Wind<br/>Bearing','Time of<br/>Gust','Min. Temp<br/>(&deg;C)','Time of<br/>Min.','Max. Temp<br/>(&deg;C)','Time of<br/>Max.','Avg. Temp<br/>(&deg;C)','Lowest<br/>pressure<br/>(mb)','Time of<br/>Min.','Highest<br/>pressure<br/>(mb)','Time of<br/>high','Highest<br/>Rain rate<br/>(mm/hr)','Time of<br/>High Rate','Total Rain<br/>fall (mm)','Tot.Wind<br/>run'],
// ]]>

Job's right! The javascript parser ignores the CDATA term as it's commented out and the XML parser ignores the line enclosed by the CDATA term - no more errors from the <br/> tags.
I don't understand why it has to be commented out with // but if not, the script doesn't display the table.

More info here:
http://www.w3schools.com/XML/xml_cdata.asp
and here:
http://msdn.microsoft.com/en-us/library/ms256076.aspx

Something else which came to light about 5 minutes ago:
Code:
<table id="list"></table>
<div id="pager"></div>
</div>

causes an unfinished tag error as the table wants row and cell tags as below:
Code:
<table id="list"><tr><td></td></tr></table>
<div id="pager"></div>
</div>

which fixes the error.


That's it for me. Going off to do something else for a while...

_________________
Graeme.
http://weather.gktnet.com/cumulus/index.htm
Image


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 3:28 pm 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 501
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi David,
is there away to do this with out js
Beau


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 3:34 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
Is there life without JS?! LOL

I could probably do it in PHP

Curious -- why not JS?

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 4:24 pm 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 501
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi David,
I have a friend that uses my site with his screen reader
it does like js so that page can not be read
Beau


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 7:53 pm 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 501
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi David
I us inHG on my davis station for my pressure what wood i need to change to show 3 digits after the point im not sure what file to change?
Thanks Beau


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Feb 09, 2010 8:10 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
n9mfk wrote:
Hi David
I us inHG on my davis station for my pressure what wood i need to change to show 3 digits after the point im not sure what file to change?
Thanks Beau

It's actually the import you will need to adjust, not the table that displays it.

Edit the ImportCumulusFile.php file and look for the line starting...
(should be line 100)

Code:
$CreateQuery="CREATE TABLE " . $table_name . " (LogDate date NOT NULL ,HighWindGust decimal(4,1)........


Quite far along the line change the MinPress decimal(6,2) to (7,3) same for MaxPress a little further along

For consistency, also change line 107...

Change ...Pressure decimal(6,2) to (7,3)

Delete your SQL table and re-import so that it creates the table again

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Wed Feb 10, 2010 9:04 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
n9mfk wrote:
is there away to do this with out js

Beau

Kevin has done us proud.....

viewtopic.php?f=14&t=2419

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Sun Feb 14, 2010 1:29 pm 
Offline

Joined: Tue Jan 26, 2010 8:54 am
Posts: 107
Location: Mayenne, France
Weather Station: Maplin N96GY
Operating System: Vista Home Premium SP2
David,

This is now up and running. Thanks very much for producing it. It has worked a treat. :clap:

_________________
Many thanks
Helen

La Locherie Weather


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Tue Dec 14, 2010 11:03 pm 
Offline

Joined: Wed Dec 08, 2010 9:37 am
Posts: 3
Location: Thalgau
Weather Station: WH1080
Operating System: Windows7
Hi all,

i have uploadet all files via FTP to my webspace.
dbconfic.php is setup with my login data.

1.) how can i create a dayfile.txt ?
2.) wen i use the read_dayfile i become an error!

=> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/web10/html/wetter/read_dayfile.php on line 25
Couldn't execute query.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

URL to my weather files is http://arbeiter4ever.com/wetter/

Please help me.
thanks
GismoAT


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Wed Dec 15, 2010 8:35 pm 
Offline
User avatar

Joined: Tue Jul 29, 2008 8:00 pm
Posts: 2001
Location: Thornhill, Dumfries, UK
Weather Station: WH1081
Operating System: Mac OSx & Win 7
You need to get your dayfile.txt (created by Cumulus) into your SQL DB. You can do this yourself or use a script to do it

viewtopic.php?f=18&t=2367

_________________
David
Contact Me


Top
 Profile  
 
 Post subject: Re: Display data from SQL in a table on your website
PostPosted: Wed Dec 22, 2010 7:30 pm 
Offline

Joined: Wed Dec 08, 2010 9:37 am
Posts: 3
Location: Thalgau
Weather Station: WH1080
Operating System: Windows7
Hi,
the script is working good. But i have a question.
How can i change the table size?
I will include the Historic page to my homepage but the aktual table size is to big.
thanks
GismoAT


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group