Page 3 of 3
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 3:26 pm
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
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 3:36 pm
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?
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 3:43 pm
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 57° 19' 51"";
as there is a single quote in the middle
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 3:53 pm
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 57° 19' 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 - "'" apparently isn't part of the HTML spec?
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:01 pm
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 57° 19' 51"';
But this breaks PHP as it is then confused by a rouge ' in the middle.
Indeed the ' is not supported by IE but I think all other browsers -- shame we could not use it

Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:15 pm
by steve
I don't know enough abour PHP to understand why single quotes are preferable to double quotes.
What does an ’ look like? Could we use that for 'minutes'?
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:24 pm
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 ’ look like? Could we use that for 'minutes'?
Yeah, that's an option I think
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:35 pm
by steve
’ looks a bit odd in this context. It's the bottom one:
quotes.png
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:40 pm
by daj
It does look a bit pants (translation -- it does not look good!)
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 4:40 pm
by steve
There's always ' of course, but is that a valid standards-compliant thing to do?
Re: Cumuluswebtags.php query please
Posted: Tue 23 Feb 2010 6:14 pm
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?
Re: Cumuluswebtags.php query please
Posted: Wed 24 Feb 2010 2:05 pm
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 ''' code nor the even less standard '’' code - I know, both code will display under certain conditions in some browsers but not under all conditions in all browsers...
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.
Re: Cumuluswebtags.php query please
Posted: Wed 24 Feb 2010 2:55 pm
by steve
gemini06720 wrote:the even less standard '’'
’ 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.