Page 1 of 1

Getting The Moon Phase Picture Back

Posted: Sun 09 Oct 2016 4:31 pm
by Buford T. Justice
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 -->

Re: Getting The Moon Phase Picture Back

Posted: Thu 13 Oct 2016 9:32 am
by scanman
Thanks for that. I feel like Gru from the "Despicable Me" movies - I put the moon back! :lol:

Re: Getting The Moon Phase Picture Back

Posted: Fri 14 Oct 2016 7:01 pm
by jlmr731
Thanks nice to see the moon there now

Re: Getting The Moon Phase Picture Back

Posted: Thu 20 Oct 2016 11:55 pm
by sungazer
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

Re: Getting The Moon Phase Picture Back

Posted: Fri 21 Oct 2016 9:18 am
by mcrossley
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.

Re: Getting The Moon Phase Picture Back

Posted: Fri 21 Oct 2016 4:30 pm
by water01
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. https://cumulus.hosiene.co.uk/viewtopic.p ... se#p110751

Re: Getting The Moon Phase Picture Back

Posted: Mon 21 Nov 2016 8:56 am
by sungazer
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