Daily Moon Forecast Web App Documentation

Daily Moon Forecast Web App

About

Daily Moon Forecast is a web app that displays the current zodiac sign of the moon along with a forecast, which updates automatically as the moon sign changes. It also displays the current local time of the viewer, as given by the viewer’s browser.

The zodiac icon will also update as the moon sign changes. The forecast is simply a one-sentence or two-sentence suggestion of the general mood in the air according to the zodiac sign the moon is in. Twelve forecasts are included in the PHP script, one for each of the twelve zodiac signs.

There is a CSS style sheet included with some responsive CSS to adjust the width for smaller screens. There is a favicon included.

Daily Moon Forecast uses the Swiss Ephemeris inside to get the longitude of the Moon.

Requirements and Specs

Your server must have at least PHP 4.x installed. Your web host must allow file permissions be set (chmod 755). The app does this automatically, and works fine with most web hosts, but I have been alerted to at least 1 web host that blocks this. Also, your web host must allow the PHP exec() function.

Installation

  1. Unzip the .zip package file.
  2. Upload the moon-forecast folder to your website server.
  3. View the moon forecast by navigating on your web browser to:
    http://yoursite.com/moon-forecast/moon-forecast.php

Languages

These languages are included in Daily Moon Forecast web app:

English (default)

Arabic

French

Hindi

Spanish

Daily Moon Forecast web app is translation-ready, and includes a .pot file to make it easy for you to translate it into other languages.

How To Set The Language To Arabic

The languages included in the Daily Moon Forecast web app are English (default), Arabic, French, Hindi, and Spanish. To set the language to Arabic:

  1. Open the file: moon-forecast.php.
  2. Line 36 should look like this:

    // $language = "en_EN";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. On that same line, replace "en_EN" with "ar_SA".
  5. Save the file.

How To Set The Language To Spanish

The languages included in the Daily Moon Forecast web app are English (default), Arabic, French, Hindi, and Spanish. To set the language to Spanish:

  1. Open the file: moon-forecast.php.
  2. Line 36 should look like this:

    // $language = "en_EN";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. On that same line, replace "en_EN" with "es_ES".
  5. Save the file.

How To Set The Language To French

The languages included in the Daily Moon Forecast web app are English (default), Arabic, French, Hindi, and Spanish. To set the language to French:

  1. Open the file: moon-forecast.php.
  2. Line 36 should look like this:

    // $language = "en_EN";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. On that same line, replace "en_EN" with "fr_FR".
  5. Save the file.

How To Set The Language To Hindi

The languages included in the Daily Moon Forecast web app are English (default), Arabic, French, Hindi, and Spanish. To set the language to Spanish:

  1. Open the file: moon-forecast.php.
  2. Line 36 should look like this:

    // $language = "en_EN";
  3. Uncomment that line by deleting the two slashes at the beginning of the line.
  4. On that same line, replace "en_EN" with "hi_IN".
  5. Save the file.

How To Set To a Different Language

The languages included in the Daily Moon Forecast web app are English (default), Arabic, French, Hindi, and Spanish. To set a different language, you’ll have to create the .mo and .po translation files for your desired language.

  1. Use the included .pot file to easily make your translation. You’ll find the file, dailymoonforecast.pot, in the root directory of the app.
  2. Your .mo and .po translation files must be named exactly like this:

    dailymoonforecast.mo
    dailymoonforecast.po
    
  3. In the /locale/ directory, create a new directory named after your locale code. The locale is the two-letter language code, underscore, and two-letter country code. For example, for Spanish, you would name the directory “es_ES“. As another example, Moroccan Arabic would be “ar_MA“, while Libyan Arabic would be “ar_LY“. For the following steps, I will use Moroccan Arabic as an example (“ar_MA”).
  4. Inside the directory which you created in the previous step, create another directory named, “LC_MESSAGES” (all uppercase).
  5. Place your .mo and .po files inside your new “LC_MESSAGES” directory. Using Moroccan Arabic as an example, the path to your files should look like this:

    moon-forecast/locale/ar_MA/LC_MESSAGES/dailymoonforecast.mo
    moon-forecast/locale/ar_MA/LC_MESSAGES/dailymoonforecast.po
    
  6. Now set your locale to Moroccan Arabic. Open the file: moon-forecast.php.
  7. Line 36 should look like this:

    // $language = "en_EN";
  8. Uncomment that line by deleting the two slashes at the beginning of the line.
  9. On that same line, replace "en_EN" with "ar_MA".
  10. Save the file.

Free WordPress Plugin Alternative

The WordPress plugin version of this is available at WordPress.org.

License

License: GNU General Public License, version 2

Troubleshooting

The Moon Sign is Stuck on Aries

The app includes a file that must have permission to execute (CHMOD 755) in order to get the moon’s position from the Swiss Ephemeris. The file is:

moon-forecast/sweph/isabelse

The app sets this permission automatically. If the moon sign is always stuck on Aries, it means that your server did not allow the script to set file permissions to 755. If you feel comfortable with this, you can check this file’s permission on your server to be sure. You may manually have to set the permission to 755.

If you confirm that the file (moon-forecast/sweph/isabelse) has the proper permissions set to 755, and yet it is still stuck on Aries, then it may be that your server does not allow scripts to execute using the PHP exec() function. If your web host blocks the PHP exec() function, then this app will not work on that server.

Updated on February 17, 2017

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]