Page 28 of 54
Re: Now available: AJAX/PHP multilingual website templates
Posted: Sat 03 Sep 2011 11:04 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 8:00 am
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!
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 12:32 pm
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
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)
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 2:33 pm
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
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 3:35 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 5:47 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 6:11 pm
by Ruxomar
Thank you so much for your incredible work keeping up with Cumulus
Best regards
Ruggero
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 6:34 pm
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é
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 6:46 pm
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...
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 6:52 pm
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!
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 7:38 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Tue 06 Sep 2011 7:43 pm
by josebp
Thanks Ken.
Best regards,
José
Re: Now available: AJAX/PHP multilingual website templates
Posted: Wed 07 Sep 2011 3:10 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Wed 07 Sep 2011 5:54 pm
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
Re: Now available: AJAX/PHP multilingual website templates
Posted: Wed 07 Sep 2011 5:57 pm
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