→  Mondphasen für Wordpress

The Moon for Wordpress

→ There are scripts like this, already?

Yes, indeed…

For the last few months I was looking for a Wordpress plugin or widget that shows the Moon’s phases. There are some plugins, but beeing an amateur astronomer they didn’t really satisfy my visions. Not to call someone others work bad, no way! Somehow the existing moonphase scripts are not that exact as they could be. But, again, maybe my point of view is something different…

OK, as you can see in the sidebar there goes my solution for the problem. It’s a widget written in Flash, which is 160 pixels squared. It shows the Moon’s current phase and has some more features. You can easily set the layout to English or German in the widget’s parameter backend. However, in the english version the date has the format Month/Day/Year, but the time format is still in 24 hours mode, not 01-12 am/pm. In astronomical calculations, there is no am/pm “concept”. The time from your system is converted into UT (Universal Time) and the calculations are made due to this instant.

You can modify nearly every visual parameter of the basic layout of the widget in the backend, as there are:

Current parameters availiable
  • Background color
  • Background alpha value
  • Font color (including all visible elements except the Moon)
  • The color of the dark part of the Moon’s surface
  • The alpha value of the dark part
  • Frame color
  • Frame alpha value

Unfortuantely, the size of the widget isn’t adjustable, because the widget uses pixel fonts for all text displays. But hopefully your sidebar isn’t that small, is it?  ;)

Some color examples (screenshot shows both German and English version of the widget)

Layout screenshots

→ Features

Standard screen on loading:
  • Picture of the current phase of the Moon
  • Calculations are given in system time of your machine, daylight saving time is taken into account.
  • Shows the current illumination in %, maximal error should be ±0.18 %
  • Shows the time span to the upcoming New Moon and upcoming Full Moon in days/hours/minutes (e.g. 12d 17h 22m), nearest event is printed first.
  • A click on the zodiac sign draws the zodiac over the graphics, showing the “astrological” position with the ecliptic longitude value of the Moon (please don’t confuse the astrological-zodiacal position of the Moon with the astronomical constellation!).
  • Text description of the current phase

Standard screen

Click on the “Continue”-Button
  • Text output: Age of the Moon in days/hours/minutes (= time span from the last New Moon up to the current Moon)
  • Text output: Length of the current lunation in days/hours/minutes (= time span from the last New Moon up to next New Moon)
  • Shows the current lunation in an overview, starting from the last New Moon to the upcoming New Moon. The First Quarter/Full Moon/Last Quarter phases are drawn within, keeping the real distances as their events occur on the timeline.
  • Progress bar of the current lunation, showing how much of the Moon’s cycle has completed
  • Date output for all phases to occur, time is given in 24 hours mode.

Progress of the lunation

Setting the date and time
  • Setting another date is easily done by clicking the desired part and dragging the mouse to the left or right. The date range is from 1900 to 2100.

  • You can also set the time in this way. The hour mode is in 24 hours per day.

  • Click on the “Date” in the upper left corner to reset the date/time to your system time.

Setting date and time

The zodiac
  • Clicking on the zodiac sign (here shown as “Leo”, as the Moon stood in that sign when making the screenshot) brings up a graphic drawn over the Moon’s graphic. It shows the zodiacal position of the Moon, given in degrees and acrminutes inside the current sign. On the given screenshot you can see 8°33.9′, meaning the Moon has travelled 8 degrees and 33.9 arcminutes since entering the sign of Leo. It also shows if the Moon is at Long or Short Ascending. The Moon is long ascending while travelling the signs Capricornus to Gemini (included), and short ascending while Cancer to Sagittarius (included). Be aware that the long and short ascending is vice versa on the southern hemisphere of the earth.

Zodiac and ecliptic longitude

→ For the interested ones…

The phases of the Moon are exact instants of time. It looks like that the Moon is “full” over serveral days, because it is very hard to see a very small dark sickle with the naked eye. In fact, all these phases are points of time. These times are calculated in an astronomical way here, not just setting up equal time spans by “guessing” the times from the last New Moon upwards. This will be wrong after a short period of time.

Calculating the phases of the Moon is not trivial. One cound take the date and time of the last New Moon. Knowing that an average lunation is about 29.530556 days long, one divides this period by 4, so he gets the dates and times for the upcoming phases. But, unfortuately,  nature isn’t that simple. Calculating the phases in such way could be one day in error sometimes! The Moon’s orbit isn’t a circle, but an ellipse, so the Moon travels fast when he is near to the Earth and more slowly when he is far away. Moreover, the orbit of the Moon is tilted to the orbit of the Earth by more than 5 degrees. Therefore, the length of the lunation can differ more than 7 hours from the average lunation, which is 29 days 12 hours and 44 minutes long.

Depending on the accuracy one wishes to obtain, calculations become complex very quickly. Is has to be said that the calculations for this widget are not too complex, there is no need to calculate for “seconds of time” accuracy. Most calculations are based on the algorithms of Jean Meeus’ book “Astronomical Algoritms“. The accurracy within the time span 1900-2100 lies at 1 or 2 minutes in error. Too much accuracy will bring up performance problems.

Calculating the zodiacal position means to get the current position of the Moon on the ecliptic, or true ecliptical coordinates. The zodical signs are divided in equal parts of 30 degrees, starting at Aries (0°-30°), Taurus (30°-60°), Gemini (60°-90°), and so on…. So when one gets a true ecliptical longitude of 128.565°, this means that the Moon is in “Leo” (120°-150°), and since the entering of that sign he travelled 8.565° or 8°33.9′.

Last not least: The times of the phases of the Moon do not depend on where the observer is located. The instants are calculated in Universal Time (UT), the timezone of Greenwich, London. The output times are then given, of course, in the time according to the UT timezone-offset of your machine. It is not crucial if you are sitting in Los Angeles or Berlin.
Example: Full Moon occurs on September 23, 2010, 09:18 UT. That is 10:18 MEZ (Middle european timezone = UT+1h) in Berlin, or 11:18 with taking the daylight saving time into account. The same instant occurs on 01:18  in Los Angeles (UT-8h, Pazific Standard Time =02:18 Pazific Daylight Time)

→ Languages

Unfortunately, at the moment there are only English and German availiable. You can set the language in the widget’s backend.

→ Download

15.2.2010: New versiopn upcoming. Some more features, like calculation of rising/setting, are planned.
I’m currently testing the widget, upload soon. I am looking forward to build a “plugin only” version, too (no widget).

You can download the current version Wordpress Moonphase widget here:

moonphase_parallax_at.zip

The widget was tested on Wordpress v2.8 and v2.9. it should run on Wordpress versions from v2.6 upwards, but there are no guarantees. Please report troubles if you discover. Thanks!

And one more thing: No registration, no costs, no code twiddle diddle. Just install, set your layout, enjoy.

→ Installation

  1. Unpack the *.zip file and extract the “moonphase_parallax_at” folder. The folder contains two files, the .php and the .swf file.
  2. Using an FTP program, upload the full “moonphase_parallax_at” folder to your WordPress plugins directory (Example: /wp-content/plugins).
    Attention: Please NEVER rename the folder name inside your plugins directory. The name has to be “moonphase_parallax_at” (no other folder name is accepted, to work correctly and to avoid conflicts with other plugins. Also please DO NOT rename the swf-file, which name is parallax_at_mondphase.swf.
  3. Go to Plugins > Installed, activate the plugin.
  4. Go to Appearance > Widgets, add the widget to a sidebar, set your default options.
  5. Save, ready go!

Have fun!


Dieser Beitrag wurde am Dienstag, 22. Dezember 2009 um 23:35 Uhr veröffentlicht und wurde unter der Kategorie Allgemein abgelegt. Du kannst die Kommentare zu diesen Eintrag durch den RSS-Feed verfolgen. Du hast die Möglichkeit einen Kommentar zu hinterlassen, oder einen Trackback von deinem Weblog zu senden.

« Mondphasen für Wordpress – 

17 Kommentare »

  1. Hi again,

    i think there was somthing wrong at the exporting of the file from the FLash IDE. So the fault was on my side ;)
    BTW, can one see the using of my plugin somewhere out there?
    greets,
    hc

    Kommentar: hc greier – 15. Februar 2010 @ 10:44

  2. Hello hc greier,

    I did what you said, and it’s now working perfectly in english. I don’t know what I did wrong but thanks for helping me. Also I will now write in english without translation, thanks for the tip.

    Take Care and thanks again for all your help,
    Cheif

    Kommentar: Cheif – 14. Februar 2010 @ 20:13

  3. Hi Cheif,

    thank you for the feedback again. BTW, you don’t need to machine-translate your comments, so feel free to comment in English!

    Well, I tried to set the plugin language to English, and as you can see on the top, it works for me. I didn’t see a problem switching the language. So, please download the .zip file again and replace your .swf file. Maybe it will work then.

    BTW, putting Flash content on a site doesn’t normally validate, so I am working on a valid implementation of the .swf file in the sidebar. So please look back here again next time.

    Please post again if you find any problems.
    Thanks,
    hc

    Kommentar: hc greier – 14. Februar 2010 @ 14:30

  4. wollte dir danken für Ihr Design ist es das größte Mondphase Applet mir bisher begegnet ist, Ich mag es. Also, bitte, die gut funktioniert, überprüfte ich die Zukunft gesehen und sie richtig sind.

    Ich lief in ein Problem, ich heruntergeladen habe, die neuen Dateien, aber ich kann nicht scheinen, ändern Sie es in Englisch, aber wenn ich den alten Dateien läuft gut Englisch. Könnten Sie überprüfen, ob Ihre Anzeige kann Englisch.

    Danke für all die harte Arbeit, es ist wirklich großartig.

    Pass auf dich auf,
    Chief

    Hello Again,

    I wanted to thank you for your design, it is the greatest moon phase applet I ever came across, I really like it. Also your fix is working well, I checked the future times and they are correct.

    I ran into one problem, I downloaded the new files but I can’t seem to change it to english, but when I run the old files it runs english fine. Could you check to see if yours can display english.

    Thanks for all your hard work, it really is great.

    Take Care,
    Cheif

    Kommentar: Cheif – 14. Februar 2010 @ 09:55

  5. Hi Cheif,

    I changed my time zone to EST (that is UT -5 hours) an saw that you were right!
    Maybe there was an older version of the moonphase on my server. I uploaded the newest version now.
    Testing again for time zone UT-5h, it shows New Moon on Feb. 13th, 21:52 correctly! (This is Feb. 14th, 03:52 in my timezone (Middle European))

    Thank you for your advice,
    hc

    Kommentar: hc greier – 11. Februar 2010 @ 16:28

  6. Ihr neuer Mond 13. Februar 2010 berichtet, 19:07 aber der Almanach-und andere Seiten hat:

    Eastern Standard Time
    New Moon: Samstag, 13. Februar (21:53)
    Rise: 05:28 Set: 16:18

    Vielleicht ist keine große Sache, aber dachte, Sie könnten wissen wollen.

    Thank You,
    Chief

    Your new moon for February 13th, 2010 is reporting 19:07 but the almanac and other sites has it :

    Eastern Standard Time
    New Moon: Saturday, 13 February (21:53)
    Rise: 05:28 Set: 16:18

    Maybe no big deal but thought you might want to know.

    Thank You,
    Cheif

    Kommentar: Cheif – 11. Februar 2010 @ 15:13

  7. Das widgetfähig-machen des Themes ist nicht das Problem. Widgets sind auch sicherlich praktisch und simpel handzuhaben, aber für mich bzw. mein Theme finde ich es wesentlich simpler, einfach den Pluginaufruf in die Sidebar zu schreiben. Ich habe keine Ahnung, wieviele Leute keine Widgets nutzen, vielleicht ist das ja auch nur eine verschwindende Minderheit. Du musst jetzt nicht für mich oder diese Minderheit das Plugin umschreiben. Ich sehe es halt nur so, dass wenn dieses Plugin für mich nur nutzbar ist, wenn ich irgendwas an meinen Dateien verändere, dann nutze ich es halt nicht. Das ist so wie z.B. mit Internetseiten, die nur mit dem IE anzuschauen sind, die schaue ich mir dann halt nicht an. Also nix für ungut! Ich bin vielleicht auch einfach nur etwas eigen ;-)

    Kommentar: Barbara – 14. Januar 2010 @ 10:07

  8. Freut mich dass es nun funktioniert.

    Schade, dass es nur als Widget funktioniert, denn da ich in meinen eigenen Themes nicht mit Widgets arbeite

    Naja OK. Hast schon Recht. Frage mich aber, warum du Widget-Fähigkeit von Themes so kategorisch ausschließt? Es ist ja idR kein Problem, ein Theme widgetfähig zu machen.
    (zB http://automattic.com/code/widgets/themes/ ).
    Werde mich aber bemühen, das Widget auf ein “einfaches” Plugin umzubauen und auch dies zum Download anzubieten. Auch das dürfte nicht allzu schwer sein.

    Kommentar: hc greier – 13. Januar 2010 @ 20:02

  9. Super, jetzt klappt alles, auch die Einstellungen lassen sich bei mir in allen Browsern durchführen!
    Schade, dass es nur als Widget funktioniert, denn da ich in meinen eigenen Themes nicht mit Widgets arbeite, kann ich es nicht nutzen. Und ich denke mal, da bin ich nicht die einzige ;-) Also wenn du in der Richtung nochmal was ändern solltest, würde ich mich über eine Mitteilung freuen!
    Viele Grüße,
    Barbara

    Kommentar: Barbara – 13. Januar 2010 @ 10:48

  10. Hallo Barbara,
    ich habe jetzt die php-Datei überarbeitet. Fehlerhaft waren einige HTML-markups. Ich habe das Widget im Backend getestet und bei mir läuft in FF 3.5, Opera 10 und IE 7 jetzt alles so wie es soll.
    Bitte um Feedback, ob’s jetzt auch bei deinem Blog klappt.
    Thx,
    hc

    Kommentar: hc greier – 11. Januar 2010 @ 17:08

  11. Naja, eigenes Testblog dafür nicht wirklich, das ist einfach ein Blog, auf dem ich alles mögliche ausprobiere.
    Im Firefox gibt es jetzt keine Probleme mehr, auch nicht nach mehrmaligem Laden. Nach wie vor ist es aber so, dass im Opera die Widget-Einstellungen nicht mehr aufklappen, nachdem man einmal etwas geändert hat, und im IE7 sind nach dem ersten Speichern von Änderungen die Buttons Löschen, Schließen und Speichern verschwunden.

    Kommentar: Barbara – 09. Januar 2010 @ 20:07

  12. Hallo Barbara!

    Wow, eigenes Test-Blog. Zuviel der Ehre ;)
    Das mit dem Lesen ist mir schon klar, sorry, wollte das nur noch mal ausschließen. Wenn die SWF Angezeigt wird – wenn auch grün und leer – dann heißt das ja, sie wird zumindest gefunden…Irgendwas scheint da mit der Variablenübergabe nicht zu funktionieren. Ich habe deinen neuen Blog getestet, und das “Moonphase” geht bei mir in den Browsern IE7, Opera 10.1, FF 3.5 immer.
    Habe jetzt die Variablen-Ladesequenz im Flash nochmals überarbeitet.
    Bitte die neueste .zip herunterladen und nochmals probieren.
    Danke fürs Testen,
    hc

    Kommentar: hc greier – 09. Januar 2010 @ 14:54

  13. Hallo,
    also lesen kann ich ganz gut ;-) Den Ordnernamen habe ich *nicht* umbenannt, und ich habe zuerst mit der 2.9.1-RC1 getestet und mittlerweile mit der finalen 2.9.1. Jetzt habe ich es auch nochmal auf einem anderen Rechner probiert, das Ergebnis ist das gleiche: Nachdem die Einstellungen einige Male verändert wurden, ist nur der grüne Mondphasen-Hintergrund zu sehen, bzw. nachdem der Cache geleert wurde. Ebenso im Safari. Auch auf dem zweiten Rechner öffnet sich im Opera das Widget nicht mehr, nachdem einmal Änderungen durchgeführt wurden.
    Die Seite, auf der ich es testweise installiert habe, ist übrigens http://barbarajany.de/greet/

    Schönes Wochenende, Barbara

    Kommentar: Barbara – 09. Januar 2010 @ 10:20

  14. Hi,
    danke fürs Probieren nochmal.
    Dann kann es eigentlich nur mehr an Wordpress selbst liegen. Welche Version hast du? Das dein Theme widgetfähig sein muss ist eh klar.
    Das Widget benötigt WP Version 2.8 oder höher. Getestet habe ich es unter 2.8.x und 2.9.0, und da geht es in allen Browsern, auch unter Linux Jaunty/Ibex mit Koqueror ;)
    Und nochmals die Frage: Hast du den Ordnernamen des Plugins umbenannt? (Bitte dies nicht zu tun!).
    Wenn du Wordpress < 2.8 hast wird das nicht funktionieren. Werde zusehen, ob ich das abwärtskompatibel hinbekomme.

    Kommentar: hc greier – 08. Januar 2010 @ 12:14

  15. 2. Versuch, zu kommentieren:
    Ich habe mit Firefox, Opera und IE7 getestet. Meine Flash-Version ist die aktuelle, 10.0.irgendwas. Im Firefox ist es so wie ich oben geschrieben habe, nachdem ich ein paar mal Änderungen durchgeführt und die Seite neu geladen habe, ist nur noch grüner Hintergrund mit dunkelgrünem Rand zu sehen. Im Opera öffnet sich das Widget nach dem Abspeichern von Änderungen nicht mehr, im IE ist nach Speichern von Änderungen die Schaltfläche “Speichern” nicht mehr da.

    Kommentar: Barbara – 07. Januar 2010 @ 18:56

  16. Hi Barbara,

    danke für deine Infos!
    Das mit den “&” war mir bekannt, hab es soweit bereinigt. Die Validität ist durch den Gebrauch von “embed”-Tag für das Flash ohnehin weg….:(. Damit muss ich leben.
    Zu deinem Problem:
    Was passiert, wenn du die Seiten neu lädst? (Strg+F5)
    Hast du den Ordner des Plugins umbenannt?
    Welchen Browser verwendest du? IE hat eigene Sicherheitseinstellungen für Flash+ActiveX usw….
    Welcher FlashPlayer ist installiert?
    Wenn du hier keine “Betriebsgeheimnisse” preisgeben willst bitte PM an mich ;)
    LG,
    hc

    Kommentar: hc greier – 06. Januar 2010 @ 11:48

  17. Hallo,
    schade, dass das Plugin nur für die Nutzung mit Widgets ausgelegt ist, da kann ich es leider in meinem Blog nicht testen, da ich keine Widgets nutze. Ich habe es in einem anderen Blog installiert, dort ist es nun allerdings so, dass außer dem grünen Hintergrund nichts mehr zu sehen ist, nachdem ich die Einstellungen ein paar mal geändert habe.
    Das Plugin liefert invaliden XHTML-Code, da die &-Zeichen nicht maskiert sind.
    Viele Grüße, Barbara

    Kommentar: Barbara – 05. Januar 2010 @ 21:16

Einen Kommentar hinterlassen

Mondphase

Meta

 

WP-Design: Vlad -- Powered by WordPress -- XHTML 1.0