Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

Comparing with one year ago

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderators: daj, TNETWeather

User avatar
dazza1223
Posts: 412
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Post by dazza1223 » Sat Oct 20, 2018 10:57 pm

hey mate thank you for that demo it made it more easier :D to work out i took what u said go to "https://www.w3schools.com/html/default.asp

ive leaned a lote to night bye watching video and reading so thank u for puting me on the right tracks
have fun and keep learning

dazza :D

sfws
Posts: 461
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Comparing with one year ago

Post by sfws » Sun Oct 21, 2018 7:50 am

It was a decade ago, after leaving paid work, while acting as a full time carer for my late mum that I first taught myself HTML to pass the time between carer duties. Looking back, it was a miserable time coping with her terminal illness, but I did feel better for learning that skill and I have found it a useful way of keeping my brain working in my retirement.

I am glad I have inspired you to follow your own learning path.

User avatar
dazza1223
Posts: 412
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Post by dazza1223 » Sun Oct 21, 2018 6:53 pm

im sor sorry to here about when u hade to go through with your mum :cry: um i leaning html more better but i ive tryed to do

some mode off the code u gave me

<td class="table_two"><?=$required_fields[4];?>&nbsp;<#tempunit></td>
<td class="table_two">at&nbsp;<?=$required_fields[5];?></td>
</tr>

im trying to put all this code so it look very tidy but for the hell can i do it so do u mind place the code in the line above plz

<?php
echo "$required_fields[17]";
?> <#windunit>(
<?php
$return = calculateBeaufort($required_fields[17],'<#windunit>');
echo "$return";
?>)</td>
<td>at&nbsp;
<?php
echo (calculateTime($required_fields[18]));
?> </td>
have fun and keep learning

dazza :D

sfws
Posts: 461
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Comparing with one year ago

Post by sfws » Sun Oct 21, 2018 8:16 pm

The shorter format is only available if the only instruction within the PHP script section within the HTMl is an echo.
This bit of php

Code: Select all

<?php
$return = calculateBeaufort($required_fields[17],'<#windunit>');
echo "$return";
?>)
has an instruction that is not an echo followed by an echo, so that combination cannot be expressed in any other way.

The alternative is to separate the two PHP instructions out:
Type the call to the function (that can be placed anywhere provide the returned string is defined before it is used, therefore the php snippet

Code: Select all

<?php
$return = calculateBeaufort($required_fields[17],'<#windunit>');
?>
is placed before the HTML table (i.e. before <table>) and that leaves just the echo (that has to be placed where it is to appear) to put

Code: Select all

<td class="table_two"><?= $required_fields[17] . ' <#windunit>(' .  $return;?>)</td>
within the table cell within the table.

User avatar
dazza1223
Posts: 412
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Post by dazza1223 » Sun Oct 21, 2018 10:01 pm

yep that did the trick thank you

http://www.davisworthing.co.uk/new/tod_yes_yerar.php

take a look if u see any error can u pont them out as ive been on the for 6 hr trying to sort it and i must say ur very good with php


ps i wood like to remove this lin as it taking up to much room (F3=Gentle breeze)
have fun and keep learning

dazza :D

sfws
Posts: 461
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Comparing with one year ago

Post by sfws » Mon Oct 22, 2018 7:06 am

dazza1223 wrote:take a look, if u can see any errors can u point them out
The "Temperature Average" line has used syntax for time-stamp instead of syntax for value cell - remove "at&nbsp;" before figure, add units after figure (copy "Temperature Range" row).
Otherwise looks good.
dazza1223 wrote: (F3=Gentle breeze) is taking up to much room
In the
function calculateBeaufort(
area change the following line:

Code: Select all

$beaufort='F' . ($i2 - 1) . '=' . $speedArray[$i2-1][4];
into

Code: Select all

$beaufort='F' . ($i2 - 1);

User avatar
dazza1223
Posts: 412
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Post by dazza1223 » Mon Oct 22, 2018 8:05 am

:bash: doh sorry I ment just remove Gentle breeze and leve the f3 all the same thank u for all the help u gave me


Ps have u got a website?
have fun and keep learning

dazza :D

sfws
Posts: 461
Joined: Fri Jul 27, 2012 11:29 am
Weather Station: Customised mix of Fine Offset
Operating System: Tempermental Win. 10 PC
Location: UK

Re: Comparing with one year ago

Post by sfws » Mon Oct 22, 2018 11:20 am

dazza1223 wrote:I meant just remove Gentle breeze and leave the f3 ...


Ps have u got a website?
I understood fully what you meant, and provided code change to do exactly that in my last reply. You will see earlier in this thread some discussion about the shorter or longer format of exactly that part of the display.

I can see I did write the script with the option of either display, but I simplified the final PHP script version I posted to make it friendlier. I selected to provide the longer display as most users understand enough PHP to take something out (the bit removed in my previous reply), but those users may not know how to add extra.


My server is local, not shared online, as I am using a very tempermental windows 10 PC that constantly fails now. Plus, as I have posted many times before, I accept the dubious quality of my weather station and consequently statistics produced are often rubbish. The only use of my weather station is to produce something that varies in its content, that I can try my different scripts on.

User avatar
dazza1223
Posts: 412
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Comparing with one year ago

Post by dazza1223 » Mon Oct 22, 2018 11:30 am

o i see ok i will have a bach at it to night thanks and u saying ( scripts) how meny have you made as i will like some more off them it u got any :D
have fun and keep learning

dazza :D

Post Reply