Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Cumulus PHP-GD Banner

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

Moderator: daj

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 »

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: 26702
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 »

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 »

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 »

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: 26702
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 »

"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 »

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 »

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: 26702
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 »

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 »

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 »

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: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Cumulus PHP-GD Banner

Post by PaulMy »

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

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

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 »

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: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus PHP-GD Banner

Post by beteljuice »

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 »

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
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Cumulus PHP-GD Banner

Post by beteljuice »

What's happened to your realtime.txt ?

This is where banner.php is looking, but it's empty :shock: http://climaguayana.comuv.com/realtime.txt
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply