Php webtags: Difference between revisions

1,957 bytes added ,  09:49, 25 April 2020
m
no edit summary
mNo edit summary
Line 47: Line 47:


So although this article has links to many single ready made scripts assigning every single Cumulus web tag to a PHP variable, it actually makes better sense to have multiple scripts, each processed only when the content might change for the tags in that script.
So although this article has links to many single ready made scripts assigning every single Cumulus web tag to a PHP variable, it actually makes better sense to have multiple scripts, each processed only when the content might change for the tags in that script.
=== Locale issues ===
*Some locales use decimal commas, that is in any real numbers a comma separates the integer and decimal parts. So people in these locales expect to see any output in that format. However, to perform arithmetic on a number many script languages need that number to use a full stop as the separator for the decimal part.
**Cumulus makes available a selection of web tags with a "RC" prefix where the comma (if any used) is removed and the output always uses a decimal point (like a full stop).
** Many ready-made scripts present both the "RC" and normal versions of such tags, they have to enclose all tags (even numeric ones) in quotes so the locale does not worry about format
** Having numeric values in quotes makes it more difficult to do arithmetic with them, and may insert unwanted leading zeroes.
*Different locales may express dates differently
** Some ready-made scripts assume that the separator between parts of the date are "/" and hard code the alternative outputs with that assumption (perhaps replacing "/" with ".").
**Many ready-made scripts are derived from one written assuming the USA date format is being used with month before day of month, and year last. Of course Cumulus actually outputs dates either in the format used by the locale selected or in the ISO format of year first with hyphens between date parts.
** Check your choice of read-made script can cope with dates in the format you prefer.
*Do you prefer 24-hour clock (some call this timetable format or military format) or 12 hour clock with am/pm?
**Some ready made scripts may express times in both formats so you can choose the format you want
If there are dates and times to output, Cumulus changes the date for certain web tags for times between midnight and rollover time (if 9am or 10am). Be sure you understand how any ready-made script is reporting combinations of date and time. If you are writing your own script, bear this in mind.


=== station and/or sensor specific tags ===
=== station and/or sensor specific tags ===
5,838

edits