Sandaysoft

Support forum for Cumulus weather station software
It is currently Wed Jun 19, 2013 11:27 pm
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 796 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 54  Next
Author Message
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 5:03 am 
Offline
User avatar

Joined: Wed May 06, 2009 5:02 am
Posts: 439
Location: Saratoga, CA, USA
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
PaulMy wrote:
How can I add the Cumulus All Time Records into a new page on my test http://www.komokaweather.com/wxindex.php?

Paul


You'll need to add <?php print $WX['nameOfVariable']; ?> to the page where you would like it printed. Repeat using a different nameOfVariable for each one you want printed in the page.

The nameOfVariable is the Cumulus name and can be seen by browsing to your CUtags.php?sce=dump

Best regards,
Ken


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 5:20 am 
Offline
User avatar

Joined: Sun Sep 28, 2008 11:54 pm
Posts: 561
Location: Komoka, ON Canada
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Thanks Ken,
I’ll experiment with it and see what I can create.

Paul

_________________
Davis Vantage Pro 2 - CWOP DW3930 - WU IONTARIO226 - PWS Weather KOMOKA - AWEKAS 6890
Windows-8
Cumulus v1.9.3 b.1059
www.komokaweather.ca
www.komokaweather.com
www.komokaweather.com/weather/sunrecord ... today.html
Image


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 1:45 pm 
Offline

Joined: Sun Dec 13, 2009 1:21 pm
Posts: 882
Location: Apeldoorn The Netherlands
Weather Station: WH1080 / WS 4000
Operating System: Windows 7 / Ubuntu
Ken about the metar conditions ( get-metar-conditions-inc.php ) , I noticed the describings are in English only, I want to translate it to Dutch.

I'm not sure what I've to translate but if there is an option I can do this and send the translated php file , only in Dutch because my Chinese is very poor :lol:

_________________
Ron

Image

Apeldoorn, The Netherlands


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 2:11 pm 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 508
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi Ken,
is there any code that could brake this down $WX['MonthGustHD'] = '01 February';

to
01
February
thanks Beau


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 11:14 pm 
Offline
User avatar

Joined: Wed May 06, 2009 5:02 am
Posts: 439
Location: Saratoga, CA, USA
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
nitrx wrote:
Ken about the metar conditions ( get-metar-conditions-inc.php ) , I noticed the describings are in English only, I want to translate it to Dutch.

I'm not sure what I've to translate but if there is an option I can do this and send the translated php file , only in Dutch because my Chinese is very poor :lol:

Yes, they are all in English, but you can add separate conditions to translate to Dutch by adding langlookup entries into the language-nl.txt file for conditions you find to not be translated. Do a ?show=missing on the page, then view the source .. near the bottom of the page (after the </html>) will be a set of comments with langlookup entries ready for you to place in your language-nl.txt file (replacing the third field with Dutch) and the translation should be done :)
Like:
langlookup|Cloudy|Bewolkt|

Generally, there is no need to modify the PHP source to provide translations.. entering them in the language-nl.txt or language-nl-local.txt will suffice. The language translation files provide the English->language service for you (as long as the exact English words/phrases have language words/phrases counterparts in the langlookup entries).

Best regards,
Ken


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sat Feb 19, 2011 11:25 pm 
Offline
User avatar

Joined: Wed May 06, 2009 5:02 am
Posts: 439
Location: Saratoga, CA, USA
Weather Station: Davis Vantage Pro Plus
Operating System: Windows XP SP3
n9mfk wrote:
Hi Ken,
is there any code that could brake this down $WX['MonthGustHD'] = '01 February';

to
01
February
thanks Beau


Beau,
You've been studying PHP for some time.. haven't you seen something like

Code:
  $t = preg_replace('| |','<br/>',$WX['MonthGustHD']);
  print $t;

which replaces the space with <br/>.

For references about PHP, I suggest the PHP docs which even has downloadable Windows Help files with examples included. Also the Sitepoint and O'Rilley books on PHP are excellent.

Best regards,
Ken


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 1:59 am 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 508
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Hi ken,
I have added the code for gust month using bata tags
Beau


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 2:16 am 
Offline
User avatar

Joined: Sun Sep 28, 2008 11:54 pm
Posts: 561
Location: Komoka, ON Canada
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Quote:
Thanks Ken,
I’ll experiment with it and see what I can create

I tried inserting the tags in a new php page with some results, referring to php online tutorial to help me (went looking for html and php books but wasn't able to find any today), but far from anything that would look neat so made it my way for the time being. :clap:

http://www.komokaweather.com/wxindex.php

Thanks again, and appreciate all the help and suggestions you have provided,
Paul

_________________
Davis Vantage Pro 2 - CWOP DW3930 - WU IONTARIO226 - PWS Weather KOMOKA - AWEKAS 6890
Windows-8
Cumulus v1.9.3 b.1059
www.komokaweather.ca
www.komokaweather.com
www.komokaweather.com/weather/sunrecord ... today.html
Image


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 12:20 pm 
Offline

Joined: Sun Dec 13, 2009 1:21 pm
Posts: 882
Location: Apeldoorn The Netherlands
Weather Station: WH1080 / WS 4000
Operating System: Windows 7 / Ubuntu
saratogaWX wrote:

Generally, there is no need to modify the PHP source to provide translations.. entering them in the language-nl.txt or language-nl-local.txt will suffice. The language translation files provide the English->language service for you (as long as the exact English words/phrases have language words/phrases counterparts in the langlookup entries).


Aha yes clever I will translate it everytime I see an untranslated one :)

_________________
Ron

Image

Apeldoorn, The Netherlands


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 3:13 pm 
Offline

Joined: Sun Dec 13, 2009 1:21 pm
Posts: 882
Location: Apeldoorn The Netherlands
Weather Station: WH1080 / WS 4000
Operating System: Windows 7 / Ubuntu
PaulMy wrote:
Quote:
Thanks Ken,
I’ll experiment with it and see what I can create

I tried inserting the tags in a new php page with some results, referring to php online tutorial to help me (went looking for html and php books but wasn't able to find any today), but far from anything that would look neat so made it my way for the time being. :clap:

http://www.komokaweather.com/wxindex.php

Thanks again, and appreciate all the help and suggestions you have provided,
Paul

Paul you better use a php file and replace the content with the cumulus tags (I saw you have an empty one) , I used the wxlinks.php (for testpurposes) and put the cumulus tags in it and let it process by cumulus an ftp so I get nice values http://www.apeldoorn.tk/weer/wxlinks.php you can do this with most templates from the standard cumulus templates it's some work 8-)

_________________
Ron

Image

Apeldoorn, The Netherlands


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 3:20 pm 
Offline
User avatar

Joined: Sun Sep 28, 2008 11:54 pm
Posts: 561
Location: Komoka, ON Canada
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
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. :bash:

Paul

_________________
Davis Vantage Pro 2 - CWOP DW3930 - WU IONTARIO226 - PWS Weather KOMOKA - AWEKAS 6890
Windows-8
Cumulus v1.9.3 b.1059
www.komokaweather.ca
www.komokaweather.com
www.komokaweather.com/weather/sunrecord ... today.html
Image


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 3:35 pm 
Offline

Joined: Sun Dec 13, 2009 1:21 pm
Posts: 882
Location: Apeldoorn The Netherlands
Weather Station: WH1080 / WS 4000
Operating System: Windows 7 / Ubuntu
PaulMy 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. :bash:

Paul

Well for your 'record's (recordT.htm data simple cut/paste

Code:
<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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#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>&nbsp;<#pressunit></td>
    <td class="right_align_indented"><#TpressH format="'om' hh:nn 'op' dd mmmm yyyy"></td>
  </tr>
  </table>


Notice you have to to change some code like the hours and date parameters and not use my language :) past it in a php file the code above can be marked up with some simple html code's like <b>for bold</b> headers <i>italalics</i> and even some color if you wish

_________________
Ron

Image

Apeldoorn, The Netherlands


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 3:39 pm 
Offline

Joined: Sun May 10, 2009 8:52 pm
Posts: 508
Location: Springfield, IL
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Ken
line 515 of ajax-dashboard b reads
Code:
<?php langtrans('Gust Month'); ?>: <?php echo $mrecordwindgust. " $uomWind"; ?>

in all v2 dashboard do not have the
Code:
. " $uomWind"

Beau


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Sun Feb 20, 2011 4:49 pm 
Offline
User avatar

Joined: Sun Sep 28, 2008 11:54 pm
Posts: 561
Location: Komoka, ON Canada
Weather Station: Davis Vantage Pro 2 w/Envoy USB
Operating System: Windows-8
Thanks nitrx,
Quote:
Well for your 'record's (recordT.htm data simple cut/paste

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.

Quote:
and not use my language

Maybe I should leave it your language so I can refresh my Vlaams :lol:
Paul

_________________
Davis Vantage Pro 2 - CWOP DW3930 - WU IONTARIO226 - PWS Weather KOMOKA - AWEKAS 6890
Windows-8
Cumulus v1.9.3 b.1059
www.komokaweather.ca
www.komokaweather.com
www.komokaweather.com/weather/sunrecord ... today.html
Image


Top
 Profile  
 
 Post subject: Re: Now available: AJAX/PHP multilingual website templates
PostPosted: Mon Feb 21, 2011 4:40 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1698
Location: World...
Weather Station: No weather station
Operating System: No operating system
nitrx wrote:
Well for your 'record's (recordT.htm data simple cut/paste
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.

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:
tempH|<#tempH>:|:

- the syntax to be used in the 'CU-defs.php' file should be:
Code:
$tempH = $WX['tempH'];

Then the tags required for the new page are available... Paul must first make a copy of the template 'wxnewpage.php' to something such as 'wxrecords.php'. Now, Paul can copy-and-paste the code from the 'recordT.htm' into the new 'wxrecords.php' template remembering to replace all the '<#webtag>' - using the above tag, the '<#tempH>' must be replaced with '<?php echo $tempH; ?>', such as:
Code:
<td class="right_align_indented"><#tempH> <#tempunit></td>

Code:
<td class="right_align_indented"><?php echo $tempH . '&nbsp;' . $uomtemp; ?></td>

You see, that was easy... :mrgreen:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 796 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 54  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group