Author Topic: Banner Script Help  (Read 2602 times)

0 Members and 1 Guest are viewing this topic.

Offline Jan73

  • Member
  • *
  • Posts: 6
  • WX Ham Radio
    • Ham Radio Weather
Banner Script Help
« on: December 03, 2015, 12:16:40 PM »
I like to put a picture in the background of my
Cumulus Weather Banner
banner.php
Vers. 3.0 (Project of TNET Services Inc)

The banner script at this point looks like... about  on line 200:

// 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");


My photo is located under cumuluswx/images/banpic.jpg
and the banner has the same size 468x60 as the photo.
How do I write the script in the above code stream.
My expertise iis in this case very limited.
 
Thank you
Jan

Offline meteo-saint-brevin

  • Senior Contributor
  • ****
  • Posts: 192
    • Météo Saint-Brevin
Re: Banner Script Help
« Reply #1 on: December 03, 2015, 04:36:58 PM »
Hi Jan,
I also use this banner script from TNET, version 3.
I suggest you insert your background jpg picture in the same directory as the php script, ie image.jpg
This image must have the same size as the banner.
And then you only have to insert the name of your background jpg picture in line 208.

Code: [Select]
208  $baseimg = imagecreatefromjpeg("image.jpg"); Regards
Marcel
Marcel Le Jeune F6DOW - Saint-Brevin-les-Pins - Pays de la Loire - France
www.meteo-saint-brevin.fr
Vantage Pro2 6163EU - VirtualVP, Cumulus, WeatherLink, Skymet
Wifi webcam D-link DCS-2130 - Blue Iris

Offline virusdunil

  • Forecaster
  • *****
  • Posts: 388
    • Station Meteo Hebertville
Re: Banner Script Help
« Reply #2 on: December 03, 2015, 05:19:42 PM »
@ m st brevin.... J'aime bien ton site web mon cher...tres bien realisé  =D>
Cabled Vantage pro2 + Solar / Stevensen screen
Weather Display latest version + Boltek PCI-NexStorm-StormVue NGX / NSDisplay


http://www.meteolacstjean.com/weather28/index.php
Meteotemplate : http://www.meteolacstjean.com/hebert/index.php

Offline gluepack

  • Contributor
  • ***
  • Posts: 101
    • Jerbils' Weather Site
Re: Banner Script Help
« Reply #3 on: December 03, 2015, 05:20:12 PM »
Deja vu :)

I replied to your previous post on this subject…
http://www.wxforum.net/index.php?topic=28019.msg270864#msg270864

Offline meteo-saint-brevin

  • Senior Contributor
  • ****
  • Posts: 192
    • Météo Saint-Brevin
Re: Banner Script Help
« Reply #4 on: December 03, 2015, 05:41:28 PM »
@ virusdunil    Merci pour le compliment.
Ton site est très complet aussi avec une combinaison originale de 2 templates.  =D>
Marcel Le Jeune F6DOW - Saint-Brevin-les-Pins - Pays de la Loire - France
www.meteo-saint-brevin.fr
Vantage Pro2 6163EU - VirtualVP, Cumulus, WeatherLink, Skymet
Wifi webcam D-link DCS-2130 - Blue Iris

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4538
    • KomokaWeather
Re: Banner Script Help
« Reply #5 on: December 03, 2015, 07:21:36 PM »
I also would like to put an image in the background but this is something I have never done.  Maybe I have a much older version of the TNET banner.php as mine has:
Quote
// 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);

What and were would I put my image info?
 
Thanks,
Paul
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger/CumulusMX
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/  
www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969


Offline virusdunil

  • Forecaster
  • *****
  • Posts: 388
    • Station Meteo Hebertville
Re: Banner Script Help
« Reply #6 on: December 03, 2015, 07:23:21 PM »
C'est un test que je fasais et...ca a fini que c'est rester hehehe
Cabled Vantage pro2 + Solar / Stevensen screen
Weather Display latest version + Boltek PCI-NexStorm-StormVue NGX / NSDisplay


http://www.meteolacstjean.com/weather28/index.php
Meteotemplate : http://www.meteolacstjean.com/hebert/index.php

Offline meteo-saint-brevin

  • Senior Contributor
  • ****
  • Posts: 192
    • Météo Saint-Brevin
Re: Banner Script Help
« Reply #7 on: December 04, 2015, 05:26:49 AM »
Hi Paul,
In version 3, the line for the background image is just below the colors settings

Code: [Select]
// Output the header to let the browser know we are
// sending a graphic file format
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, 0xFF, 0xFF, 0xFF);
$black              = imagecolorallocate($im, 0x40, 0x40, 0x40);
$green              = imagecolorallocate($im, 0x00, 0xdd, 0x00);
$blue               = imagecolorallocate($im, 0x00, 0xdd, 0xff);
$red                = imagecolorallocate($im, 0xee, 0x88, 0x55);
$orange             = imagecolorallocate($im, 0xff, 0xD7, 0x00);
$white              = imagecolorallocate($im, 0xff, 0xff, 0xff);
$yellow             = imagecolorallocate($im, 0xff, 0xf7, 0x00);
$violet             = imagecolorallocate($im, 0x88, 0x00, 0xff);
$grey               = imagecolorallocate($im, 0xe2, 0xe2, 0xe2);


// The line below is for the background image, which must be placed in the same directory as the banner.php script
 $baseimg = imagecreatefromjpeg("image.jpg");

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


// Make a Border Around the box

Regards
Marcel
Marcel Le Jeune F6DOW - Saint-Brevin-les-Pins - Pays de la Loire - France
www.meteo-saint-brevin.fr
Vantage Pro2 6163EU - VirtualVP, Cumulus, WeatherLink, Skymet
Wifi webcam D-link DCS-2130 - Blue Iris

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4538
    • KomokaWeather
Re: Banner Script Help
« Reply #8 on: December 04, 2015, 09:47:07 AM »
Thanks very much Marcel.  That was easy once I understood #-o   Now to work on the text colour...
 
Enjoying,
Paul
Davis Vantage Pro 2 Plus 24-FARS Wireless
Envoy/USB DataLogger/Cumulus v.1.9.4   -   Vue Console/WiFiLogger/CumulusMX
Komoka, ON  Canada
www.komokaweather.ca   www.komokaweather.com   www.komokaweather.com/weather28/  
www.komokaweather.com/pws/index.php
Blitzortung Station #1076 www.lightningmaps.org/blitzortung7/america/index.php?bo_page=statistics&bo_show=network&lang=en&bo_station_id=969


Offline Jan73

  • Member
  • *
  • Posts: 6
  • WX Ham Radio
    • Ham Radio Weather
Re: Banner Script Help
« Reply #9 on: December 22, 2015, 04:42:59 AM »
Hi

Now the Banner Background Photo is ok but I have to work on the text because it is low-readable (see remarks).
Can´t change letter colours any more. No effect. Have I to do something with the previous background colour?
I still have it in the script.

- One thing more.
I´m not using ttf-fonts but like to. The `usettf` setting is "no" 
Where to get a suitable ttf font file? How does it look? My fonts.html file is empty.

Br,
Jan

Remarks:  http://www.jel.one/cumuluswx/banner0pic.php



« Last Edit: December 22, 2015, 07:56:46 AM by Jan73 »