Page 30 of 31

Re: Cumulus PHP-GD Banner

Posted: Fri 28 Jan 2022 3:43 pm
by freddie
Paul C wrote: Fri 28 Jan 2022 3:38 pm Ray

Sorry I can't see it 😩
Did you follow the advice in this post?
viewtopic.php?p=160883#p160883

Re: Cumulus PHP-GD Banner

Posted: Fri 28 Jan 2022 3:43 pm
by RayProudfoot
Paul, try clearing your cache. Logically it should be visible. It's now named chlive.php.

See if you can get to this page. www.cheadlehulmeweather.co.uk/chlive.php

Re: Cumulus PHP-GD Banner

Posted: Fri 28 Jan 2022 4:45 pm
by PaulMy
Thanks freddie and Mark, finally found the Insecure settings in Edge and Chrome and now Ray's and others (and mine with the renamed file) show the banner image http://komokaweather.com/weather/current.php

Enjoy,
Paul

Re: Cumulus PHP-GD Banner

Posted: Fri 28 Jan 2022 5:23 pm
by RayProudfoot
Paul, excellent! Looking at your temps I don’t know how you cope with those. My coldest was -11°C back in 2010. 🥶

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Jul 2022 8:05 am
by Nottub
As a relative newby with limited skills, is there a template download (with some instruction to tailor for an individuals site) to create a Banner?

It seems the originator in the early posts has withdrawn parts of their webpage where the code was made available.

Eventually I would like to add current conditions to my webcam image.


Thanks

Martyn

Image

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Jul 2022 9:33 am
by broadstairs
Nottub wrote: Sun 10 Jul 2022 8:05 am It seems the originator in the early posts has withdrawn parts of their webpage where the code was made available.
See this thread viewtopic.php?p=128518#p128518

Stuart

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Jul 2022 12:18 pm
by water01
I am afraid the code doesn't seem to be in that topic, but I found it in my backups plus the pdf with the instructions.

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Jul 2022 2:54 pm
by broadstairs
water01 wrote: Sun 10 Jul 2022 12:18 pm I am afraid the code doesn't seem to be in that topic, but I found it in my backups plus the pdf with the instructions.
That thread explains why the site no longer exists, not that the code was available!

Stuart

Re: Cumulus PHP-GD Banner

Posted: Sun 10 Jul 2022 5:39 pm
by Nottub
I hadn't picked up on the sad news, and for that I'm very sorry. It would appear that the information/ coding provided was the backbone of many banners, for that I think is much appreciated.

David, thanks for the files, I'll see if I can do something / anything with them.

Best wishes

Martyn

Re: Cumulus PHP-GD Banner

Posted: Wed 13 Jul 2022 8:17 pm
by Nottub
Much to my amazement, it worked. Just need to understand the script a little better to see what's going on.

What does the $SITE['format'] image option actually do? I've read it, but don't really understand where the .png, jpeg or .gif formats come into this .php page.

Thanks for supplying the scripts David.

Re: Cumulus PHP-GD Banner

Posted: Wed 13 Jul 2022 8:31 pm
by freddie
It is important to realise that this script returns a stream of binary data which your browser will render as an image. The $SITE['format'] variable holds the image type you wish to return - mine is set to 'png' - other potential values are shown in a comment line close to where you set the variable. This value is used to set the content type header in the response returned to the web browser so that the browser knows how to handle the binary data returned.

Re: Cumulus PHP-GD Banner

Posted: Wed 13 Jul 2022 8:40 pm
by Nottub
Thanks Freddie, not sure I've completely got that.

I understand what youre saying but does that mean I can include the .php page as a .png or .gif, for, say embedding as an image in another web page?

I think I need to have a play when I have more time to see what the options do.


Thanks for the feedback

Martyn

Re: Cumulus PHP-GD Banner

Posted: Wed 13 Jul 2022 9:05 pm
by freddie
Yes, you can include it as an image on a web page - that is exactly what happens on this forum thread in my replies. You just add a standard img HTML tag with the src attribute pointing to your php script. Something like this:

Code: Select all

<img src="https://www.hosiene.co.uk/weather/banner.php">
So you don't need to specify the type (png, jpg, etc ) in the img tag, as the browser will know this from the content type that your php script returns (this is the bit I was talking about in my previous reply).

Re: Cumulus PHP-GD Banner

Posted: Tue 23 Jan 2024 5:39 pm
by RayProudfoot
@Mapantz kindly provided the code to add to my .htaccess file to ensure the info in my banner was always current. I plucked up the courage to add it yesterday and it seems to be working fine with one exception.

Cunulussites run by @JennyLeez is still showing yesterday’s data and despite refreshing the page and even clearing the cache for that site the problem remains.

Is it something at my end I need to change and if so, what?

Re: Cumulus PHP-GD Banner

Posted: Tue 23 Jan 2024 6:01 pm
by Mapantz
Glad you've got it working Ray.

The banner is updating here and on the Cumulus sites page for me. Both showed 18:00 today when I refreshed the page.