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

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 »

The script doesn't use web tags, it uses realtime.txt. It has no idea what 'wlatest' is unless you tell it. The labels you've changed are just identifiers for the fields in realtime.txt. In fact, what the script calls 'wgust' is actually the 'latest' wind speed.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Cumulus PHP-GD Banner

Post by William Grimsley »

Oh, right! Thanks, changing both tags from "wlatest" to "wgust", worked! :D
User avatar
avoorpool
Posts: 168
Joined: Tue 08 May 2012 4:24 pm
Weather Station: WMR200A
Operating System: Windows 10 64-bit
Location: Pickering, Ontario Canada
Contact:

Re: Cumulus PHP-GD Banner

Post by avoorpool »

HI,

I'd like to add a setting to the banner (change Windchill to Apparent Temp).
The code shows realtime.txt fields & pos 0 to 39 however apptemp is not shown in the 'banner.php' script.

How and where do I add the apptemp (realtime.txt pos # 55) to the code so it will be displayed on the banner??

Thanks,

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

You need to extend the 'cvalues' array so that it goes as far as the field you want. Then use whatever identifier you give to the field you want later on in the lines of code which write the data to the image.
Steve
User avatar
avoorpool
Posts: 168
Joined: Tue 08 May 2012 4:24 pm
Weather Station: WMR200A
Operating System: Windows 10 64-bit
Location: Pickering, Ontario Canada
Contact:

Re: Cumulus PHP-GD Banner

Post by avoorpool »

Hi Steve,

Thanks for the reply.

This means I have to add the 'cvalues' positions 40 - 55 (as the realtime.txt currently shows)..??
According realtime.txt it's: '10 minute high gust' (#40) to 'Apparent Temp' (#55)

Thanks,

Arthur
User avatar
avoorpool
Posts: 168
Joined: Tue 08 May 2012 4:24 pm
Weather Station: WMR200A
Operating System: Windows 10 64-bit
Location: Pickering, Ontario Canada
Contact:

Re: Cumulus PHP-GD Banner

Post by avoorpool »

Hi Steve,

Figured it out. Correct display now!! Thanks!!!

BTW: Thanks for the final version 1.9.3 as well. :clap:
Great!!

Cheers,

Arthur
User avatar
kingqueen
Posts: 60
Joined: Tue 26 Feb 2013 6:52 pm
Weather Station: Maplin N96GY / Fine Offset 1081
Operating System: Windows 7 HP 64 bit
Location: Wetherby, UK
Contact:

Re: Cumulus PHP-GD Banner

Post by kingqueen »

I have been attempting to add a background image to my banner but have been struggling. I think it might be an issue with the palette used.

If I use this:
Image
Then, using these instructions I get this:
Image

But if I fade it and use this:
Image
I get a mess like this:
Image

The same if I use .png or .jpg - I still get a mess.

Any suggestions as to how to make this better would be very gratefully received! Thank you!
Image
User avatar
Werk_AG
Posts: 198
Joined: Sun 13 Jan 2013 8:04 pm
Weather Station: WeatherDuino 4Pro
Operating System: Windows 7
Location: Cercal CDV - Portugal
Contact:

Re: Cumulus PHP-GD Banner

Post by Werk_AG »

Hi

Try to change this line of code in your banner.php:

Code: Select all

$im = @imagecreate($SITE['image_width'], $SITE['image_height'])
with this one:

Code: Select all

$im = @imagecreatetruecolor($SITE['image_width'], $SITE['image_height'])
Hope it helps
Image
The freedom to choose the weather instruments you want
User avatar
kingqueen
Posts: 60
Joined: Tue 26 Feb 2013 6:52 pm
Weather Station: Maplin N96GY / Fine Offset 1081
Operating System: Windows 7 HP 64 bit
Location: Wetherby, UK
Contact:

Re: Cumulus PHP-GD Banner

Post by kingqueen »

That's got it. Thank you very much indeed, Werk_AG.
Image
nicp01
Posts: 26
Joined: Fri 25 Jan 2013 10:38 am
Weather Station: vantage pro 2
Operating System: windows 7
Location: United Kingdom

hloc where's the data

Post by nicp01 »

Hi, hope someone can help ....get banner but no data which suggests path not right to realtime.txt
checkserver all ok

/home/linweb17/s/stpetersstonyhurst.org.uk-1063720548/user/htdocs/hgweather

what should the path for hloc be "./"; not working..

Thks Peter
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: hloc where's the data

Post by steve »

Rats. I merged the topic and ended up with the title of the new one instead of the original. I should just leave things alone.

I'll see if I can fix.

Edit: sorted, I think.
Steve
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: hloc where's the data

Post by steve »

nicp01 wrote:what should the path for hloc be "./"; not working..
The path is correct; the problem is that you have no realtime.txt file on your web site. The most likely cause is either that you haven't selected the realtime settings on the internet settings screen, or you haven't supplied the correct directory in the web site setup.
Steve
nicp01
Posts: 26
Joined: Fri 25 Jan 2013 10:38 am
Weather Station: vantage pro 2
Operating System: windows 7
Location: United Kingdom

Re: hloc where's the data

Post by nicp01 »

steve wrote:
nicp01 wrote:what should the path for hloc be "./"; not working..
The path is correct; the problem is that you have no realtime.txt file on your web site. The most likely cause is either that you haven't selected the realtime settings on the internet settings screen, or you haven't supplied the correct directory in the web site setup.
I presumed because the site updates realtime.txt was there...

yes youre right I havent any of the realtime boxes checked, which ones do I need? Ive ticked all 3! ok realtime.txt is there but it still isnt working!! now it is!! thkyou

How do I attach my banner to say a yahoo email??

I can now get to work on the background img.

(1840 .. have copied/edited beteljuice code and put new bground img file into 3 different folders and still I get very small icon!)
(http://stpetersstonyhurst.org.uk/hgweather/banner.php)

Do you know if anybody's done a graphic of the weather station circle I used to plot many years ago?

thks
peter
1984
Posts: 1
Joined: Sat 27 Apr 2013 4:08 pm
Weather Station: wh1080
Operating System: server 2008 r2
Location: norfolk, uk

Cumulus PHP-GD Banner - What am I doing wrong...

Post by 1984 »

Hello,

I am new to posting on this forum, been reading stuff for around a year.

I am stumped, i am trying to get the background image on my php banner, I currently have this in the code:


// Output the header to let the browser know we are
// sending a graphic file format
header("Content-type: image/" . $SITE['format'] );
$im = @imagecreate($SITE['image_width'], $SITE['image_height'])
or die("Cannot Initialize new GD image stream");

// Set colors we want to use...
// first background is a white background
$background_color = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
$black = imagecolorallocate($im, 0x00, 0x00, 0x00);
$green = imagecolorallocate($im, 0x00, 0x80, 0x00);
$blue = imagecolorallocate($im, 0x00, 0x00, 0xff);
$red = imagecolorallocate($im, 0xff, 0x00, 0x00);

$baseimg = imagecreatefromjpeg("background1.jpg");

imagecopy($im,$baseimg,0,0,0,0,$SITE['image_width'], $SITE['image_height']);
imagedestroy($baseimg);

// Make a Border Around the box


I have a 17KB file called background1.jpg in the /images folder, but all I get is the default white background, what daft thing am I missing?

Thanks in advance :)
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 »

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 https://cumulus.hosiene.co.uk/viewtopic.p ... 0&start=15
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply