Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post 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.
User avatar
Buford T. Justice
Posts: 382
Joined: Fri Aug 17, 2012 9:21 pm
Weather Station: Ambient Weather WS-2095
Operating System: https://ubuntu-mate.org/
Location: USA

Getting The Moon Phase Picture Back

Postby Buford T. Justice » Sun Oct 09, 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 Mar 26, 2017 10:15 am, edited 2 times in total.

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

Re: Getting The Moon Phase Picture Back

Postby scanman » Thu Oct 13, 2016 9:32 am

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

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

Re: Getting The Moon Phase Picture Back

Postby jlmr731 » Fri Oct 14, 2016 7:01 pm

Thanks nice to see the moon there now

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

Re: Getting The Moon Phase Picture Back

Postby sungazer » Thu Oct 20, 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: 5186
Joined: Thu Jan 07, 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

Postby mcrossley » Fri Oct 21, 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: 1460
Joined: Sat Aug 13, 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

Postby water01 » Fri Oct 21, 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. viewtopic.php?f=27&t=13902&hilit=moon+phase#p110751

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

Re: Getting The Moon Phase Picture Back

Postby sungazer » Mon Nov 21, 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


Return to “Cumulus MX”

Who is online

Users browsing this forum: No registered users and 5 guests