You can't use the 'mon=2' parameter with a PHP variable; it's Cumulus which understands that, not PHP. You have to use the parameter when you set the PHP variable from the web tag, like Graeme has done here: https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=7359duke wrote:"<?php echo $ByMonthWindHT mon=2 format="'day' dd, yyyy 'at' hh:mm"; ?>"
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
Build 1033 comments
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Build 1033 comments
Steve
Re: Build 1033 comments
So, if I've got this right (and it is still early) my first 2 lines should be (removed time/date format for now):
Code: Select all
hightemp = ["<?php echo $JanTempH; ?>","<?php echo $FebTempH; ?>","<?php echo $MarTempH; ?>","<?php echo $AprTempH; ?>","<?php echo $MayTempH; ?>","<?php echo $JunTempH; ?>","<?php echo $JulTempH; ?>","<?php echo $AugTempH; ?>","<?php echo $SepTempH; ?>","<?php echo $OctTempH; ?>","<?php echo $NovTempH; ?>","<?php echo $DecTempH; ?>"],
hightempT = ["<?php echo $JanTempHT; ?>","<?php echo $FebTempHT; ?>","<?php echo $MarTempHT; ?>","<?php echo $AprTempHT; ?>","<?php echo $MayTempHT; ?>","<?php echo $JunTempHT; ?>","<?php echo $JulTempHT; ?>","<?php echo $AugTempHT; ?>","<?php echo $sepTempHT; ?>","<?php echo $OctTempHT; ?>","<?php echo $NovTempHT; ?>","<?php echo $DecTempHT; ?>"],
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Build 1033 comments
Yes, that looks about right. But note that PHP variable names are case sensitive:
duke wrote:"<?php echo $sepTempHT; ?>
Steve
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Build 1033 comments
@duke
Looks like you are mixing up JS and php array definitions.
I think it should be more like:But the beteljuice has been lacking clarity lately
Edit: missing a quote - fixed
Looks like you are mixing up JS and php array definitions.
I think it should be more like:
Code: Select all
<?php
echo "hightemp = new Array ('" .$JanTempH. "','" .$FebTempH. "','" .$MarTempH. "','" .... "','" .$DecTempH. "');";
// OR
echo "hightemp = new Array (\"" .$JanTempH. "\",\"" .$FebTempH. "\",\"" .$MarTempH. "\",\"" .... "\",\"" .$DecTempH. "\");";
// but of course your php tags should already have been created as an inlude file eg.
// $FebTempH = '<#ByMonthTempH mon=2>';
?>
Edit: missing a quote - fixed
Last edited by beteljuice on Sun 15 Apr 2012 11:13 pm, edited 1 time in total.
......................Imagine, what you will KNOW tomorrow !
Re: Build 1033 comments
Firstly, thanks Steve / beteljuice for your help but this is really getting the better of me .
beteljuice, I tried both your examples but both produce a syntax error.
Steve, the webtags by GraemeT are capitalized as
Any other ideas guys before I conceed and wait for someone else to convert?
Duke
beteljuice, I tried both your examples but both produce a syntax error.
Steve, the webtags by GraemeT are capitalized as
The 2 lines I have shown above allow the page to load without errors but show no figures. The tags work ok because if I paste them anywhere else on the page they produce a figure. HERE$JanTempH = '<#ByMonthTempH mon=1>';
Any other ideas guys before I conceed and wait for someone else to convert?
Duke
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Build 1033 comments
yes, and one of yours (the one I quoted) wasn't capitalised correctly.duke wrote:Steve, the webtags by GraemeT are capitalized as$JanTempH = '<#ByMonthTempH mon=1>';
Your last variable declaration ends with a comma rather than a semicolon.The 2 lines I have shown above allow the page to load without errors but show no figures.
Steve
Re: Build 1033 comments
OOpps, sorry steve, missed that.yes, and one of yours (the one I quoted) wasn't capitalised correctly.
And my hat off to you, spot on. seems to working now, just a "few" more webtags to change .Your last variable declaration ends with a comma rather than a semicolon.
Thanks for sticking with me guys.
Duke
- beteljuice
- Posts: 3292
- Joined: Tue 09 Dec 2008 1:37 pm
- Weather Station: None !
- Operating System: W10 - Threadripper 16core, etc
- Location: Dudley, West Midlands, UK
Re: Build 1033 comments
@ duke
I missed a quote (edited and fixed)
But the 'values' which are numeric can lose one set of enclosing quotes altogether:
Test for code below
Outputs:
I missed a quote (edited and fixed)
But the 'values' which are numeric can lose one set of enclosing quotes altogether:
Test for code below
Code: Select all
<?php
$JanTempH = 1.0;
$FebTempH = 2.0;
$MarTempH = 3.0;
$DecTempH = 12.0;
echo "hightemp = new Array ('" .$JanTempH. "','" .$FebTempH. "','" .$MarTempH. "','" .$DecTempH. "');<br />";
echo "hightemp = new Array (" .$JanTempH. "," .$FebTempH. "," .$MarTempH. "," .$DecTempH. ");";
?>
Code: Select all
hightemp = new Array ('1','2','3','12');
hightemp = new Array (1,2,3,12);
......................Imagine, what you will KNOW tomorrow !