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

monthlyrecord 'table'

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

monthlyrecord 'table'

Post by laulau »

Hi,
I have a monthlyrecord page with a table option (i think it was written by the beteljuice) that is no working with CMX.
I think it's perhaps a formating problem.
The page processed by cumulus C1 :http://meteo.laurentmey.fr/php/monthlyrecord1.php
The one processed by CMX :http://meteo.laurentmey.fr/php/monthlyrecord.php
The table don't appear anymore.
In the source code at line ~222 i can see
var hightempT = ["Impossible de trouver un guillemet correspondant pour le caractère '''.'dd'</b>, en <b>'yyyy'</b> à <b>'hh:mm'</b>'">","Impossible de trouver un guillemet correspondant pour le caractère .....
It seem that it is a webtag format error!
var hightempT = ["<#ByMonthTempHT mon=1 format=" 'Le <b>'dd'</b>, en <b>'yyyy'</b> à <b>'hh:mm'</b>'">","<#ByMonthTempHT mon=2 format="'Le <b>'dd'</b>, en <b>'yyyy ....
<b>'dd'</b> in text formating isn't accepted by CMX ?
Source code attached
Thanks
You do not have the required permissions to view the files attached to this post.
Laurent

Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: monthlyrecord 'table'

Post by mcrossley »

dd should be OK, I certainly use it in lots of my tags.

I suggest you start building up the format string a bit at a time and see exactly which part is causing the problem.
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: monthlyrecord 'table'

Post by mcrossley »

I'd start by removing that leading space on the first array variable, I don't think it will matter, but it is inconsistent with the rest...

format=" 'Le <b>
to
format="'Le <b>
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: monthlyrecord 'table'

Post by steve »

The closing ">" in "<b>" is being taken as the end of the web tag by the token parser. I'm not sure there's anything I can do about that.
Steve
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: monthlyrecord 'table'

Post by mcrossley »

Ah, even though it is in a string, :bash:

You will have to do what I have done then in these variables (it's PHP but the same principle), where I put the HTML outside the tag code (I probably hit the same problem and forgot about it!)...

Code: Select all

$ByMonthTempHTmon1='<#ByMonthTempHT mon=1 format="dd MMM yyyy"><span class="not-mobile"><#ByMonthTempHT mon=1 format="' at 'HH:mm"></span>';
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: monthlyrecord 'table'

Post by steve »

mcrossley wrote:Ah, even though it is in a string
Yes - I had to write the parser myself, and it's fairly dumb. The Delphi parser must take account of the start and end of quoted characters.

I am always happy to accept code submissions (in C#) for inclusion in MX ;)
Steve
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: monthlyrecord 'table'

Post by mcrossley »

I'll let you off then :lol: , I thought it would be part of the standard library. So do you strip out the predefined tags and pass them on to .ToString() for processing?
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: monthlyrecord 'table'

Post by steve »

It just scans the contents of the file for "<#", copying input to output, and then when it finds that, it scans for the next ">", and then extracts the text between those two and passes it on to the tag processing code. The returned processed tag is appended to the output instead of the tag.
Steve
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: monthlyrecord 'table'

Post by laulau »

The tooltips are now working as they should !
Laurent

Image
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: monthlyrecord 'table'

Post by beteljuice »

Good workaround Laurent, but sneaky 8-)
:clap:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: monthlyrecord 'table'

Post by laulau »

Yes it is a DIY solution, I'm no expert in coding. there is certainly a more professional solution.
Laurent

Image
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: monthlyrecord 'table'

Post by mcrossley »

laulau wrote:there is certainly a more professional solution.
Yeah, write Steve a decent parser routine :lol:

For brevity, you can concatenate the replace functions (and as you use a global variable get rid of the 'evil')...

var tvt = window[tip_var_time[y]][x].replace(/bld/g,"</b>").replace(/BLD/g,"<b>");

Good solution though.
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: monthlyrecord 'table'

Post by beteljuice »

Something isn't right Laurent ....

You've commented out the eval but it still seems to work ???
... but your wet / dry dates are a nonsense !

I'll think about it when my brain is in gear.

Probably a sequence thing ?
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: monthlyrecord 'table'

Post by laulau »

beteljuice wrote:... but your wet / dry dates are a nonsense !
:oops:

Code: Select all

format="yyyy,m,dd
shoud be

Code: Select all

format="yyyy,%M,dd
with CMX
Laurent

Image
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: monthlyrecord 'table'

Post by beteljuice »

Ahh :groan: that could cause problems in other scripts as well :shock:

Do I do seperate versions or put a user var for mx decisions ... I think I'll go and lie down for a bit.

Edit: That's rubbish ! - has to be seperate version because mx parser is before anything else !
.... unless ...
Image
......................Imagine, what you will KNOW tomorrow !
Locked