Hi Steve,
Looking at the data for rain for This Month it doesn't look quite right when no rain has fallen.
Is there any way the tags could be made invisible until there is some rain data to display?
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
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
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
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
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
This Month's rain when none has fallen
-
RayProudfoot
- Posts: 3602
- Joined: Wed 06 May 2009 6:29 pm
- Weather Station: Davis VP2 with Daytime FARS
- Operating System: Windows XP SP3
- Location: Cheadle Hulme, Cheshire, England
- Contact:
This Month's rain when none has fallen
You do not have the required permissions to view the files attached to this post.
-
serowe
- Posts: 484
- Joined: Tue 03 Aug 2010 6:23 am
- Weather Station: WM918
- Operating System: Win Server 2008 R2
- Location: Ferntree Gully, VIC, Oz
- Contact:
Re: This Month's rain when none has fallen
As long as you are exporting your file(s) as PHP, the followig will work:
Change the tag to suit whatever section you want (daily, hourly, monthly, yearly falls etc.
You can also use the if()... statements to also provide a display if nothing has fallen eg
Code: Select all
if ( $rfallmH > 0 ){
// Put your display in here - if the monthly rainfall is zero, nothing will display
}
You can also use the if()... statements to also provide a display if nothing has fallen eg
Code: Select all
if ( $rfallmH > 0 ){
// Put your display in here - if the monthly rainfall is zero, nothing will display
echo $rfallmH . " recorded so far this month.";
}
else
{
// Now display a message saying no rain has been recorded
echo "Nil rain recorded so far this month";
}
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
serowe
- Posts: 484
- Joined: Tue 03 Aug 2010 6:23 am
- Weather Station: WM918
- Operating System: Win Server 2008 R2
- Location: Ferntree Gully, VIC, Oz
- Contact:
Re: This Month's rain when none has fallen
Whoops just realised - the above code assumes you are creating a single webtags file and then doing the tanspositions in the PHP files when you display them instead of creating lots of individual files that Cumulus processes (if that makes sense).
If you are processing the files through Cumulus replace the $rfallmH PHP variable with the Cumulus tag - it will still work that way.
If you are processing the files through Cumulus replace the $rfallmH PHP variable with the Cumulus tag - it will still work that way.
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: This Month's rain when none has fallen
You could put some javascript in your HTML to display something else when you've had no rain.RayProudfoot wrote:Is there any way the tags could be made invisible until there is some rain data to display?
Steve
- steve
- Cumulus Author
- Posts: 26672
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: This Month's rain when none has fallen
As an example of how to do this using javascript, I've modified my todayT.htm template. The code for the time of today's max rain rate is currently:
which displays as:
I added some javascript so that the time is only displayed if the max rain rate isn't zero:
and it now looks like this:
Note that I'm not a javascript expert and there may be better ways of writing the code!
Code: Select all
<td>at <#TrrateTM>"</td>Code: Select all
<td><script type="text/javascript">if (<#rrateTM> != "0.0") {document.write("at <#TrrateTM>")}</script></td>You do not have the required permissions to view the files attached to this post.
Steve
-
RayProudfoot
- Posts: 3602
- Joined: Wed 06 May 2009 6:29 pm
- Weather Station: Davis VP2 with Daytime FARS
- Operating System: Windows XP SP3
- Location: Cheadle Hulme, Cheshire, England
- Contact:
Re: This Month's rain when none has fallen
Thanks Steve and serowe. I think I have enough information from your examples to change my HTML template files.
BUT!!! Sod's Law strikes again. It started raining this afternoon after 23 days without rain. Quite a rarity in this part of the world.
BUT!!! Sod's Law strikes again. It started raining this afternoon after 23 days without rain. Quite a rarity in this part of the world.
-
serowe
- Posts: 484
- Joined: Tue 03 Aug 2010 6:23 am
- Weather Station: WM918
- Operating System: Win Server 2008 R2
- Location: Ferntree Gully, VIC, Oz
- Contact:
Re: This Month's rain when none has fallen
Which is the rarity? The fact is hasn't ben raining or that it is raining? 
Punctuation is the difference between 'Let's eat, grandma' and 'Let's eat grandma'
-
RayProudfoot
- Posts: 3602
- Joined: Wed 06 May 2009 6:29 pm
- Weather Station: Davis VP2 with Daytime FARS
- Operating System: Windows XP SP3
- Location: Cheadle Hulme, Cheshire, England
- Contact:
Re: This Month's rain when none has fallen
The former. Manchester has a reputation for damp weather so to go 23 days without any measurable precipitation is quite unusual.serowe wrote:Which is the rarity? The fact is hasn't ben raining or that it is raining?