Php webtags: Difference between revisions

16 bytes removed ,  20:09, 20 April 2020
m
Line 103: Line 103:
*An equivalent for 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] also posted by the administrator (water01), and developed from the . This one does not contain any web tags added since 2015, but use this one also for versions before 3.5.3 to avoid any errors being reported and accept it may not include some of the web tags available in in-between versions.
*An equivalent for 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] also posted by the administrator (water01), and developed from the . This one does not contain any web tags added since 2015, but use this one also for versions before 3.5.3 to avoid any errors being reported and accept it may not include some of the web tags available in in-between versions.
* An alternative approach in the early days of MX was taken by Duke. You can download his version from [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424#p99536 this storm rain topic]. His zip contains two files '''cumulustags_no_description.tpl''' and '''cumulustags_with_description.tpl''', each uses the approach of defining an array $WX in which the index to the array elements is the web tag name for example <code>$WX['rfall'] = '<#rfall>';  //  total rainfall so far today</code>. It contains all tags used by either Cumulus 1 or MX  in September 2014. If you use this script you need to call it by '''require_once 'cumulustags_no_description.php';''' because it contains functions that can only be declared once to convert between decimal degrees and degrees, minutes, seconds formats in either direction, basically because it it stripping out the HTML space characters used by Steve Loft for latitude and longitude. For Recent History web tags there are up to 27 different input parameters in some cases. The extra time and date parameters shown above appear, but as array elements e.g. <code>$WX['timeshort']  = '<#time format="hh:nn">';  //  current time (example format: 12:34)</code>.
* An alternative approach in the early days of MX was taken by Duke. You can download his version from [https://cumulus.hosiene.co.uk/viewtopic.php?f=6&t=10424#p99536 this storm rain topic]. His zip contains two files '''cumulustags_no_description.tpl''' and '''cumulustags_with_description.tpl''', each uses the approach of defining an array $WX in which the index to the array elements is the web tag name for example <code>$WX['rfall'] = '<#rfall>';  //  total rainfall so far today</code>. It contains all tags used by either Cumulus 1 or MX  in September 2014. If you use this script you need to call it by '''require_once 'cumulustags_no_description.php';''' because it contains functions that can only be declared once to convert between decimal degrees and degrees, minutes, seconds formats in either direction, basically because it it stripping out the HTML space characters used by Steve Loft for latitude and longitude. For Recent History web tags there are up to 27 different input parameters in some cases. The extra time and date parameters shown above appear, but as array elements e.g. <code>$WX['timeshort']  = '<#time format="hh:nn">';  //  current time (example format: 12:34)</code>.
*For the final version 1.9.4 of Cumulus 1 use the download file available on [[:File:Cumuluswebtags.txt this wiki page]]). 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 available on [[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 only use PHP arrays when the web tag returns an array.
** 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 only use PHP arrays when the web tag returns an array.


5,838

edits