Sandaysoft

Support forum for Cumulus weather station software
It is currently Sat May 25, 2013 10:02 am
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 7:27 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17613
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
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: http://sandaysoft.com/forum/viewtopic.php?f=14&t=7359

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 9:13 am 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
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:
  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; ?>"],
   

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 10:41 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17613
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
Yes, that looks about right. But note that PHP variable names are case sensitive:

duke wrote:
"<?php echo $sepTempHT; ?>

_________________
Steve
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 11:31 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1852
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
@duke

Looks like you are mixing up JS and php array definitions.

I think it should be more like:
Code:
<?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

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Last edited by beteljuice on Sun Apr 15, 2012 11:13 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 3:32 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
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
Quote:
$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

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 3:54 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 02, 2008 6:49 pm
Posts: 17613
Location: Sanday, Orkney
Weather Station: Davis VP2
Operating System: Windows Home Server 2011
duke wrote:
Steve, the webtags by GraemeT are capitalized as
Quote:
$JanTempH = '<#ByMonthTempH mon=1>';

yes, and one of yours (the one I quoted) wasn't capitalised correctly.

Quote:
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
Sanday Weather
----------------------------------------------------------------------------------------------------------------------------------
Like Cumulus and want to support it? Please donate! Image


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 4:02 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
Quote:
yes, and one of yours (the one I quoted) wasn't capitalised correctly.


OOpps, sorry steve, missed that.

Quote:
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

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Sun Apr 15, 2012 11:18 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1852
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
@ 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:
<?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:
hightemp = new Array ('1','2','3','12');
hightemp = new Array (1,2,3,12);

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: Build 1033 comments
PostPosted: Tue Apr 17, 2012 6:05 pm 
Offline
User avatar

Joined: Sun Jul 03, 2011 6:23 pm
Posts: 324
Location: Eastleigh, Hampshire, UK
Weather Station: Davis VP2 - 24hr FARS
Operating System: Windows 7 - 64 bit
So as not to hog this thread and some what off topic anyway. New thread here.

Duke

_________________
Duke

Nightingale Weather PHP
Eastleigh, Hampshire, UK


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group