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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Cumulus PHP-GD Banner

Post by BCJKiwi »

OK have set up banner in my signature - great!

How can I place the banner on a web page of another website (not a forum) and have it link to my weather website the way it does from my siganture?

I have been able to get it to display but not to work as a hyperlink.
The closest I could get was from a right click on the banner,
or,
from a separate hyperlink to the banner

Thanks
User avatar
steve
Cumulus Author
Posts: 26701
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 »

BCJKiwi wrote:How can I place the banner on a web page of another website (not a forum) and have it link to my weather website the way it does from my siganture?
This ought to work:

Code: Select all

<a href="http://silveracorn.co.nz/weather"><img src="http://silveracorn.co.nz/weather/banner.php"/></a>
but it doesn't seem to. I suspect the .php extension for the image is confusing something.

However, if you view the source of this forum page, the forum software has generated:

Code: Select all

<a href="http://silveracorn.co.nz/weather" class="postlink"><img src="http://silveracorn.co.nz/weather/banner.php" alt="Image" /></a>
So I'm afraid I have no idea what's going on. Perhaps something in the forum CSS fixes it. No doubt someone clever will be along soon with an explanation.
Steve
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 »

Works for me ?
The only thing that I can see is a missing space before /> in the <img tag, although that shouldn't really make a difference.
Might be the forum protecting itself and using the 'class' to allow the call ?

For completness the link should be expanded a bit:

Code: Select all

<a href="http://silveracorn.co.nz/weather" target="_blank" border="0"><img src="http://silveracorn.co.nz/weather/banner.php" height="60" width="468" alt="Visit Silver Acorn Weather" title="Visit Silver Acorn Weather" /></a>
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
steve
Cumulus Author
Posts: 26701
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 »

beteljuice wrote:Works for me ?
Ah - and for me, I now realise, in IE. But not in Chrome. I've probably screwed up my test page.
Steve
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Cumulus PHP-GD Banner

Post by BCJKiwi »

beteljuice wrote:Works for me ?
The only thing that I can see is a missing space before /> in the <img tag, although that shouldn't really make a difference.
Might be the forum protecting itself and using the 'class' to allow the call ?

For completness the link should be expanded a bit:

Code: Select all

<a href="http://silveracorn.co.nz/weather" target="_blank" border="0"><img src="http://silveracorn.co.nz/weather/banner.php" height="60" width="468" alt="Visit Silver Acorn Weather" title="Visit Silver Acorn Weather" /></a>
@beteljuice

Thanks, your solution works perfectly!
As a beginner at this coding (but I trust learning fast) I would not have got there in ages.
- now to find a suitable image or add a coloured background.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Cumulus PHP-GD Banner

Post by BCJKiwi »

The code does work perfectly but I noticed it produced a hyperlink coloured border around the banner.

Code: Select all

<a href="http://silveracorn.co.nz/weather" target="_blank" border="0"><img src="http://silveracorn.co.nz/weather/banner.php" height="60" width="468" alt="Visit Silver Acorn Weather" title="Visit Silver Acorn Weather" /></a>
So I added border="0" but still got a dotted line around the banner.
So then (having looked at the examples provided by w3schools.com) noticed that they included <p> </p> tags outside the <a> </a> tags.
so the final code is;

Code: Select all

<p><a href="http://silveracorn.co.nz/weather" target="_blank" border="0"><img border="0" src="http://silveracorn.co.nz/weather/banner.php" height="60" width="468" alt="Visit Silver Acorn Weather" title="Visit Silver Acorn Weather" /></a><p>
Thanks again.
Mark14
Posts: 79
Joined: Thu 23 Aug 2012 8:53 pm
Weather Station: Ecowitt HP3501
Operating System: Windows 10
Location: Konin, Poland

Re: Cumulus PHP-GD Banner

Post by Mark14 »

I have a problem with my banner because today disappeared.
The banner is located on a server of my website with all my scripts for weather station - http://pogodaslesin.cba.pl/
However, I showed my banner on a different webpage - http://gminaslesin.hostpark.pl/ through the script:

Code: Select all

<a href='http://pogodaslesin.cba.pl/'><img src='http://pogodaslesin.cba.pl/banner.php' width='468' height='60' /></a>
.
Today it turned out that the server where there is a banner.php file forbids hotlinking. So I wanted to place banner.php to the server where I want to show it but when I wrote:

Code: Select all

$SITE['version']        = "3.0";
$SITE['hloc']           = "http://pogodaslesin.cba.pl/";
$SITE['datafile']       = "realtime.txt";
$SITE['image_width']    = 468;
$SITE['image_height']   = 60;
#---------------------------------------------------------------------------
$SITE['fontdir']        = "http://pogodaslesin.cba.pl/fonts/";     # must contain ttf font files!
$SITE['usettf']         = "yes";        # Set to No to use default fonts
I got the message that the image can't be displayed because there are some errors. It is possible to have banner.php on the another page then realtime.txt file?
Image
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 »

It seems that when you edited the file you saved it in a different format (something that seems to becoming more and more of a problem recently for some reason).

eg. http://pogodaslesin.cba.pl/banner.php (working)

Code: Select all

$months = array ("Styczeñ","Luty","Marzec","Kwiecieñ","Maj","Czerwiec","Lipiec","Sierpieñ",
    "Wrzesieñ","Pazdziernik","Listopad","Grudzieñ");

http://gminaslesin.hostpark.pl/banner.php (NOT working)

Code: Select all

$months = array ("Stycze�","Luty","Marzec","Kwiecie�","Maj","Czerwiec","Lipiec","Sierpie�",
    "Wrzesie�","Pazdziernik","Listopad","Grudzie�");

(further down the degree symbol is also �)
Last edited by beteljuice on Tue 06 Nov 2012 11:36 pm, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
Mapantz
Posts: 1808
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Cumulus PHP-GD Banner

Post by Mapantz »

Hi guys.

Great banner script!
I've belonged to a weather forum for 6 years and recently it had it's overdue update which allows many many new options. I was going to use my banner in my signature (Like here) but the software doesn't allow .php to be used as a picture extension, is there any ways around it?

Regards. :)
Image
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 »

You need to go back a few pages and read this: https://cumulus.hosiene.co.uk/viewtopic.p ... &start=195
Image
......................Imagine, what you will KNOW tomorrow !
Mapantz
Posts: 1808
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Cumulus PHP-GD Banner

Post by Mapantz »

beteljuice wrote:You need to go back a few pages and read this: https://cumulus.hosiene.co.uk/viewtopic.p ... &start=195
Thank you! Works perfectly. :)
Image
TNETWeather

Re: Cumulus PHP-GD Banner

Post by TNETWeather »

Mapantz wrote:Hi guys.

Great banner script!
I've belonged to a weather forum for 6 years and recently it had it's overdue update which allows many many new options. I was going to use my banner in my signature (Like here) but the software doesn't allow .php to be used as a picture extension, is there any ways around it?

Regards. :)
Yep... if you have access to mod_rewrite on your website, you can "fake" an image and have it point to your PHP script.

Some examples:

Code: Select all

RewriteRule ^/?banner.png$ /banner.php [L]
RewriteRule ^/?banner2.png$ /banner2.php [L]
RewriteRule ^/?banner3.png$ /banner3.php [L]
RewriteRule ^/?avatar.png$ /avatar.php [L]
RewriteRule ^/?therm.png$ /graph/therm.php [L]
In each case, the first part is the "fake" png file I want to use on websites and the second part is which php script it should call.

This way you can reference your PHP graphic like:

http://cumulus.tnetweather.com/banner2.png

... and it will actually (in this example) use the PHP script called banner3.php which is:

Image
Mark14
Posts: 79
Joined: Thu 23 Aug 2012 8:53 pm
Weather Station: Ecowitt HP3501
Operating System: Windows 10
Location: Konin, Poland

Re: Cumulus PHP-GD Banner

Post by Mark14 »

I would like to add a weather icon to my banner. It should reffer to the current weather situation, so the icon should show the weather from METAR report, eg. sun, rain as in the weather widgets. Is it possible?
Image
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 »

In a word YES

... but very awkward.
This script has been striped down from the Anole wxsticker http://scripts.anolecomputer.com/download.shtml

You would need to isolate the METAR grab part and stitch it back in to the Cumulus version.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Cumulus PHP-GD Banner

Post by mcrossley »

How about having a selection of full size background images for the banner which incorporate the icons and selecting the appropriate image based on the conditions?
Post Reply