Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.0.0 (build 4022) - 11 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
Latest Cumulus MX V4 release 4.0.0 (build 4022) - 11 May 2024
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.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
Moderator: daj
Cumulus PHP-GD Banner
Cumulus data generated Graphic Banner
I played around a bit with some of the existing banner php scripts out there and got them to work, but ended up just writing one from scratch. This is basically because the other scripts have lots of stuff in them that would not be supported and it will be easier to just build from this one.
This is a simple PHP banner script that uses standard GD and the default fonts (5 of them) that come with the package. I tested this on a PHP5 based server, so I'm not sure if it will work with PHP4.
This script generates an image each time it is called by reading the current realtime.txt file that is on the server.
Sample Output:
It was very kind of Mother Nature to drop some rain so that I could for the first time test Cumulus's recording of rain...
The script is a single script, needs no images to work and uses standard GD (no ttf fonts).
If the script is used in the same web directory that your realtime.txt file is located, you won't need to make any changes except if you use different units for temp, rain, wind and of course you will want to change the station name to yours.
The version number which is not send out in the realtime.txt file is also a manual setting in the script.
Source and PDF Instructions
Unfortunately the original Coder of this banner (Kevin Reed) passed away in 2018 and his website was closed so the links below no longer work. I had backup copies of the source an instructions which I have made available in the topic below.
viewtopic.php?p=164850#p164850
Details below are no longer valid but I have left the topic intact in case there are any comments by other Users that help in the implementation.
Project Page and Downloads
http://cumulus.tnetweather.com/projects/phpggbanner
Collection of other banners in use:
http://cumulus.tnetweather.com/projects ... er/gallery
I played around a bit with some of the existing banner php scripts out there and got them to work, but ended up just writing one from scratch. This is basically because the other scripts have lots of stuff in them that would not be supported and it will be easier to just build from this one.
This is a simple PHP banner script that uses standard GD and the default fonts (5 of them) that come with the package. I tested this on a PHP5 based server, so I'm not sure if it will work with PHP4.
This script generates an image each time it is called by reading the current realtime.txt file that is on the server.
Sample Output:
It was very kind of Mother Nature to drop some rain so that I could for the first time test Cumulus's recording of rain...
The script is a single script, needs no images to work and uses standard GD (no ttf fonts).
If the script is used in the same web directory that your realtime.txt file is located, you won't need to make any changes except if you use different units for temp, rain, wind and of course you will want to change the station name to yours.
The version number which is not send out in the realtime.txt file is also a manual setting in the script.
Source and PDF Instructions
Unfortunately the original Coder of this banner (Kevin Reed) passed away in 2018 and his website was closed so the links below no longer work. I had backup copies of the source an instructions which I have made available in the topic below.
viewtopic.php?p=164850#p164850
Details below are no longer valid but I have left the topic intact in case there are any comments by other Users that help in the implementation.
Project Page and Downloads
http://cumulus.tnetweather.com/projects/phpggbanner
Collection of other banners in use:
http://cumulus.tnetweather.com/projects ... er/gallery
Last edited by TNETWeather on Sun 05 Oct 2008 5:47 am, edited 1 time in total.
-
- Posts: 63
- Joined: Thu 18 Sep 2008 8:40 pm
- Weather Station: Davis VP pro 2
- Operating System: Win7
- Location: Tokoroa South Waikato New Zealand
- Contact:
Re: Cumulus PHP-GD Banner
Many thanks, very easy to understand and use/modify
Re: Cumulus PHP-GD Banner
See Version 1.1... this article has been superseded...
The new version allows you to choose this option in the source code.
One big advantage is that you can use more fonts and more importantly, you can change the size of the same font bigger (the temp) and smaller. The TTF fonts are also clearer in output than the default fonts.
The only issues is that you need to have support for TTF (possible show stopper for some) and of course you need some TTF fonts available on the server (not a big deal).
I've seen some code that allows dealing with flush right, left, center etc.. that would make positioning better. Will play with that tomorrow. Need to add some color shifts based on values as well (around here if it is > 100F, the font gets red, below say 32F blue etc...
The new version allows you to choose this option in the source code.
One big advantage is that you can use more fonts and more importantly, you can change the size of the same font bigger (the temp) and smaller. The TTF fonts are also clearer in output than the default fonts.
The only issues is that you need to have support for TTF (possible show stopper for some) and of course you need some TTF fonts available on the server (not a big deal).
I've seen some code that allows dealing with flush right, left, center etc.. that would make positioning better. Will play with that tomorrow. Need to add some color shifts based on values as well (around here if it is > 100F, the font gets red, below say 32F blue etc...
Last edited by TNETWeather on Sun 05 Oct 2008 6:30 pm, edited 1 time in total.
Re: Cumulus PHP-GD Banner
Version: 1.1
Updated version supports both TTF and Default GD fonts.
If you want to use TTF fonts, you need to set the following variables:
The fontdir needs to point to a directory that contains the Truetype fonts you want to use.
I simply copied over a number of fonts I use from time to time with JpGraph:
Further down in the code, you can see where I setup of the use of $font1 $font2 and $font3 like:
Also added logic that if there is no rain, to say No Rain Today instead of Rain 0.00xxx
Updated version supports both TTF and Default GD fonts.
If you want to use TTF fonts, you need to set the following variables:
Code: Select all
$SITE['fontdir'] = "fonts/"; # must contain ttf font files!
$SITE['usettf'] = "yes"; # Set to No to use default fonts
I simply copied over a number of fonts I use from time to time with JpGraph:
Code: Select all
-rw-r--r-- 1 root root 16880 Oct 5 00:11 ARIALALS.TTF
-rw-r--r-- 1 root root 24264 Oct 5 00:11 ARIALALT.TTF
-rw-r--r-- 1 root root 288496 Oct 5 00:11 arialbd.ttf
-rw-r--r-- 1 root root 226748 Oct 5 00:11 arialbi.ttf
-rw-r--r-- 1 root root 207808 Oct 5 00:11 ariali.ttf
-rw-r--r-- 1 root root 138468 Oct 5 00:11 ARIALNBI.TTF
-rw-r--r-- 1 root root 139056 Oct 5 00:11 ARIALNB.TTF
-rw-r--r-- 1 root root 134188 Oct 5 00:11 ARIALN.TTF
-rw-r--r-- 1 root root 311636 Oct 5 00:11 arial.ttf
-rw-r--r-- 1 root root 132832 Oct 5 00:11 comic.ttf
-rw-r--r-- 1 root root 49788 Oct 5 00:11 STENCIL.TTF
-rw-r--r-- 1 root root 137616 Oct 5 00:11 verdanab.ttf
-rw-r--r-- 1 root root 155076 Oct 5 00:11 verdanai.ttf
-rw-r--r-- 1 root root 171792 Oct 5 00:11 verdana.ttf
-rw-r--r-- 1 root root 154800 Oct 5 00:11 verdanaz.ttf
-rw-r--r-- 1 root root 37812 Oct 5 00:11 WEATHER.TTF
Code: Select all
// Path to our font file
$font1 = $SITE['fontdir'] . "arialbd.ttf";
$font2 = $SITE['fontdir'] . "arial.ttf";
$font3 = $SITE['fontdir'] . "verdana.ttf";
-
- Posts: 132
- Joined: Thu 26 Jun 2008 5:51 am
- Weather Station: Davis VP2 + Solar
- Operating System: A20 TV box + CumulusMX
- Location: Slov.Konjice, Slovenia
- Contact:
Re: Cumulus PHP-GD Banner
I guess script works in CLI mode ?
Im going to try it out when I get time, nice work TNETWeather Respect
Im going to try it out when I get time, nice work TNETWeather Respect
Re: Cumulus PHP-GD Banner
You could use it in CLI mode.
One way out of the box would be to call the script like:
If you want to do that though, you should change the output commands and add a filename you want it saved as:
For example:
Then when the script is called, instead of outputting the image data, it would save it to a file instead.
One way out of the box would be to call the script like:
Code: Select all
# path_to_php/php banner.php > banner.png
For example:
Code: Select all
imagegif($im, "banner.gif");
Code: Select all
# path_to_php/php banner.php
-
- Posts: 132
- Joined: Thu 26 Jun 2008 5:51 am
- Weather Station: Davis VP2 + Solar
- Operating System: A20 TV box + CumulusMX
- Location: Slov.Konjice, Slovenia
- Contact:
Re: Cumulus PHP-GD Banner
Great! Got it working
Since im not that much in PHP coding what should i change so date will be shown as 06.10.08 instead of 08-10-06
Thanks in advance!
EDIT: OK nevermind, i fixed it
Since im not that much in PHP coding what should i change so date will be shown as 06.10.08 instead of 08-10-06
Thanks in advance!
EDIT: OK nevermind, i fixed it
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Cumulus PHP-GD Banner
These TTF ones are very smart, I'm going to change mine when I get a minute
Steve
- Paul C
- Posts: 538
- Joined: Thu 19 Jun 2008 7:45 am
- Weather Station: Davis VP2 with solar
- Operating System: Windows 10
- Location: Brampton, Cumbria, UK
- Contact:
Re: Cumulus PHP-GD Banner
Kevin
As you can see I use a similar banner at the moment, but would like to switch to the cumulus version. You will have to bare with me or is it bear never can remember. Are there some simple instructions on how to use it/alter it. I have mine installed but completley forgot how to do it - Are there any of those smaller avatars available aswell and last question can any of these banners/scripts etc be use as a footer or signature on an email using Miscrosoft Outlook.
eg of the avatar - http://www.bramptonweather.co.uk/wd/wxg ... ype=avatar
How about a cumulus rapid fire weather - likes wundergrounds but one created for cumulus users as a stand alone system ?
http://www.wunderground.com/swf/Rapid_F ... =ICUMBRIA1
I always have great ideas, but now a clue how to do carry them out
thanks
As you can see I use a similar banner at the moment, but would like to switch to the cumulus version. You will have to bare with me or is it bear never can remember. Are there some simple instructions on how to use it/alter it. I have mine installed but completley forgot how to do it - Are there any of those smaller avatars available aswell and last question can any of these banners/scripts etc be use as a footer or signature on an email using Miscrosoft Outlook.
eg of the avatar - http://www.bramptonweather.co.uk/wd/wxg ... ype=avatar
How about a cumulus rapid fire weather - likes wundergrounds but one created for cumulus users as a stand alone system ?
http://www.wunderground.com/swf/Rapid_F ... =ICUMBRIA1
I always have great ideas, but now a clue how to do carry them out
thanks
Re: Cumulus PHP-GD Banner
Currently, the banner does just one banner output.
The banner you are currently using does have a lot of flexibility in it and in fact, I first hacked that script to make it work with Cumulus. However, the current realtime.txt is much less than what that script is capable of supporting so it was easier to just start over.
I have planned on either making the current script output multiple sized banners or simply creating a new script called... avatar.php. In fact, I almost started playing with that last night (its 3:19am here now), I am watching a server that paged me to see if it is okay.
As for using it, it is almost ready to work right out of the box er... download. It is assumed that you have PHP5 and have GD support included otherwise it won't work. You would need to adjust the information header information so that I knows about information that is not contained within the realtime.txt data file like station name, what unit values are used etc...
For most, it doesn't appear to have been too hard to setup especially if you place it in the same directory that the realtime.txt file is located.
Changing the colors, sizes and position, does require some tweaking, but that part is not that dissimilar to the script you are already using.
I think that before I start either adding more formats or creating a new script to do that, I want to come up with some basic functions that make formatting a bit easier. Like the ability to specify flush right, left and center so that changing values remain positioned correctly. There are some functions out there that do that now, I just haven't given them a try yet.
As for your last request... I'm not a flash programmer... though I have started to dabble a bit. I would have a better shot at perhaps an AJAX based web page that does the same.
But before I start down that road, I want to finish the XML stuff as that would then provide a lot more data about the station than just what the realtime.txt file provides. And I currently upload the test XML file once a minute now.
Note that I'm not a big fan of rapid data uploads.... which primarily just show wind changes. I personally, don't have too much time to sit and watch my weather output for hours on end.
Having the XML data available to the banner script would greatly increase the data that could be displayed as well, such as current conditions, historical data like monthly, yearly rain, current cumulus version etc... data that is not contained in the realtime.txt file
I only have so much time to play though...
The banner you are currently using does have a lot of flexibility in it and in fact, I first hacked that script to make it work with Cumulus. However, the current realtime.txt is much less than what that script is capable of supporting so it was easier to just start over.
I have planned on either making the current script output multiple sized banners or simply creating a new script called... avatar.php. In fact, I almost started playing with that last night (its 3:19am here now), I am watching a server that paged me to see if it is okay.
As for using it, it is almost ready to work right out of the box er... download. It is assumed that you have PHP5 and have GD support included otherwise it won't work. You would need to adjust the information header information so that I knows about information that is not contained within the realtime.txt data file like station name, what unit values are used etc...
Code: Select all
############################################################################
# CONFIGURATION INFORMATION
############################################################################
$SITE['version'] = "1.4";
$SITE['hloc'] = "./";
$SITE['datafile'] = "realtime.txt";
$SITE['fontdir'] = "fonts/"; # must contain ttf font files!
$SITE['usettf'] = "yes"; # Set to No to use default fonts
$SITE['format'] = "png"; # Options: jpeg gif png
$SITE['dateiso'] = "no";
$SITE['image_width'] = 468;
$SITE['image_height'] = 60;
$SITE['sitename'] = "Mesa AZ USA - TNET Weather";
$SITE['cumulusver'] = "1.8.2";
$SITE['tempunit'] = "°F";
$SITE['rainunit'] = "in";
$SITE['barounit'] = " mb";
$SITE['windunit'] = " mph";
Changing the colors, sizes and position, does require some tweaking, but that part is not that dissimilar to the script you are already using.
I think that before I start either adding more formats or creating a new script to do that, I want to come up with some basic functions that make formatting a bit easier. Like the ability to specify flush right, left and center so that changing values remain positioned correctly. There are some functions out there that do that now, I just haven't given them a try yet.
As for your last request... I'm not a flash programmer... though I have started to dabble a bit. I would have a better shot at perhaps an AJAX based web page that does the same.
But before I start down that road, I want to finish the XML stuff as that would then provide a lot more data about the station than just what the realtime.txt file provides. And I currently upload the test XML file once a minute now.
Note that I'm not a big fan of rapid data uploads.... which primarily just show wind changes. I personally, don't have too much time to sit and watch my weather output for hours on end.
Having the XML data available to the banner script would greatly increase the data that could be displayed as well, such as current conditions, historical data like monthly, yearly rain, current cumulus version etc... data that is not contained in the realtime.txt file
I only have so much time to play though...
- Paul C
- Posts: 538
- Joined: Thu 19 Jun 2008 7:45 am
- Weather Station: Davis VP2 with solar
- Operating System: Windows 10
- Location: Brampton, Cumbria, UK
- Contact:
Re: Cumulus PHP-GD Banner
Thanks for the reply at 0315hrs !! If its any consolation I will be working until 2am tomorrow
I will give it a go over the next few days and let you know if I succeed.
I take it I keep using what I have already alongside the new cumulus one ?
cheers
I will give it a go over the next few days and let you know if I succeed.
I take it I keep using what I have already alongside the new cumulus one ?
cheers
Re: Cumulus PHP-GD Banner
I think you will find it is really easy to use. You should be able to put it on your server and run it without any changes and you will get output. You can then tweak it from there.Paul C wrote:I will give it a go over the next few days and let you know if I succeed.
There should not be any issues as to how many of these types of things you have on your server other than keeping track of which does which.I take it I keep using what I have already alongside the new cumulus one ?
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Cumulus PHP-GD Banner
I've been meaning to ask you - I tried to use my banner on another forum, and it said php wasn't allowed for images. Is there a way around this?
Steve