Sandaysoft

Support forum for Cumulus weather station software
It is currently Thu May 23, 2013 2:18 pm
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  [ 153 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11  Next
Author Message
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Mar 11, 2012 6:11 am 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
beteljuice wrote:
Sorry - I got a bit of a JavaScript head on.

:lol:

How's it look for you? Nightingale NOAA

All good here. thank you :D

Duke

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Mar 11, 2012 9:30 am 
Online
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2518
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
I 'think' this may be due to the page construction.

Duke is using a XHTML page, and has included a header META tag to specify the character set encoding, but no xml tag. The standard says...

Quote:
Historically, the character encoding of an HTML document is either specified by a web server via the charset parameter of the HTTP Content-Type header, or via a meta element in the document itself. In an XML document, the character encoding of the document is specified on the XML declaration (e.g., <?xml version="1.0" encoding="EUC-JP"?>). In order to portably present documents with specific character encodings, the best approach is to ensure that the web server provides the correct headers. If this is not possible, a document that wants to set its character encoding explicitly must include both the XML declaration an encoding declaration and a meta http-equiv statement (e.g., <meta http-equiv="Content-type" content="text/html; charset=EUC-JP" />). In XHTML-conforming user agents, the value of the encoding declaration of the XML declaration takes precedence.

Note: be aware that if a document must include the character encoding declaration in a meta http-equiv statement, that document may always be interpreted by HTTP servers and/or user agents as being of the internet media type defined in that statement. If a document is to be served as multiple media types, the HTTP server must be used to set the encoding of the document.

Dukes web server is not providing any character encoding information in the header.
Code:
RESPONSE HEADERS
Connection:Keep-Alive
Content-Type:text/html
Date:Sun, 11 Mar 2012 09:07:28 GMT
Keep-Alive:timeout=2, max=100
Server:Apache
Transfer-Encoding:chunked
X-Powered-By:PHP/5.3.10
Note, no charset after 'text/html'. So I think this statement applies
Quote:
If this is not possible [server providing encoding in the header], a document that wants to set its character encoding explicitly must include both the XML declaration an encoding declaration and a meta http-equiv statement

But Dukes page does not have an <xml> declaration.

It would be interesting to know if that fixed the problem without beteljuices workaround. These encoding issues keep popping up.

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Mar 11, 2012 1:06 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1847
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Thank you both - a (sort of) result :clap:

First post has been updated to include link to work-around.

@ Mark, I remember when text was easy (single type face / size and with bold / underline and only in 'English' :lol:

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Mar 11, 2012 5:15 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
Mark, I will willingly try what you suggest. But, being a novice, how exactly do I put the "XML" in?

Currently
Quote:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>


Duke

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Mar 12, 2012 10:29 am 
Online
User avatar

Joined: Thu Jan 07, 2010 9:44 pm
Posts: 2518
Location: Wilmslow, Cheshire, UK
Weather Station: Davis VP2
Operating System: XP SP3, Win 7
I'm no expert either, but I think the top of you page needs to look like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
...


The standard also says:
Quote:
An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol. Here is an example of an XHTML document. In this example, the XML declaration is included.

Which would imply that UTF-8 is the default encoding anyway - but your server seems to be treating the page as text/html rather than application/xhtml+xml.
And there is a warning about this situation! :
Quote:
Be aware that processing instructions are rendered on some user agents. Also, some user agents interpret the XML declaration to mean that the document is unrecognized XML rather than HTML, and therefore may not render the document as expected. For compatibility with these types of legacy browsers, you may want to avoid using processing instructions and XML declarations. Remember, however, that when the XML declaration is not included in a document, the document can only use the default character encodings UTF-8 or UTF-16.


Argh! It's all too complicated. :bash:

_________________
Mark
Wilmslow Astro Weather


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Mar 12, 2012 6:24 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
mcrossley wrote:
Argh! It's all too complicated. :bash:


Blimey you're right. I'll try this the weekend and let you know the results. Thanks Mark.

Duke

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Apr 29, 2012 11:01 am 
Offline

Joined: Sun Jan 02, 2011 9:38 am
Posts: 33
Location: Stevenage, Herts, UK
Weather Station: Watson W-8681
Operating System: XP SP3
Just starting to get into NOAA reports. Thanks very much to beteljuice for all the effort you have put in here. I'm actually starting to get some benefit from the php support my GoDaddy account is charging me for!

My NOAA-reports.php page is here: http://www.elmnet-weather.net/NOAA_reports.php

I prefer the Classic menu, just my preference. Not linked it from my main pages yet until I am happy with it.

My menu shows an indent at the start of line for 2011, I note that the example pages from beteljuice do the same, but some of the pages linked on the thread don't have this. I've poured over the script but can't make enough sense of it to know what's going on.

Any suggestions anyone?

Late News: Just discovered it's a Google Chrome issue, in IE9 the menu lines up nicely! DOH!

_________________
Malcolm
North Herts, UK
http://www.elmnet-weather.net
Watson W-8681; Cumulus v1.9.3


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Apr 29, 2012 1:25 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1847
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Quote:
I prefer the Classic menu, just my preference.
You may change your mind when you have 10+ years of reports :lol:

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Apr 29, 2012 3:08 pm 
Offline

Joined: Sun Jan 02, 2011 9:38 am
Posts: 33
Location: Stevenage, Herts, UK
Weather Station: Watson W-8681
Operating System: XP SP3
beteljuice wrote:
Quote:
I prefer the Classic menu, just my preference.
You may change your mind when you have 10+ years of reports :lol:

Too true, but I don't have that much data yet. I'll worry about it if my Fine Offset lasts that long!

_________________
Malcolm
North Herts, UK
http://www.elmnet-weather.net
Watson W-8681; Cumulus v1.9.3


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Apr 29, 2012 7:57 pm 
Offline

Joined: Mon Nov 28, 2011 2:13 am
Posts: 349
Location: Brisbane, Australia
Weather Station: La Crosse WS 2306
Operating System: Windows 7 64 Bit
Thanks Betejuice for your work here. I have no konwledge of php but I have managed to set up this very useful page. Thanks

The page is here: http://www.localweatherdata.0glo.com/NOAA-reports.php

_________________
Regards, Matt of Brisbane, Australia
Web Site: http://www.localweatherdata.0glo.com


Top
 Profile  
 
 Post subject: Update
PostPosted: Sun Apr 29, 2012 10:59 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1847
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Update: viewtopic.php?f=14&t=5754&p=49194#p49194

V3.2 available

A Chrome user has highlighted a small piece of 'malformed' html when more than one year of reports is in the 'nav menu'. For Chrome users it results in a small indent in subsequent 'year' lines.

The offending o/p results in ....<br /></span>.....
but needs to be corrected to ...</span><br />.....

The beteljuice has corrected his pilot error :bash:

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Apr 30, 2012 9:19 pm 
Offline

Joined: Sun Jan 02, 2011 9:38 am
Posts: 33
Location: Stevenage, Herts, UK
Weather Station: Watson W-8681
Operating System: XP SP3
Excellent Work beteljuice, Chrome display now sorted.

PS, my weather station PC is slartibartfast!

_________________
Malcolm
North Herts, UK
http://www.elmnet-weather.net
Watson W-8681; Cumulus v1.9.3


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Apr 30, 2012 11:07 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1847
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
From Magrathea - the mice will be most annoyed !

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sat Jun 09, 2012 2:35 am 
Offline

Joined: Fri Jun 10, 2011 12:40 pm
Posts: 108
Location: Prospect, KY, USA
Weather Station: WMR-968
Operating System: Windows XP SP3
:clap: Thanks for an excellent bit of code and an easy to implement feature. I moved to a hosting service that supports php a few months back. Figured it was about time to implement the viewer. I am a complete php noob, but it went exceptionally well.

jim

_________________
Thanks
Jim - The Timber Ridge Weather Station, Prospect, KY
http://dantinconsulting.com/


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sat Jun 09, 2012 4:07 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1847
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Glad it all went smoothly ... Your next mission, should you choose to accept it ............ :shock:

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 153 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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