Page 19 of 31

Re: Cumulus PHP-GD Banner

Posted: Fri 01 Feb 2013 7:35 pm
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.

Re: Cumulus PHP-GD Banner

Posted: Fri 01 Feb 2013 7:37 pm
by William Grimsley
Oh, right! Thanks, changing both tags from "wlatest" to "wgust", worked! :D

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Feb 2013 6:59 pm
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

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Feb 2013 7:06 pm
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.

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Feb 2013 7:24 pm
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

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Feb 2013 8:04 pm
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

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Mar 2013 7:44 pm
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!

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Mar 2013 10:00 pm
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

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Mar 2013 10:24 pm
by kingqueen
That's got it. Thank you very much indeed, Werk_AG.

hloc where's the data

Posted: Tue 02 Apr 2013 12:07 pm
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

Re: hloc where's the data

Posted: Tue 02 Apr 2013 12:21 pm
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.

Re: hloc where's the data

Posted: Tue 02 Apr 2013 12:26 pm
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.

Re: hloc where's the data

Posted: Tue 02 Apr 2013 12:51 pm
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

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

Posted: Sat 27 Apr 2013 4:18 pm
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 :)

Re: Cumulus PHP-GD Banner

Posted: Sat 27 Apr 2013 10:05 pm
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