Page 38 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 10:25 am
by Toddi
Hi!
Could this be a dot / comma issue?

Toddi

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 11:01 am
by meteotortosa
Hi folks,

I just do this for show my website

Code: Select all

When you've decided that the new site is to be made 'live', then use these steps to have it become the primary display.

Rename (on your local disk) wxindex.php to index.php
Edit flyout-menu.xml for flyout-menu to replace wxindex.php with index.php in the link.
Upload flyout-menu.xml and index.php to your website.
but now, it don't work properly. Where is the issue?

A lot of thanks

Link to my new website: www.meteotortosa.cat

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 12:16 pm
by meteotortosa
I retorn to old state, and no update data :bash: :bash: :bash:

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 1:50 pm
by beteljuice
That page seems to be working OK - did you fix it ?

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 1:54 pm
by gemini06720
Toddi wrote:Has tried to get the nice templates to work. It is a masterpiece , but may not get ajaxCUwx to work. Has tried in all possible ways. Can anyone please take a look.
Toddi did you make modifications to the files, other than the setting files, particularly to the files 'top.php' and 'include-style-switcher.php' - I am getting some PHP errors when I use the 'debug' command as in:

Code: Select all

http://kystvind.no/wxindex.php?debug
I also noticed, in the 'ajaxCUwx.js' script, that you have not modified the 'decimalComma' variable:

Code: Select all

var decimalComma = false;  // =false for '.' as decimal separator, =true for ',' (comma) as decimal separator
Your main page is already using the ',' (comma) as a decimal separator.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 2:44 pm
by meteotortosa
beteljuice wrote:That page seems to be working OK - did you fix it ?
Yes, i fix it. A little problem with the domain name :D

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 2:44 pm
by meteotortosa
beteljuice wrote:That page seems to be working OK - did you fix it ?
Yes, i fix it. A little problem with the domain name :D

Re: Now available: AJAX/PHP multilingual website templates

Posted: Thu 19 Jan 2012 3:54 pm
by Toddi
gemini06720 wrote:
Toddi wrote:Has tried to get the nice templates to work. It is a masterpiece , but may not get ajaxCUwx to work. Has tried in all possible ways. Can anyone please take a look.
Toddi did you make modifications to the files, other than the setting files, particularly to the files 'top.php' and 'include-style-switcher.php' - I am getting some PHP errors when I use the 'debug' command as in:

Code: Select all

http://kystvind.no/wxindex.php?debug
I also noticed, in the 'ajaxCUwx.js' script, that you have not modified the 'decimalComma' variable:

Code: Select all

var decimalComma = false;  // =false for '.' as decimal separator, =true for ',' (comma) as decimal separator
Your main page is already using the ',' (comma) as a decimal separator.
Thanks for haven a look!
Have set decimalComma = true;
I did not make modifications to the files. Trying to replace these.

Still the same!
At my Weather Station Status it say Cumulus weather data "not current". What is weather data?


Regard Toddi

Re: Now available: AJAX/PHP multilingual website templates

Posted: Fri 20 Jan 2012 12:07 am
by beteljuice
The AJAX JavaScript(s) can't cope with your date delimiter !

Code: Select all

		var tdate = ajaxdateraw.split("/");
		if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
		var ajaxdateformat = tdate[1]+"/"+tdate[0]+"/"+tdate[2];
The script is expecting / or -

Your date format is 20.01.12

Re: Now available: AJAX/PHP multilingual website templates

Posted: Fri 20 Jan 2012 6:51 am
by Toddi
wow! beteljuice, thanks for seeing this.
Is there a way i can fix this.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Fri 20 Jan 2012 12:57 pm
by beteljuice
There is a simple fix, but I would rather wait for any comment by Ken True (the author) as then you would be running a non-standard script and if you attempted any script updates it would fail again.

Please wait another 24hr or so ...

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 21 Jan 2012 9:39 pm
by saratogaWX
Thanks for finding this issue.. seems the internationalization for local date format was incomplete :(

I'll issue an update to the ajaxCUwx.js, but meanwhile, you can change ajaxCUwx.js from

Code: Select all

      var tdate = ajaxdateraw.split("/");
      if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
      var ajaxdateformat = tdate[1]+"/"+tdate[0]+"/"+tdate[2];
to

Code: Select all

      var tdate = ajaxdateraw.split("/");
      if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
      if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
      var ajaxdateformat = tdate[1]+"/"+tdate[0]+"/"+tdate[2];
and that should get around the issue.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 21 Jan 2012 9:51 pm
by meteotortosa
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

Re: Now available: AJAX/PHP multilingual website templates

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

http://kystvind.no/wxindex.php

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sat 21 Jan 2012 10:21 pm
by saratogaWX
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