Php webtags: Difference between revisions

115 bytes added ,  12:05, 19 April 2020
m
Line 40: Line 40:
2. One convention is to make the php_variable_name match the cumulus_tag_name. This breaks down if you use names like $version for other purposes, or if you get confused by the random naming standard adopted by Steve Loft (some yesterday tags have Y at end, some don't, sometimes Y means yesterday, other times Y means yearly), so feel feel free to invent you own consistent naming standard.  
2. One convention is to make the php_variable_name match the cumulus_tag_name. This breaks down if you use names like $version for other purposes, or if you get confused by the random naming standard adopted by Steve Loft (some yesterday tags have Y at end, some don't, sometimes Y means yesterday, other times Y means yearly), so feel feel free to invent you own consistent naming standard.  


3. If the cumulus web tag always returns a numeric value, it is better to leave off the quotes, because then it can be used in PHP arithmetic more easily.
3. If the cumulus web tag always returns a numeric value, it is better to leave off the quotes, because then it can be used in PHP arithmetic more easily. To discover all available web tags for the Cumulus version you are using see [[Webtags|top of Web tags page]].


4. I have shown single quotes there, but they do not always work, see the discussion about problems with delimiting strings at [https://cumulus.hosiene.co.uk/viewtopic.php?f=4&t=1 this cumulus support forum link].
4. I have shown single quotes there, but they do not always work, see the discussion about problems with delimiting strings at [https://cumulus.hosiene.co.uk/viewtopic.php?f=4&t=1 this cumulus support forum link].
Line 61: Line 61:
'''Instead of producing your own template''', there are a number already produced, ''none of them cover all web tags'', but they might cover enough for your purposes:
'''Instead of producing your own template''', there are a number already produced, ''none of them cover all web tags'', but they might cover enough for your purposes:


*The download file on '''this page''' (download [[File:Cumuluswebtags.txt]]) contains all current [[webtags]] produced by Cumulus v 1.9.4. '''IMPORTANT''' This file is only for use with Cumulus v1.9.4, it will not work with [[CumulusMX|Cumulus MX]]. 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 so if you want to use them you need to put in the necessary time selectors yourself.
*The download file on '''this page''' (download [[File:Cumuluswebtags.txt]]) contains all current [[webtags]] produced by Cumulus v 1.9.4. '''IMPORTANT''' This file is only for use with Cumulus v1.9.4, it will not work with [[Cumulus MX|Cumulus 3 (MX)]]. 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 so if you want to use them you need to put in the necessary time selectors yourself.
*You may prefer the template that you can download at [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424&sid=123ca9bf91d769094eed72096c7920ea&start=15#p99549 by Brandon in this cumulus support forum link]. It should work for Cumulus 1 or MX.
*You may prefer the template that you can download at [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424&sid=123ca9bf91d769094eed72096c7920ea&start=15#p99549 by Brandon in this cumulus support forum link]. It should work for Cumulus 1 or MX.
* An equivalent for MX only 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 only 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.
5,838

edits