Sandaysoft

Support forum for Cumulus weather station software
It is currently Tue May 21, 2013 1:35 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  [ 40 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Sat Apr 21, 2012 11:00 pm 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi,
I configured and transfer cloudbase.php script on my website root directory. Thing is that I don't know how to place it on my website. I use Saratoga basic world ajax/php web template and I would like put cloud base image on left web template side between Rain and Outlook columns. If someone can help me with that I will be very, very thankful.
my website http://www.nightliferedditch.info and cloudbasephp located http://www.nightliferedditch.info/cloudbase.php
Thanks in advance,
Rim

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 11:52 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Rim, you cannot place the 'cloudbase' image between the rain and outlook columns (both on the right side of the display) as it will distort the display of the data - you will have to replace one of those columns with the 'cloudbase' image.

A long time ago, I installed the 'cloudbase' image on my (highly customized/modified) Tzouhalem-Maple Bay Weather main page (Weather Display produced pages) but all the column widths had to be readjusted to compensate for the with of the 'cloudbase' image (Note: Although the weather data on those pages is up-to-date, the code behind those pages needs to be updated, something I have just started to do).

A few months back, I included the 'cloudbase' image on my Tzouhalem-Maple Bay - Cumulus Weather PHP main page (Cumulus produced pages) - although not continually displayed on the page, the 'cloudbase' image can be displayed by clicking on the icon at the right side of the 'Cloud Base' data line.

The 'cloudbase' image is just that, an image, even if the script to produce the image has the 'php' extension. So, as with any images, the 'cloudbase' image is included in a page with the following:
Code:
<?php
$cloudbase = 'cloudbase.php';
list($stAlt, $uomAlt) = explode ('&nbsp;', trim($WX['altitude']));
list($cldAlt, $uomCld) = explode (' ', trim($WX['cloudbase']));
$cldAlt = $cldAlt + $stAlt;
$uomAlt = strtoupper(trim($uomAlt));
$uomCld = (trim($uomCld)=='m'?'M':'I');
$above = langtransstr(($stAlt >0 ? '(ASL)':'(AGL)'));
$cldTxt = langtransstr('Cloud Base').' @ '.$cldAlt.' '.langtransstr((trim($uomCld=='M')?'meters':'feet')).' '.$above;
###for testing purposes only
//echo '<br />$stAlt == '.$stAlt;
//echo '<br />$uomAlt == '.$uomAlt;
//echo '<br />$cldAlt == '.$cldAlt;
//echo '<br />$uomCld == '.$uomCld;
//echo '<br />$above == '.$above;
//echo '<br />$cldTxt == '.$cldTxt;
?>
This above code gets the station elevation and the cloud height from the tags produced by Cumulus, does a few checks and finally produces the text that will appear when the mouse cursor hovers over the image.

Note: The path to the 'cloudbase.php' script must be modified if the script is located in a different directory.

Code:
<?php echo '<img src="'.$cloudbase.'?uom='.$uomCld.'" alt="'.$cldTxt.'" title="'.$cldTxt.'" style="width: 100px; height: 200px; border: none;" />'; ?>
This is the code that must be used where ever the image is to be displayed.

I have just tested the code and it displayed properly by itself - I did not try including the 'cloudbase' into the 'ajax-dashboard.php' script.

I had a look at the source code of your 'index.php' page... Some errors were highlighted in my browser:
    - there is a stray end tag "a" between the '</head>' and the '<body>' tags;
    - the Google scripts are also poorly formatted;
    - the Dynamic CountUp script has been installed outside, not only of the page content (id="page" wrapper) but also outside of the '</body>' tags!


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 12:12 pm 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi gemini06720 and thanks for information.
I will try to understand how it works :)
Is it all right that my cumulus default website setup cloud base always 17m or 18m? No lower and no higher?

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 1:07 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
ergie wrote:
Is it all right that my cumulus default website setup cloud base always 17m or 18m? No lower and no higher?
Rim, I do not understand your question! I had a look at your cloudbase image and the information it displayed seemed fine.

The 'cloudbase' has been redesigned to either calculate the base of the clouds using the current temperature and dew point or to take the cloud base values produced by either Cumulus or Weather Display.

If the cloud base value comes from Cumulus, that value does not include the station elevation and thus the image shows the base of the clouds as being above ground level. Weather Display produces a cloud base value which includes the station elevation and thus the image shows the base of the clouds as being above sea level.

If the station elevation is available for or provided into the script and if the option to add the station elevation to the calculated or (weather software) provided cloud base value , then the 'cloudbase' script will display the image with the base of the clouds as being above sea level.

I just compared the cloud base value provided by Cumulus (176 m) and the cloud base value calculated by the script (175 m) and they are within acceptable tolerances (I think the script rounds off the number down whereas it appears that Cumulus might round off the number up).


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 5:21 pm 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi,
Your last message explain me very will about cloud base height and why on cumulus original template web there is 17 or 18meters. It is because cumulus adds these 17 or sometime 18meters to my altitude which is set 162 meters in cumulus software.
I am talking about that http://www.nightliferedditch.info/gauges.htm link ab cloud base picture
and my saratoga base php template and cloud.php file measure from sea level. So I now why it in the picture in cloudbase.php altitude is about ~172meters and why original cumulus website shows 17 or 18meter.
Thanks,
Rim

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 8:13 pm 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
gemini06720,
big, big thanks for all information which you gave me. Finally I done separate page for cloud base. http://www.nightliferedditch.info/wxclouds.php
I fix stray end tag "a" between the '</head>' and the '<body>' tags; but still don't know where to fix that one:
the Dynamic CountUp script has been installed outside, not only of the page content (id="page" wrapper) but also outside of the '</body>' tags!

I just note that my website stops frefreshing after 5 or 6 auto refreshs. Before was everything ok but after when I add green flashing button on top it stops. :bash:

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 9:49 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Nothing to do with your gif.

In ajaxCUwx your setting is:

var maxupdates = 12; // Maxium Number of updates allowed (set to zero for unlimited)

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Mon Apr 23, 2012 10:57 pm 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Beteljuice thanks a lot!
Mabe you can help me in other situation?
I done everything what's written here: http://sandaysoft.com/forum/viewtopic.php?f=14&t=7334
Now I am receiving data in to my mysql data base but I don’t know how to show that data in graphs style or archive like NOAA or etc. Basically I would like to do that from mysql data base all data goes in to graphs.
I know that there is such thing like highcharts http://www.highcharts.com but I really, really don’t know from where to start.

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Wed Apr 25, 2012 8:08 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Rim, the 'cloudbase' script can calculate the base of the clouds at both above ground level and above sea level - there is nothing wrong with Cumulus as it only providing the base of the clouds at ground level (by not adding the station elevation).

ergie wrote:
...but still don't know where to fix that one: the Dynamic CountUp script has been installed outside, not only of the page content (id="page" wrapper) but also outside of the '</body>' tags!
Rim, if you look at the source code of your web page (Ctrl+U on Firefox) and go to the end of that source code page you should/will notice that all the code for the 'Dynamic CountUp' script is located outside the closing '</body>' tag - it is fine to put CSS and JavaScript code outside the closing '</body>' tag but not the HTML code required to display the counter - that code should be installed inside the limit of the page wrapper, before the closing '</body>' tag.

Rim, a good starting point for the Highcharts interactive charts would be to download and unzip their zip package and look at the examples - some are easy to follow, others are more complicated - by trying and failing, you will eventually learn and understand the requirements and the operation of the Highcharts... ;)


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Wed Apr 25, 2012 9:50 am 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi Gemini06720,
Thanks for information again. I will try to fix 'Dynamic CountUp' script'. Idea with this script was to put it in the bottom below footer.
Finally little by little I start to pull information from mysql. This is not what I want but I proud myself that I finally start to pull it in any format :)
http://www.nightliferedditch.info/bandyma.php

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Thu Apr 26, 2012 6:00 am 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Rim, I have been 'playing' with the Dynamic Drive Dynamic CountUp Script script and I have come to the following conclusions:

    - the CSS code (located between the '<style style="text/css">...</style>' tags) can (should) be placed at the end of the 'top.php' template:
    Code:
    ?>
      ...place the CSS code here... (and remove this line!)
    <!-- World-ML template from http://saratoga-weather.org/wxtemplates/ -->
    <!-- end of top -->

    - the all the JavaScript code can (should) be placed near the end of the 'footer.php' template, between the closing '</body>' tag and the closing '</html>' tag:
    Code:
      </body>
      ...place the JavaScript code here... (and remove this line!)
    </html>

    - the '<div id="cpcontainer">&nbsp;</div>' code required to display the counter can (should) also be placed near the end of the 'footer.php' template, as shown:
    Code:
          <br/><?php langtrans('Never base important decisions on this or any weather information obtained from the Internet'); ?>.<br class="doNotPrint" />
          </div>
          <div id="cpcontainer" class="doNotPrint" style="text-align: center;">&nbsp;</div>
        </div><!-- end id="footer" -->
      </div><!-- end id="page" wrapper -->
      </body>

I have just tested the code as suggested above and the results are good... ;)


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Thu Apr 26, 2012 10:31 am 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi Gemini06720,
thank you so much for scrip I will try to do everything like you show me.
Thanks again!

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Thu May 03, 2012 9:04 am 
Offline
User avatar

Joined: Thu Apr 19, 2012 9:24 pm
Posts: 32
Location: West Middlands
Weather Station: W-8681
Operating System: Win XP
Hi,
Maybe someone know why cloudbase script show sunny day without wind and rain if today all morning raining? And Saratoga template gif images shows rain. Or sometimes cloudbase scrip shows that snowing when outside is +8 or +10?
http://www.nightliferedditch.info/wxclouds.php
Thanks,
Rim

_________________
http://www.weatherboy.info - in West Middlands
Image


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Thu May 03, 2012 11:55 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
It also says you have a temp of 78C :lol:

You have set up the script to look at YOUR data haven't you ?

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: How to insert cloudbase.php scrip on ajax/php site?
PostPosted: Thu May 03, 2012 12:01 pm 
Offline

Joined: Sun Dec 13, 2009 1:21 pm
Posts: 867
Location: Apeldoorn The Netherlands
Weather Station: WH1080 / WS 4000
Operating System: Windows 7 / Ubuntu
beteljuice wrote:
It also says you have a temp of 78C :lol:

You have set up the script to look at YOUR data haven't you ?

No its 7A the Celsius isn't encoded well I think, I wonder if the tear code is right, currond conditions are the same on the site as in the cloudbasesript.

_________________
Ron

Image

Apeldoorn, The Netherlands


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: gluepack and 1 guest


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