Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
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
Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024
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
Now available: AJAX/PHP multilingual website templates
Moderator: saratogaWX
- PaulMy
- Posts: 3878
- Joined: Sun 28 Sep 2008 11:54 pm
- Weather Station: Davis VP2 Plus 24-Hour FARS
- Operating System: Windows8 and Windows10
- Location: Komoka, ON Canada
- Contact:
Re: Now available: AJAX/PHP multilingual website templates
Thanks nitrx,
I experimented that way and got text and data but haven't figured out yet how to get the columns to line up, let alone how to put separate text and data on the same line.
Paul
I experimented that way and got text and data but haven't figured out yet how to get the columns to line up, let alone how to put separate text and data on the same line.
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
- 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
Well for your 'record's (recordT.htm data simple cut/pastePaulMy wrote:Thanks nitrx,
I experimented that way and got text and data but haven't figured out yet how to get the columns to line up, let alone how to put separate text and data on the same line.
Paul
Code: Select all
<p>Recorden vanaf <#recordsbegandate>. Hier zijn de extremen vanaf.</p>
<table width="100%" cellpadding="0" cellspacing="0" id="Current_Weather_Records">
<caption>Recorden vanaf <#recordsbegandate></caption>
<tr>
<td colspan="3" class="tableseparator_temp">Temperatuur en Rel. Luchtvochtigheid</td>
</tr>
<tr class="td_temperature_data">
<td class="main_table_text_labels">Hoogste Temperatuur</td>
<td class="right_align_indented"><#tempH> <#tempunit></td>
<td class="right_align_indented"><#TtempH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_temperature_data">
<td class="main_table_text_labels">Laagste Temperatuur</td>
<td class="right_align_indented"><#tempL> <#tempunit></td>
<td class="right_align_indented"><#TtempL format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_temperature_data">
<td class="main_table_text_labels">Laagste Wind chill</td>
<td class="right_align_indented"><#wchillH> <#tempunit></td>
<td class="right_align_indented"><#TwchillH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_temperature_data">
<td class="main_table_text_labels">Hoogste Minimum Temperatuur</td>
<td class="right_align_indented"><#mintempH> <#tempunit></td>
<td class="right_align_indented"><#TmintempH format="'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_temperature_data">
<td class="main_table_text_labels">Laagste Maximum Temperatuur</td>
<td class="right_align_indented"><#maxtempL> <#tempunit></td>
<td class="right_align_indented"><#TmaxtempL format="'op' dd mmmm yyyy"></td>
</tr>
<tr>
<td colspan="3" class="tableseparator_rainfall">Neerslag</td>
</tr>
<tr class="td_rainfall_data">
<td class="main_table_text_labels">Hoogste neerslagintensiteit per uur</td>
<td class="right_align_indented"><#rrateM> <#rainunit>/hr</td>
<td class="right_align_indented"><#TrrateM format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_rainfall_data">
<td class="main_table_text_labels">Hoogste neerslag per uur</td>
<td class="right_align_indented"><#rfallhH> <#rainunit></td>
<td class="right_align_indented"><#TrfallhH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_rainfall_data">
<td class="main_table_text_labels">Hoogste dagelijkse neerslag</td>
<td class="right_align_indented"><#rfallH> <#rainunit></td>
<td class="right_align_indented"><#TrfallH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_rainfall_data">
<td class="main_table_text_labels">Hoogste maandelijkse neerslag</td>
<td class="right_align_indented"><#rfallmH> <#rainunit></td>
<td class="right_align_indented"><#TrfallmH format="'over' mmmm yyyy"></td>
</tr>
<tr>
<td colspan="3" class="tableseparator_wind">Wind</td>
</tr>
<tr class="td_wind_data">
<td class="main_table_text_labels">Hoogste windvlaag</td>
<td class="right_align_indented"><#gustM> <#windunit></td>
<td class="right_align_indented"><#TgustM format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_wind_data">
<td class="main_table_text_labels">Hoogste Windsnelheid</td>
<td class="right_align_indented"><#wspeedH> <#windunit></td>
<td class="right_align_indented"><#TwspeedH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr>
<td colspan="3" class="tableseparator_pressure">Luchtdruk op zee niveau</td>
</tr>
<tr class="td_pressure_data">
<td class="main_table_text_labels">Laagste Luchtdruk</td>
<td class="right_align_indented"><#pressL> <#pressunit></td>
<td class="right_align_indented"><#TpressL format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
<tr class="td_pressure_data">
<td class="main_table_text_labels">Hoogste Luchtdruk</td>
<td class="right_align_indented"><#pressH> <#pressunit></td>
<td class="right_align_indented"><#TpressH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
</tr>
</table>
-
- 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
Ken
line 515 of ajax-dashboard b reads
in all v2 dashboard do not have the
Beau
line 515 of ajax-dashboard b reads
Code: Select all
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?>
Code: Select all
. " $uomWind"
- PaulMy
- Posts: 3878
- Joined: Sun 28 Sep 2008 11:54 pm
- Weather Station: Davis VP2 Plus 24-Hour FARS
- Operating System: Windows8 and Windows10
- Location: Komoka, ON Canada
- Contact:
Re: Now available: AJAX/PHP multilingual website templates
Thanks nitrx,
Paul
I tried that with the Cumulus tags but found I needed to use the php tags provided in Ken's template and that is where I got into deep trouble.Well for your 'record's (recordT.htm data simple cut/paste
Maybe I should leave it your language so I can refresh my Vlaamsand not use my language
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
-
- Posts: 1700
- Joined: Mon 10 Aug 2009 10:16 pm
- Weather Station: No weather station
- Operating System: No operating system
- Location: World...
Re: Now available: AJAX/PHP multilingual website templates
Ron, Paul cannot just cut-and-paste the code as the templates are not processed by Cumulus - meaning the Cumulus tags will not be added.nitrx wrote:Well for your 'record's (recordT.htm data simple cut/paste
Paul must first edit Ken's 'CUtags.txt' (or 'CUtags-comments.txt') to include the tags needed for the record page (using 'recordT.htm" as a guide). Paul then has to use Ken's 'gen-CUtags.php' script to create 'CUtags.php' which should then be renamed 'CUtagsT.htm' and be processed by Cumulus to add the data to the new tags.
Second, Paul must then edit Ken's 'CU-defs.php' to include the new tags. There is a syntax to follow:
- the syntax used in the 'CUtagsT.txt' file was:
Code: Select all
tempH|<#tempH>:|:
Code: Select all
$tempH = $WX['tempH'];
Code: Select all
<td class="right_align_indented"><#tempH> <#tempunit></td>
Code: Select all
<td class="right_align_indented"><?php echo $tempH . ' ' . $uomtemp; ?></td>
- saratogaWX
- Posts: 1211
- 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
I can see there is some confusion on how you can add a page with native Cumulus variables on the page, so I've generated an example (attached) of the port of the recordsT.htm template so you can see how it can be done.
In short:
1) you should never have to upload a PHP page with embedded Cumulus <#variableName> markup .. all the available Cumulus tags are available in PHP through the upload of CUtags.txt->CUtags.php and are useable as.
2) You don't need to mess with the CU-defs.php file at all to add any $variableName equates as Ray suggested .. the CU-defs.php file should remain unmodified as it may be replaced in new distributions as new variables corresponding to tags used in the ajax-dashboard become available.
So.. please, don't modify the CU-defs.php file .. let me do that with new distributions.
3) when making a new page, do copy wxnewpage.php in your site to a new name and modify the copied page. Repeat as needed for each new page.
4) Use the built-in functions to provide multilanguage compatiblity. Instead of using something like use which will return the text for the language selected. All the page markups should be in English and the translation done in a corresponding language-LL.txt file with langlookup|<english>|<language>| entries
For example, the attached page just needs the following items translated Replace the second English phrase in each line with the targeted language's phrase, and you're done
Using your sample above, Ron, I surmise the Dutch translations would be
You can see a sample of the page with the above Dutch translation active at http://saratoga-weather.org/wxtemplates ... hp?lang=nl
I'm not trying to say this is the only way to add new pages with native Cumulus data, and you are free to do as you wish. The suggested method above has several advantages:
1) it is easier on you long-term
2) it keeps your template system maintainable for future updates
3) it lets you easily offer translations
4) it presents the UOM and date/time format as you specified in the Settings.php
5) it avoids unnecessary uploads by leveraging the single CUtags.php for ALL the Cumulus data available
I hope this helps... enjoy the new wxcurecords.php page
Best regards,
Ken
In short:
1) you should never have to upload a PHP page with embedded Cumulus <#variableName> markup .. all the available Cumulus tags are available in PHP through the upload of CUtags.txt->CUtags.php and are useable as
Code: Select all
<?php print $WX['variableName']; ?>
2) You don't need to mess with the CU-defs.php file at all to add any $variableName equates as Ray suggested .. the CU-defs.php file should remain unmodified as it may be replaced in new distributions as new variables corresponding to tags used in the ajax-dashboard become available.
So.. please, don't modify the CU-defs.php file .. let me do that with new distributions.
3) when making a new page, do copy wxnewpage.php in your site to a new name and modify the copied page. Repeat as needed for each new page.
4) Use the built-in functions to provide multilanguage compatiblity. Instead of using something like
Code: Select all
<td>Temperature</td>
Code: Select all
<td><?php langtrans('Temperature'); ?></td>
For example, the attached page just needs the following items translated
Code: Select all
langlookup|Records began on|Records began on|
langlookup|Here are the extremes recorded since then|Here are the extremes recorded since then|
langlookup|Records Since|Records Since|
langlookup|Highest|Highest|
langlookup|Lowest|Lowest|
langlookup|Wind Chill|Wind Chill|
langlookup|Minimum|Minimum|
langlookup|Maximum|Maximum|
langlookup|Rainfall|Rainfall|
langlookup|Hourly Rainfall|Hourly Rainfall|
langlookup|Daily Rainfall|Daily Rainfall|
langlookup|Monthly Rainfall|Monthly Rainfall|
langlookup|Wind Gust|Wind Gust|
langlookup|Wind Speed Average|Wind Speed Average|
Using your sample above, Ron, I surmise the Dutch translations would be
Code: Select all
langlookup|Records began on|Recorden vanaf|
langlookup|Here are the extremes recorded since then|Hier zijn de extremen vanaf|
langlookup|Records Since|Recorden vanaf|
langlookup|Highest|Hoogste|
langlookup|Lowest|Laagste|
langlookup|Wind Chill|Wind Chill|
langlookup|Minimum|Minimum|
langlookup|Maximum|Maximum|
langlookup|Rainfall|Neerslag|
langlookup|Hourly Rainfall|neerslag per uur|
langlookup|Daily Rainfall|dagelijkse neerslag|
langlookup|Monthly Rainfall|maandelijkse neerslag|
langlookup|Wind Gust|windvlaag|
langlookup|Wind Speed Average|Windsnelheid|
I'm not trying to say this is the only way to add new pages with native Cumulus data, and you are free to do as you wish. The suggested method above has several advantages:
1) it is easier on you long-term
2) it keeps your template system maintainable for future updates
3) it lets you easily offer translations
4) it presents the UOM and date/time format as you specified in the Settings.php
5) it avoids unnecessary uploads by leveraging the single CUtags.php for ALL the Cumulus data available
I hope this helps... enjoy the new wxcurecords.php page
Best regards,
Ken
You do not have the required permissions to view the files attached to this post.
Last edited by saratogaWX on Mon 21 Feb 2011 6:32 am, edited 2 times in total.
- saratogaWX
- Posts: 1211
- 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
Ummm.. not quite. The ajax-dashboard hasn9mfk wrote:Ken
line 515 of ajax-dashboard b readsin all v2 dashboard do not have theCode: Select all
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?>
BeauCode: Select all
. " $uomWind"
Code: Select all
$uomWind = ' mph';
...
if (isset($SITE['uomWind'])) {$uomWind = $SITE['uomWind'];}
- 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
Thanks Ken, I understand the advantages (allthough it's all very complicated to me) but it seems the date and time functions will give strange figures I get data in the seventies http://www.apeldoorn.tk/weer/wxcurecords.php compared to my 'real' data http://www.apeldoorn.tk/weer/wxlinks.php , I'll try to do some other pages this week like today and yesterdayT.htmsaratogaWX wrote: I'm not trying to say this is the only way to add new pages with native Cumulus data, and you are free to do as you wish. The suggested method above has several advantages:
1) it is easier on you long-term
2) it keeps your template system maintainable for future updates
3) it lets you easily offer translations
4) it presents the UOM and date/time format as you specified in the Settings.php
5) it avoids unnecessary uploads by leveraging the single CUtags.php for ALL the Cumulus data available
I hope this helps... enjoy the new wxcurecords.php page
Best regards,
Ken
Thanks,
Ron
-
- 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
Hi Ken,
I do not think i was clear in my last post
on line 515 if you look st the image it reads Gust Month: 34.0 mph Feb 01
most v2 ajax-dashboard read Gust Month: 34.0 Feb 01
so i was ask to have the mph removed on that 1 line
Beau
I do not think i was clear in my last post
on line 515 if you look st the image it reads Gust Month: 34.0 mph Feb 01
most v2 ajax-dashboard read Gust Month: 34.0 Feb 01
so i was ask to have the mph removed on that 1 line
Beau
You do not have the required permissions to view the files attached to this post.
- saratogaWX
- Posts: 1211
- 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
Hi Ron,nitrx wrote:Thanks Ken, I understand the advantages (allthough it's all very complicated to me) but it seems the date and time functions will give strange figures I get data in the seventies http://www.apeldoorn.tk/weer/wxcurecords.php compared to my 'real' data http://www.apeldoorn.tk/weer/wxlinks.php , I'll try to do some other pages this week like today and yesterdayT.htmsaratogaWX wrote: I'm not trying to say this is the only way to add new pages with native Cumulus data, and you are free to do as you wish. The suggested method above has several advantages:
1) it is easier on you long-term
2) it keeps your template system maintainable for future updates
3) it lets you easily offer translations
4) it presents the UOM and date/time format as you specified in the Settings.php
5) it avoids unnecessary uploads by leveraging the single CUtags.php for ALL the Cumulus data available
I hope this helps... enjoy the new wxcurecords.php page
Best regards,
Ken
Thanks,
Ron
I've done an update to the wxcurecords.php page to add additional processing in the date areas. I forgot that I needed to convert the <i>dd month yyyy</i> where month was in Dutch to english for processing by strtotime(). I borrowed a bit of that function from the wxastronomy.php page, so now the months display as they should.
Best regards,
Ken
You do not have the required permissions to view the files attached to this post.
Last edited by saratogaWX on Mon 21 Feb 2011 6:10 pm, edited 1 time in total.
- saratogaWX
- Posts: 1211
- 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
Ahh... I didn't really understand your first question correctly.n9mfk wrote:Hi Ken,
I do not think i was clear in my last post
on line 515 if you look st the image it reads Gust Month: 34.0 mph Feb 01
most v2 ajax-dashboard read Gust Month: 34.0 Feb 01
so i was ask to have the mph removed on that 1 line
Beau
You can change
Code: Select all
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?>
Code: Select all
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust; ?>
-
- 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
Thanks Ken,
will you be adding that change to the v3 ajax-dashboard.php
Beau
will you be adding that change to the v3 ajax-dashboard.php
Beau
- 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
Great that does the jobsaratogaWX wrote: I've done an update to the wxcurecords.php page to add additional processing in the date areas. I forgot that I needed to convert the <i>dd month yyyy</i> where month was in Dutch to english for processing by strtotime(). I borrowed a bit of that function from the wxastronomy.php page, so now the months display as they should.
Best regards,
Ken
Thanks,
Ron
- PaulMy
- Posts: 3878
- Joined: Sun 28 Sep 2008 11:54 pm
- Weather Station: Davis VP2 Plus 24-Hour FARS
- Operating System: Windows8 and Windows10
- Location: Komoka, ON Canada
- Contact:
Re: Now available: AJAX/PHP multilingual website templates
Thanks Ken,can see there is some confusion on how you can add a page with native Cumulus variables on the page, so I've generated an example (attached) of the port of the recordsT.htm template so you can see how it can be done.
In short:
1) you should never have to upload a PHP page with embedded Cumulus <#variableName> markup .. all the available Cumulus tags are available in PHP through the upload of CUtags.txt->CUtags.php and are useable as
I had learned what needs to be done just not familiar enough yet with php to get the right results (got the data - high temp, date and time, etc. to show but all on different lines) so took the simple way that I could handle for the time being. I will look at wxcurecords.zip and work on it further so it will continue when the ajax/php templates replaces my existing.
On another matter, I have looked but without success, where would I remove the text "The WXSIM forecast is not currently available." that is displayed on the Home page below the local Radar?
Then on to changing the top header with some images/graphics, text, etc. before the changeover. It has been a great learning experience.
Paul
VP2+
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
C1 www.komokaweather.com/komokaweather-ca
MX https://komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX https://komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX https:// komokaweather.com/cumulusmx4/index.htm
- saratogaWX
- Posts: 1211
- 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
Hi Paul,PaulMy wrote:Thanks Ken,can see there is some confusion on how you can add a page with native Cumulus variables on the page, so I've generated an example (attached) of the port of the recordsT.htm template so you can see how it can be done.
In short:
1) you should never have to upload a PHP page with embedded Cumulus <#variableName> markup .. all the available Cumulus tags are available in PHP through the upload of CUtags.txt->CUtags.php and are useable as
I had learned what needs to be done just not familiar enough yet with php to get the right results (got the data - high temp, date and time, etc. to show but all on different lines) so took the simple way that I could handle for the time being. I will look at wxcurecords.zip and work on it further so it will continue when the ajax/php templates replaces my existing.
On another matter, I have looked but without success, where would I remove the text "The WXSIM forecast is not currently available." that is displayed on the Home page below the local Radar?
Then on to changing the top header with some images/graphics, text, etc. before the changeover. It has been a great learning experience.
Paul
I'm pleased you've found it a great learning experience
For the WXSIM message, you just have to change in Settings.php
Code: Select all
$SITE['WXSIM'] = true; // Set to false if no WXSIM/plaintext-parser.php
Code: Select all
$SITE['WXSIM'] = false; // Set to false if no WXSIM/plaintext-parser.php
Best regards,
Ken