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

wxcurecords.php

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

Moderator: daj

n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

wxcurecords.php

Post by n9mfk »

hi All,
i get this error were a month should be

Notice: Undefined index: langMonths in C:\c_n9mfk\www\wxcurecords.php on line 217

I have not made any changes to wxcurecords.php

how can i fix this
thanks beau

http://99.148.159.206/wxcurecords.php
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: wxcurecords.php

Post by beteljuice »

Looks OK from here ?
Image
......................Imagine, what you will KNOW tomorrow !
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wxcurecords.php

Post by n9mfk »

Hi beteljuice,
if you load the page then click reload it will brake
Beau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

It appears that one of the functions is having a problem with your date/time format for all-time records:
<!-- CU_getAlltimeDate input inDate='at 3:37 PM on 21 July 2011' -->
<!-- CU_getAlltimeDate after tstr='$2 $1' -->

<!-- CU_getAlltimeDate result ltime='31 12 1969 18:00' -->
<!-- CU_getAlltimeDate input inDate='at 7:33 AM on 10 January 2010' -->
<!-- CU_getAlltimeDate after tstr='$2 $1' -->
<!-- CU_getAlltimeDate result ltime='31 12 1969 18:00' -->
The extra PM or AM was unanticipated.. I'll need to change the CU_getAlltimeDate function to fix that.
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

I think my prior post was somewhat in error .. the problem seems to be your PHP installation, Beau.

The code in CU_getAlltimeDate()

Code: Select all

  if(preg_match('|^at (.*) on (.*)$|i',$inDate)) { // at 2:45 PM on 16 October 2009
    $tstr = "$2 $1";
  } elseif (preg_match('|^on (.*)$|i',$inDate)) { // on 16 October 2009
    $tstr = "$1";
  }
seems to fail in your PHP to set the temporary variables $1 and $2 with the results of the last preg_match (which works fine on my PHP).

You can change that code to

Code: Select all

  if(preg_match('|^at (.*) on (.*)$|i',$inDate,$m)) { // at 2:45 PM on 16 October 2009
    $tstr = $m[2] . " " .$m[1];
  } elseif (preg_match('|^on (.*)$|i',$inDate,$m)) { // on 16 October 2009
    $tstr = $m[1];
  }
which uses the $m variable to store the matches. I'll change the code in the next release of the CU-defs.php version, but go ahead and try it on your copy.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wxcurecords.php

Post by n9mfk »

Hi Ken,
i put in the new code im still get the Notice: Undefined index: langMonths in C:\c_n9mfk\www\wxcurecords.php on line 217 2009

Beau
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

With the modified code, the CU_getAlltimeDate() routine is correctly parsing it with your PHP

Code: Select all

<!-- CU_getAlltimeDate input inDate='at 3:37 PM on 21 July 2011' -->
<!-- CU_getAlltimeDate after tstr='21 July 2011 3:37 PM' -->

<!-- CU_getAlltimeDate result ltime='21 7 2011 15:37' -->
<!-- CU_getAlltimeDate input inDate='at 7:33 AM on 10 January 2010' -->
<!-- CU_getAlltimeDate after tstr='10 January 2010 7:33 AM' -->
<!-- CU_getAlltimeDate result ltime='10 1 2010 07:33' -->
However, there's a problem in
<tr class="column-dark">
<td><?php langtrans('Highest'); ?> <?php langtrans('Monthly Rainfall'); ?></td>
<td><?php print $WX['rfallmH']; ?> <?php print $SITE['uomRain']; ?></td>
<td><?php print fix_CU_record_date($WX['TrfallmH']); ?></td>
</tr>
The fix_CU_record_date() function is showing
<tr class="column-dark">
<td>Highest Monthly Rainfall</td>
<td>8.78 in</td>
<td><!-- inDate='October 2009' month='October' year='2009' -->

Notice: Undefined index: langMonths in C:\c_n9mfk\www\wxcurecords.php on line 217
<!-- outTime=' 2009' -->
2009</td>
</tr>
so the month/year are processed correctly.

Your site seems to be missing the language-en.js file .. install that, and you should be rid of the Notice error.
You do not have the required permissions to view the files attached to this post.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wxcurecords.php

Post by n9mfk »

Hi Ken,
I added the file what else did need to change im still get the error?
Beau
mike
Posts: 14
Joined: Wed 16 Sep 2009 10:54 pm
Weather Station: Davis lacrosse

Re: wxcurecords.php

Post by mike »

I got the same problem as beau.

<tr class="column-dark">
<td>Highest Monthly Rainfall</td>
<td>7.35 in</td>
<td><!-- inDate='May 2011' month='May' year='2011' -->
<!-- outTime=' 2011' -->
2011</td>
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

n9mfk wrote:Hi Ken,
I added the file what else did need to change im still get the error?
Beau
Beau, you added the file as language-en.js.txt, it needs to be language-en.js
That's why I'd put the comment with the download to "Save file as language-en.js".
mike wrote:I got the same problem as beau.

<tr class="column-dark">
<td>Highest Monthly Rainfall</td>
<td>7.35 in</td>
<td><!-- inDate='May 2011' month='May' year='2011' -->
<!-- outTime=' 2011' -->
2011</td>
What's the URL for your website, Mike?
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

Ahh... found the underlying issue.. I'd forgotten to put a copy of the language-en.js into the Base-USA distribution .zip (now corrected).

So those users of Base-USA with Cumulus-Plugin will need to manually add the language-en.js file to fix the Notice error and correctly display the month for Hightest Rain in wxcurecords.php

Sorry for the inconvenience.

Best regards,
Ken
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wxcurecords.php

Post by n9mfk »

Hi ken,
I Changed the name of the file
im still get Undefined index: langMonths in C:\c_n9mfk\www\wxcurecords.php on line 217 2009
Beau
Last edited by n9mfk on Mon 29 Aug 2011 10:11 pm, edited 1 time in total.
mike
Posts: 14
Joined: Wed 16 Sep 2009 10:54 pm
Weather Station: Davis lacrosse

Re: wxcurecords.php

Post by mike »

Ahh... found the underlying issue.. I'd forgotten to put a copy of the language-en.js into the Base-USA distribution .zip (now corrected).

So those users of Base-USA with Cumulus-Plugin will need to manually add the language-en.js file to fix the Notice error and correctly display the month for Hightest Rain in wxcurecords.php

That fixed it for me.

Thanks
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: wxcurecords.php

Post by saratogaWX »

Beau,
It looks like the language translation function is not engaging.

You seem to also be missing language-en.txt file.

Try installing that too (I've fixed that in the distribution).
You do not have the required permissions to view the files attached to this post.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: wxcurecords.php

Post by n9mfk »

Hi Ken,
that fixed it

are there any other file missing
what are thy used for ?
thanks
Post Reply