Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

Cumulus PHP-GD Banner

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Cumulus PHP-GD Banner

Post by beteljuice » Sat 27 Apr 2013 10:05 pm

background1.jpg in the /images folder
But where is the php file ?
$baseimg = imagecreatefromjpeg("background1.jpg");
Also to avoid any unexpected colour interactions it would be better to:

Code: Select all

$im = @imagecreatetruecolor($SITE['image_width'], $SITE['image_height'])
or die("Cannot Initialize new GD image stream");
See http://sandaysoft.com/forum/viewtopic.p ... 0&start=15
Image
......................Imagine, what you will KNOW tomorrow !

weatherfrog80
Posts: 70
Joined: Tue 06 Mar 2012 7:50 pm
Weather Station: WH 1080
Operating System: Windows XP SP 3
Location: Bremerhaven, NW Germany
Contact:

Re: Cumulus PHP-GD Banner

Post by weatherfrog80 » Wed 29 May 2013 9:36 am

Hi all,

I wanted to replace the current wind speed with the "10 min average wind speed" in my weather banner.
According to realtime.txt that would be the numbers "46" for "degrees" and "51" which shows the bearing in words. However the positions only go from 0 to 39.
Anyone having an idea, how do this?

Best regards

Georg
Best Regards

Georg

Private weatherstation Bremerhaven-Twischkamp
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus PHP-GD Banner

Post by steve » Wed 29 May 2013 9:56 am

weatherfrog80 wrote:According to realtime.txt that would be the numbers "46" for "degrees" and "51" which shows the bearing in words. However the positions only go from 0 to 39. Anyone having an idea, how do this?
You need to extend the 'cvalues' array near the top of the file so that it goes as far as the entry that you need. It doesn't matter what names you use as long as you use the same name later on when you add the item to the banner.
Steve

weatherfrog80
Posts: 70
Joined: Tue 06 Mar 2012 7:50 pm
Weather Station: WH 1080
Operating System: Windows XP SP 3
Location: Bremerhaven, NW Germany
Contact:

Re: Cumulus PHP-GD Banner

Post by weatherfrog80 » Wed 29 May 2013 11:56 am

Thanks for your help Steve, that works. :)
Best Regards

Georg

Private weatherstation Bremerhaven-Twischkamp
Image

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Wed 05 Jun 2013 4:21 pm

Hi is it possible to add custom tags to display in the banner from another file?. For example the Blake-Larsen Sunrecorder application makes a file to be used by Cumulus (which can easily be uploaded using Cumulus alongside the other webfiles of course also).
I've attached an example file with values explained, i'd like to include sun hours today and maybe sunny or not now also if possible in my banner.

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

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus PHP-GD Banner

Post by steve » Wed 05 Jun 2013 4:44 pm

"Sun hours today" and "is it sunny?" are both in realtime.txt, so by extending the cvalues array as previously mentioned, you can include those in the banner.
Steve

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Wed 05 Jun 2013 5:07 pm

steve wrote:"Sun hours today" and "is it sunny?" are both in realtime.txt, so by extending the cvalues array as previously mentioned, you can include those in the banner.
Great, thanks very much Steve, I must have overlooked that, i'll get reading.
Image

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Wed 05 Jun 2013 8:33 pm

I cant seem to figure out how to tell the cvalues array where to find the value position i want ?

For example I know that I want to add a custom "sunHR" - hours of sun today which is position 56 in the realtime file, but how to tell that position?
I added it to the reference list, but its obviously not reading that. The value in my signature isn't correct below.

feel like a bit of a thicko :(
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Cumulus PHP-GD Banner

Post by steve » Wed 05 Jun 2013 8:42 pm

Supercell wrote:I cant seem to figure out how to tell the cvalues array where to find the value position i want ?
You have to fill in all of entries up to the ones you need; that's how it knows which position in realtime.txt corresponds to each item in cvalues. So you need to extend cvalues, like this:

Code: Select all

$SITE['cvalues'] = array(
    "date","time","temp","hum","dew","wspeed","wgust","avgbearing","rrate",
    "rfall","press","wdir","beaufort","windunit","tempunit","pressunit","rainunit",
    "windrun","presstrend","rmonth","ryear","rfallY","intemp","inhum","wchill",
    "temptrendval","tempTH","TtempTH","tempTL","TtempTL",
    "windTM","TwindTM","wgustTM","TwgustTM",
    "pressTH","TpressTH","pressTL","TpressTL",
    "cversion","cbuild","wgust","heatindex","humidex", ... and so on up to... "sunshinehours","currentsolarmax","issunny");
Then you can get the values using ret_value("sunshinehours") and ret_value("issunny")
Steve

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Wed 05 Jun 2013 10:08 pm

Ahhhhhhhhhhhhhhhhhh! I see, I was wondering why it is currently showing the 10-minute high gust value :)
I'll get right on it Thanks again :clap:
Image

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Wed 05 Jun 2013 10:44 pm

It works!
Now to add cloudy, sunny and night graphics to the banner based on the realtime .txt ..much more reading needed I feel...

Thanks for your patience and help.
Image

User avatar
PaulMy
Posts: 1729
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis Vantage Pro 2+ w/Envoy USB
Operating System: Windows-8
Location: Komoka, ON Canada
Contact:

Re: Cumulus PHP-GD Banner

Post by PaulMy » Thu 06 Jun 2013 1:38 am

Well done Supercell. I need to look and see if I can do something similar,

Paul

Supercell
Posts: 16
Joined: Sat 13 Oct 2012 9:37 pm
Weather Station: Vue + B-L Sunrecorder
Operating System: Win7
Location: Dublin, Ireland

Re: Cumulus PHP-GD Banner

Post by Supercell » Thu 06 Jun 2013 8:41 am

Thanks Paul.

I've added sunny, cloudy and night images using the code from earlier in this thread.

Currently looks like :-

Image

I'd like to put the current conditions picture off the end of the banner without text overlaying so making the banner 60px wider I guess , not sure how to do that.
Alternatively make the images transparent, so there isn't a white background as in the image above - do I need new pictures?
Image

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Cumulus PHP-GD Banner

Post by beteljuice » Thu 06 Jun 2013 11:00 pm

In another post (re. avatar), the beteljuice posted a load of rubbish !

These are the lines you need to modify:

Code: Select all

		imagettftextbox($im, $size, 0, 0, 1, $green, $font3, $text, $SITE['image_width'], "right");
These are the (ttf font) options for right justified text.

$SITE['image_width'] is the furthermost right 'edge' that the text justifies to (less a 5px margin).
So if you replace $SITE['image_width'] with your pretend right-hand (text) extreme, everything should be hunky dory - I think
Image
......................Imagine, what you will KNOW tomorrow !

josecmorales
Posts: 19
Joined: Thu 04 Jul 2013 4:13 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 7
Location: Ciudad Guayana, Venezuela

Re: Cumulus PHP-GD Banner

Post by josecmorales » Fri 05 Jul 2013 1:42 am

I downloaded the files from TNET, i modified teh banners.php, but doesnt shows, only show this
http://climaguayana.comuv.com/banners.php

can someone give a hand with this?

Grettings

Post Reply