Php webtags: Difference between revisions

726 bytes added ,  19:07, 26 June 2020
m
Line 295: Line 295:
**That download includes just 10 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 just 10 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.


=== Alternatives ===
=== Ready-made Templates not based on original ===


These templates have not been influenced by the original template, but instead have tried to cover what suited each author at the time the template was written, and each author has made their own independent decision about what parameters to use.
These templates have not been influenced by the original template, but instead have tried to cover what suited each author at the time the template was written, and each author has made their own independent decision about what parameters to use.


==== Simplest ====
*The simplest template of all, it essentially reproduces the layout used for tables on the [[Webtags|web tags wiki page]], so it is very nicely laid out. It was written from scratch by Brandon using all web tags available in November 2014 with Cumulus 1, although MX beta was available then, he has not identified the tags not available in MX at that time. Because Brandon has not used using any output parameters, it will work with Cumulus 1 and MX, but as it is also without any input parameters none of his Recent History PHP variables actually contain anything but rubbish. It can be downloaded in [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424#p99549 this storm rain topic].
*The simplest template of all, it essentially reproduces the layout used for tables on the [[Webtags|web tags wiki page]], so it is very nicely laid out. It was written from scratch by Brandon using all web tags available in November 2014 with Cumulus 1, although MX beta was available then, he has not identified the tags not available in MX at that time. Because Brandon has not used using any output parameters, it will work with Cumulus 1 and MX, but as it is also without any input parameters none of his Recent History PHP variables actually contain anything but rubbish. It can be downloaded in [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424#p99549 this storm rain topic].
==== Smallest number of web tags ====
* Another simple template, but this one includes far fewer web tags, is called ''CUtags.txt'', it was produced by BCJKiwi as a single template file able to work with both Cumulus 1 and MX. It can be downloaded as part of his [[CumulusMX_and_Cumulus1_UI_style_Multilingual_Websites|package]] or separately at [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17985&p=140688#p140688 this post of mine in a zip].
* Another simple template, but this one includes far fewer web tags, is called ''CUtags.txt'', it was produced by BCJKiwi as a single template file able to work with both Cumulus 1 and MX. It can be downloaded as part of his [[CumulusMX_and_Cumulus1_UI_style_Multilingual_Websites|package]] or separately at [https://cumulus.hosiene.co.uk/viewtopic.php?f=40&t=17985&p=140688#p140688 this post of mine in a zip].
**This template does not contain any web tags that are only available in MX, nor does it contain any web tags that require input or output parameters. The PHP variable names match Cumulus 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.
**This template does not contain any web tags that are only available in MX, nor does it contain any web tags that require input or output parameters. The PHP variable names match Cumulus 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.
*This [[File:Web tag templates.zip|zip]] contains a set of templates, each updated at different frequencies. It includes all web tags for either Cumulus 1 or MX. You may get an error reported locally when Cumulus processes an individual file as your version of Cumulus does not include every tag it will try to process. However, once it has been converted to a PHP script, it will test the version and should not give any errors as you use it on your production web site. I have taken the decision to write all the templates assuming your locale uses a fullstop as decimal separator. I am working on templates that use the Remove Comma options that Cumulus 1 and MX provide, but those are not ready to release.
 
==== Minimised Upload size ====
 
You can reduce your consumption of your cap on uploading by not uploading at real time any PHP variables based on web tags that don't alter that frequently.
 
In fact, you can define and upload some variables for web tags that change less frequently during the day at the standard uploading interval, and PHP variables based on yesterday's web tags (and some others) just once a day.
 
So what you need is a set of scripts, and one such ready made set can be found in [[File:Web tag templates.zip|this zip]].
*It contains a set of templates, each updated at different frequencies.  
*It includes all web tags for either Cumulus 1 or MX.  
*You may get an error reported locally when Cumulus processes an individual file as your version of Cumulus does not include every tag it will try to process.  
*However, once it has been converted to a PHP script, it will test the version and should not give any errors as you use it on your production web site.  
*Most of the templates are written assuming that either your locale uses a fullstop as decimal separator, or you don't need to do any calculation with the PHP variables.
*But for the most frequently changing web tags, there is a script for Cumulus 1 and another for MX that do indeed remove commas and produce PHP variables that can safely be used for calculations.


== Usage ==
== Usage ==
5,838

edits