Cloud Base

I have been looking through all the posts regarding the cloud base script and still cannot work out why I cannot get it to work. I get http://www.wanakaweather.co.nz/weather1/cloud-base.php cannot be displayed because it contains errors. When I test it with ?html=1 added I get:

Date/Time: Mon, 05 Oct 2015 18:38:24 -0500 (day)
Conditions: Sunny
METAR:
Cloud Alt: 8130ft (ASL)
Sunrise: Mon, 05 Oct 2015 07:08:00 -0500
Sunset : Mon, 05 Oct 2015 19:55:00 -0500
TZ: America/Chicago (GMT-5 hours)
BG: cb-bg-00sprd.png
Moon age: 22 days, 16 hours, 57 minutes (22.71 days)

with no graphic. The time is wrong as well as the zone. I was hoping to add the graphic as well as a gauge reflecting cloud base if I can. Any ideas? Attached is the script as I have used it.


cloud-base.php.txt (80.8 KB)

Easy one first, you have:

date_default_timezone_set(‘America/Chicago’);

on line 328, I don’t know if NZ has multiple time zones but you probably want to change that to Pacific/Auckland

Where did you upload the images?

Niko,

I had changed the TZ on line 154 even though no Heavy Weather (should know by now that there is always a simple solution when you know where to look). The images were not loaded art all so no wonder no display. I have gone and sorted that and a great result. Now I just have to figure out how to actually use that result. Thanks for reply.

Rod

I think you need to take another look through the settings line by line. On line 196 it’s looking for the images in

   $pathToImages     = './images/cb/';      // path to the background, cloud, windsock and scale images (with trailing slash)

which would be http://www.wanakaweather.co.nz/weather1/images/cb/

Should it be …/images as that folder is in weather1? The graphic loads when I test here http://www.wanakaweather.co.nz/weather1/cloud-base.php?uom=M&html=1&test=1 I am not sure where I put the ajaxcloudheightimg tag in the ajaxdashboard.php script.

OK, now you are confusing me. Didn’t you say the images were in ajax-images?

Niko,

Sorry I removed that bit as I realised that I did not actually have the images required anywhere. I downloaded them and placed them as images in mt weather1. The testing displays a graphic I just do not know how to get it actually on the site.

You’ll need someone familiar with your template to answer that specifically. The html code to embed it is in the script

# USAGE:                                                                       #
#   Metric : <img src="cloudbase.php?uom=M" alt="" width="100" height="200" /> #
#   English: <img src="cloudbase.php?uom=E" alt="" width="100" height="200" /> #

but I don’t know where you would put it in that page.

Thanks for your help. I need to put the code into ajax-dashboard.php but I am unsure exactly where. All my attempts so far result in errors. I am sure it is simple but this whole php thing is difficult to get your head around.

After working my way through 35 pages of posts and trying to get this onto my site I am beaten. http://www.wanakaweather.co.nz/weather1/cloud-base.php shows I have an error but http://www.wanakaweather.co.nz/weather1/cloud-base.php?uom=M&html=1&test=1 provides a result. Can anyone help me place the proper code into ajax-dashboard?


ajax-dashboard.php.txt (56 KB)

cloud-base.php.txt (80.8 KB)