Changeset 127176
- Timestamp:
- 06/18/2009 07:46:56 PM (17 years ago)
- Location:
- hijri/trunk
- Files:
-
- 2 edited
-
hijri.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hijri/trunk/hijri.php
r126582 r127176 4 4 Plugin URI: http://dev.holooli.com/ 5 5 Description: Display Hijri and/or Gregorian dates in your blog. 6 Version: 0. 66 Version: 0.7 7 7 Author: Khaled Al Hourani 8 8 Author URI: http://holooli.com … … 13 13 function Hijri() { //constructor 14 14 global $wp_version; 15 //A CTIONS15 //Actions 16 16 #Add Settings Panel 17 17 add_action('admin_menu', array($this, 'addPanel')); … … 25 25 26 26 #Date hooks 27 add_filter('the_time', array($this, 'get Date'));28 add_filter('get_comment_date', array($this, 'get Date'));29 30 // VERSION CONTROL27 add_filter('the_time', array($this, 'getPostDate')); 28 add_filter('get_comment_date', array($this, 'getCommentDate')); 29 30 // Check WP Version 31 31 if ($wp_version < 2.5) { 32 32 add_action('admin_notices', array($this, 'versionWarning')); … … 152 152 } 153 153 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 159 157 $date_format = get_settings('date_format'); 160 158 … … 162 160 $gregorian_date = get_post_time($date_format, false, $post); //the false is GMT 163 161 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) { 164 178 $hijri_settings = get_option('hijri'); 165 179 … … 169 183 require_once('Arabic.php'); 170 184 $Arabic = new Arabic('ArDate'); 171 $time = time();172 185 173 186 $hijri_date = $Arabic->date('l dS F Y', strtotime($gregorian_date)); -
hijri/trunk/readme.txt
r126582 r127176 4 4 Requires at least: 2.4 5 5 Tested up to: 2.8 6 Stable tag: 0. 66 Stable tag: 0.7 7 7 8 8 Display Hijri and/or Gregorian dates in your blog.
Note: See TracChangeset
for help on using the changeset viewer.