Page 1 of 1

Moon icon

Posted: Tue 17 Aug 2010 7:50 pm
by Palmyweather
I understand that the graphics that are uploaded from Cumulus are snapshots of the program itself (like the wind rose and moon phase).

Is there any way to change the moon graphic so that it matches the other weather icons I use on my site?

Re: Moon icon

Posted: Tue 17 Aug 2010 8:35 pm
by steve
I don't really understand what you're asking. There's no way to change the image as displayed in Cumulus (and hence no way to change the moon.bmp file that Cumulus produces). Apart from providing me with an alternative Delphi component to use, of course.

What would it need to look like to match the other weather icons you use on your site? I had a quick look but it wasn't obvious. Do you mean you want it to have a transparent background? The easiest way to get a different moon image on your site would probably be to use something other than the one Cumulus produces - a few people have done this, there are some quite nice ones out there - Mark Crossley has written his own, I believe.

Re: Moon icon

Posted: Tue 17 Aug 2010 9:23 pm
by Synewave
Palmyweather,

One that seems to be popular is the one I use on my site. It's not as dynamic as Steve's, and has 8 (I think) phases. However, it is produced by adding the moonphase webtag into an extra realtime file, Cumulus process and FTP it. Then use Javascript in the webpage to read the extra realtime file and display an image based on the name of the moonphase image. So a little complicated really, but totally achievable if you are a little comfortable with javascript. If you want some code, let me know.

Re: Moon icon

Posted: Tue 17 Aug 2010 9:28 pm
by steve
That one you use is quite nice, Paul. I think it would fit in well on the Palmy Weather site.

Re: Moon icon

Posted: Tue 17 Aug 2010 9:53 pm
by gemini06720
Indeed, the moon icon on Paul's page is quite nice.

On my site, I use both a PHP script (used when the page is first downloaded to the user's browser) and a JavaScript (for near real-time updating) to control 28 different moon icons - in fact, the scripts control 56 moon icons, 28 icons for the northern hemisphere and 28 icons for the southern hemisphere. The 'moon' scripts do not rely on any weather software to produce their phases (icons and texts) - the scripts only need the proper latitude, longitude and hemisphere (either 'NH' or 'SH').

On my main page ([link removed]), the moon phase icon is not displayed during the daylight hours as it is replaced by a thumbnail image of the weather WebCam but the text for the phase of the moon is continuously display.

Ray.

Re: Moon icon

Posted: Wed 18 Aug 2010 12:49 am
by GraemeT
I think this thread might have the information you're looking for:
https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=2505

This is the php code I use:

Code: Select all

...html
<td width="10%" rowspan="3" align="center"><?php echo '<img src="../images/moon/' . rawurlencode($moonphase) . '.png" alt="" width="60" height="60" />' ?></td>
more html...
Cheers,

Re: Moon icon

Posted: Wed 18 Aug 2010 8:34 am
by Synewave
Graeme's method above certainly is a much simpler way to achieve the same result as mine, without using any Javascript.

Re: Moon icon

Posted: Wed 18 Aug 2010 8:52 am
by Palmyweather
It's a lot easier than any way I was thinking. Should have given it a bit more thought to figure this one out myself.

Re: Moon icon

Posted: Wed 06 Apr 2011 4:37 am
by Krumlov
Don't know if this has been posted before but just came across this and I'm now using it on my site:

http://www.calculatorcat.com/moon_phase ... ases.phtml

Works well!

Here is my site: http://www.users.on.net/~gavin_n/weather

Re: Moon icon

Posted: Wed 06 Apr 2011 9:46 pm
by gwheelo
Another example of the moon phase gadget above.

http://www.wheelocknet.net/cumulus/today.html?gb

GW

Re: Moon icon

Posted: Fri 08 Apr 2011 1:40 pm
by MickinMoulden
Krumlov wrote:Don't know if this has been posted before but just came across this and I'm now using it on my site:

http://www.calculatorcat.com/moon_phase ... ases.phtml

Works well!

Here is my site: http://www.users.on.net/~gavin_n/weather
I've seen that before on someones site, looks good. I like the % value. By the way, is that a webcam picture you use for your background? I haven't seen that before. I use a webcam picture (1 of 6 pics) on my home page as well. Mines just a LOT smaller :lol: