Version Description
- fix memory error
- fix post_where hook
Download this release
Release Info
Developer | man4toman |
Plugin | Parsi Date |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.2
- lib/parsidate.php +4 -2
- readme.txt +5 -1
- wp-parsidate.php +8 -7
lib/parsidate.php
CHANGED
@@ -64,6 +64,8 @@ class bn_parsidate
|
|
64 |
$dayofyear=$this->g_days_sum_month[$gm]+$gd;
|
65 |
$leap=self::IsLeapYear($gy-1);
|
66 |
$leab=self::IsLeapYear($gy);
|
|
|
|
|
67 |
if($dayofyear>79)
|
68 |
{
|
69 |
$jd=($leab)?$dayofyear-78:$dayofyear-79;
|
@@ -75,14 +77,14 @@ class bn_parsidate
|
|
75 |
{
|
76 |
$jd=($leap||($leab&&$gm>2))?287+$dayofyear:286+$dayofyear;
|
77 |
$jy=$gy-622;
|
78 |
-
if($
|
79 |
return array($jy,12,30);
|
80 |
for($i=0;$jd>$this->j_days_in_month[$i];$i++)
|
81 |
$jd-=$this->j_days_in_month[$i];
|
82 |
}
|
83 |
$jm=++$i;
|
84 |
return array($jy,$jm,$jd);
|
85 |
-
}
|
86 |
|
87 |
public function trim_number($num,$sp='٫')
|
88 |
{
|
64 |
$dayofyear=$this->g_days_sum_month[$gm]+$gd;
|
65 |
$leap=self::IsLeapYear($gy-1);
|
66 |
$leab=self::IsLeapYear($gy);
|
67 |
+
if($leap and $gm>2)
|
68 |
+
++$gd;
|
69 |
if($dayofyear>79)
|
70 |
{
|
71 |
$jd=($leab)?$dayofyear-78:$dayofyear-79;
|
77 |
{
|
78 |
$jd=($leap||($leab&&$gm>2))?287+$dayofyear:286+$dayofyear;
|
79 |
$jy=$gy-622;
|
80 |
+
if($jd==366)
|
81 |
return array($jy,12,30);
|
82 |
for($i=0;$jd>$this->j_days_in_month[$i];$i++)
|
83 |
$jd-=$this->j_days_in_month[$i];
|
84 |
}
|
85 |
$jm=++$i;
|
86 |
return array($jy,$jm,$jd);
|
87 |
+
}
|
88 |
|
89 |
public function trim_number($num,$sp='٫')
|
90 |
{
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://forum.wp-parsi.com/
|
|
4 |
Tags: shamsi, wp-parsi, wpparsi, persian, parsi, farsi, jalali, date, calendar, i18n, l10n, Iran, Iranian, parsidate, rtl
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Persian package builder for WordPress, Full RTL and Shamsi(Jalali) date
|
10 |
|
@@ -38,6 +38,10 @@ List of some features:
|
|
38 |
2. Widget of 'بایگانی تاریخ خورشیدی'
|
39 |
|
40 |
== Changelog ==
|
|
|
|
|
|
|
|
|
41 |
= 1.1 =
|
42 |
* Fix TinyMce text direction
|
43 |
* Fix sitemaps date problems
|
4 |
Tags: shamsi, wp-parsi, wpparsi, persian, parsi, farsi, jalali, date, calendar, i18n, l10n, Iran, Iranian, parsidate, rtl
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.2
|
8 |
|
9 |
Persian package builder for WordPress, Full RTL and Shamsi(Jalali) date
|
10 |
|
38 |
2. Widget of 'بایگانی تاریخ خورشیدی'
|
39 |
|
40 |
== Changelog ==
|
41 |
+
= 1.2 =
|
42 |
+
* fix memory error
|
43 |
+
* fix post_where hook
|
44 |
+
|
45 |
= 1.1 =
|
46 |
* Fix TinyMce text direction
|
47 |
* Fix sitemaps date problems
|
wp-parsidate.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
/*
|
4 |
Plugin Name: WP-Parsidate
|
5 |
-
Version: 1.
|
6 |
Author: Mobin Ghasempoor
|
7 |
Author URI: http://wp-parsi.com/
|
8 |
Plugin URI: http://forum.wp-parsi.com/
|
@@ -20,6 +20,7 @@ define('wp_contentpath',dirname(dirname(wp_parsipath)));
|
|
20 |
global $timezone,$persian_month_names;
|
21 |
$persian_month_names = array('','فروردین','اردیبهشت','خرداد','تیر','مرداد','شهریور','مهر','آبان','آذر','دی','بهمن','اسفند');
|
22 |
|
|
|
23 |
$timezone = get_option('timezone_string');
|
24 |
if(empty($timezone))
|
25 |
$timezone='Asia/Tehran';
|
@@ -241,8 +242,8 @@ function wp_pdtitle($title, $sep,$seplocation)
|
|
241 |
if ($val['sep_fixurl']=='بلی')
|
242 |
{
|
243 |
add_filter("post_link","get_pdpermalink",10,3);
|
244 |
-
add_action( 'pre_get_posts',
|
245 |
-
add_filter( 'posts_where' ,'wppd_posts_where');
|
246 |
}
|
247 |
|
248 |
function get_pdpermalink($perma, $post,$leavename = false)
|
@@ -393,10 +394,10 @@ function wppd_pre_get_posts( $query )
|
|
393 |
|
394 |
function wppd_posts_where($where)
|
395 |
{
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
$m = $wp_query->query_vars['m'];
|
401 |
$hour = $wp_query->query_vars['hour'];
|
402 |
$minute = $wp_query->query_vars['minute'];
|
2 |
|
3 |
/*
|
4 |
Plugin Name: WP-Parsidate
|
5 |
+
Version: 1.2
|
6 |
Author: Mobin Ghasempoor
|
7 |
Author URI: http://wp-parsi.com/
|
8 |
Plugin URI: http://forum.wp-parsi.com/
|
20 |
global $timezone,$persian_month_names;
|
21 |
$persian_month_names = array('','فروردین','اردیبهشت','خرداد','تیر','مرداد','شهریور','مهر','آبان','آذر','دی','بهمن','اسفند');
|
22 |
|
23 |
+
@define('WP_MEMORY_LIMIT', '64M');
|
24 |
$timezone = get_option('timezone_string');
|
25 |
if(empty($timezone))
|
26 |
$timezone='Asia/Tehran';
|
242 |
if ($val['sep_fixurl']=='بلی')
|
243 |
{
|
244 |
add_filter("post_link","get_pdpermalink",10,3);
|
245 |
+
add_action( 'pre_get_posts','wppd_pre_get_posts');
|
246 |
+
add_filter( 'posts_where' , 'wppd_posts_where');
|
247 |
}
|
248 |
|
249 |
function get_pdpermalink($perma, $post,$leavename = false)
|
394 |
|
395 |
function wppd_posts_where($where)
|
396 |
{
|
397 |
+
global $wp_query, $wpdb,$pagenow;
|
398 |
+
if(empty($wp_query->query_vars))
|
399 |
+
return $where;
|
400 |
+
$j_days_in_month = array('',31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
|
401 |
$m = $wp_query->query_vars['m'];
|
402 |
$hour = $wp_query->query_vars['hour'];
|
403 |
$minute = $wp_query->query_vars['minute'];
|