Duke, I have followed the previous thread and I am still unsure at what you are trying to accomplish...
As I started reading the previous thread a couple of nights a go, with my know ledge of PHP, I created a extra-webtag template, similar to the to 'webtag' template already available for Cumulus. The new monthly tags are created as arrays - because of my requirements, the template is producing two arrays for each extra-webtag. Here is a line of that template - first, the template read and processed by Cumulus:
Code: Select all
$WXX['dailyrain'] = array("<#ByMonthDailyRainH mon=1>","<#ByMonthDailyRainH mon=2>","<#ByMonthDailyRainH mon=3>","<#ByMonthDailyRainH mon=4>","<#ByMonthDailyRainH mon=5>","<#ByMonthDailyRainH mon=6>","<#ByMonthDailyRainH mon=7>","<#ByMonthDailyRainH mon=8>","<#ByMonthDailyRainH mon=9>","<#ByMonthDailyRainH mon=10>","<#ByMonthDailyRainH mon=11>","<#ByMonthDailyRainH mon=12>");
$dailyrain = 'new Array("<#ByMonthDailyRainH mon=1>","<#ByMonthDailyRainH mon=2>","<#ByMonthDailyRainH mon=3>","<#ByMonthDailyRainH mon=4>","<#ByMonthDailyRainH mon=5>","<#ByMonthDailyRainH mon=6>","<#ByMonthDailyRainH mon=7>","<#ByMonthDailyRainH mon=8>","<#ByMonthDailyRainH mon=9>","<#ByMonthDailyRainH mon=10>","<#ByMonthDailyRainH mon=11>","<#ByMonthDailyRainH mon=12>");';
The resulting PHP template:
Code: Select all
$WXX['dailyrain'] = array("35.4","60.0","23.0","10.8","23.4","27.5","10.9","141.8","31.7","331.2","39.6","22.0");
$dailyrain = 'new Array("35.4","60.0","23.0","10.8","23.4","27.5","10.9","141.8","31.7","331.2","39.6","22.0");';
The first line is used directly into the PHP template page to immediately display values as the page is loaded, before the JavaScript has time to load - my PHP template page will even/still display the extremes recorded for the current month name (such as for April) to users that might have JavaScript deactivated in their browsers.
The second line is used to 'populate' the JavaScript so other months are available once the script has been downloaded and is running on the user's computer.
To immediately display the values as the page is loaded (even if/when JavaScript is deactivated), I use the following PHP code, first at the top of the page:
Code: Select all
include_once ('cumulusXwebtags.php'); // to include the required extra-webtags
$month = (date('n')-1); // to set the current month number as a variable
Then, to display, for example, the extreme rain value that was recorded for the current month name (such as for the month of April):
Code: Select all
<tr class="td_rainfall_data">
<td style="text-align: left; padding-left: 10px;">Highest Daily Rainfall</td>
<td style="text-align: center;"><span id="DailyRainH"><?php echo $WXX['dailyrain'][$month]; ?></span> <?php echo $WX['rainunit']; ?></td>
<td style="text-align: center;"><span id="DailyRainHT"><?php echo $WXX['dailyrainT'][$month]; ?></span></td>
</tr>
Sure, I could have create a template with individual tags, as GraemeT did, but that would have produced a file with more than 600 rarely-used tags - my used of arrays make it as convenient (if not more convenient) while keeping the number of tags to 50.
This resulting page: [link removed]