Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - 28 November 2014
Latest Cumulus MX release v3.0.0 build 3046 - 02 January 2019. See the Wiki for download

Getting The Moon Phase Picture Back

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.

Moderator: mcrossley

Post Reply
User avatar
Buford T. Justice
Posts: 385
Joined: Fri 17 Aug 2012 9:21 pm
Weather Station: Ambient Weather WS-2902A
Operating System: Windows 10 Pro 64-bit
Location: USA

Getting The Moon Phase Picture Back

Post by Buford T. Justice » Sun 09 Oct 2016 4:31 pm

I did some digging around on and off and found a pretty good Moon Phase Picture. I think the code has been removed from the Cumulus MX indexT.htm template.

From Cumulus 1.9.4, here is the original Almanac code:

Code: Select all

<!-- Almanac -->
<table style="width:100%;border-collapse: collapse; border-spacing: 0;" >
  <tbody><tr>
    <td class="labels">Dawn:</td>
    <td class="site_data" style="text-align: left;"><#dawn></td>
    <td class="labels">Sunrise:</td>
    <td class="site_data" style="text-align: left;"><#sunrise></td>
    <td class="labels">Moonrise:</td>
    <td class="site_data" style="text-align: left;"><#moonrise></td>
    <td rowspan="3"><img src="images/moon.bmp" alt="Moon" width="64" height="64" style="margin: 0px 10px;horizontal-align:left" /></td>
  </tr>
  <tr>
    <td class="labels">Dusk:</td>
     <td class="site_data" style="text-align: left;"><#dusk></td>
    <td class="labels">Sunset:&nbsp;</td>
    <td class="site_data" style="text-align: left;"><#sunset></td>
    <td class="labels">Moonset:</td>
    <td class="site_data" style="text-align: left;"><#moonset></td>
  </tr>
  <tr>
    <td class="labels">Daylight:</td>
    <td class="site_data" style="text-align: left;"><#daylightlength></td>
    <td class="labels">Day Length:</td>
    <td class="site_data" style="text-align: left;"><#daylength></td>
    <td class="labels">Moon Phase:</td>
    <td class="site_data" style="text-align: left;"><#moonphase></td>
  </tr>
</tbody>
</table>
<!-- END Almanac -->
Now here it is with the correction to do Moon Phases in Cumulus MX:

Code: Select all

<!-- Almanac -->
<table style="width:100%;border-collapse: collapse; border-spacing: 0;" >
  <tbody><tr>
    <td class="labels">Dawn:</td>
    <td class="site_data" style="text-align: left;"><#dawn></td>
    <td class="labels">Sunrise:</td>
    <td class="site_data" style="text-align: left;"><#sunrise></td>
    <td class="labels">Moonrise:</td>
    <td class="site_data" style="text-align: left;"><#moonrise></td>
    <td rowspan="3"><a href="http://aa.usno.navy.mil/imagery/moon" target="_blank"><img src="http://tycho.usno.navy.mil/cgi-bin/phase.gif" alt="<#moonphase>" height="75" width="75" style="margin: 0px 10px" /></a></td>
  </tr>
  <tr>
    <td class="labels">Dusk:</td>
     <td class="site_data" style="text-align: left;"><#dusk></td>
    <td class="labels">Sunset:&nbsp;</td>
    <td class="site_data" style="text-align: left;"><#sunset></td>
    <td class="labels">Moonset:</td>
    <td class="site_data" style="text-align: left;"><#moonset></td>
  </tr>
  <tr>
    <td class="labels">Daylight:</td>
    <td class="site_data" style="text-align: left;"><#daylightlength></td>
    <td class="labels">Day Length:</td>
    <td class="site_data" style="text-align: left;"><#daylength></td>
    <td class="labels">Moon Phase:</td>
    <td class="site_data" style="text-align: left;"><#moonphase></td>
  </tr>
</tbody>
</table>
<!-- END Almanac -->
You can also click on the Moon Phase picture to see exactly what the Moon looks like in its current phase.

If you want AM/PM times:

Code: Select all

<!-- Almanac -->
<table style="width:100%;border-collapse: collapse; border-spacing: 0;" >
  <tbody><tr>
    <td class="labels">Dawn:</td>
    <td class="site_data" style="text-align: left;"><#dawn format="h:mm tt"></td>
    <td class="labels">Sunrise:</td>
    <td class="site_data" style="text-align: left;"><#sunrise format="h:mm tt"></td>
    <td class="labels">Moonrise:</td>
    <td class="site_data" style="text-align: left;"><#moonrise format="h:mm tt"></td>
    <td rowspan="3"><a href="http://aa.usno.navy.mil/imagery/moon" target="_blank"><img src="http://tycho.usno.navy.mil/cgi-bin/phase.gif" alt="<#moonphase>" height="75" width="75" style="margin: 0px 10px" /></a></td>
  </tr>
  <tr>
    <td class="labels">Dusk:</td>
     <td class="site_data" style="text-align: left;"><#dusk format="h:mm tt"></td>
    <td class="labels">Sunset:&nbsp;</td>
    <td class="site_data" style="text-align: left;"><#sunset format="h:mm tt"></td>
    <td class="labels">Moonset:</td>
    <td class="site_data" style="text-align: left;"><#moonset format="h:mm tt"></td>
  </tr>
  <tr>
    <td class="labels">Daylight:</td>
    <td class="site_data" style="text-align: left;"><#daylightlength format="H'h' mm'm' ss's'"></td>
    <td class="labels">Day Length:</td>
    <td class="site_data" style="text-align: left;"><#daylength format="H'h' mm'm' ss's'"></td>
    <td class="labels">Moon Phase:</td>
    <td class="site_data" style="text-align: left;"><#moonphase></td>
  </tr>
</tbody>
</table>
<!-- END Almanac -->
Last edited by Buford T. Justice on Sun 26 Mar 2017 10:15 am, edited 2 times in total.

scanman
Posts: 64
Joined: Sun 18 Oct 2009 8:44 pm
Weather Station: Davis VP2

Re: Getting The Moon Phase Picture Back

Post by scanman » Thu 13 Oct 2016 9:32 am

Thanks for that. I feel like Gru from the "Despicable Me" movies - I put the moon back! :lol:

jlmr731
Posts: 119
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Youngstown, Ohio
Contact:

Re: Getting The Moon Phase Picture Back

Post by jlmr731 » Fri 14 Oct 2016 7:01 pm

Thanks nice to see the moon there now

sungazer
Posts: 4
Joined: Thu 29 Sep 2016 6:57 am
Weather Station: WH3081
Operating System: Win7 64bit
Location: Australia
Contact:

Re: Getting The Moon Phase Picture Back

Post by sungazer » Thu 20 Oct 2016 11:55 pm

Just wondered if this code will be included in the next build. The moon phases are something I have always liked as well but putting the code in may be a bit much especially if the next update then reset this and I had to do it again.

TIA

User avatar
mcrossley
Posts: 5317
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Getting The Moon Phase Picture Back

Post by mcrossley » Fri 21 Oct 2016 9:18 am

If I were Steve, the problem for me with putting this in the MX source files is it introduces an external dependency that may change and and break the template in the future. In fact I just tried the link - http://tycho.usno.navy.mil/cgi-bin/phase.gif - and its not working for me at the moment - EDIT: Ah worked 5 mins later.

It just leads to more support questions on the forum when it doesn't work for some reason.

It's fine for people to tweak and self support though. I chose to be self contained and created my own graphic on my web server.

water01
Posts: 1491
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

Re: Getting The Moon Phase Picture Back

Post by water01 » Fri 21 Oct 2016 4:30 pm

I wrote a moon phase piece of code for MX users some months back, that is self contained (uses its own images), and works in the northern and southern hemispheres. http://sandaysoft.com/forum/viewtopic.p ... se#p110751

sungazer
Posts: 4
Joined: Thu 29 Sep 2016 6:57 am
Weather Station: WH3081
Operating System: Win7 64bit
Location: Australia
Contact:

Re: Getting The Moon Phase Picture Back

Post by sungazer » Mon 21 Nov 2016 8:56 am

I am not a programmer. I can follow instructions and change code as directed but would not want to have to do this on a constant basis. The Moon Phase for me is important as my wife is Buddhist and a lot revolves around the stages of the moon.

Please put it back in as standard in a bold and beautiful way.

TIA

Post Reply