Full list of Webtags: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
2,144 bytes removed ,  13:57, 4 October 2022
m
Line 1,951: Line 1,951:


=Day/Night/Sun/Moon=
=Day/Night/Sun/Moon=
In Cumulus 1 most of these are only calculated at UTC zero hours, but are updated each hour to refer to current time-zone.


MX is more complicated, but most of these are calculated hourly.
These values are calculated hourly.
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,960: Line 1,960:
|-
|-
|<#sunrise>
|<#sunrise>
|Last sunrise time at the station - This sunrise time is calculated by a third party library each midnight UTC (in legacy cumulus), and each hour Cumulus converts it to local time to ensure shown correctly before and after any clock change.
|Last sunrise time at the station - This sunrise time is calculated by a third party library each hour Cumulus converts it to local time to ensure shown correctly before and after any clock change.
|-
|-
|<#sunset>
|<#sunset>
|Next sunset time at the station - The sunset/sunrise times are calculated each midnight UTC (in legacy cumulus), and each hour Cumulus converts them to local time to ensure it shows them correctly before and after any clock change.
|Next sunset time at the station - The sunset/sunrise times are calculated each hour Cumulus converts it to local time to ensure shown correctly before and after any clock change.
|-
|-
|<#daylength>
|<#daylength>
|Length of day in hours and minutes (sunrise to sunset) -  The third party library that Cumulus uses each midnight UTC (in legacy cumulus), may take last sunrise from previous day and next sunset from next day, so the calculation may be off by a minute or so compared to true figure for current day.
|Length of day in hours and minutes (sunrise to sunset).
|-
|-
|<#IsSunUp>
|<#IsSunUp>
Line 1,980: Line 1,980:
|-
|-
|<#daylightlength>
|<#daylightlength>
| Approximate length of daylight in hours and minutes (dawn to dusk) - if your timezone is UTC or a few hours off that,  the dusk may well be that just passed, and the dawn that to come as at the zero hours UTC when Cumulus 1 does this calculation
| Approximate length of daylight in hours and minutes (dawn to dusk)
|-
|-
|<#isdaylight>
|<#isdaylight>
Line 1,986: Line 1,986:


Possible values are 0 or 1, where 1 notes that it is currently within the hours of daylight.
Possible values are 0 or 1, where 1 notes that it is currently within the hours of daylight.
|-
|-
|<#tomorrowdaylength>
|<#tomorrowdaylength>
|A string giving an approximate predicted difference between the length of daylight (dawn to dusk) yesterday and length of daylight tomorrow.
|A string giving an approximate predicted difference between the length of daylight (dawn to dusk) yesterday and length of daylight tomorrow.
This web tag is unreliable, basically because of the note for <#daylightlength>, and its use was not recommended. Its use is therefore not supported by Steve Loft (i.e. you use it at your own risk) in the legacy Cumulus.
|-
|-
|<#moonphase>
|<#moonphase>
Line 1,998: Line 1,995:
|<#MoonAge>
|<#MoonAge>
|Current '''approximate''' age of the Moon in days (0-29.53)
|Current '''approximate''' age of the Moon in days (0-29.53)
MX b3047 adds the 'dp' and 'rc' parameters Supports an optional 'dp' parameter, if supplied the result is returned to the specified number of decimal places. E.g <#MoonAge> gives "11" <#MoonAge dp=3> gives "11.234"
There is some PHP script code below this table showing how this can be converted to days, hours, minutes, seconds*
If the "dp" parameter is supplied, then supplying "rc=y" in addition will cause any decimal comma to be converted to a decimal point.
|-
|-
|<#moonrise>
|<#moonrise>
Line 2,013: Line 2,004:
|<#MoonPercent>
|<#MoonPercent>
|Current percentage of moon visible (negative value indicates 'waning')
|Current percentage of moon visible (negative value indicates 'waning')
MX b3047 adds the 'dp' and 'rc' parameters as <#MoonAge> above
|-
|-
|<#MoonPercentAbs>
|<#MoonPercentAbs>
|Current percentage of moon visible (always positive)
|Current percentage of moon visible (always positive)
MX b3047 adds the 'dp' and 'rc' parameters as <#MoonAge> above
|-
|-
|<#SunshineHours>
|<#SunshineHours>
Line 2,033: Line 2,020:
|Returns 1 if the sun is shining, otherwise 0 (Solar sensor needed)
|Returns 1 if the sun is shining, otherwise 0 (Solar sensor needed)
|}
|}
<pre>
* Footnote: PHP code extract:
$MoonAgeDays = <#MoonAge dp=0> +0;
$moonDecimalPart = <#MoonAge dp=4> - $MoonAgeDays;
$MoonAgeHours = round($moonDecimalPart * 24, 0);
$MoonAgeMinutes  = round(($moonDecimalPart * 24 * 60) - ($MoonAgeHours * 60), 0);
$MoonAgeSeconds = round(($moonDecimalPart * 24 * 60 * 60) - ($MoonAgeHours * 60 * 60) - ($MoonAgeMinutes * 60), 3);
$MoonAge      =    $MoonAgeDays . '&nbsp;days, ' .  $MoonAgeHours . '&nbsp;hours, '
. $MoonAgeMinutes . '&nbsp;minutes, ' . $MoonAgeSeconds . '&nbsp;seconds';
// Change the English words 'days, ', ' hours, ', and 'minutes' to the equivalents in your language</pre>


=Alarms=
=Alarms=

Navigation menu