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 4018) - 28 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

kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

Is this enough? Or do You need something more? I`ll give links to anywhere, if it helps to get answer to this dilemma.... My little brains are smoking, cause I dont have my banner work... :o :arrow: :geek:
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 »

Looks OK to me: http://www.kapo511.net/banner.php
2013-01-18 19_54_57-banner.php (468×60).png
You do not have the required permissions to view the files attached to this post.
Steve
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

I can`t say anything but: "How is this possible?" I have :bash: :bash: :bash: several days.. and now everything is working!! After one question! This is unbelievebaly service from You. Thank You more than enough!!! I`m ashamed about my unknowing these probs... :oops: :oops: :oops: Tomorrow I`ll donate You, if my wife promises to me... ;) :P This is GREAT forum. Thanks for it.
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 »

kapo wrote:Tomorrow I`ll donate You, if my wife promises to me... ;)
I don't know if that means the same thing in Finland as it does here, but good luck anyway ;)
Steve
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Cumulus PHP-GD Banner

Post by water01 »

^^^^^^^

:lol: :lol: :lol: :lol: :lol:
David
Image
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

steve wrote:
kapo wrote:Tomorrow I`ll donate You, if my wife promises to me... ;)
I don't know if that means the same thing in Finland as it does here, but good luck anyway ;)
Yes it does!!! And I got two times yesterday evening: To ask (read =to pray) and to be without... :mrgreen: :clap: :clap:
So Your donation will be really hard to be earned.... :?
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

And next noobie question: How can I get bagground image to work in my banner? I have red this topic thrue, and tried to make background with those advice, but it made only a link of that banner (shown in my signature) and the links name is "image"... so... help needed here in finland again...This question went first in wrong topic, but I deleted it from there and moved it here.
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 »

The answer is in here - honest !
You need to go back a few pages and read this: https://cumulus.hosiene.co.uk/viewtopic.p ... 0&start=15
Image
......................Imagine, what you will KNOW tomorrow !
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

O.k. now background is black... and some text seems to gone... What next? :lol: :o :lol: :lol: :clap: :clap: :clap:
This is the situation now:

header("Content-type: image/" . $SITE['format'] );


$im = @imagecreatetruecolor($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, 0xC1, 0xFF, 0xC1);
$black = imagecolorallocate($im, 0x00, 0x00, 0x00);
$green = imagecolorallocate($im, 0x00, 0x80, 0x00);
$blue = imagecolorallocate($im, 0x00, 0x00, 0x99);
$red = imagecolorallocate($im, 0xff, 0x00, 0x00);
$indianred = imagecolorallocate($im, 0x8b, 0x3a, 0x3a);

$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);

imagecopy($im,$baseimg,0,0,0,0,$SITE['image_width'], $SITE['image_height']);
imagedestroy($baseimg);
Last edited by kapo on Thu 24 Jan 2013 6:41 pm, edited 1 time in total.
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 »

kapo wrote:$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);
My guess is that the above needs to be

$baseimg = imagecreatefromjpeg('style/panner.jpg');
Steve
mikkimii
Posts: 42
Joined: Fri 23 Mar 2012 3:17 pm
Weather Station: Davis VP2
Operating System: Windows 7 x64 Pro
Location: Vilppula, Finland

Re: Cumulus PHP-GD Banner

Post by mikkimii »

kapo wrote:
$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);
Change
$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);
to
$baseimg = imagecreatefromjpeg("style/panner.jpg");
Br,
Mika
Image
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

mikkimii wrote:
kapo wrote:
$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);
Change
$baseimg = imagecreatefromjpeg(public_html/style/panner.jpg);
to
$baseimg = imagecreatefromjpeg("style/panner.jpg");
Katohan onhan täällä joku paikallisväestöönkin kuuluva... Tervehdys vaan.... vielä lähes naapurikunnastakin.
Kiitos neuvosta... Nyt täytyy sitten alkaa hakkaamaan päätä seinään, miten saan fonttien värit muutettua, ja sitten kun saan ne muutettua, niin väri pitää vielä saada luettavaksi. (olis varmaan pitäny kirjottaa lontooksi, mutta kokeillaan näin välillä)
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

Thanks
Now the image suddenly came out from nowhere!!! :o . And next problem is: how to change banners font colours... and after that have the font colours so that they are visible and readable with my brand new banner background image... :roll: :!: A little bit help might be welcome.. again :lol: :lol: :lol:
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Cumulus PHP-GD Banner

Post by water01 »

You can use the standard colours in the banner.php file here

Code: Select all

$background_color   = imagecolorallocate($im, 0xC1, 0xFF, 0xC1);
$black              = imagecolorallocate($im, 0x00, 0x00, 0x00);
$green              = imagecolorallocate($im, 0x00, 0x80, 0x00);
$blue               = imagecolorallocate($im, 0x00, 0x00, 0x99);
$red                = imagecolorallocate($im, 0xff, 0x00, 0x00);
$indianred          = imagecolorallocate($im, 0x8b, 0x3a, 0x3a);
$white              = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
The white line is one I added and you can add others using the same format and working out the hex RGB definition of the colour which is what the 3 items are after $im i.e. 0xFF, 0xFF, 0xFF.

To use the colour say in Temperature

Code: Select all

// Print Temp
$text = ret_value("temp") . '°' . ret_value("tempunit");
if ($SITE['usettf'] == "yes" ) {
    $size = 18;
    imagettftextbox($im, $size, 0, 0, 20, $red, $font1, $text, $SITE['image_width'], "center");
} else {
    $size = 5;
    imageWriteString($im, $size, $text, $red, "center", 23);
If you are using TTF fonts and want white change

Code: Select all

    imagettftextbox($im, $size, 0, 0, 20, $red, $font1, $text, $SITE['image_width'], "center");
to

Code: Select all

    imagettftextbox($im, $size, 0, 0, 20, $white, $font1, $text, $SITE['image_width'], "center");
or if you are using the default font change

Code: Select all

imageWriteString($im, $size, $text, $red, "center", 23);
to

Code: Select all

imageWriteString($im, $size, $text, $white, "center", 23);
David
Image
kapo
Posts: 246
Joined: Thu 03 Jan 2013 1:59 pm
Weather Station: Davis VP2
Operating System: Windows 10
Location: Vihtavuori, Laukaa, Finland

Re: Cumulus PHP-GD Banner

Post by kapo »

water01 wrote:You can use the standard colours in the banner.php file here

Code: Select all

$background_color   = imagecolorallocate($im, 0xC1, 0xFF, 0xC1);
$black              = imagecolorallocate($im, 0x00, 0x00, 0x00);
$green              = imagecolorallocate($im, 0x00, 0x80, 0x00);
$blue               = imagecolorallocate($im, 0x00, 0x00, 0x99);
$red                = imagecolorallocate($im, 0xff, 0x00, 0x00);
$indianred          = imagecolorallocate($im, 0x8b, 0x3a, 0x3a);
$white              = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
The white line is one I added and you can add others using the same format and working out the hex RGB definition of the colour which is what the 3 items are after $im i.e. 0xFF, 0xFF, 0xFF.

To use the colour say in Temperature

Code: Select all

// Print Temp
$text = ret_value("temp") . '°' . ret_value("tempunit");
if ($SITE['usettf'] == "yes" ) {
    $size = 18;
    imagettftextbox($im, $size, 0, 0, 20, $red, $font1, $text, $SITE['image_width'], "center");
} else {
    $size = 5;
    imageWriteString($im, $size, $text, $red, "center", 23);
If you are using TTF fonts and want white change

Code: Select all

    imagettftextbox($im, $size, 0, 0, 20, $red, $font1, $text, $SITE['image_width'], "center");
to

Code: Select all

    imagettftextbox($im, $size, 0, 0, 20, $white, $font1, $text, $SITE['image_width'], "center");
or if you are using the default font change

Code: Select all

imageWriteString($im, $size, $text, $red, "center", 23);
to

Code: Select all

imageWriteString($im, $size, $text, $white, "center", 23);
Thanks!
These are very usefull... But how can I have temperature font to : red, bold and a little bigger font, so that it`s easier to read from banner?
Post Reply