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

Now available: AJAX/PHP multilingual website templates

Discussion of Ken True's web site templates

Moderator: saratogaWX

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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

vpokroglo wrote:I got many date issues some time ago, but then i corrected some code and all dates seems to show ok. But now when i update to the new cu-defs file the date showing month gust data its wrong (Gust Month: 8,6 km/h Jan 1). My site is http://www.okroglovreme.com. Any sugestions?

Thanks!
Your version of CU-defs.php has a bug (on some PHP installations) that results in being unable to process some dates. Viewing your homepage (with view source) shows
<!-- CU_getAlltimeDate input inDate='at 15:38 on 23 avgust 2011' -->
<!-- CU_getAlltimeDate after tstr='$2 $1' -->

<!-- CU_getAlltimeDate result ltime='1 1 1970 01:00' -->
<!-- CU_getAlltimeDate input inDate='at 0:17 on 17 december 2010' -->
<!-- CU_getAlltimeDate after tstr='$2 $1' -->
<!-- CU_getAlltimeDate result ltime='1 1 1970 01:00' -->
That's why the 1-Jan-1970 date is shown for some items.

I suggest you update with http://saratoga-weather.org/wxtemplates/updates.php using 1-Aug-2011 as the selection date.

Best regards,
Ken
User avatar
vpokroglo
Posts: 111
Joined: Thu 24 Feb 2011 7:45 pm
Weather Station: WS-2350
Operating System: Raspberry Pi 2
Location: Slovenija
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by vpokroglo »

Thanks Ken for your reply.
I have done al the updates You say and some things are realy better, but Month gust date in dashboard is still wrong. its showing Gust Month: 32,4 km/h Jan 6 . But this gust was today on 6 sep, not jan 6.

Thanks!
Image
WoodburyMan
Posts: 166
Joined: Sun 04 Sep 2011 2:02 am
Weather Station: Ecowitt GW1000
Operating System: Windows 10 20H2
Location: Woodbury, Connecticut, U.S.A.
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by WoodburyMan »

Thanks for sharing your amazing work!

I keep getting and error though...

On the Advisories page and top header of main page, I get the following
Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.
My current zone is "CTZ013", Southern Litchfield County.
Here is my lines in Settings.php

Code: Select all

// NOAA warning zone
$SITE['noaazone'] 		= 'CTZ013'; // used for NOAA advisories and advforecast2.php forecasts
$SITE['hurlURL']		= "wxadvisory.php"; // page to launch for details on NOAA advisories
// 
I believe I have done everything right... anyone point me to what might be wrong?
I have my site set up temporarily running on http://grudzien.no-ip.org:8080/weather/new/
(My site runs on grudzien.us that just forwards to a DYDNS site run locally rather than hosting remotely)
Woodbury, CT Weather Ecowitt GW1100, Solar, Wind, Rain, Temp, Soil, Lightning
Southington, CT Weather Ecowitt GW2000 Wittboy Solar, Wind, Rain, Temp, Soil, Lightning, CO2/PM2.5/PM10

Running CumuluxMX 3.24.1 b3234 both sites on Windows 11 22H2
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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

WoodburyMan wrote:Thanks for sharing your amazing work!

I keep getting and error though...

On the Advisories page and top header of main page, I get the following
Advisory Information Unavailable, error fetching or reading data from the NOAA advisories server.
My current zone is "CTZ013", Southern Litchfield County.
Here is my lines in Settings.php

Code: Select all

// NOAA warning zone
$SITE['noaazone'] 		= 'CTZ013'; // used for NOAA advisories and advforecast2.php forecasts
$SITE['hurlURL']		= "wxadvisory.php"; // page to launch for details on NOAA advisories
// 
I believe I have done everything right... anyone point me to what might be wrong?
I have my site set up temporarily running on http://grudzien.no-ip.org:8080/weather/new/
(My site runs on grudzien.us that just forwards to a DYDNS site run locally rather than hosting remotely)
I ran check-fetch-times.php on your site, and it appears that none of the cache files stored in ./cache are writable. Make sure that directory is writable by PHP and the scripts should return to working :)

Best regards,
Ken
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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

vpokroglo wrote:Thanks Ken for your reply.
I have done al the updates You say and some things are realy better, but Month gust date in dashboard is still wrong. its showing Gust Month: 32,4 km/h Jan 6 . But this gust was today on 6 sep, not jan 6.

Thanks!
The code that generates the Gust Month display in ajax-dashboard.php is

Code: Select all

              <?php if(isset($mrecordwindgust)) { ?>
              <tr>
                <td colspan="2" class="data1" align="center">
				  <?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?> 
                  <?php if(isset($mrecordhighgustday)) { ?>
				  <?php echo substr($monthname,0,3) . " " . $mrecordhighgustday; ?> 
                  <?php } // $mrecordhighgustday ?>
				</td>
              </tr>
              <?php } // $mrecordwindgust ?>
and the code in CU-defs.php that fills those variables is

Code: Select all

$mrecordwindgust = $WX['MonthGustH'];
list($mrecordhighgustday,$mrecordhighgustmonth,$mrecordhighgustyear)=CU_getRecordDate($WX['MonthGustHD'],$WX['year']); // calculated value

# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
  = CU_setDateTimes($date,$time,$SITE['WDdateMDY']);

Your CUtags.php?sce=dump has

Code: Select all

$WX['MonthGustH'] = '35,3';
$WX['MonthGustHT'] = '11:00';
$WX['MonthGustHD'] = '06 september';
Running your home page with ?debug=y and viewing the source shows

Code: Select all

<!-- CU_setDateTimes CUtime='2000--6.9.2011 16:55:00' assembled -->
<!-- CU_setDateTimes CUtime='1970 01 01 01 00 January Thursday' values set -->
So the issue is the date format in $WX['date'] = '6.9.2011';
is the underlying cause. So... change your CU-defs.php from

Code: Select all

  $d = explode('/',$indate);
  if(!isset($d[2])) {$d = explode("-",$indate);}
to

Code: Select all

  $d = explode('/',$indate);
  if(!isset($d[2])) {$d = explode("-",$indate);}
  if(!isset($d[2])) {$d = explode(".",$indate);}
and that should fix the date issue.

Sorry for the long post.. I just wanted to show the debug process so you could see how it all ties together.

I'll make the update to CU-defs.php for the next distribution.

Best regards,
Ken
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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

I've updated the tags files to support Cumulus 1.9.2 Beta 1010 tags, and CU-defs.php to have the fix for date in dd.mm.yyyy format.

http://saratoga-weather.org/wxtemplates/updates.php for the customized update .zip file

Best regards,
Ken
Ruxomar
Posts: 12
Joined: Sun 23 Jan 2011 2:59 pm
Weather Station: Davis Pro2 Plus Wireless
Operating System: W7 x64 SP1
Location: San Marino (Montalbo)
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by Ruxomar »

Thank you so much for your incredible work keeping up with Cumulus :D

Best regards
Ruggero
josebp
Posts: 65
Joined: Tue 13 Apr 2010 11:37 am
Weather Station: Davis Vantage Pro2
Operating System: WINDOWS 10
Location: Sevilla, España
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by josebp »

Hi Ken, from a few minutes ago I get the following message:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533


I've changed nothing and this is what makes in the extended forecast:
http://www.tiempoensevilla.es/wxforecast.php


Do you know what can be?
Thank you.
Best regards
José
------------------------------------------------------------------------------------------------
Hola Ken, desde hace unos minutos me sale el siguiente mensaje:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533

No he cambiado nada y esto es lo que pone en el pronóstico extendido:
http://www.tiempoensevilla.es/wxforecast.php

¿Sabés lo que puede ser?
Gracias.
Saludos,
José
Image
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by nitrx »

josebp wrote:Hi Ken, from a few minutes ago I get the following message:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533


I've changed nothing and this is what makes in the extended forecast:
http://www.tiempoensevilla.es/wxforecast.php


Do you know what can be?
Thank you.
Best regards
José
------------------------------------------------------------------------------------------------
Hola Ken, desde hace unos minutos me sale el siguiente mensaje:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533

No he cambiado nada y esto es lo que pone en el pronóstico extendido:
http://www.tiempoensevilla.es/wxforecast.php

¿Sabés lo que puede ser?
Gracias.
Saludos,
José
I've the same today seems something wrong by wunderground...
WoodburyMan
Posts: 166
Joined: Sun 04 Sep 2011 2:02 am
Weather Station: Ecowitt GW1000
Operating System: Windows 10 20H2
Location: Woodbury, Connecticut, U.S.A.
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by WoodburyMan »

I ran check-fetch-times.php on your site, and it appears that none of the cache files stored in ./cache are writable. Make sure that directory is writable by PHP and the scripts should return to working :)

Best regards,
Ken
Thanks Ken, worked like a charm!
Woodbury, CT Weather Ecowitt GW1100, Solar, Wind, Rain, Temp, Soil, Lightning
Southington, CT Weather Ecowitt GW2000 Wittboy Solar, Wind, Rain, Temp, Soil, Lightning, CO2/PM2.5/PM10

Running CumuluxMX 3.24.1 b3234 both sites on Windows 11 22H2
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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

josebp wrote:Hi Ken, from a few minutes ago I get the following message:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533


I've changed nothing and this is what makes in the extended forecast:
http://www.tiempoensevilla.es/wxforecast.php


Do you know what can be?
Thank you.
Best regards
José
------------------------------------------------------------------------------------------------
Hola Ken, desde hace unos minutos me sale el siguiente mensaje:
Warning: Division by zero in /htdocs/public/www/WU-forecast.php on line 533

No he cambiado nada y esto es lo que pone en el pronóstico extendido:
http://www.tiempoensevilla.es/wxforecast.php

¿Sabés lo que puede ser?
Gracias.
Saludos,
José
Yes, the WU-forecast.php script is no longer working due to changes in the design of the WeatherUnderground website.

I'm working on an update which should be ready later today.. I'll post a note when it's available.

Best regards,
Ken
josebp
Posts: 65
Joined: Tue 13 Apr 2010 11:37 am
Weather Station: Davis Vantage Pro2
Operating System: WINDOWS 10
Location: Sevilla, España
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by josebp »

Thanks Ken.
Best regards,
José
Image
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: Now available: AJAX/PHP multilingual website templates

Post by n9mfk »

Ken,
if you had a file that get uploaded 1 time a day
how wood you set wxstatus.php to check for it
thanks 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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Sorry Beau, that (as they used to say in math classes) "is an exercise for the student".

Here's a hint. How many seconds in a day? 60*60*24=86400
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: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Thanks, WeatherUnderground website elves for complicating things :(

There are two updated WU-forecast.php versions:

Download: WU-forecast.php (SA) Version 1.13 - 07-Sep-2011 for old WD/PHP/World template set or standalone use)
Download: WU-forecast.php (ML) Version 1.18 - 07-Sep-2011 for old WD/PHP/World-ML or V3 Base-World template set)

With the new WU website changes comes a bit of a problem for English and Spanish language versions. WU has become a LOT more verbose in the text description, so the short one or two word description under the icon is now (possibly) long sentences. I don't have a good way to automatically fix that while supporting multiple languages... Sorry.

Secondly, the words they use for High and Low temperatures do not have good consistency across the various languages which may result in truncated words in the High/Low temperature under the icon. I can't fix that either.

Do send your feedback to WeatherUnderground to have them improve the specific language you are interested in.

I've attached some screenshots of the English, Spanish and Danish forecasts to show how it works with their updated website design.

Best regards,
Ken
You do not have the required permissions to view the files attached to this post.
Post Reply