wp-jalali - Version 4.5

Version Description

Download this release

Release Info

Developer mani_monaj
Plugin Icon 128x128 wp-jalali
Version 4.5
Comparing to
See all releases

Code changes from version 4.4 to 4.5

Files changed (2) hide show
  1. readme.txt +4 -4
  2. wp-jalali.php +24 -8
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
=== wp-jalali ===
2
Contributors: mani_monaj, Gonahkar
3
- Donate link: http://www.wishlistr.com/mani_monaj/
4
Tags: Persian, Farsi, Jalali, Date, Calendar, i18n, l10n, Iran, Iranian
5
Requires at least: 2.1
6
- Tested up to: 3.5
7
- Stable tag: 4.4
8
9
Turn you Wordpress into a full featured Persian (Iranian) Blogging Platform.
10
@@ -43,7 +43,7 @@ You can read complete documentations on the [plug-in documentation page](http://
43
44
= What is Wordpress Persian Project (پروژه وردپرس فارسی) =
45
46
- Just take a look at [this page](http://wp-persian.com/en/about/).
47
48
== Screenshots ==
49
1
=== wp-jalali ===
2
Contributors: mani_monaj, Gonahkar
3
+ Donate link: http://www.wp-persian.com/donate/
4
Tags: Persian, Farsi, Jalali, Date, Calendar, i18n, l10n, Iran, Iranian
5
Requires at least: 2.1
6
+ Tested up to: 3.7
7
+ Stable tag: 4.5
8
9
Turn you Wordpress into a full featured Persian (Iranian) Blogging Platform.
10
43
44
= What is Wordpress Persian Project (پروژه وردپرس فارسی) =
45
46
+ Please check out [this page](http://wp-persian.com/en/about/).
47
48
== Screenshots ==
49
wp-jalali.php CHANGED
@@ -3,12 +3,12 @@
3
Plugin Name: wp-jalali
4
Plugin URI: http://wp-persian.com/plugins/wp-jalali/
5
Description: Full Jalali Date and Persian(Farsi) Support Package for wordpress, Full posts' and comments' dates convertion , Jalali Archive , Magic(Jalali/Gregorian) Calendar and Jalali/Gregorian Compaitables Permalinks, TinyMCE RTL/LTR activation, TinyMCE Persian Improvement, Cross browser Perisan keyboard support, Jalali Archive/Calendar widgets and Persian numbers, Great tool for Persian(Iranian) Users of WordPress, part of <a href="http://wp-persian.com" title="پروژه وردپرس فارسی">Persian Wordpress Project</a>.
6
- Version: 4.4
7
- Author: Vali Allah(Mani) Monajjemi
8
Author URI: http://www.manionline.org/
9
*/
10
11
- /* Copyright 2005-2008 Vali Allah[Mani] Monajjemi (email : mani.monajjemi@gmail.com)
12
13
This program is free software; you can redistribute it and/or modify
14
it under the terms of the GNU General Public License as published by
@@ -541,7 +541,7 @@ function mps_jalali_query($where) {
541
542
$j_monthnum = 1;
543
$j_day = 1;
544
- $j_hour = 0;
545
$j_minute = 0;
546
$j_second = 0;
547
$j_monthnum_next = 1;
@@ -622,12 +622,28 @@ function mps_jalali_query($where) {
622
$tablename_prefix = $wpdb->prefix.'posts.';
623
$sna = (strpos($where, $tablename_prefix) === false) ? '' : $tablename_prefix;
624
// TODO: Remove above line and improve the regex
625
626
- $patterns = array("YEAR\(".$sna."post_date\)='*[0-9]{4}'*","DAYOFMONTH\(".$sna."post_date\)='*[0-9]{1,}'*"
627
- ,"MONTH\(".$sna."post_date\)='*[0-9]{1,}'*","HOUR\(".$sna."post_date\)='*[0-9]{1,}'*",
628
- "MINUTE\(".$sna."post_date\)='*[0-9]{1,}'*","SECOND\(".$sna."post_date\)='*[0-9]{1,}'*");
629
foreach ($patterns as $pattern){
630
- $where = ereg_replace($pattern,"1=1",$where); // :D good idea ! isn't it ?
631
}
632
if ($j_second_next > 59) {
633
$j_second_next = 0;
3
Plugin Name: wp-jalali
4
Plugin URI: http://wp-persian.com/plugins/wp-jalali/
5
Description: Full Jalali Date and Persian(Farsi) Support Package for wordpress, Full posts' and comments' dates convertion , Jalali Archive , Magic(Jalali/Gregorian) Calendar and Jalali/Gregorian Compaitables Permalinks, TinyMCE RTL/LTR activation, TinyMCE Persian Improvement, Cross browser Perisan keyboard support, Jalali Archive/Calendar widgets and Persian numbers, Great tool for Persian(Iranian) Users of WordPress, part of <a href="http://wp-persian.com" title="پروژه وردپرس فارسی">Persian Wordpress Project</a>.
6
+ Version: 4.5
7
+ Author: Mani Monajjemi
8
Author URI: http://www.manionline.org/
9
*/
10
11
+ /* Copyright 2005-2013 Wordpress Persian Project (email : info@wp-persian.com)
12
13
This program is free software; you can redistribute it and/or modify
14
it under the terms of the GNU General Public License as published by
541
542
$j_monthnum = 1;
543
$j_day = 1;
544
+ $j_hour = 0;
545
$j_minute = 0;
546
$j_second = 0;
547
$j_monthnum_next = 1;
622
$tablename_prefix = $wpdb->prefix.'posts.';
623
$sna = (strpos($where, $tablename_prefix) === false) ? '' : $tablename_prefix;
624
// TODO: Remove above line and improve the regex
625
+ if (version_compare($_wp_version, '3.7', '<')) {
626
+ $patterns = array(
627
+ "YEAR\(".$sna."post_date\)='*[0-9]{4}'*",
628
+ "DAYOFMONTH\(".$sna."post_date\)='*[0-9]{1,}'*",
629
+ "MONTH\(".$sna."post_date\)='*[0-9]{1,}'*",
630
+ "HOUR\(".$sna."post_date\)='*[0-9]{1,}'*",
631
+ "MINUTE\(".$sna."post_date\)='*[0-9]{1,}'*",
632
+ "SECOND\(".$sna."post_date\)='*[0-9]{1,}'*"
633
+ );
634
+ } else {
635
+ $patterns = array(
636
+ "YEAR\(\s*post_date\s*\)\s*=\s*'*[0-9]{4}'*",
637
+ "DAYOFMONTH\(\s*post_date\s*\)\s*=\s*'*[0-9]{1,}'*",
638
+ "MONTH\(\s*post_date\s*\)\s*=\s*'*[0-9]{1,}'*",
639
+ "HOUR\(\s*post_date\s*\)\s*=\s*'*[0-9]{1,}'*",
640
+ "MINUTE\(\s*post_date\s*\)\s*=\s*'*[0-9]{1,}'*",
641
+ "SECOND\(\s*post_date\s*\)\s*=\s*'*[0-9]{1,}'*"
642
+ );
643
+ }
644
645
foreach ($patterns as $pattern){
646
+ $where = preg_replace('/'.$pattern.'/',"1=1",$where); // :D good idea ! isn't it ?
647
}
648
if ($j_second_next > 59) {
649
$j_second_next = 0;