Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Cumuluswebtags.php query please

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

gemini06720 wrote:Indeed, Steve is correct that the '$forum = '<#forum>'; // URL of the forum' tag should have been enclosed within single quotes ... but David, for 'Cumulus Toolbox' needed to replace the single quotes with double quotes... :(
Actually, just to confirm, 'Toolbox' can be set to use either the double or single quote, but we needed to be consistent. Using the single quote caused problems with Latitude, Longitude as they also incorporate single quotes given by Cumulus. So changing from double back to single quote just moves the problem to another field :( Maybe the answer is for Cumulus to 'Escape' the webtags to ensure they have no offending symbols

Equally odd is that my PHP tags do not have any values set for <#forum> or <#webcam> and the source=view still fails. If I use my Mac (rather than Windows) I can view the same file without issue. So I wonder if the quotes in the <#forum> is not necessarily the entire answer to the 'view' problem
I have since moved to a more advanced PHP5 version of 'cumuluswebtags' and I have stopped supporting the file relinquishing any future updates to David.
It a shame as it would have been better to work on one model rather than running two
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

daj wrote:Maybe the answer is for Cumulus to 'Escape' the webtags to ensure they have no offending symbols
But the problem with this one in particular is that it is a section of HTML. How would you escape it such that it still worked on a web page? It's really designed specifically for the Cumulus standard pages, so maybe it doesn't need to be in the php file anyway?
Steve
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

Good point Steve -- indeed, why bother including those in the PHP tags. That would still leave the Latitude problem

Code: Select all

$latitude             = "N&nbsp;57&deg;&nbsp;19'&nbsp;51"";
as there is a single quote in the middle
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

daj wrote:Good point Steve -- indeed, why bother including those in the PHP tags. That would still leave the Latitude problem

Code: Select all

$latitude             = "N&nbsp;57&deg;&nbsp;19'&nbsp;51"";
as there is a single quote in the middle
But that one's OK, isn't it, because it's not the same as the double quotes which delimit the string? I didn't encode that one as there doesn't seem to be an encoding for it - "&apos;" apparently isn't part of the HTML spec?
Steve
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

Yes, it was ok in the example above, however to keep Ray on-board he wanted to go back to delimitation with single quotes...

Code: Select all

$latitude             = 'N&nbsp;57&deg;&nbsp;19'&nbsp;51"';
But this breaks PHP as it is then confused by a rouge ' in the middle.

Indeed the &apos; is not supported by IE but I think all other browsers -- shame we could not use it :(
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

I don't know enough abour PHP to understand why single quotes are preferable to double quotes.

What does an &rsquo; look like? Could we use that for 'minutes'?
Steve
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

steve wrote:I don't know enough abour PHP to understand why single quotes are preferable to double quotes.
It is all to do with string manipulation....a quick example

echo "Hello $name"; will result in .....Hello David
whereas
echo 'Hello $name'; will result in ..... Hello $name

The single quote echo's (prints) the string literally. The doulbe quote ask PHP to check for variables (in this case $name) within the string and replace with it's value.

So a big difference, but for the purpose of the WebtagsPHP it makes no difference.

What does an &rsquo; look like? Could we use that for 'minutes'?
Yeah, that's an option I think
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

&rsquo; looks a bit odd in this context. It's the bottom one:
quotes.png
You do not have the required permissions to view the files attached to this post.
Steve
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

It does look a bit pants (translation -- it does not look good!)
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

There's always ' of course, but is that a valid standards-compliant thing to do?
Steve
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Cumuluswebtags.php query please

Post by daj »

steve wrote:There's always ' of course, but is that a valid standards-compliant thing to do?
I tested it in IE7, IE8, FF 3.6 (all windows) and Safari, Chrome, FF (all on Mac) and it would happily display ' for '

It passes HTML 4.01, XML 1.0 and 1.1

Ray, any thoughts?
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Cumuluswebtags.php query please

Post by gemini06720 »

I guess the code ''' could be used by Cumulus to produce the latitude and longitude information - I would certainly not recommend the use of the non-standard '&apos;' code nor the even less standard '&rsquo;' code - I know, both code will display under certain conditions in some browsers but not under all conditions in all browsers... :shock:

But what would be more standard would be to produce both the latitude and the longitude in the more accepted '48.123456789/-123.123456789' format - I know that format would not look good on the Web page.

That is why my new-format webtags template includes PHP script to convert the raw latitude/longitude data into easier to use and display information.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumuluswebtags.php query please

Post by steve »

gemini06720 wrote:the even less standard '&rsquo;'
&rsquo; is in the standard: http://www.w3.org/TR/REC-html40/sgml/entities.html
But what would be more standard would be to produce both the latitude and the longitude in the more accepted '48.123456789/-123.123456789' format - I know that format would not look good on the Web page.
I can add tags for that format; the original ones are there for easy substitution into the 'standard' HTML web pages in the DMS format that I prefer.
Steve
Post Reply