Page 20 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 28 Mar 2011 1:28 pm
by actioman
saratogaWX wrote:Manuel,

As far as I know, nobody has adapted the Cloud-height graphic script to use Cumulus realtime.txt instead of clientraw.txt. It should be possible to do, however.
Then becomes the challenge for programmers who are interested in applying this feature to our cumulus.
These templates are in some way a visual improvement over the default web cumulus. As such we would expect not to loose functionality and data, like the cloud-height...

saratogaWX wrote:The Cumulus forecast is in $WX['forecast'] in the CUtags.php.
In your index.php page, change

Code: Select all

	<?php if(isset($SITE['ajaxDashboard']) and file_exists($SITE['ajaxDashboard']))
	 { include_once("ajax-dashboard.php");
	   } else {
to

Code: Select all

	<?php if(isset($SITE['ajaxDashboard']) and file_exists($SITE['ajaxDashboard']))
	 { $vpforecasttext = $WX['forecast'];
      include_once("ajax-dashboard.php");
	   } else {
and that will display the Cumulus forecast as the VP Forecast in the dashboard.

Best regards,
Ken
Hummm I have tried, but I did not like the end result:

Image

First because it refers to Davis and my station is a PCE and there is also confused in the middle of the forecast wu.

Anyway thanks for your explanation Ken! ;)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 28 Mar 2011 2:29 pm
by gemini06720
saratogaWX wrote:...As far as I know, nobody has adapted the Cloud-height graphic script to use Cumulus realtime.txt instead of clientraw.txt. It should be possible to do, however.
I have adapted Rainer Finkeldeh's 'cloudbase' script to the Cumulus 'realtime' file format almost a year ago... I am just putting a finishing hand into the code (cleaning it - making it more 'portable') and will be able to release it later on today (Monday, late afternoon, PDT)... :)

If you have some time available, once the script has been released, you could check the code and suggest modification or improvments... ;)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 28 Mar 2011 2:34 pm
by gemini06720
actioman wrote:...Hummm I have tried, but did not I liked the end result...
... First because it refers to Davis and my station is a PCE and there is also confused in the middle of the forecast wu...
Well, Manuel, I guess some modification to the 'ajax-dashboard.php' script are required... :mrgreen:

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 28 Mar 2011 10:28 pm
by actioman
gemini06720 wrote: I have adapted Rainer Finkeldeh's 'cloudbase' script to the Cumulus 'realtime' file format almost a year ago... I am just putting a finishing hand into the code (cleaning it - making it more 'portable') and will be able to release it later on today (Monday, late afternoon, PDT)... :)

If you have some time available, once the script has been released, you could check the code and suggest modification or improvments... ;)
Big Ray! :clap:

Tomorrow morning when I can, I come lurking here. :D

gemini06720 wrote:Well, Manuel, I guess some modification to the 'ajax-dashboard.php' script are required... :mrgreen:
Indeed, you need to know is do it! :mrgreen:

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 2:03 am
by saratogaWX
gemini06720 wrote:
actioman wrote:...Hummm I have tried, but did not I liked the end result...
... First because it refers to Davis and my station is a PCE and there is also confused in the middle of the forecast wu...
Well, Manuel, I guess some modification to the 'ajax-dashboard.php' script are required... :mrgreen:
Easy change. Replace in ajax-dashboard.php

Code: Select all

		      print '		   	   <b>Davis VP+ ' . langtransstr('forecast') . ':</b> <span style="color: green; font-size:9pt">' . ucfirst($vpforecasttext) . "</span>"; 
with

Code: Select all

		      print '		   	   <b>Cumulus ' . langtransstr('forecast') . ':</b> <span style="font-size:9pt">' . ucfirst($vpforecasttext) . "</span>"; 
and it should work for you.

Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 12:32 pm
by gemini06720
OK, here is what I hope a fully multilingual cloud base script - I have tried the script with the three template sets and the results appeared correct (well, at least for english and french languages) - I tried with other languages but they only displayed in english as the proper translations had not been entered into the 'language-LL.txt' language templates. I have not yet translated the Cumulus forecasts - would any of you have the 27 Cumulus forecast strings translated to french?

The multilingual cloud base script should produce an image with, not only Cumulus, but also Weather Display, VWS (Virtual Weather Station) and WUHU (Heavy Weather) - I have tested the code only with the Cumulus and the Weather Display data files - I have not tried the script with the other software.

This is the image the cloud base script should produce - not all options have been activated:
Image

Ensure that you keep the proper directory path for the graphic files.

If you encounter any problems, I would like to hear about them. If you have suggestions, I would like to hear about them (but, please, do not ask me to completely rewrite the script for you personal needs :roll: ). If you produce a translation to another languages, I would really appreciate if you send me a copy - eventually, I would like to include translations.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 2:31 pm
by kinder
Ken sorry about that request but is this possible to give me a summary of what u have changed to ajax-dashboard and ajax-gizmo.php to fix the trend issue?I have done some changes to those scripts and i dont want to loose everything:P

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 3:13 pm
by n9mfk
HI ken i have a question about ajaxcu.js
i have been look at the pressure code i fond the math to convert mb to hpa but no inhg to hpa
thanks for any info Beau

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 8:14 pm
by JESUS HEREDERO
Hi Ray

The format cloudbase.php test works well in all 1 .. 5
But two questions, if you do not need to use realtime.txt METAR conditions, Cumulus falsifies or not used.
Since I am not good at PHP script is required for introduction in the ajax-dashboard.php.

Thanks for your time to me

Jesus

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 9:53 pm
by PaulMy
Ray wrote:
Ensure that you keep the proper directory path for the graphic files.
If you encounter any problems, I would like to hear about them.
I probably had the file structure wrong as I got "Path to realtime.txt file not found! and can't see any settings in cloudbase.php to change.

The realtime.txt is in root/weather/ folder and I have put cloudbase in
root/cloudbase/cloudbase.php and the others in
root/cloudbase/cloudbase/cb/ and
root/cloudbase/cloudbase/cb/moon/

Ray can you help me on this?

Paul

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 29 Mar 2011 10:44 pm
by saratogaWX
kinder wrote:Ken sorry about that request but is this possible to give me a summary of what u have changed to ajax-dashboard and ajax-gizmo.php to fix the trend issue?I have done some changes to those scripts and i dont want to loose everything:P
I generally don't keep around prior versions of the scripts (unless there's a really major change), but I downloaded your ajax-dashboard and compared it to the current version and used Ultra Compare to highlight the differences (attached below). This was ajax-dashboard, a similar correction was done to the ajax-gizmo.

I noticed a couple of things that may simplify your maintenance in the future:
1) you don't have to change the settings area inside ajax-dashboard.php if you run it in the template set .. all the settings are replaced by corresponding settings in Settings.php and Settings-weather.php.
2) your use of a different domain for the thermometer.php image may not allow the ajaxCUwx.js to 'refresh' the image as it makes it be a cross-site-scripting issue.

So the basic changes involve automatically changing to two decimal points of precision for the barometer trend arrow when the pressure is measured using inHg units. Otherwise the precision is 1 decimal point for this and all other values.

Hope this helps...
Best regards,
Ken

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 30 Mar 2011 10:09 am
by gemini06720
saratogaWX wrote:I generally don't keep around prior versions of the scripts (unless there's a really major change)...
Ken, should you need an older version of the scripts (the new 'AJAX-PHP Saratoga templates for VWS, Cumulus, WeatherLink, WD' template sets or even the older 'Weather Display (PHP-AJAX) Website' template set) they are all archived on one of my drives going back to February 2009... ;)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 30 Mar 2011 11:18 am
by gemini06720
JESUS HEREDERO wrote:The format cloudbase.php test works well in all 1 .. 5
Jesus, I presume you are writing about the command line 'test=' with values from 1 to 5, such as:

Code: Select all

http//www.mysite.com/cloud-base.php?test=1&html=1
It uses different fixed weather data to produce different images for testing purposes... :)
JESUS HEREDERO wrote:But two questions, if you do not need to use realtime.txt METAR conditions, Cumulus falsifies or not used.
Jesus, the 'cloudbase' script is designed to use the Cumulus 'realtime.txt' data file (or the Weather Display 'clientraw.txt' data file) which is updated often (about every 5 seconds). The 'cloudbase' script also uses the 'CUtags.php' (webtag file) if it is available to get additional variables.

I have tried to make 'cloudbase.php' a 'self-standing' script, meaning that once you have made basic setting modifications to the script (such as weather software to use, the latitude/longitude/timezone, the station elevation, and the correct paths to the required files) the script only needs the data file (such as 'realtime.txt' for Cumulus) to produce the image.

If the 'Settings.php' and 'Settings-weather.php' templates are in the same directory as the script (by default), then, some of the basic setting will be read/taken from those files and replace the default setting of the 'cloudbase.php' script.

If the webtag template 'CUtags.php' (for Cumulus) is in the same directory as the script (by default), then, some additional variables will be read/taken from that file and can/could/will replace the value of some of the variables being processed by the 'cloudbase.php' script.

But, as I indicated above, neither the 'Settings.php/Settings-weather.php' templates nor the 'CUtags.php' template is needed for the operation of the 'cloudbase.php' script - it only needs the 'realtime.txt' data file.

As a test example, I have temporarily installed another copy of the 'cloudbase.php' script, in a directory by itself, with no other file - the only modification I made to the script was to add the complete (relative) path to the 'realtime.txt' data file - and I get <link removed> this cloudbase image (test mode).
JESUS HEREDERO wrote:Since I am not good at PHP script is required for introduction in the ajax-dashboard.php.
Jesus, some 'major' modification must first be made to the 'ajax-dashboard.php' script to position the '100*200' image produced by the 'cloudbase.php' script. Once things have been moved around, adding the image produced by the script is as simple as adding an image on a page - the code to add the image produced by 'cloudbase' is:
<link removed>

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 30 Mar 2011 11:56 am
by kinder
i tried to modify this cloudbase script so it can work on another webserver than the one i have template and realtime.txt.I have done this because on my server there is no support for gd and no way to enable it.
The first attempt doesnt work,so i wonder if anyone else have done it and possible instruct me how to do this.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 30 Mar 2011 11:58 am
by gemini06720
PaulMy wrote:I probably had the file structure wrong as I got "Path to realtime.txt file not found! and can't see any settings in cloudbase.php to change.
Paul, I will add some extra code in order to try simplifying the entry of paths such as those you are using...

Whereas some programmers like to work with fixed path from the root directory down, I prefer to work with relative paths, meaning you indicate the paths as being relative to the script being used.

But as I can see from your setup, it is going to be fun... :mrgreen:
PaulMy wrote: The realtime.txt is in root/weather/ folder and I have put cloudbase in
root/cloudbase/cloudbase.php and the others in
root/cloudbase/cloudbase/cb/ and
root/cloudbase/cloudbase/cb/moon/
OK, I am not that great with graphics, but, please bear with me... :oops:

Code: Select all

     +- weather == realtime.txt
     |
root +
     |
     +- cloudbase + == cloudbase.php
                  |
                  +- cloudbase +
                               |
                               +- cb + == cb-bg-XX.png
                                     |
                                     +- moon == NH-moon##.gif/SH-moon##.giv
Using the above graphic, to find the 'realtime.txt' data file, the 'cloudbase.php' script will first have to look up one directory (to the root directory) and then down one directory (to the weather directory) - thus the path needed will be:

Code: Select all

$realtimefile = '../weather/realtime.txt';
Paul, by the time you read this message, I would have released an update to the 'cloudbase.php' script (without the graphic files) with modifications to include paths to the needed files.
PaulMy wrote:Ray can you help me on this?
I really do not know ... how much money do you have at your disposal... :mrgreen: Or better yet, which political party will you be supporting... :twisted: