Plugin Directory

Changeset 127176


Ignore:
Timestamp:
06/18/2009 07:46:56 PM (17 years ago)
Author:
holooli
Message:

Fixed comment date

Location:
hijri/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hijri/trunk/hijri.php

    r126582 r127176  
    44Plugin URI: http://dev.holooli.com/
    55Description: Display Hijri and/or Gregorian dates in your blog.
    6 Version: 0.6
     6Version: 0.7
    77Author: Khaled Al Hourani
    88Author URI: http://holooli.com
     
    1313        function Hijri() { //constructor
    1414            global $wp_version;
    15             //ACTIONS
     15            //Actions
    1616                #Add Settings Panel
    1717                    add_action('admin_menu', array($this, 'addPanel'));
     
    2525               
    2626                #Date hooks
    27                     add_filter('the_time', array($this, 'getDate'));
    28                     add_filter('get_comment_date', array($this, 'getDate'));
    29 
    30             //VERSION CONTROL
     27                    add_filter('the_time', array($this, 'getPostDate'));
     28                    add_filter('get_comment_date', array($this, 'getCommentDate'));
     29
     30            // Check WP Version
    3131                if ($wp_version < 2.5) {
    3232                    add_action('admin_notices', array($this, 'versionWarning'));
     
    152152        }
    153153
    154 
    155         //  Display the selected dates
    156         function getDate() {
    157 
    158             // Get the current date
     154        // Get post date
     155        function getPostDate() {
     156            // Get date format of this blog
    159157            $date_format = get_settings('date_format');
    160158
     
    162160            $gregorian_date = get_post_time($date_format, false, $post); //the false is GMT
    163161
     162            return $this->getDate($gregorian_date);
     163        }
     164
     165        // Get comment date
     166        function getCommentDate() {
     167            // Get date format of this blog
     168            $date_format = get_settings('date_format');
     169
     170            $comment = get_comment($comment, ARRAY_A);
     171            $gregorian_date = date($date_format, strtotime($comment['comment_date']));
     172
     173            return $this->getDate($gregorian_date);
     174        }
     175
     176        //  Convert date
     177        function getDate($gregorian_date) {
    164178            $hijri_settings = get_option('hijri');
    165179
     
    169183                require_once('Arabic.php');
    170184                $Arabic = new Arabic('ArDate');
    171                 $time = time();
    172185
    173186                $hijri_date = $Arabic->date('l dS F Y', strtotime($gregorian_date));
  • hijri/trunk/readme.txt

    r126582 r127176  
    44Requires at least: 2.4
    55Tested up to: 2.8
    6 Stable tag: 0.6
     6Stable tag: 0.7
    77
    88Display Hijri and/or Gregorian dates in your blog.
Note: See TracChangeset for help on using the changeset viewer.