Php webtags: Difference between revisions

613 bytes added ,  10:37, 20 April 2020
m
Line 68: Line 68:
* An equivalent for MX version 3.0.x is at [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=13252&p=103860&hilit=cumuluswebtags.txt#p103830 this page on  support forum] posted by the administrator (water01), but that was last edited in 2015 and does not contain any web tags added since then.
* An equivalent for MX version 3.0.x is at [https://cumulus.hosiene.co.uk/viewtopic.php?f=39&t=13252&p=103860&hilit=cumuluswebtags.txt#p103830 this page on  support forum] posted by the administrator (water01), but that was last edited in 2015 and does not contain any web tags added since then.
*For the final version 1.9.4 of Cumulus 1 use the download file on '''this page''' (download [[File:Cumuluswebtags.txt]]). Note that in this download the recent history tags only occur with a single 3 hours ago parameter but if you use these tags it is likely you will want to include them for several other periods too.  Edit this template file to put in the necessary time selectors yourself.
*For the final version 1.9.4 of Cumulus 1 use the download file on '''this page''' (download [[File:Cumuluswebtags.txt]]). Note that in this download the recent history tags only occur with a single 3 hours ago parameter but if you use these tags it is likely you will want to include them for several other periods too.  Edit this template file to put in the necessary time selectors yourself.
** The advantage of only choosing one possible input parameter is that this template can use PHP variable names that match the web tag name, and no arrays.
*An alternative simpler template, that should work for Cumulus 1 or MX as it does not contain any output parameters, can be downloaded at [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424&sid=123ca9bf91d769094eed72096c7920ea&start=15#p99549 by Brandon in this support forum link].
*An alternative simpler template, that should work for Cumulus 1 or MX as it does not contain any output parameters, can be downloaded at [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424&sid=123ca9bf91d769094eed72096c7920ea&start=15#p99549 by Brandon in this support forum link].
* Another simple template called ''CUtags.txt'' produced by BCJKiwi that works with both Cumulus 1 and MX is at [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17985&p=140688#p140688 this post of mine in a zip], this one does not contain any web tags that are only available in MX, nor does it contain any that require output parameters.
* Another simple template called ''CUtags.txt'' produced by BCJKiwi that works with both Cumulus 1 and MX is at [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17985&p=140688#p140688 this post of mine in a zip], this one does not contain any web tags that are only available in MX, nor does it contain any that require output parameters. The PHP variable names match the web tag names, but some of those PHP variables are set to "not used", instead of to the web tag contents, because this template file is designed for a specific set of web pages.
*Another approach is to create an array '''$WX''' that holds a sub-set of Cumulus web tags, choosing some parameter combinations to implement:  
*Another approach is to create an array '''$WX''' that holds a sub-set of Cumulus web tags, choosing some parameter combinations to implement:  
**Using this array your customised pages would replace any reference to a Cumulus web tag <tt><#xxyyzz optional_parameter></tt> by a PHP array element '''$WX[xxyyzz]'''''[optional_additional_selector]''   (the recent history web tags include for example '''m=10''' as an input parameter, so you select the one you want using the second index).
**Using this array your customised pages would replace any reference to a Cumulus web tag <tt><#xxyyzz optional_parameter></tt> by a PHP array element '''$WX[xxyyzz]'''''[optional_additional_selector]''  
**Most of the web tags might not need any input or output parameters to be specified, you are using their default output, so the corresponding PHP element would not need a second index.
**For those web tags that do have a parameter defined (the recent history web tags include for example '''m=10''' as an input parameter), you select the one you want using the optional second index.
**A template file to do this is also called ''CUtags.txt'' and it can be downloaded from [http://saratoga-weather.org/wxtemplates/install.php Saratoga-Weather.org].
**A template file to do this is also called ''CUtags.txt'' and it can be downloaded from [http://saratoga-weather.org/wxtemplates/install.php Saratoga-Weather.org].
**That download includes elements for the recent history tags at 5, 10, 15, 20, 30, 45, 60, 75, 90, 105 and 120 minutes. If you want older values or values at other times, then you will need to add these to the array yourself.
**That download includes elements for the recent history tags at 5, 10, 15, 20, 30, 45, 60, 75, 90, 105 and 120 minutes. If you want older values or values at other times, then you will need to add these to the array yourself.
5,838

edits