Page 39 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 21 Jan 2012 10:50 pm
by saratogaWX
Toddi wrote:Hi
Tanks ken. have done that, but still no update and the date is still wrong.

http://kystvind.no/wxindex.php
I think it runs deeper than just the ajaxCUwx.js .. neither the ajax-dashboard nor the ajax-gizmo currently support '.' delimited dates, only '/' or '-' delimited dates.

Looks like I have some more coding to do :)

I'll release an update which should support the '.' delimited date format, and an update to the CUtags file for Cumulus 1.9.2 build 1028 likely tomorrow.

I'll post when it's ready.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 21 Jan 2012 11:22 pm
by saratogaWX
Toddi wrote:Hi
Tanks ken. have done that, but still no update and the date is still wrong.

http://kystvind.no/wxindex.php
Ok.. I've made the changes to ajax-dashboard, ajax-gizmo and ajaxCUwx.js to support the dd.mm.yy date formats.

Would you mind trying the attached and see if it fixes the issue on your site?

Don't forget to re-customize the ajaxCUwx.js .. the version I sent was for English units :)

Thanks,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 12:17 am
by Toddi
Hi!
The date on the gismo and dashboard is god. on my status it still wrong and on sun/moon almanac the moon got wrong date.
Thanks for all the help Ken.

Regard Toddi

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 12:47 am
by saratogaWX
Toddi wrote:Hi!
The date on the gismo and dashboard is god. on my status it still wrong and on sun/moon almanac the moon got wrong date.
Thanks for all the help Ken.

Regard Toddi
Thanks for testing Toddi.

I've added fixes to include-wxstatus.php and wxastronomy.php pages in the .zip attached (the ajax-dashboard, ajax-gizmo and ajaxCUwx.js are unchanged from the prior .zip).

Please try those two (include-wxstatus.php and wxastronomy.php on your site.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 1:04 am
by Toddi
status site and sun/mon site and all of det date issue is ok :)
The only ting no is the update of the site.

Toddi

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 1:12 am
by saratogaWX
Toddi wrote:status site and sun/mon site and all of det date issue is ok :)
The only ting no is the update of the site.

Toddi
Great! Now we're getting somewhere.

which page and what is "the update of the site"?

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 1:17 am
by Toddi
It just count, not updating the dashboard.
http://kystvind.no/wxindex.php

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 1:32 am
by saratogaWX
Toddi wrote:It just count, not updating the dashboard.
http://kystvind.no/wxindex.php
The issue is a JavaScript error causing the ajaxCUwx.js (and all the rest of the scripts to stop).
Error: missing ] in index expression
Source File: http://kystvind.no/wxindex.php
Line: 228, Column: 25
Source Code:
langTransLookup['Today's & Yesterday's Weather Data'] = 'Dagens & Gårsdagens Værdata';
It's caused by an entry in your language-no.txt

Code: Select all

langlookup|Fog|Tåke|
#
# wxcudata.php language strings
which should read as

Code: Select all

langlookup|Fog|Tåke|
conditions|end||
#
# wxcudata.php language strings
Because of the missing conditions|end|| flag, it was trying to put everything else in a JavaScript array for translation of conditions, and ran into the line later in the file that said

langlookup|Today's & Yesterday's Weather Data|Dagens & Gårsdagens Værdata|

and the ' in Today's created a JavaScript Error.

Make sure the conditions translation entries start with

conditions|begin||

and end with

conditions|end||

to avoid this issue :)

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 2:27 am
by Toddi
Hi!
Took a cleanup, got rid all errors (I believe) but still I have no update on dashboard.

Toddi

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 4:04 am
by saratogaWX
Toddi wrote:Hi!
Took a cleanup, got rid all errors (I believe) but still I have no update on dashboard.

Toddi
Yes..now no JavaScript errors. It looks like the commaDecimal=true is stopping the update. More debug needed to fix.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 5:05 am
by saratogaWX
I was correct.. the decimalComma=true was causing the issue. I changed to use a new function ajax_set_obs_noDCR() for the date/time replacements and it works with/without decimalComma enabled.

Please try the ajaxCUwx.js in the attached .zip .. other files are unchanged from the prior version posted.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 7:58 am
by meteotortosa
A lot of thanks, I think now is allright

:clap:
saratogaWX wrote:
meteotortosa wrote:Hi,
I think something is wrong..

In "Home" tab, we can find: Gust Month: 62,8 km/h January 1

but, this is wrong, you can see in NOAA reports (http://www.meteotortosa.cat/web3/wxnoaa ... eports.php)

Gust Month was on 3th Junary.

How can I fix it?

A lot of thanks
Your NOAA report shows the 62,8 km/h gust was on the 4th of January.

The ajax-dashboard.php has the following code to display the max gust for the month

Code: Select all

              <tr>
                <td colspan="2" class="data1" align="center">
				  <?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?> 
                  <?php if(isset($mrecordhighgustday)) { ?>
				  <?php echo $monthname . " " . $mrecordhighgustday; ?> 
                  <?php } // $mrecordhighgustday ?>
				</td>
              </tr>
and the CU-defs.php has the following mappings

Code: Select all

$mrecordwindgust = $WX['MonthGustH'];
list($mrecordhighgustday,$mrecordhighgustmonth,$mrecordhighgustyear)=CU_getRecordDate($WX['MonthGustHD'],$WX['year']); // calculated value
Looking at your CUtags.php?sce=dump shows

Code: Select all

$WX['MonthGustH'] = '62,8';
$WX['MonthGustHT'] = '21:44';
$WX['MonthGustHD'] = '04 enero';
$WX['year'] = '2012';
So it appears that the CU_getRecordDate() function in CU-defs.php is not able to parse the date of '04 enero 2012' since it is not in English (which is what your PHP is running). The function uses the $SITE['monthNames'] to translate from local language to English for PHP processing.

In your Settings.php, you have set the month names as

Code: Select all

$SITE['monthNames'] = array(
'Gener',
'Febrer',
'Marc',
'Abril',
'Maig',
'Juny',
'Juliol',
'Agost',
'Setembre',
'Octubre',
'Novembre',
'Desembre',
);
which should handle your local month names v.s. English month names. Missing is the month 'enero' used in your tags.
Is your weather software uploading a different language for the months than you have included in the $SITE['monthNames'] array in Settings.php? If so, that setting should match what your weather PC language is using.

I'd suggest using

Code: Select all

$SITE['monthNames'] = array(
"Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Septiembre",
"Octubre",
"Noviembre",
"Diciembre"
);
(the Spanish names) instead of the Catalan names you're currently using.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 10:03 am
by Toddi
saratogaWX wrote:I was correct.. the decimalComma=true was causing the issue. I changed to use a new function ajax_set_obs_noDCR() for the date/time replacements and it works with/without decimalComma enabled.

Please try the ajaxCUwx.js in the attached .zip .. other files are unchanged from the prior version posted.

Best regards,
Ken
Hi!
Thank you for all the help Ken, I appreciate it.
but slill no update.
Hmm! can this bee a host issue, my php test was ok but still..

edit! allow_url_fopen is disabled on server/webhoster. can it mean something?

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 9:13 pm
by saratogaWX
Toddi wrote:
saratogaWX wrote:I was correct.. the decimalComma=true was causing the issue. I changed to use a new function ajax_set_obs_noDCR() for the date/time replacements and it works with/without decimalComma enabled.

Please try the ajaxCUwx.js in the attached .zip .. other files are unchanged from the prior version posted.

Best regards,
Ken
Hi!
Thank you for all the help Ken, I appreciate it.
but slill no update.
Hmm! can this bee a host issue, my php test was ok but still..

edit! allow_url_fopen is disabled on server/webhoster. can it mean something?
No, wasn't a PHP issue, and yes, you can probably leave allow_url_fopen off on a Base-World website .. none of the support scripts use that function. It is requred on the Canada (for ec-radar.php) and USA (NOAA IOD) templates.

So.. finally found the last thing that was preventing the ajaxCUwx.js from running on your site. Sorry it took so long, but
it was changing

Code: Select all

    var cupattern=/\d+(\/|-)\d+(\/|-)\d+ \d+:\d+:\d+/; // looks for 'dd/dd/dd' date string followed by 'hh:mm:ss'
to

Code: Select all

    var cupattern=/\d+(\/|-|\.)\d+(\/|-|\.)\d+ \d+:\d+:\d+/; // looks for 'dd/dd/dd' date string followed by 'hh:mm:ss'
in ajaxCUwx.js .. try doing that on your copy.. it should work then :)

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 22 Jan 2012 9:31 pm
by Toddi
Hi! Ken
Jippy! Thank You it was good. :D :clap:
Thank you for the great support Ken. You are really good.