Sandaysoft

Support forum for Cumulus weather station software
It is currently Sat May 25, 2013 8:51 pm
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Moon Image ??
PostPosted: Sat Jun 23, 2012 3:50 pm 
Offline

Joined: Sat Dec 17, 2011 11:55 am
Posts: 139
Location: Wareham, Dorset
Weather Station: Davis Vantage Vue
Operating System: Windows 7 x64
GraemeT wrote:
I've reworked my moonphase code and (hopefully) we can now show a different image for each day of the moon-cycle.
Here are the images, as well as a bit of php code to display them.
http://weather.gktnet.com/public/weather/moonphases2.zip

Cheers.


Hi Graeme, I'd like to use the new way on my site, but i'm not clued up on what to do with php, so i wondered if you could guide me through it?

Regards.

PS: Good work!


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jun 24, 2012 12:24 am 
Offline
User avatar

Joined: Wed Oct 21, 2009 11:19 am
Posts: 280
Location: Bayswater, Australia
Weather Station: La Crosse WS-2355
Operating System: Windoze 7
Hi Mapantz,

If you're not using php, it can be done in javascript.

My javascript is very rudimentary, but this should work for you:
Code:
<script type="text/javascript">
var Lat="<#latitude>";
var hemi=Lat.substr(0,1);
var imagen = "<#MoonAge>";
if (hemi=="S") imagen = (-imagen)+29;
document.write('<img src="/images/moon2/'+imagen+'.png"/>');
</script>

View here: http://weather.gktnet.com/cumulus/index.htm
I've updated http://weather.gktnet.com/public/weather/moonphases2.zip to include this code.

_________________
Graeme.
http://weather.gktnet.com/cumulus/index.htm
Image


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jun 24, 2012 3:06 pm 
Offline

Joined: Sat Dec 17, 2011 11:55 am
Posts: 139
Location: Wareham, Dorset
Weather Station: Davis Vantage Vue
Operating System: Windows 7 x64
GraemeT wrote:
Hi Mapantz,

If you're not using php, it can be done in javascript.

My javascript is very rudimentary, but this should work for you:
Code:
<script type="text/javascript">
var Lat="<#latitude>";
var hemi=Lat.substr(0,1);
var imagen = "<#MoonAge>";
if (hemi=="S") imagen = (-imagen)+29;
document.write('<img src="/images/moon2/'+imagen+'.png"/>');
</script>

View here: http://weather.gktnet.com/cumulus/index.htm
I've updated http://weather.gktnet.com/public/weather/moonphases2.zip to include this code.


Excellent! Thank you Graeme. :D


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jun 24, 2012 3:11 pm 
Offline
User avatar

Joined: Thu Apr 26, 2012 6:36 am
Posts: 48
Location: Clacton on Sea, Essex
Weather Station: Watson W8681 MK2
Operating System: Win 7
Got it working here too

Good work Graeme :clap:

Paul

_________________
Image

Weather: http://www.g0hwc.com/weather
Ham Radio: http://www.g0hwc.com
TruckCam: http://www.truckcam.tv


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jun 24, 2012 3:30 pm 
Offline
User avatar

Joined: Thu Apr 26, 2012 6:36 am
Posts: 48
Location: Clacton on Sea, Essex
Weather Station: Watson W8681 MK2
Operating System: Win 7
I think its funny the time we spend doing tweaks to our weather pages
that 99% of visitirs will never notice ! But all part of the fun

:o

Paul

_________________
Image

Weather: http://www.g0hwc.com/weather
Ham Radio: http://www.g0hwc.com
TruckCam: http://www.truckcam.tv


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jun 24, 2012 3:52 pm 
Offline

Joined: Sat Dec 17, 2011 11:55 am
Posts: 139
Location: Wareham, Dorset
Weather Station: Davis Vantage Vue
Operating System: Windows 7 x64
Paul-G0HWC wrote:
I think its funny the time we spend doing tweaks to our weather pages
that 99% of visitirs will never notice ! But all part of the fun

:o

Paul


haha - yeah i'm always tweaking. As long as i'm happy with it, then i know most of the visitors will be.


Top
 Profile  
 
 Post subject: Re: Moon Image ??
PostPosted: Sun Jan 20, 2013 2:35 pm 
Offline

Joined: Sun Jan 20, 2013 2:21 pm
Posts: 2
Location: Jericho, VT USA
Weather Station: Davis Vantage Vue
Operating System: Windows 7
Thanks for doing this. I really like these moon images.

The only thing I would mention in the text file is that the path of the imagefile may need to be changed to the include the subfolder that Cumulus is running under. I spent about an hour trying to determine why the image did not show.

I have my site running under .../Weather/index.htm, so I had to add /Weather to the code

document.write('<img src="Weather/images/moon2/'+imagen+'.png" alt="No Image" title="Moon is


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group