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

Build 1033 comments

Please discuss beta versions of Cumulus 1 here. Note: There are currently no beta versions of Cumulus 1.
User avatar
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

Post by steve »

duke wrote:"<?php echo $ByMonthWindHT mon=2 format="'day' dd, yyyy 'at' hh:mm"; ?>"
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=7359
Steve
duke

Re: Build 1033 comments

Post by duke »

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; ?>"],
   
User avatar
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

Post by steve »

Yes, that looks about right. But note that PHP variable names are case sensitive:
duke wrote:"<?php echo $sepTempHT; ?>
Steve
User avatar
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

Post by beteljuice »

@duke

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>';

?>
But the beteljuice has been lacking clarity lately :?

Edit: missing a quote - fixed
Last edited by beteljuice on Sun 15 Apr 2012 11:13 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
duke

Re: Build 1033 comments

Post by duke »

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
$JanTempH = '<#ByMonthTempH mon=1>';
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

Any other ideas guys before I conceed and wait for someone else to convert?

Duke
User avatar
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

Post by steve »

duke wrote:Steve, the webtags by GraemeT are capitalized as
$JanTempH = '<#ByMonthTempH mon=1>';
yes, and one of yours (the one I quoted) wasn't capitalised correctly.
The 2 lines I have shown above allow the page to load without errors but show no figures.
Your last variable declaration ends with a comma rather than a semicolon.
Steve
duke

Re: Build 1033 comments

Post by duke »

yes, and one of yours (the one I quoted) wasn't capitalised correctly.
OOpps, sorry steve, missed that.
Your last variable declaration ends with a comma rather than a semicolon.
And my hat off to you, spot on. seems to working now, just a "few" more webtags to change ;) .

Thanks for sticking with me guys.

Duke
User avatar
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

Post by beteljuice »

@ 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

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. ");";
?>
Outputs:

Code: Select all

hightemp = new Array ('1','2','3','12');
hightemp = new Array (1,2,3,12);
Image
......................Imagine, what you will KNOW tomorrow !
duke

Re: Build 1033 comments

Post by duke »

So as not to hog this thread and some what off topic anyway. New thread here.

Duke
Locked