Page 24 of 54

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 17 Apr 2011 2:46 am
by MackerelSky
Not sure if this is the correct time for a nube to jump in or not, but I feel I can get you thru this
Another thing, the script that you shared with us kindly, does not make what it does here in the picture (printscreen from the Tzouhalem-Maple Bay website):

Image

When I move the mouse cursor over the picture does not show me the cloud height in overlay, how do this?
In your dashboard script, where you have the

Code: Select all

<img src='cloudbase.php' width='100' height='200' />
try this

Code: Select all

<img src='cloudbase.php' title ='Cloud Base at <?php  echo $WX['cloudbase'] ?>' alt=' Cloud Base at <?php  echo $WX['cloudbase'] ?>' width='100' height='200' />

That's assuming(I know) that you are using CUtags.php for your height of the cloudbase. Anyways, that's how I get the title/alt tags to show on my site...

Brad

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 17 Apr 2011 3:45 pm
by actioman
MackerelSky wrote:Not sure if this is the correct time for a nube to jump in or not, but I feel I can get you thru this

In your dashboard script, where you have the

Code: Select all

<img src='cloudbase.php' width='100' height='200' />
try this

Code: Select all

<img src='cloudbase.php' title ='Cloud Base at <?php  echo $WX['cloudbase'] ?>' alt=' Cloud Base at <?php  echo $WX['cloudbase'] ?>' width='100' height='200' />

That's assuming(I know) that you are using CUtags.php for your height of the cloudbase. Anyways, that's how I get the title/alt tags to show on my site...

Brad
Is a thread open to all, please participate freely. Just got to thank you for your help!

It works :) , but with some difference from what is shown in the picture, as you can see:

Image

can you explain why this happens?

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 17 Apr 2011 5:42 pm
by MackerelSky
Is a thread open to all, please participate freely. Just got to thank you for your help!
Thanks
It works :) , but with some difference from what is shown in the picture, as you can see:
Hmmm, seems to be working fine now....

Re: Now available: AJAX/PHP multilingual website templates

Posted: Sun 17 Apr 2011 6:43 pm
by actioman
MackerelSky wrote:Hmmm, seems to be working fine now....
Yes it works, but as I said with some differences in meters and I do not know why?... Hopefully Ray explain to us why ;)

How can you add pictures to the banner in your signature?
I have this, from Kevin - TNET Services, Inc., but has no image but has no image:

Image

MackerelSky, thanks in advance! :)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 18 Apr 2011 12:50 am
by MackerelSky
Hi Manuel,
actioman wrote: Yes it works, but as I said with some differences in meters and I do not know why?... Hopefully Ray explain to us why ;)
Like i said, you're site is working fine for me...while I was working on some other things this evening, I had you're front page open and refreshed it a half a dozen times over the course of an hour or so...
Each time, the text was printed before the image refreshed, for what ever reason...each time I instantly took my mouse over your image, it was wrong. but then 10 or so seconds later, the image caught up...But each time, your alt text and the number on the image came together...so if you are seeing a different number as soon as the page loads, just watch as the image changes in a few seconds
How can you add pictures to the banner in your signature?
I have this, from Kevin - TNET Services, Inc., but has no image but has no image:
I use the wxgrahics script for my banners and such. Not sure if Kevin's allows an image for a background but it will allow you to use a solid color other than white...

That's actually a picture taken off of my deck in the back yard looking across the back yard.

Brad

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 18 Apr 2011 7:38 am
by steve
There are some instructions here for how to put a background image into one of Kevin's banners.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 18 Apr 2011 11:55 am
by gemini06720
Manuel, Paul and Brad, hello... :)

I am back and I am feeling a bit better ... coughing is gone, sniffing is also gone ... still a bit weak...

But not weak enough to stay away from the computer... :D

Over the last 3-4 days, I have spent many many hours going through the 'cloudbase' script, not a complete rewrite, but many sections of the code has been modified, a few new parameters have been added and the script itself has been tested and tested and tested ... :| ... It is not that I guarantee that it is 100% but it is more functional than previous releases... :oops:

I have also installed a few of the 'cloudbase' scripts on this <link removed> page (the script for the page is included into the ZIP file).

Obviously, over the past days, I have not spent much time on the AJAX/PHP templates ... so I have not found a solution with the date problems.

Manuel, Brad gave you a good solution for producing a message while the mouse cursor hovers the 'cloudbase' image. I cannot add any code to the script (I just do not know what and where) to include the message directly into the image as it is being produced - probably because the image is produced 'on-the-fly' and as such not download (to the user's browser) as an image but as code.

The old script did not use the cloud base value produced by Cumulus (one of the many bugs in the code) - the script used the current temperature and the dew point to calculate its AGL (above ground level) cloud base value - as you have noticed, the calculated value is always slightly different than the one produced by Cumulus (thus the cloud base value displayed on the image has been different from the cloud base value produced by Cumulus). Also, the script was automatically adding to the calculation the weather station elevation (in meters) above sea level to produce an ASL (above sea level) cloud base value - one can now setup the script to use or not use the Cumulus cloud base value, to use or not to use the station elevation (I have tried to add more flexibilities to the script and I probably had added some bugs...). The script can also be setup to use a local METAR data to produce a cloud base at night (or all the time).

Although many parameters can be setup directly into the script, it also reads the 'Settings.php' and the 'Settings-weather.php' files to get much of its settings - I still recommend that the parameters within the script be properly setup.

The script gets most of its 'raw data' information from the 'realtime.txt' file - a few additional values are obtained from the 'CUtags.php' file and from the METAR (if activated). As mentioned above, the script can now get its cloud base information from Cumulus or the script can calculate that value (I feel the calculated value is probably more accurate as the calculation uses eight decimal which are eventually rounded to two.

OK, Manuel, it might be a little while before I include the 'cloudbase' script to the 'ajaxCUwx.js' script - I first want to make sure the script is running without problem... ;) Then I might look at how I added a 'cloudbase' script to my AJAX script... :(

Now, on to other questions... :twisted:

Manuel, the '1 day since last rain' is displayed when more than 24 hours have elapse since the last tip of the rain detector. I have modified my script to not only display the number of days since the last rain (tip) but also display the time and date of that last rain. Unfortunately, Cumulus does not provide a value for the number of consecutive days with no rain nor a value for the number of days with rain for the present month - if these information were available, they could be posted in that same area.

OK, I have to catch up some sleep... Please report any problem you might have with this release of the 'cloudbase' script... :mrgreen:

Re: Now available: AJAX/PHP multilingual website templates

Posted: Mon 18 Apr 2011 11:33 pm
by mike
It is m y feeling that the lack of participation is mostly due to a greatly diminishing lack of interest in the templates... At first, it was a new thing... Now, it is less exciting...
Still working with the scripts. Keep up the good work. This is my site I am working on. Now off to try your new cloud base script :D

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 19 Apr 2011 12:53 am
by MackerelSky
gemini06720 wrote:Manuel, Paul and Brad, hello... :)
OK, I have to catch up some sleep... Please report any problem you might have with this release of the 'cloudbase' script... :mrgreen:
Man, get healthy...

Downloaded the new script and test page, nice addition, makes it easier to test a few things...

Also, nice addition here in the script

Code: Select all

if (isset($_GET['html'])) { // for output testing ( if 0 then only save picture and return img tag )
  $uom4cloud = ($uom == 'M'?'meters':'feet');
  if (function_exists('langtransstr')) {
    $cloudbaseTxt1 = langtransstr('Cloud Base');
    $cloudbaseTxt2 = ':  '.$cldheigt.' '.langtransstr($uom4cloud).' '.langtransstr($AgLAsL);
  }
  else {
    $cloudbaseTxt1 = 'Cloud Base';
    $cloudbaseTxt2 = ':  '.$cldheigt.' '.$uom4cloud.' '.$AgLAsL;
  }
  $imageTXT = $cloudbaseTxt1.$cloudbaseTxt2;
  imagejpeg($slate, 'cb.jpeg', 80);
  echo '<img src="cb.jpeg" width="100" height="200" alt="'.$imageTXT.'" title="'.$imageTXT.'" />';
I had the alt and title tags working for the html test output page, but not as nicely written as yours...I used "Cloud Base at '.$txtC.' "

As far as having the correct cloudbase as alt and/or title, I'm not too concerned with it...I was just anal enough to want 'something' in the alt/title tags moving forward and thought I could come up with something...

Anyways, thanks for the great script and your hard work...

All the Best...

Brad

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 19 Apr 2011 1:10 am
by MackerelSky
mike wrote:
This is my site I am working on. Now off to try your new cloud base script :D
Nice lookin site Mike, eye catching header...Still looking for the right one for mine...

Ray has that script pretty easy to configure and use, you should like it.

Just a little West of ya on Route 6

Brad

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 19 Apr 2011 2:02 am
by actioman
steve wrote:There are some instructions here for how to put a background image into one of Kevin's banners.
Thank you Steve, you are always on top of the event! :D

gemini06720 wrote:Manuel, Paul and Brad, hello... :)

I am back and I am feeling a bit better ... coughing is gone, sniffing is also gone ... still a bit weak...
Ray I hope you're recovering well, the scripts could wait. In first place is our health. ;)

gemini06720 wrote:I have also installed a few of the 'cloudbase' scripts on this CloudBase Script Test page (the script for the page is included into the ZIP file).

Obviously, over the past days, I have not spent much time on the AJAX/PHP templates ... so I have not found a solution with the date problems.

Manuel, Brad gave you a good solution for producing a message while the mouse cursor hovers the 'cloudbase' image. I cannot add any code to the script (I just do not know what and where) to include the message directly into the image as it is being produced - probably because the image is produced 'on-the-fly' and as such not download (to the user's browser) as an image but as code.

The old script did not use the cloud base value produced by Cumulus (one of the many bugs in the code) - the script used the current temperature and the dew point to calculate its AGL (above ground level) cloud base value - as you have noticed, the calculated value is always slightly different than the one produced by Cumulus (thus the cloud base value displayed on the image has been different from the cloud base value produced by Cumulus). Also, the script was automatically adding to the calculation the weather station elevation (in meters) above sea level to produce an ASL (above sea level) cloud base value - one can now setup the script to use or not use the Cumulus cloud base value, to use or not to use the station elevation (I have tried to add more flexibilities to the script and I probably had added some bugs...). The script can also be setup to use a local METAR data to produce a cloud base at night (or all the time).

Although many parameters can be setup directly into the script, it also reads the 'Settings.php' and the 'Settings-weather.php' files to get much of its settings - I still recommend that the parameters within the script be properly setup.

The script gets most of its 'raw data' information from the 'realtime.txt' file - a few additional values are obtained from the 'CUtags.php' file and from the METAR (if activated). As mentioned above, the script can now get its cloud base information from Cumulus or the script can calculate that value (I feel the calculated value is probably more accurate as the calculation uses eight decimal which are eventually rounded to two.
Yes, the Brad solution works well! :)
I do not use the METAR, because the closest to me does not update often.
Regard the program, I have not tested these new versions. Later I say something. ;)

gemini06720 wrote:OK, Manuel, it might be a little while before I include the 'cloudbase' script to the 'ajaxCUwx.js' script - I first want to make sure the script is running without problem... ;) Then I might look at how I added a 'cloudbase' script to my AJAX script... :(
Of course, things are very well made ​​and not in a hurry. And I also know that you will do an excellent work!

gemini06720 wrote:Now, on to other questions... :twisted:

Manuel, the '1 day since last rain' is displayed when more than 24 hours have elapse since the last tip of the rain detector. I have modified my script to not only display the number of days since the last rain (tip) but also display the time and date of that last rain. Unfortunately, Cumulus does not provide a value for the number of consecutive days with no rain nor a value for the number of days with rain for the present month - if these information were available, they could be posted in that same area.
I had a problem with the "last day rain", but ultimately was not of the script. Was generated by a fault that I had on the computer, where I have installed the Cumulus. And with the invaluable help from the Steve (as always ;) ), is already solved. :D
Ray Cumulus generates the following variable: 'LastRainTipISO' = Date / time of last rain gauge tip (eg 09/06/2010 06:09).
I think from this information we can at least be able to show the last day of precipitation?

Well and today I finish by thanking you once again your constant availability and assistance. :clap:

I know that each of us has his life, I again point out the strange absence from Ken ... And It is a pity, because these templates are in large part of him! :(

Re: Now available: AJAX/PHP multilingual website templates

Posted: Tue 19 Apr 2011 9:35 pm
by mike
Ray
I am having a problem with the temperature in cloud base script. Mighty hot :)

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 20 Apr 2011 10:23 am
by gemini06720
Brad, I am getting better ... healthier ... cough, cough ... sneeze, sneeze ... :mrgreen:

I thought that adding a pre-written template might be of help for others ... and myself, as I had to create one to test the script. My latest <link removed> page is displaying nine (yes 9!) 'cloudbase' scripts with different parameters (switches) activated - in two languages - there are even a few new parameters on that page that will only be available in a few days... ;)

Yesterday (Tuesday) I managed to incorporate the Cumulus forecast texts ... Those phrases/texts do not tell me much about the weather ... what the f... does something like this mean: 'Fairly fine, possible showers early' ?? Not overly informative... How much easier it would be to read something like: 'Overcast. Risk of showers later in the day.' in an english everybody understand... :roll:

Anyway, the Cumulus phrases/terms are now being merged with other simple words to finally produce the forecast text that appears on the image. As I wrote above, additional parameters (switches) have been added to force the script to use the cloud height produce by Cumulus (or Weather Display), to add (or not) the station elevation (above sea level) to the cloud height (to produce a cloud height above seal level), to activate (or not) the use of a local METAR at night.

I have not been able to pass on any of the variables used in the 'cloudbase' script back to the page - more likely because the script is producing a dynamic image and nothing else can be written on the screen. The image with the weather information displayed below the image when using the 'html=1' parameter is not produce dynamically, the script first create an image, saves it in the same directory where the script is located and then loads the image back, adding the weather information below the image.

If requested, and to compensate for the missing 'hover the image cloud height information', I could release the lines of PHP code that are used to calculate the cloud height so those lines could be added to the page displaying the 'cloudbase' script... ;)
actioman wrote:Ray Cumulus generates the following variable: 'LastRainTipISO' = Date / time of last rain gauge tip (eg 09/06/2010 06:09). I think from this information we can at least be able to show the last day of precipitation?
Manuel, this is what I have done on my main page... :twisted:

Here are the line of code I am using inside the 'ajax-dashboard.php' script - starting below the line '<?php } // end show-depth-of-snow if needed ?>':

Code: Select all

<?php if ($WXsoftware == 'WD'){ ?>
<?php
if ($dayswithrain <= 0 and strip_units($dayrn) <= 0) {
  $raindays = $dayswithnorain.' '.($dayswithnorain > 1 ? langtransstr('days since last rain'):langtransstr('day since last rain'));
} else {
  $raindays = $dayswithrain.' '.($dayswithrain > 1 ? langtransstr('days of rain in'):langtransstr('day of rain in'));
  $raindays = $raindays . ' '.substr($monthname,0,3);
}
?>
<tr><td colspan="2" class="data2" style="text-align: center; white-space: nowrap;"><?php echo $raindays; ?></td></tr>
<?php }  // end WD dayswithnorain/dayswithrain display ?>
<?php
if ($WXsoftware == 'CU' and isset($dayswithnorain)){
  $LastRainTip = explode(' ',$WX['LastRainTipISO']);
  $LastRainDate = date($ShortdateFormat,strtotime($LastRainTip[0]));
  $LastRainTime = fixup_time($LastRainTip[1]);
  $rainwhen = langtransstr('at').' '.$LastRainTime.' '.langtransstr('on').' '.$LastRainDate;
  if ($dayswithnorain > 0) {
    $raindays = $dayswithnorain.' '.($dayswithnorain > 1 ? langtransstr('days since last rain'):langtransstr('day since last rain'));
  } else {
    $raindays = langtransstr('Last rain').':';
  }
?>
<tr><td colspan="2" class="data2" style="text-align: center;"><?php echo $raindays; ?><br /><?php echo $rainwhen; ?></td></tr>
<?php } // end CU dayswithnorain display ?>
I modified the code this way so the '$dayswithrain' and '$dayswithnorain' (produced by Weather Display) can still be used and the data found into '$WX['LastRainTipISO']' (produced by Cumulus) can be used fully and produce something such as: '1 day since last rain
at 15:46 on 19-Apr'.
mike wrote:I am having a problem with the temperature in cloud base script. Mighty hot :)
Mike, it would have been nice if you had provided a link to your site... :roll: ...how is one suppose to check the information... :shock:

First, which version of the script are you using?

Second, I noticed a few other problems with the image - which problems have been corrected in the soon to be released version ... ;) In that image, not only is the temperature somewhat off (not to write wrong ... or, maybe, just maybe, the 38.3°F temperature might be wrong one and the 214°F one on the 'cloudbase' image might be right ... if you living next to hell... :D ) - the forecast is also missing. Have a look my 'cloudbase' test page (link above).

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 20 Apr 2011 2:42 pm
by steve
gemini06720 wrote:Yesterday (Tuesday) I managed to incorporate the Cumulus forecast texts ... Those phrases/texts do not tell me much about the weather ... what the f... does something like this mean: 'Fairly fine, possible showers early' ?? Not overly informative... How much easier it would be to read something like: 'Overcast. Risk of showers later in the day.' in an english everybody understand... :roll:
Cumulus uses the algorithm from the 'Zambretti Forecaster', and hence those are the descriptions from the Zambretti Forecaster, and are in the form of English prevalent at the time. If you don't like the phrases, you can use whatever you want instead.

Re: Now available: AJAX/PHP multilingual website templates

Posted: Wed 20 Apr 2011 3:08 pm
by actioman
gemini06720 wrote:Manuel, this is what I have done on my main page... :twisted:

Here are the line of code I am using inside the 'ajax-dashboard.php' script - starting below the line '<?php } // end show-depth-of-snow if needed ?>':

Code: Select all

<?php if ($WXsoftware == 'WD'){ ?>
<?php
if ($dayswithrain <= 0 and strip_units($dayrn) <= 0) {
  $raindays = $dayswithnorain.' '.($dayswithnorain > 1 ? langtransstr('days since last rain'):langtransstr('day since last rain'));
} else {
  $raindays = $dayswithrain.' '.($dayswithrain > 1 ? langtransstr('days of rain in'):langtransstr('day of rain in'));
  $raindays = $raindays . ' '.substr($monthname,0,3);
}
?>
<tr><td colspan="2" class="data2" style="text-align: center; white-space: nowrap;"><?php echo $raindays; ?></td></tr>
<?php }  // end WD dayswithnorain/dayswithrain display ?>
<?php
if ($WXsoftware == 'CU' and isset($dayswithnorain)){
  $LastRainTip = explode(' ',$WX['LastRainTipISO']);
  $LastRainDate = date($ShortdateFormat,strtotime($LastRainTip[0]));
  $LastRainTime = fixup_time($LastRainTip[1]);
  $rainwhen = langtransstr('at').' '.$LastRainTime.' '.langtransstr('on').' '.$LastRainDate;
  if ($dayswithnorain > 0) {
    $raindays = $dayswithnorain.' '.($dayswithnorain > 1 ? langtransstr('days since last rain'):langtransstr('day since last rain'));
  } else {
    $raindays = langtransstr('Last rain').':';
  }
?>
<tr><td colspan="2" class="data2" style="text-align: center;"><?php echo $raindays; ?><br /><?php echo $rainwhen; ?></td></tr>
<?php } // end CU dayswithnorain display ?>
I modified the code this way so the '$dayswithrain' and '$dayswithnorain' (produced by Weather Display) can still be used and the data found into '$WX['LastRainTipISO']' (produced by Cumulus) can be used fully and produce something such as: '1 day since last rain
at 15:46 on 19-Apr'.
Hello Ray! :)

First of all thank you for the work and effort you have put into this script! ;)

Now looking at your line of code, and directing attention to the part that refers to CU.

Code: Select all

<?php
if ($WXsoftware == 'CU' and isset($dayswithnorain)){
  $LastRainTip = explode(' ',$WX['LastRainTipISO']);
  $LastRainDate = date($ShortdateFormat,strtotime($LastRainTip[0]));
  $LastRainTime = fixup_time($LastRainTip[1]);
  $rainwhen = langtransstr('at').' '.$LastRainTime.' '.langtransstr('on').' '.$LastRainDate;
  if ($dayswithnorain > 0) {
    $raindays = $dayswithnorain.' '.($dayswithnorain > 1 ? langtransstr('days since last rain'):langtransstr('day since last rain'));
  } else {
    $raindays = langtransstr('Last rain').':';
  }
?>
<tr><td colspan="2" class="data2" style="text-align: center;"><?php echo $raindays; ?><br /><?php echo $rainwhen; ?></td></tr>
<?php } // end CU dayswithnorain display ?>

Do not work for me! This is what shows:

Image


To ensure that everything stays on the same line I took the:

" <tr><td colspan="2" class="data2" style="text-align: left;"><?php echo $raindays; ?><br /><?php echo $rainwhen; ?></td></tr> "

I did not think quite right to information looks like this:

" last rain: at 15:46 on 19-Apr "

So I made the following change:

Previously:

Code: Select all

 $rainwhen = langtransstr('at').' '.$LastRainTime.' '.langtransstr('on').' '.$LastRainDate;
After:

Code: Select all

 $rainwhen = $LastRainTime.' '.langtransstr('on').' '.$LastRainDate;
I removed the 'at' and the information looks like this:

" Last rain: 15:46 on 19-Apr "

well, should stay. But does not stay here. The date does not appear?

Only this: " Last rain: 15:46 on "

Looking at thhis line of code:

" $rainwhen = $LastRainTime.' '.langtransstr('on').' '.$LastRainDate; "

It seems that the script interprets well the '$LastRainTime.', but not recognises '$LastRainDate'?

I do not know anything about php and do not know where to go get these "commands" ('$LastRainTime.', '$LastRainDate', etc). But the only place were I find them is in the 'CU-defs.php' file. And these are not there...

Any help? :?