Page 1 of 2
is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 11:53 am
by hills
Hi Steve
Is there a webtab for highest annual rainfall that could be included in the records page like <#HighYearlyRainRecordSet>?
I couldn't find one in the webtags section.
Cheers
Phil
Re: is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 11:58 am
by steve
No, Cumulus doesn't maintain any 'year-by-year' records at all.
Re: is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 12:07 pm
by hills
no worries, thanks for that. Given that its only once a year, I've manually entered it into my records page.

Re: is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 12:10 pm
by steve
hills wrote:Given that its only once a year, I've manually entered it into my records page.

Yes, I was going to suggest that, as it's once a year (at most).
Re: is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 12:15 pm
by steve
Although - if the current year becomes the new record holder and you want it to update straight away and keep the total updating, it's a bit more of a pain.
Re: is there a webtag for record yearly rainfall?
Posted: Tue 10 Jan 2012 12:23 pm
by mcrossley
A little bit of JavaScript on the page could keep it updated dynamically - you would only have to update that once a year (at most) with the last yearly record. Just compare the hard coded record value with the current year total, display whichever is greater.
Re: is there a webtag for record yearly rainfall?
Posted: Thu 17 May 2012 12:32 pm
by bigmac
No, Cumulus doesn't maintain any 'year-by-year' records at all.
mcrossley wrote:A little bit of JavaScript on the page could keep it updated dynamically - you would only have to update that once a year (at most) with the last yearly record. Just compare the hard coded record value with the current year total, display whichever is greater.
I was wondering if there was a webtag as well, so from searching the forums, found this thread and now know that there isn't

. Which is a shame as I think the wettest year (or even the driest year) is quite an important record to show on my "Records" page.
Soooooo, when you say "a little bit of Javascript", how difficult would it be, given I have no programming skills and have basically "used" many other peoples websites, their hard work, and my "tinkering trying to get it to work for me", to put my site together
In my mind, for the wettest year, I just need to add the monthly totals together for each year and then display the highest value that results, but I guess in a web page I would have to calculate that every time, whereas I probably need to store this value once it's calculated so that this is just a one time operation.
How would I go about the driest year, probably the same way, but then use the lowest total calculated?
Can I do this without a MySQL database?
Lots of questions, hope someone can point me in the right direction

Re: is there a webtag for record yearly rainfall?
Posted: Thu 17 May 2012 12:49 pm
by steve
I just wrote a long reply explaining what you could do (just expanding a little on what Mark has already said) but then accidentally hit some key combination that cleared my reply. So here's a shorter version: You don't need to do any rain total calculations on the web page; manually find the current record holder using 'this year' in Cumulus, put that on a web page. Add javascript to check the <#rainyear> tag, and if it's higher, display this year's total and year instead. On Jan 1st, if the year just ended now holds record, edit the default on the web page.
The same method applies to 'driest', but you can really only update that at the end of the year, so you could do it manually anyway.
Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 9:30 am
by bigmac
Thanks Steve.
So , in a basic form, something like this?
Code: Select all
<script type="text/javascript">
var wettestyear = "whatever my existing highest rainfall year is";
var driestyear = "whatever my existing lowest rainfall year is";
if(wettestyear > #rainyear)
document.write("Wettest Year" wettestyear);
else
document.write("Wettest Year" #rainyear);
if(driestyear < #rainyear)
document.write("Driest Year" driestyear);
else
document.write("Driest Year" #rainyear);
</script>
Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 9:44 am
by mcrossley
Except you cannot compare your driest year to the current year, the current year will probably nearly always be the driest until it is a substantial way through! The direst year record is only valid for whole past years.
Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 9:54 am
by beteljuice
Mark wrote:... The direst year record ...
The beteljuice likes that

Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 10:04 am
by mcrossley
Sounds scotch to me

Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 4:16 pm
by bigmac
mcrossley wrote:Except you cannot compare your driest year to the current year, the current year will probably nearly always be the driest until it is a substantial way through!

Doh, of course.
So, for the driest year, I could also add a statement that checks the date that basically says if it's not December 31st , ignore it?
Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 5:23 pm
by steve
You might as well just edit it in manually (if it's changed) on Jan 1st, and not use Javascript at all for that one.
Re: is there a webtag for record yearly rainfall?
Posted: Fri 18 May 2012 10:13 pm
by bigmac
Except I'm lazy and would like to have it automated
