Plugin Directory

Changeset 854105


Ignore:
Timestamp:
02/09/2014 07:42:34 AM (12 years ago)
Author:
ppaquet
Message:

Version 2.1

Location:
ephemeris/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ephemeris/trunk/ephemeris.php

    r139559 r854105  
    66 *  Plugin URI: http://www.joeswebtools.com/wordpress-plugins/ephemeris/
    77 *  Description: Adds a sidebar widget that display the current astrological sky.
    8  *  Version: 2.0
     8 *  Version: 2.1
    99 *  Author: Joe's Web Tools
    1010 *  Author URI: http://www.joeswebtools.com/
     
    8888
    8989    // Get date
    90     $y = date('Y');
    91     $m = date('n');
    92     $d = date('j');
     90    $y = gmdate('Y');
     91    $m = gmdate('n');
     92    $d = gmdate('j');
    9393
    9494    // Calculate julian day
     
    269269    }
    270270
    271     // Ecliptic longitude
    272     if(date('L') == '1')
    273     {
    274         $sun_zodiac_longitude = (366 / 360) * (date('z') + 20);
    275     }
    276     else
    277     {
    278         $sun_zodiac_longitude = (365 / 360) * (date('z') + 20);
    279     }
    280     $sun_zodiac_longitude = round($sun_zodiac_longitude % 30);
     271    // Calculate sun's ecliptic longitude
     272    $d = $jd - 2451545;
     273    $g = 357.529 + (0.98560028 * $d);
     274    $q = 280.459 + (0.98564736 * $d);
     275    $l = $q + (1.915 * sin($g)) + (0.020 * sin(2 * $g));
     276    if($l > 360) {
     277        $l -= 360;
     278    }
     279
     280    // Zodiac adjusted longitude
     281    $sun_zodiac_longitude = round($l % 30);
    281282
    282283    $content = '<table style="border-width: thin thin thin thin; border-style: solid solid solid solid;">';
     
    372373
    373374        // Get date
    374         $y = date('Y');
    375         $m = date('n');
    376         $d = date('j');
     375        $y = gmdate('Y');
     376        $m = gmdate('n');
     377        $d = gmdate('j');
    377378
    378379        // Calculate julian day
     
    553554        }
    554555
    555         // Ecliptic longitude
    556         if(date('L') == '1')
    557         {
    558             $sun_zodiac_longitude = (366 / 360) * (date('z') + 20);
    559         }
    560         else
    561         {
    562             $sun_zodiac_longitude = (365 / 360) * (date('z') + 20);
    563         }
    564         $sun_zodiac_longitude = round($sun_zodiac_longitude % 30);
     556        // Calculate sun's ecliptic longitude
     557        $d = $jd - 2451545;
     558        $g = 357.529 + (0.98560028 * $d);
     559        $q = 280.459 + (0.98564736 * $d);
     560        $l = $q + (1.915 * sin($g)) + (0.020 * sin(2 * $g));
     561        if($l > 360) {
     562            $l -= 360;
     563        }
     564   
     565        // Zodiac adjusted longitude
     566        $sun_zodiac_longitude = round($l % 30);
    565567
    566568        // Display sun zodiac
  • ephemeris/trunk/readme.txt

    r139559 r854105  
    44Tags: ascendant, astrology, astrological report, astrological reports, horoscope, horoscopes, moon, moon phase, moon phases, phase, phases, sidebar, sidebars, star sign, star signs, sign, signs, sun, widget, widgets, zodiac
    55Requires at least: 2.8
    6 Tested up to: 2.8.2
    7 Stable tag: 2.0
     6Tested up to: 3.8.1
     7Stable tag: 2.1
    88
    99Adds a sidebar widget that display from the astrological sky the sun sign, the moon sign and the moon phase.
     
    5050== Changelog ==
    5151
     52= 2.1 =
     53* Compatibility check with WordPress 3.8.1
     54* Changing calculation method from tropical to sidereal
     55
    5256= 2.0 =
    5357* Integration of the Hungarian translation
Note: See TracChangeset for help on using the changeset viewer.