wp-jalali - Version 5.0.0-RC

Version Description

Download this release

Release Info

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

Code changes from version 4.5.3 to 5.0.0-RC

assets/banner-772x250.png ADDED
Binary file
assets/css/admin.css ADDED
@@ -0,0 +1,124 @@
1
+ @font-face {
2
+ font-family: 'ztjalali_icon';
3
+ src: url('../icon/ztjalali.eot?66463877');
4
+ src: url('../icon/ztjalali.eot?66463877#iefix') format('embedded-opentype'),
5
+ url('../icon/ztjalali.woff?66463877') format('woff'),
6
+ url('../icon/ztjalali.ttf?66463877') format('truetype'),
7
+ url('../icon/ztjalali.svg?66463877#ztjalali') format('svg');
8
+ font-weight: normal;
9
+ font-style: normal;
10
+ }
11
+
12
+ /*
13
+ [class^="icon-"]:before, [class*=" icon-"]:before {
14
+ font-family: "zt-wppersian";
15
+ font-style: normal;
16
+ font-weight: normal;
17
+ speak: none;
18
+
19
+ display: inline-block;
20
+ text-decoration: inherit;
21
+ width: 1em;
22
+ margin-right: .2em;
23
+ text-align: center;
24
+ opacity: .8;
25
+
26
+ For safety - reset parent styles, that can break glyph codes
27
+ font-variant: normal;
28
+ text-transform: none;
29
+
30
+ fix buttons height, for twitter bootstrap
31
+ line-height: 1em;
32
+
33
+ Animation center compensation - margins should be symmetric
34
+ remove if not needed
35
+ margin-left: .2em;
36
+
37
+ you can be more comfortable with increased icons size
38
+ font-size: 120%;
39
+
40
+ Uncomment for 3D effect
41
+ text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3);
42
+ }
43
+
44
+ .icon-wppersianb:before { content: '\e800'; } '' */
45
+
46
+ .dashicons-ztjalali:before{
47
+ content: '\e800';
48
+ font-family: "ztjalali_icon";
49
+ font-style: normal;
50
+ font-weight: normal;
51
+ speak: none;
52
+ display: inline-block;
53
+ text-decoration: inherit;
54
+ width: 1em;
55
+ text-align: center;
56
+ opacity: .8;
57
+ }
58
+
59
+ .form-table td{
60
+ font-size: 11px !important;
61
+
62
+ }
63
+ #wpcontent #wp-toolbar .menupop a,#wpcontent #wp-toolbar .menupop a .ab-label {
64
+ font-family: tahoma !important;
65
+ }
66
+ #dashboard_right_now .versions .b, #post-status-display, #post-visibility-display, #adminmenu .wp-submenu li.current, #adminmenu .wp-submenu li.current a, #adminmenu .wp-submenu li.current a:hover, .media-item .percent, .plugins .name, #pass-strength-result.strong, #pass-strength-result.short, #ed_reply_toolbar #ed_reply_strong, .item-controls .item-order a, .feature-filter .feature-name{
67
+ font-weight: normal !important
68
+ }
69
+
70
+ #Jaa, #Jhh, #Jjj, #Jmn {
71
+ font-size: 12px;
72
+ padding: 1px;
73
+ }
74
+ #Jhh, #Jjj, #Jmn {
75
+ width: 2em;
76
+ }
77
+ #Jaa {
78
+ width: 3.4em;
79
+ }
80
+
81
+ .ztjalali_option_logo {
82
+ margin: 20px 0;
83
+ text-align: center;
84
+ }
85
+ .ztjalali-badge {
86
+ background: url("../img/wp-jalali-80x80.png") no-repeat scroll center 24px / 80px 80px #fff !important;
87
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
88
+ color: #78c8e6;
89
+ display: inline-block;
90
+ font-size: 14px;
91
+ font-weight: 600;
92
+ height: 40px;
93
+ margin: 5px 0 0;
94
+ padding-top: 120px;
95
+ text-align: center;
96
+ text-rendering: optimizelegibility;
97
+ width: 150px;
98
+ left: 0;
99
+ position: absolute;
100
+ top: 0;
101
+ }
102
+ .zt-badge {
103
+ background: url("../img/zakrot.com.png") no-repeat scroll center 24px / 80px 80px #fff !important;
104
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
105
+ color: #78c8e6;
106
+ display: inline-block;
107
+ font-size: 14px;
108
+ font-weight: 600;
109
+ height: 40px;
110
+ margin: 5px 0 0;
111
+ padding-top: 120px;
112
+ text-align: center;
113
+ text-rendering: optimizelegibility;
114
+ width: 150px;
115
+ left: 160px;
116
+ position: absolute;
117
+ top: 0;
118
+ }
119
+ .ztjalali-welcome-top{
120
+ margin: 1em 0 1em 350px !important;
121
+ }
122
+ /*#toplevel_page_ztjalali_admin_page .wp-menu-name {
123
+ position: fixed !important;
124
+ }*/
assets/css/admin_style.css ADDED
@@ -0,0 +1,26 @@
1
+ @font-face {
2
+ font-family: 'yekan';
3
+ src: url('../fonts/BYekan.eot?#') format('eot'), /* IE6–8 */
4
+ url('../fonts/BYekan.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
5
+ url('../fonts/BYekan.ttf') format('truetype'); /* Saf3—5, Chrome4+, FF3.5, Opera 10+ */
6
+ }
7
+
8
+ #adminmenu a.menu-top, #adminmenu .wp-submenu-head{
9
+ font-size: 13px !important;
10
+ font-family: yekan !important;
11
+ }
12
+ #adminmenu .wp-submenu a {
13
+ font-size: 13px;
14
+ font-family: yekan !important;
15
+
16
+ }
17
+ .wrap h2, .subtitle {
18
+ font-weight: normal;
19
+ font-family: yekan !important;
20
+ font-size: 21px !important;
21
+ }
22
+ .form-table th, .form-wrap label {
23
+ font-family: yekan !important;
24
+ font-size: 13px !important;
25
+ font-weight: normal
26
+ }
assets/css/theme_editing.css ADDED
@@ -0,0 +1 @@
1
+ .wrap #template textarea{direction: ltr;text-align: left;}
assets/css/wysiwyg.css ADDED
@@ -0,0 +1,2 @@
1
+ body{font-family:tahoma;font-size:12px;}
2
+ #tinymce{font-family: tahoma; font-size:12px;}
assets/fonts/BYekan.eot ADDED
Binary file
assets/fonts/BYekan.ttf ADDED
Binary file
assets/fonts/BYekan.woff ADDED
Binary file
assets/icon-128x128.png ADDED
Binary file
assets/icon-256x256.png ADDED
Binary file
assets/icon/ztjalali.eot ADDED
Binary file
assets/icon/ztjalali.svg ADDED
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="ztjalali" horiz-adv-x="1000" >
7
+ <font-face font-family="ztjalali" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="wp" unicode="&#xe800;" d="m501 741c-216 0-392-176-392-392 0-216 176-392 392-392 216 0 392 176 392 392 0 216-176 392-392 392z m292-334c-8-20-95-21-124 3-29 24-3 71 37 73 40 2 95-55 87-76z m-151-311c-132-82-306 5-311-2-4-7 92-68 198-102-10 0-19-1-28-1-104 0-198 45-263 116 25 1 212 7 253 43 30 17 75 91 70 174-6 113-68 237-140 229-83-9-131-147-120-231 5-39 37-56 61-60 72-11 131 25 136 23-15-80-205-82-205-82l-117-3c0 0 0 0 0 0-21 45-32 96-32 149 0 131 70 245 175 307l105-60 64 110c4 0 9 0 13 0 110 0 208-49 274-127-12 8-25 13-39 14-73 8-167-245-86-292 66-39 134 2 165 11 13-16-41-135-173-216z m-161 282c-3-11-62-25-115-10-53 16-21 79 25 80 46 1 92-60 90-70z" horiz-adv-x="1000" />
10
+ <glyph glyph-name="zakrot" unicode="&#xe801;" d="m502 741c-217 0-393-176-393-393 0-217 176-392 393-392 217 0 392 175 392 392 0 217-175 393-392 393z m-314-326c72-10 192-30 310-61 74-20 147-45 208-67-58-3-126-8-194-15-124-12-246-32-309-43-14 37-22 77-22 119 0 23 2 46 7 67z m84-291c46-9 103-21 159-36 57-16 113-33 158-49-28-8-57-12-87-12-90 0-172 37-230 97z m408-42c-41 15-135 49-230 74-35 9-70 18-102 25 52 7 112 15 171 21 104 10 209 16 277 19-24-57-65-105-116-139z m-162 340c-116 31-235 51-308 61 51 110 163 186 292 186 177 0 321-143 321-321 0-10-1-20-2-30-67 27-183 72-303 104z" horiz-adv-x="1000" />
11
+ </font>
12
+ </defs>
13
+ </svg>
assets/icon/ztjalali.ttf ADDED
Binary file
assets/icon/ztjalali.woff ADDED
Binary file
assets/img/wp-jalali-80x80.png ADDED
Binary file
assets/img/zakrot.com.png ADDED
Binary file
assets/js/admin-af.js ADDED
@@ -0,0 +1,144 @@
1
+ jQuery(document).ready(function($) {
2
+ /**
3
+ * create vars
4
+ */
5
+ var jalaliMonthNames = ["", "حمل", "ثور", "جوزا", "سرطان", "اسد", "سنبله", "میزان", "عقرب", "قوس", "جدی", "دلو", "حوت"];
6
+ var timestampdiv = $('#timestampdiv');
7
+ /* =================================================================== */
8
+ /**
9
+ *define functions
10
+ */
11
+ function timestampDivModifier(year, month, day, hour, min) {
12
+ content = '<div class="timestamp-wrap jalaliDivBox">';
13
+ content += '<select id="Jmm" name="Jmm">';
14
+ for (var i = 1; i <= 12; i++) {
15
+ if (i == month)
16
+ sel = 'selected="selected"';
17
+ else
18
+ sel = '';
19
+ content += '<option ' + sel + ' value="' + i + '">' + jalaliMonthNames[i] + '</option>';
20
+ }
21
+ content += '</select>';
22
+
23
+ content += '<input type="text" name="Jjj" value="' + day + '" id="Jjj" size="2" maxlength="2" autocomplete="off" />,';
24
+ content += '<input type="text" name="Jaa" value="' + year + '" id="Jaa" size="4" maxlength="4" autocomplete="off" /> @';
25
+ content += '<input type="text" name="Jmn" value="' + min + '" id="Jmn" size="2" maxlength="2" autocomplete="off" /> : ';
26
+ content += '<input type="text" name="Jhh" value="' + hour + '" id="Jhh" size="2" maxlength="2" autocomplete="off" />';
27
+ content += '</div>';
28
+ return content;
29
+ }
30
+
31
+ function changeTimestampViewer(){
32
+ y = $('input[name=aa]').val();
33
+ m = $('select[name=mm]').val();
34
+ d = $('input[name=jj]').val();
35
+ h = $('input[name=hh]').val();
36
+ i = $('input[name=mn]').val();
37
+ //alert(y+','+m+','+d);
38
+ jd = JalaliDate.gregorianToJalali(y, m, d);
39
+ //alert(jd);
40
+ ret='';
41
+ $text = jalaliMonthNames[jd[1]]+' '+jd[2]+', '+jd[0]+' @'+h+':'+i;
42
+ for (var i = 0; i < $text.length ; i++){
43
+ if(!isNaN($text[i]) && $text[i]!=' '){
44
+ ret += String.fromCharCode($text.charCodeAt(i) + 1728);
45
+ }else{
46
+ ret += $text[i];
47
+ }
48
+ }
49
+ $('#timestamp b').text(ret);
50
+
51
+ }
52
+ /* =================================================================== */
53
+ $('#the-list').on('click', '.editinline', function() {
54
+ var tr = $(this).closest('td');
55
+ var year = tr.find('.aa').html();
56
+ if (year > 1700){
57
+ var month = tr.find('.mm').html();
58
+ var day = tr.find('.jj').html();
59
+ var hour = tr.find('.hh').html();
60
+ var min = tr.find('.mn').html();
61
+ var date = JalaliDate.gregorianToJalali(year, month, day);
62
+ // $('.jalaliDivBox').remove();
63
+ $('.inline-edit-date div').hide();
64
+ $('.inline-edit-date').prepend(timestampDivModifier(date[0], date[1], date[2], hour, min));
65
+ }
66
+ });
67
+
68
+ $('.inline-edit-date').on('keyup', '#Jhh', function(e) {
69
+ $('input[name=hh]').val($(this).val());
70
+ });
71
+
72
+ $('.inline-edit-date').on('keyup', '#Jmn', function(e) {
73
+ $('input[name=mn]').val($(this).val());
74
+ });
75
+
76
+ $('.inline-edit-date').on('keyup', '#Jaa , #Jjj', function(e) {
77
+ year = $('#Jaa').val();
78
+ month = $('#Jmm').val();
79
+ day = $('#Jjj').val();
80
+ date = JalaliDate.jalaliToGregorian(year, month, day);
81
+ $('input[name=aa]').val(date[0]);
82
+ $('select[name=mm]').val(date[1]);
83
+ $('input[name=jj]').val(date[2]);
84
+ });
85
+
86
+ $('.inline-edit-date').on('change', '#Jmm', function() {
87
+ year = $('#Jaa').val();
88
+ month = $('#Jmm').val();
89
+ day = $('#Jjj').val();
90
+ date = JalaliDate.jalaliToGregorian(year, month, day);
91
+ $('input[name=aa]').val(date[0]);
92
+ if(date[1]<10)date[1] = '0'+date[1];
93
+ $('select[name=mm]').val(date[1]);
94
+ $('input[name=jj]').val(date[2]);
95
+ });
96
+
97
+ /* =================================================================== */
98
+ /**
99
+ * in edit.php
100
+ */
101
+
102
+ $('a.edit-timestamp').on('click', function() {
103
+ var date = JalaliDate.gregorianToJalali($('#aa').val(), $('#mm').val(), $('#jj').val());
104
+ var divCnt = timestampDivModifier(date[0], date[1], date[2], $('#hh').val(), $('#mn').val());
105
+ $('#timestampdiv .timestamp-wrap').hide();
106
+ $('#timestampdiv').prepend(divCnt);
107
+ });
108
+
109
+
110
+ $('#timestampdiv .cancel-timestamp').on('click', function() {
111
+ $('.jalaliDivBox').remove();
112
+ });
113
+
114
+ $('.save-timestamp,#publish').on('click', function() {
115
+ if($('#Jhh').val()!== undefined){
116
+ $('input[name=hh]').val($('#Jhh').val());
117
+ $('input[name=mn]').val($('#Jmn').val());
118
+ year = $('#Jaa').val();
119
+ month = $('#Jmm').val();
120
+ day = $('#Jjj').val();
121
+ jDate = [year,month,day];
122
+ date = JalaliDate.jalaliToGregorian(year, month, day);
123
+ if(date[1]<10)date[1] = '0'+date[1];
124
+ $('input[name=aa]').val(date[0]);
125
+ $('select[name=mm]').val(date[1]);
126
+ $('input[name=jj]').val(date[2]);
127
+ }
128
+
129
+ setTimeout(function(){
130
+ if($('#timestampdiv .timestamp-wrap:eq(1)').hasClass('form-invalid')){
131
+ $('.jalaliDivBox').addClass('.form-invalid');
132
+ }else{
133
+ $('.jalaliDivBox').remove();
134
+ $('#timestampdiv').slideUp('fast');
135
+ $('a.edit-timestamp').slideDown('fast');
136
+ setTimeout(function(){changeTimestampViewer()},100);
137
+ }
138
+ },100);
139
+ });
140
+
141
+
142
+ /* =================================================================== */
143
+
144
+ });
assets/js/admin-ir.js ADDED
@@ -0,0 +1,144 @@
1
+ jQuery(document).ready(function($) {
2
+ /**
3
+ * create vars
4
+ */
5
+ var jalaliMonthNames = ['', 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'];
6
+ var timestampdiv = $('#timestampdiv');
7
+ /* =================================================================== */
8
+ /**
9
+ *define functions
10
+ */
11
+ function timestampDivModifier(year, month, day, hour, min) {
12
+ content = '<div class="timestamp-wrap jalaliDivBox">';
13
+ content += '<select id="Jmm" name="Jmm">';
14
+ for (var i = 1; i <= 12; i++) {
15
+ if (i == month)
16
+ sel = 'selected="selected"';
17
+ else
18
+ sel = '';
19
+ content += '<option ' + sel + ' value="' + i + '">' + jalaliMonthNames[i] + '</option>';
20
+ }
21
+ content += '</select>';
22
+
23
+ content += '<input type="text" name="Jjj" value="' + day + '" id="Jjj" size="2" maxlength="2" autocomplete="off" />,';
24
+ content += '<input type="text" name="Jaa" value="' + year + '" id="Jaa" size="4" maxlength="4" autocomplete="off" /> @';
25
+ content += '<input type="text" name="Jmn" value="' + min + '" id="Jmn" size="2" maxlength="2" autocomplete="off" /> : ';
26
+ content += '<input type="text" name="Jhh" value="' + hour + '" id="Jhh" size="2" maxlength="2" autocomplete="off" />';
27
+ content += '</div>';
28
+ return content;
29
+ }
30
+
31
+ function changeTimestampViewer(){
32
+ y = $('input[name=aa]').val();
33
+ m = $('select[name=mm]').val();
34
+ d = $('input[name=jj]').val();
35
+ h = $('input[name=hh]').val();
36
+ i = $('input[name=mn]').val();
37
+ //alert(y+','+m+','+d);
38
+ jd = JalaliDate.gregorianToJalali(y, m, d);
39
+ //alert(jd);
40
+ ret='';
41
+ $text = jalaliMonthNames[jd[1]]+' '+jd[2]+', '+jd[0]+' @'+h+':'+i;
42
+ for (var i = 0; i < $text.length ; i++){
43
+ if(!isNaN($text[i]) && $text[i]!=' '){
44
+ ret += String.fromCharCode($text.charCodeAt(i) + 1728);
45
+ }else{
46
+ ret += $text[i];
47
+ }
48
+ }
49
+ $('#timestamp b').text(ret);
50
+
51
+ }
52
+ /* =================================================================== */
53
+ $('#the-list').on('click', '.editinline', function() {
54
+ var tr = $(this).closest('td');
55
+ var year = tr.find('.aa').html();
56
+ if (year > 1700){
57
+ var month = tr.find('.mm').html();
58
+ var day = tr.find('.jj').html();
59
+ var hour = tr.find('.hh').html();
60
+ var min = tr.find('.mn').html();
61
+ var date = JalaliDate.gregorianToJalali(year, month, day);
62
+ // $('.jalaliDivBox').remove();
63
+ $('.inline-edit-date div').hide();
64
+ $('.inline-edit-date').prepend(timestampDivModifier(date[0], date[1], date[2], hour, min));
65
+ }
66
+ });
67
+
68
+ $('.inline-edit-date').on('keyup', '#Jhh', function(e) {
69
+ $('input[name=hh]').val($(this).val());
70
+ });
71
+
72
+ $('.inline-edit-date').on('keyup', '#Jmn', function(e) {
73
+ $('input[name=mn]').val($(this).val());
74
+ });
75
+
76
+ $('.inline-edit-date').on('keyup', '#Jaa , #Jjj', function(e) {
77
+ year = $('#Jaa').val();
78
+ month = $('#Jmm').val();
79
+ day = $('#Jjj').val();
80
+ date = JalaliDate.jalaliToGregorian(year, month, day);
81
+ $('input[name=aa]').val(date[0]);
82
+ $('select[name=mm]').val(date[1]);
83
+ $('input[name=jj]').val(date[2]);
84
+ });
85
+
86
+ $('.inline-edit-date').on('change', '#Jmm', function() {
87
+ year = $('#Jaa').val();
88
+ month = $('#Jmm').val();
89
+ day = $('#Jjj').val();
90
+ date = JalaliDate.jalaliToGregorian(year, month, day);
91
+ $('input[name=aa]').val(date[0]);
92
+ if(date[1]<10)date[1] = '0'+date[1];
93
+ $('select[name=mm]').val(date[1]);
94
+ $('input[name=jj]').val(date[2]);
95
+ });
96
+
97
+ /* =================================================================== */
98
+ /**
99
+ * in edit.php
100
+ */
101
+
102
+ $('a.edit-timestamp').on('click', function() {
103
+ var date = JalaliDate.gregorianToJalali($('#aa').val(), $('#mm').val(), $('#jj').val());
104
+ var divCnt = timestampDivModifier(date[0], date[1], date[2], $('#hh').val(), $('#mn').val());
105
+ $('#timestampdiv .timestamp-wrap').hide();
106
+ $('#timestampdiv').prepend(divCnt);
107
+ });
108
+
109
+
110
+ $('#timestampdiv .cancel-timestamp').on('click', function() {
111
+ $('.jalaliDivBox').remove();
112
+ });
113
+
114
+ $('.save-timestamp,#publish').on('click', function() {
115
+ if($('#Jhh').val()!== undefined){
116
+ $('input[name=hh]').val($('#Jhh').val());
117
+ $('input[name=mn]').val($('#Jmn').val());
118
+ year = $('#Jaa').val();
119
+ month = $('#Jmm').val();
120
+ day = $('#Jjj').val();
121
+ jDate = [year,month,day];
122
+ date = JalaliDate.jalaliToGregorian(year, month, day);
123
+ if(date[1]<10)date[1] = '0'+date[1];
124
+ $('input[name=aa]').val(date[0]);
125
+ $('select[name=mm]').val(date[1]);
126
+ $('input[name=jj]').val(date[2]);
127
+ }
128
+
129
+ setTimeout(function(){
130
+ if($('#timestampdiv .timestamp-wrap:eq(1)').hasClass('form-invalid')){
131
+ $('.jalaliDivBox').addClass('.form-invalid');
132
+ }else{
133
+ $('.jalaliDivBox').remove();
134
+ $('#timestampdiv').slideUp('fast');
135
+ $('a.edit-timestamp').slideDown('fast');
136
+ setTimeout(function(){changeTimestampViewer()},100);
137
+ }
138
+ },100);
139
+ });
140
+
141
+
142
+ /* =================================================================== */
143
+
144
+ });
assets/js/date.js ADDED
@@ -0,0 +1,265 @@
1
+ /*
2
+ * JalaliJSCalendar - Jalali Extension for Date Object
3
+ * Copyright (c) 2008 Ali Farhadi (http://farhadi.ir/)
4
+ * Released under the terms of the GNU General Public License.
5
+ * See the GPL for details (http://www.gnu.org/licenses/gpl.html).
6
+ *
7
+ * Based on code from http://farsiweb.info
8
+ */
9
+
10
+ JalaliDate = {
11
+ g_days_in_month: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
12
+ j_days_in_month: [31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29]
13
+ };
14
+
15
+ JalaliDate.jalaliToGregorian = function(j_y, j_m, j_d)
16
+ {
17
+ j_y = parseInt(j_y);
18
+ j_m = parseInt(j_m);
19
+ j_d = parseInt(j_d);
20
+ var jy = j_y-979;
21
+ var jm = j_m-1;
22
+ var jd = j_d-1;
23
+
24
+ var j_day_no = 365*jy + parseInt(jy / 33)*8 + parseInt((jy%33+3) / 4);
25
+ for (var i=0; i < jm; ++i) j_day_no += JalaliDate.j_days_in_month[i];
26
+
27
+ j_day_no += jd;
28
+
29
+ var g_day_no = j_day_no+79;
30
+
31
+ var gy = 1600 + 400 * parseInt(g_day_no / 146097); /* 146097 = 365*400 + 400/4 - 400/100 + 400/400 */
32
+ g_day_no = g_day_no % 146097;
33
+
34
+ var leap = true;
35
+ if (g_day_no >= 36525) /* 36525 = 365*100 + 100/4 */
36
+ {
37
+ g_day_no--;
38
+ gy += 100*parseInt(g_day_no/ 36524); /* 36524 = 365*100 + 100/4 - 100/100 */
39
+ g_day_no = g_day_no % 36524;
40
+
41
+ if (g_day_no >= 365)
42
+ g_day_no++;
43
+ else
44
+ leap = false;
45
+ }
46
+
47
+ gy += 4*parseInt(g_day_no/ 1461); /* 1461 = 365*4 + 4/4 */
48
+ g_day_no %= 1461;
49
+
50
+ if (g_day_no >= 366) {
51
+ leap = false;
52
+
53
+ g_day_no--;
54
+ gy += parseInt(g_day_no/ 365);
55
+ g_day_no = g_day_no % 365;
56
+ }
57
+
58
+ for (var i = 0; g_day_no >= JalaliDate.g_days_in_month[i] + (i == 1 && leap); i++)
59
+ g_day_no -= JalaliDate.g_days_in_month[i] + (i == 1 && leap);
60
+ var gm = i+1;
61
+ var gd = g_day_no+1;
62
+
63
+ return [gy, gm, gd];
64
+ }
65
+
66
+ JalaliDate.checkDate = function(j_y, j_m, j_d)
67
+ {
68
+ return !(j_y < 0 || j_y > 32767 || j_m < 1 || j_m > 12 || j_d < 1 || j_d >
69
+ (JalaliDate.j_days_in_month[j_m-1] + (j_m == 12 && !((j_y-979)%33%4))));
70
+ }
71
+
72
+ JalaliDate.gregorianToJalali = function(g_y, g_m, g_d)
73
+ {
74
+ g_y = parseInt(g_y);
75
+ g_m = parseInt(g_m);
76
+ g_d = parseInt(g_d);
77
+ var gy = g_y-1600;
78
+ var gm = g_m-1;
79
+ var gd = g_d-1;
80
+
81
+ var g_day_no = 365*gy+parseInt((gy+3) / 4)-parseInt((gy+99)/100)+parseInt((gy+399)/400);
82
+
83
+ for (var i=0; i < gm; ++i)
84
+ g_day_no += JalaliDate.g_days_in_month[i];
85
+ if (gm>1 && ((gy%4==0 && gy%100!=0) || (gy%400==0)))
86
+ /* leap and after Feb */
87
+ ++g_day_no;
88
+ g_day_no += gd;
89
+
90
+ var j_day_no = g_day_no-79;
91
+
92
+ var j_np = parseInt(j_day_no/ 12053);
93
+ j_day_no %= 12053;
94
+
95
+ var jy = 979+33*j_np+4*parseInt(j_day_no/1461);
96
+
97
+ j_day_no %= 1461;
98
+
99
+ if (j_day_no >= 366) {
100
+ jy += parseInt((j_day_no-1)/ 365);
101
+ j_day_no = (j_day_no-1)%365;
102
+ }
103
+
104
+ for (var i = 0; i < 11 && j_day_no >= JalaliDate.j_days_in_month[i]; ++i) {
105
+ j_day_no -= JalaliDate.j_days_in_month[i];
106
+ }
107
+ var jm = i+1;
108
+ var jd = j_day_no+1;
109
+
110
+
111
+ return [jy, jm, jd];
112
+ }
113
+
114
+ Date.prototype.setJalaliFullYear = function(y, m, d) {
115
+ var gd = this.getDate();
116
+ var gm = this.getMonth();
117
+ var gy = this.getFullYear();
118
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
119
+ if (y < 100) y += 1300;
120
+ j[0] = y;
121
+ if (m != undefined) {
122
+ if (m > 11) {
123
+ j[0] += Math.floor(m / 12);
124
+ m = m % 12;
125
+ }
126
+ j[1] = m + 1;
127
+ }
128
+ if (d != undefined) j[2] = d;
129
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
130
+ return this.setFullYear(g[0], g[1]-1, g[2]);
131
+ }
132
+
133
+ Date.prototype.setJalaliMonth = function(m, d) {
134
+ var gd = this.getDate();
135
+ var gm = this.getMonth();
136
+ var gy = this.getFullYear();
137
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
138
+ if (m > 11) {
139
+ j[0] += math.floor(m / 12);
140
+ m = m % 12;
141
+ }
142
+ j[1] = m+1;
143
+ if (d != undefined) j[2] = d;
144
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
145
+ return this.setFullYear(g[0], g[1]-1, g[2]);
146
+ }
147
+
148
+ Date.prototype.setJalaliDate = function(d) {
149
+ var gd = this.getDate();
150
+ var gm = this.getMonth();
151
+ var gy = this.getFullYear();
152
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
153
+ j[2] = d;
154
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
155
+ return this.setFullYear(g[0], g[1]-1, g[2]);
156
+ }
157
+
158
+ Date.prototype.getJalaliFullYear = function() {
159
+ var gd = this.getDate();
160
+ var gm = this.getMonth();
161
+ var gy = this.getFullYear();
162
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
163
+ return j[0];
164
+ }
165
+
166
+ Date.prototype.getJalaliMonth = function() {
167
+ var gd = this.getDate();
168
+ var gm = this.getMonth();
169
+ var gy = this.getFullYear();
170
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
171
+ return j[1]-1;
172
+ }
173
+
174
+ Date.prototype.getJalaliDate = function() {
175
+ var gd = this.getDate();
176
+ var gm = this.getMonth();
177
+ var gy = this.getFullYear();
178
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
179
+ return j[2];
180
+ }
181
+
182
+ Date.prototype.getJalaliDay = function() {
183
+ var day = this.getDay();
184
+ day = (day + 1) % 7;
185
+ return day;
186
+ }
187
+
188
+
189
+ /**
190
+ * Jalali UTC functions
191
+ */
192
+
193
+ Date.prototype.setJalaliUTCFullYear = function(y, m, d) {
194
+ var gd = this.getUTCDate();
195
+ var gm = this.getUTCMonth();
196
+ var gy = this.getUTCFullYear();
197
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
198
+ if (y < 100) y += 1300;
199
+ j[0] = y;
200
+ if (m != undefined) {
201
+ if (m > 11) {
202
+ j[0] += Math.floor(m / 12);
203
+ m = m % 12;
204
+ }
205
+ j[1] = m + 1;
206
+ }
207
+ if (d != undefined) j[2] = d;
208
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
209
+ return this.setUTCFullYear(g[0], g[1]-1, g[2]);
210
+ }
211
+
212
+ Date.prototype.setJalaliUTCMonth = function(m, d) {
213
+ var gd = this.getUTCDate();
214
+ var gm = this.getUTCMonth();
215
+ var gy = this.getUTCFullYear();
216
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
217
+ if (m > 11) {
218
+ j[0] += math.floor(m / 12);
219
+ m = m % 12;
220
+ }
221
+ j[1] = m+1;
222
+ if (d != undefined) j[2] = d;
223
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
224
+ return this.setUTCFullYear(g[0], g[1]-1, g[2]);
225
+ }
226
+
227
+ Date.prototype.setJalaliUTCDate = function(d) {
228
+ var gd = this.getUTCDate();
229
+ var gm = this.getUTCMonth();
230
+ var gy = this.getUTCFullYear();
231
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
232
+ j[2] = d;
233
+ var g = JalaliDate.jalaliToGregorian(j[0], j[1], j[2]);
234
+ return this.setUTCFullYear(g[0], g[1]-1, g[2]);
235
+ }
236
+
237
+ Date.prototype.getJalaliUTCFullYear = function() {
238
+ var gd = this.getUTCDate();
239
+ var gm = this.getUTCMonth();
240
+ var gy = this.getUTCFullYear();
241
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
242
+ return j[0];
243
+ }
244
+
245
+ Date.prototype.getJalaliUTCMonth = function() {
246
+ var gd = this.getUTCDate();
247
+ var gm = this.getUTCMonth();
248
+ var gy = this.getUTCFullYear();
249
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
250
+ return j[1]-1;
251
+ }
252
+
253
+ Date.prototype.getJalaliUTCDate = function() {
254
+ var gd = this.getUTCDate();
255
+ var gm = this.getUTCMonth();
256
+ var gy = this.getUTCFullYear();
257
+ var j = JalaliDate.gregorianToJalali(gy, gm+1, gd);
258
+ return j[2];
259
+ }
260
+
261
+ Date.prototype.getJalaliUTCDay = function() {
262
+ var day = this.getUTCDay();
263
+ day = (day + 1) % 7;
264
+ return day;
265
+ }
inc/index.php ADDED
@@ -0,0 +1 @@
1
+ <?php
inc/wp-jalali-admin-option.php ADDED
@@ -0,0 +1,175 @@
1
+ <?php
2
+ /**
3
+ * admin options page
4
+ */
5
+ global $ztjalali_option;
6
+ ?>
7
+
8
+ <div class="wrap">
9
+ <h2><?php _e('wp persian option', 'ztjalali'); ?></h2>
10
+ <div class="ztjalali_option_logo">
11
+ <a href="http://wp-persian.com" target="_BLANK" title="وردپرس فارسی">
12
+ <img src="<?php echo plugins_url('/assets/img/wp-jalali-80x80.png', dirname(__FILE__)); ?>" />
13
+ </a>
14
+ </div>
15
+
16
+ <form method="post">
17
+ <?php wp_nonce_field('jalali_save_options'); ?>
18
+ <table class="form-table">
19
+ <tbody>
20
+ <tr>
21
+ <th scope="row"><?php _e('date option', 'ztjalali'); ?></th>
22
+ <td>
23
+ <fieldset>
24
+ <legend class="screen-reader-text"><span><?php _e('date option', 'ztjalali'); ?></span></legend>
25
+ <label for="change_date_to_jalali">
26
+ <input type="checkbox" id="change_date_to_jalali" name="change_date_to_jalali" value="1" <?php checked($ztjalali_option['change_date_to_jalali'], TRUE); ?> />
27
+ <?php _e('change_date_to_jalali Description', 'ztjalali'); ?>
28
+ </label>
29
+ <br />
30
+ <label for="change_jdate_number_to_persian">
31
+ <input type="checkbox" id="change_jdate_number_to_persian" name="change_jdate_number_to_persian" value="1" <?php checked($ztjalali_option['change_jdate_number_to_persian'], TRUE); ?> />
32
+ <?php _e('change_jdate_number_to_persian Description', 'ztjalali'); ?>
33
+ </label>
34
+ <br />
35
+ <label for="change_url_date_to_jalali">
36
+ <input type="checkbox" id="change_url_date_to_jalali" name="change_url_date_to_jalali" value="1" <?php checked($ztjalali_option['change_url_date_to_jalali'], TRUE); ?> />
37
+ <?php _e('change_url_date_to_jalali Description', 'ztjalali'); ?>
38
+ </label>
39
+ </fieldset>
40
+ </td>
41
+ </tr>
42
+
43
+ <tr>
44
+ <th scope="row"><label for="afghan_month_name"><?php _e('month_name', 'ztjalali'); ?></label></th>
45
+ <td>
46
+ <select id="afghan_month_name" name="afghan_month_name">
47
+ <option <?php selected($ztjalali_option['afghan_month_name'], FALSE); ?> value="0"><?php _e('iran', 'ztjalali'); ?></option>
48
+ <option <?php selected($ztjalali_option['afghan_month_name'], TRUE); ?> value="1"><?php _e('afghanistan', 'ztjalali'); ?></option>
49
+ </select>
50
+ </td>
51
+ </tr>
52
+
53
+ <tr>
54
+ <th scope="row"><?php _e('number option', 'ztjalali'); ?></th>
55
+ <td>
56
+ <fieldset>
57
+ <legend class="screen-reader-text"><span><?php _e('number option', 'ztjalali'); ?></span></legend>
58
+ <label for="change_title_number_to_persian">
59
+ <input type="checkbox" id="change_title_number_to_persian" name="change_title_number_to_persian" value="1" <?php checked($ztjalali_option['change_title_number_to_persian'], TRUE); ?> />
60
+ <?php _e('change_title_number_to_persian Description', 'ztjalali'); ?>
61
+ </label>
62
+ <br />
63
+ <label for="change_content_number_to_persian">
64
+ <input type="checkbox" id="change_content_number_to_persian" name="change_content_number_to_persian" value="1" <?php checked($ztjalali_option['change_content_number_to_persian'], TRUE); ?> />
65
+ <?php _e('change_content_number_to_persian Description', 'ztjalali'); ?>
66
+ </label>
67
+ <br />
68
+ <label for="change_excerpt_number_to_persian">
69
+ <input type="checkbox" id="change_excerpt_number_to_persian" name="change_excerpt_number_to_persian" value="1" <?php checked($ztjalali_option['change_excerpt_number_to_persian'], TRUE); ?> />
70
+ <?php _e('change_excerpt_number_to_persian Description', 'ztjalali'); ?>
71
+ </label>
72
+ <br />
73
+ <label for="change_comment_number_to_persian">
74
+ <input type="checkbox" id="change_comment_number_to_persian" name="change_comment_number_to_persian" value="1" <?php checked($ztjalali_option['change_comment_number_to_persian'], TRUE); ?> />
75
+ <?php _e('change_comment_number_to_persian Description', 'ztjalali'); ?>
76
+ </label>
77
+ <br />
78
+ <label for="change_commentcount_number_to_persian">
79
+ <input type="checkbox" id="change_commentcount_number_to_persian" name="change_commentcount_number_to_persian" value="1" <?php checked($ztjalali_option['change_commentcount_number_to_persian'], TRUE); ?> />
80
+ <?php _e('change_commentcount_number_to_persian Description', 'ztjalali'); ?>
81
+ </label>
82
+ <br />
83
+ <label for="change_category_number_to_persian">
84
+ <input type="checkbox" id="change_category_number_to_persian" name="change_category_number_to_persian" value="1" <?php checked($ztjalali_option['change_category_number_to_persian'], TRUE); ?> />
85
+ <?php _e('change_category_number_to_persian Description', 'ztjalali'); ?>
86
+ </label>
87
+ <br />
88
+ <label for="change_point_to_persian">
89
+ <input type="checkbox" id="change_point_to_persian" name="change_point_to_persian" value="1" <?php checked($ztjalali_option['change_point_to_persian'], TRUE); ?> />
90
+ <?php _e('change_point_to_persian Description', 'ztjalali'); ?>
91
+ </label>
92
+ </fieldset>
93
+ </td>
94
+ </tr>
95
+
96
+ <tr>
97
+ <th scope="row"><?php _e('text option', 'ztjalali'); ?></th>
98
+ <td>
99
+ <fieldset>
100
+ <legend class="screen-reader-text"><span><?php _e('text option', 'ztjalali'); ?></span></legend>
101
+ <label for="change_arabic_to_persian">
102
+ <input type="checkbox" id="change_arabic_to_persian" name="change_arabic_to_persian" value="1" <?php checked($ztjalali_option['change_arabic_to_persian'], TRUE); ?> />
103
+ <?php _e('change_arabic_to_persian Description', 'ztjalali'); ?>
104
+ </label>
105
+ <br />
106
+ <label for="change_archive_title">
107
+ <input type="checkbox" id="change_archive_title" name="change_archive_title" value="1" <?php checked($ztjalali_option['change_archive_title'], TRUE); ?> />
108
+ <?php _e('change_archive_title Description', 'ztjalali'); ?>
109
+ </label>
110
+ </fieldset>
111
+ </td>
112
+ </tr>
113
+
114
+ <tr>
115
+ <th scope="row"><?php _e('wp-jalali option', 'ztjalali'); ?></th>
116
+ <td>
117
+ <fieldset>
118
+ <legend class="screen-reader-text"><span><?php _e('wp-jalali option', 'ztjalali'); ?></span></legend>
119
+ <label for="ztjalali_admin_style">
120
+ <input type="checkbox" id="ztjalali_admin_style" name="ztjalali_admin_style" value="1" <?php checked($ztjalali_option['ztjalali_admin_style'], TRUE); ?> />
121
+ <?php _e('ztjalali_admin_style Description', 'ztjalali'); ?>
122
+ </label>
123
+
124
+ <label for="save_changes_in_db">
125
+ <input type="checkbox" id="save_changes_in_db" name="save_changes_in_db" value="1" <?php checked($ztjalali_option['save_changes_in_db'], TRUE); ?> />
126
+ <?php _e('save_changes_in_db Description', 'ztjalali'); ?>
127
+ </label>
128
+ </fieldset>
129
+ </td>
130
+ </tr>
131
+
132
+ <tr>
133
+ <th scope="row"><label for="persian_planet"><?php _e('persian_planet', 'ztjalali'); ?></label></th>
134
+ <td>
135
+ <select id="persian_planet" name="persian_planet">
136
+ <option <?php selected($ztjalali_option['persian_planet'], FALSE); ?> value="0"><?php _e('wp-persian news Blog', 'ztjalali'); ?></option>
137
+ <option <?php selected($ztjalali_option['persian_planet'], TRUE); ?> value="1"><?php _e('wp-persian planet', 'ztjalali'); ?></option>
138
+ </select>
139
+ </td>
140
+ </tr>
141
+
142
+ <tr>
143
+ <th scope="row"><?php _e('locale option', 'ztjalali'); ?></th>
144
+ <td>
145
+ <fieldset>
146
+ <legend class="screen-reader-text"><span><?php _e('locale option', 'ztjalali'); ?></span></legend>
147
+ <label for="force_locale">
148
+ <input type="checkbox" id="force_locale" name="force_locale" value="1" <?php checked($ztjalali_option['force_locale'], TRUE); ?> />
149
+ <?php _e('force locale Description', 'ztjalali'); ?>
150
+ </label>
151
+ <br />
152
+ <label for="force_timezone">
153
+ <input type="checkbox" id="force_timezone" name="force_timezone" value="1" <?php checked($ztjalali_option['force_timezone'], TRUE); ?> />
154
+ <?php _e('force timezone Description', 'ztjalali'); ?>
155
+ </label>
156
+ </fieldset>
157
+ </td>
158
+ </tr>
159
+ <?php
160
+ /* ===================================================== * /
161
+ * input text example
162
+ <tr>
163
+ <th scope="row"><label for="blogdescription">معرفی کوتاه</label></th>
164
+ <td><input type="text" class="regular-text" value="Just another WordPress site" id="blogdescription" name="blogdescription">
165
+ <p class="description">در چند واژه بیان کنید که &zwnj;این سایت درباره&zwnj;ی چیست</p></td>
166
+ </tr>
167
+ /* ===================================================== */
168
+ ?>
169
+ </tbody>
170
+ </table>
171
+ <p class="submit">
172
+ <input type="submit" value="<?php _e('save changes', 'ztjalali'); ?>" class="button button-primary" id="save_wper_options" name="save_wper_options">
173
+ </p>
174
+ </form>
175
+ </div>
inc/wp-jalali-admin.php ADDED
@@ -0,0 +1,171 @@
1
+ <?php
2
+
3
+ /**
4
+ * register admin menu
5
+ */
6
+ add_action('admin_menu', 'ztjalali_reg_admin_meun_fn');
7
+
8
+ function ztjalali_reg_admin_meun_fn() {
9
+ global $ztjalali_admin_page;
10
+ $ztjalali_admin_page = add_menu_page(
11
+ __('wp-jalali options', 'ztjalali'), // page title
12
+ __('wp-jalali', 'ztjalali'), // menu title
13
+ 'manage_options', // user access capability
14
+ 'ztjalali_admin_page', // menu slug
15
+ 'ztjalali_admin_page_fn', //menu content function
16
+ // plugins_url('/assets/img/wp-jalali-16x16.png', dirname(__FILE__)), // menu icon
17
+ 'dashicons-ztjalali', // menu icon
18
+ 82 // menu position
19
+ );
20
+ add_submenu_page(NULL, __('wp-jalali help page', 'ztjalali'), __('wp-jalali help', 'ztjalali'), 'manage_options', 'ztjalali_help_page', 'ztjalali_help_page_fn');
21
+ // add_submenu_page('ztjalali_admin_page',__('wp-jalali help page', 'ztjalali'), __('wp-jalali help', 'ztjalali'),'manage_options','ztjalali_help_page', 'ztjalali_help_page_fn');
22
+ add_action('load-' . $ztjalali_admin_page, 'ztjalali_admin_save_option_page_fn');
23
+ }
24
+
25
+ function ztjalali_admin_page_fn() {
26
+ include JALALI_DIR . 'inc' . DIRECTORY_SEPARATOR . 'wp-jalali-admin-option.php';
27
+ }
28
+
29
+ function ztjalali_help_page_fn() {
30
+ // wp_enqueue_style( 'wp-pointer' );
31
+ // wp_enqueue_script( 'wp-pointer' );
32
+ include JALALI_DIR . 'inc' . DIRECTORY_SEPARATOR . 'wp-jalali-help-page.php';
33
+ }
34
+
35
+ function ztjalali_admin_save_option_page_fn() {
36
+ global $ztjalali_admin_page;
37
+ $screen = get_current_screen();
38
+ if ($screen->id != $ztjalali_admin_page)
39
+ return;
40
+
41
+ if (isset($_POST['save_wper_options'])) {
42
+ global $ztjalali_option;
43
+ check_admin_referer('jalali_save_options');
44
+ $ztjalali_option = array(
45
+ 'force_locale' => !empty($_POST['force_locale']),
46
+ 'force_timezone' => !empty($_POST['force_timezone']),
47
+ 'change_date_to_jalali' => !empty($_POST['change_date_to_jalali']),
48
+ 'change_jdate_number_to_persian' => !empty($_POST['change_jdate_number_to_persian']),
49
+ 'change_url_date_to_jalali' => !empty($_POST['change_url_date_to_jalali']),
50
+ 'afghan_month_name' => !empty($_POST['afghan_month_name']),
51
+ 'change_title_number_to_persian' => !empty($_POST['change_title_number_to_persian']),
52
+ 'change_content_number_to_persian' => !empty($_POST['change_content_number_to_persian']),
53
+ 'change_excerpt_number_to_persian' => !empty($_POST['change_excerpt_number_to_persian']),
54
+ 'change_comment_number_to_persian' => !empty($_POST['change_comment_number_to_persian']),
55
+ 'change_commentcount_number_to_persian' => !empty($_POST['change_commentcount_number_to_persian']),
56
+ 'change_category_number_to_persian' => !empty($_POST['change_category_number_to_persian']),
57
+ 'change_point_to_persian' => !empty($_POST['change_point_to_persian']),
58
+ 'change_arabic_to_persian' => !empty($_POST['change_arabic_to_persian']),
59
+ 'change_archive_title' => !empty($_POST['change_archive_title']),
60
+ 'save_changes_in_db' => !empty($_POST['save_changes_in_db']),
61
+ 'ztjalali_admin_style' => !empty($_POST['ztjalali_admin_style']),
62
+ 'persian_planet' => !empty($_POST['persian_planet']),
63
+ );
64
+ update_option('ztjalali_options', json_encode($ztjalali_option))
65
+ OR add_option('ztjalali_options', json_encode($ztjalali_option));
66
+ }
67
+ }
68
+
69
+ /* =================================================================== */
70
+
71
+ /**
72
+ * install help
73
+ */
74
+ add_action('admin_init', 'ztjalali_install_redirect');
75
+
76
+ function ztjalali_install_redirect() {
77
+ if (get_option('ztjalali_do_activation_redirect', false)) {
78
+ delete_option('ztjalali_do_activation_redirect');
79
+ wp_redirect(menu_page_url('ztjalali_help_page', FALSE));
80
+ }
81
+ }
82
+
83
+ /* =================================================================== */
84
+
85
+ /**
86
+ * wp planet options
87
+ */
88
+ add_filter('dashboard_primary_link', 'ztjalali_dashboard_primary_link', 111, 1);
89
+ add_filter('dashboard_primary_feed', 'ztjalali_dashboard_primary_feed', 111, 1);
90
+ add_filter('dashboard_primary_title', 'ztjalali_dashboard_primary_title', 111, 1);
91
+
92
+ add_filter('dashboard_secondary_link', 'ztjalali_dashboard_secondary_link', 111, 1);
93
+ add_filter('dashboard_secondary_feed', 'ztjalali_dashboard_secondary_feed', 111, 1);
94
+ add_filter('dashboard_secondary_title', 'ztjalali_dashboard_secondary_title', 111, 1);
95
+
96
+ global $primary_replacement, $secondary_replacement;
97
+ $primary_replacement = array(
98
+ 1 => array(
99
+ 'link' => 'http://wordpress.org/development/',
100
+ 'feed' => 'http://wordpress.org/development/feed/',
101
+ 'title' => __('WordPress Development Blog', 'ztjalali')
102
+ ),
103
+ 2 => array(
104
+ 'link' => 'http://wp-persian.com/',
105
+ 'feed' => 'http://wp-persian.com/feed/',
106
+ 'title' => __('wp-persian news Blog', 'ztjalali')
107
+ )
108
+ );
109
+ $secondary_replacement = array(
110
+ 1 => array(
111
+ 'link' => 'http://planet.wordpress.org/',
112
+ 'feed' => 'http://planet.wordpress.org/feed/',
113
+ 'title' => __('Other WordPress News', 'ztjalali')
114
+ ),
115
+ 2 => array(
116
+ 'link' => 'http://planet.wp-persian.com/',
117
+ 'feed' => 'http://planet.wp-persian.com/feed/',
118
+ 'title' => __('wp-persian planet', 'ztjalali')
119
+ )
120
+ );
121
+
122
+ function ztjalali_dashboard_primary_link($value) {
123
+ global $primary_replacement, $ztjalali_option;
124
+ if ($ztjalali_option['persian_planet']) {
125
+ return $primary_replacement[2]['link'];
126
+ }
127
+ return $value;
128
+ }
129
+
130
+ function ztjalali_dashboard_primary_feed($value) {
131
+ global $primary_replacement, $ztjalali_option;
132
+ if ($ztjalali_option['persian_planet']) {
133
+ return $primary_replacement[2]['feed'];
134
+ }
135
+ return $value;
136
+ }
137
+
138
+ function ztjalali_dashboard_primary_title($value) {
139
+ global $primary_replacement, $ztjalali_option;
140
+ if ($ztjalali_option['persian_planet']) {
141
+ return $primary_replacement[2]['title'];
142
+ }
143
+ return $value;
144
+ }
145
+
146
+ function ztjalali_dashboard_secondary_link($value) {
147
+ global $secondary_replacement, $ztjalali_option;
148
+ if ($ztjalali_option['persian_planet']) {
149
+ return $secondary_replacement[2]['link'];
150
+ }
151
+ return $value;
152
+ }
153
+
154
+ function ztjalali_dashboard_secondary_feed($value) {
155
+ global $secondary_replacement, $ztjalali_option;
156
+ if ($ztjalali_option['persian_planet']) {
157
+ return $secondary_replacement[2]['feed'];
158
+ }
159
+ return $value;
160
+ }
161
+
162
+ function ztjalali_dashboard_secondary_title($value) {
163
+ global $secondary_replacement, $ztjalali_option;
164
+ if ($ztjalali_option['persian_planet']) {
165
+ return $secondary_replacement[2]['title'];
166
+ }
167
+ return $value;
168
+ }
169
+
170
+ /* =================================================================== */
171
+
inc/wp-jalali-filters.php ADDED
@@ -0,0 +1,516 @@
1
+ <?php
2
+
3
+ /**
4
+ * define filters
5
+ */
6
+ //load options
7
+ global $ztjalali_option;
8
+
9
+ //jalali force locale
10
+ if ($ztjalali_option['force_locale'])
11
+ add_filter('locale', 'ztjalali_force_locale');
12
+
13
+ if ($ztjalali_option['force_timezone'])
14
+ date_default_timezone_set('Asia/Tehran');
15
+
16
+ //convert gregorian to jalali filter
17
+ if ($ztjalali_option['change_date_to_jalali'])
18
+ add_filter('date_i18n', 'ztjalali_ch_date_i18n', 111, 4);
19
+
20
+ //if(!defined( 'WP_ADMIN' )){
21
+ //jalali link
22
+ if ($ztjalali_option['change_url_date_to_jalali']) {
23
+ add_filter("post_link", "ztjalali_permalink_filter_fn", 10, 3);
24
+ add_action('pre_get_posts', 'ztjalali_pre_get_posts_filter_fn');
25
+ add_filter('posts_where', 'ztjalali_posts_where_filter_fn');
26
+ // add_filter('year_link', 'ztjalali_year_link_filter_fn', 10, 2);
27
+ // add_filter('month_link', 'ztjalali_month_link_filter_fn', 10, 3);
28
+ // add_filter('day_link', 'ztjalali_day_link_filter_fn', 10, 4);
29
+ }
30
+ if ($ztjalali_option['save_changes_in_db']) {
31
+ // change en number to persian number in db
32
+ if ($ztjalali_option['change_title_number_to_persian'])
33
+ add_filter('title_save_pre', 'ztjalali_ch_number_to_persian');
34
+
35
+ if ($ztjalali_option['change_content_number_to_persian'])
36
+ add_filter('content_save_pre', 'ztjalali_ch_number_to_persian');
37
+
38
+ if ($ztjalali_option['change_excerpt_number_to_persian'])
39
+ add_filter('excerpt_save_pre', 'ztjalali_ch_number_to_persian');
40
+
41
+ if ($ztjalali_option['change_comment_number_to_persian']){
42
+ add_filter('comment_save_pre', 'ztjalali_ch_number_to_persian');
43
+ add_filter('pre_comment_content', 'ztjalali_ch_number_to_persian');
44
+ }
45
+
46
+ // change arabic characters
47
+ if ($ztjalali_option['change_arabic_to_persian']) {
48
+ add_filter('content_save_pre', 'ztjalali_ch_arabic_to_persian');
49
+ add_filter('title_save_pre', 'ztjalali_ch_arabic_to_persian');
50
+ add_filter('excerpt_save_pre', 'ztjalali_ch_arabic_to_persian');
51
+
52
+ add_filter('comment_save_pre', 'ztjalali_ch_arabic_to_persian');
53
+ add_filter('pre_comment_content', 'ztjalali_ch_arabic_to_persian');
54
+ }
55
+ } else {
56
+ // change en number to persian number in visit
57
+ if ($ztjalali_option['change_title_number_to_persian'])
58
+ add_filter('the_title', 'ztjalali_ch_number_to_persian');
59
+
60
+ if ($ztjalali_option['change_content_number_to_persian'])
61
+ add_filter('the_content', 'ztjalali_ch_number_to_persian');
62
+
63
+ if ($ztjalali_option['change_excerpt_number_to_persian'])
64
+ add_filter('the_excerpt', 'ztjalali_ch_number_to_persian');
65
+
66
+ if ($ztjalali_option['change_comment_number_to_persian'])
67
+ add_filter('comment_text', 'ztjalali_ch_number_to_persian');
68
+
69
+ // change arabic characters
70
+ if ($ztjalali_option['change_arabic_to_persian']) {
71
+ add_filter('the_content', 'ztjalali_ch_arabic_to_persian');
72
+ add_filter('the_title', 'ztjalali_ch_arabic_to_persian');
73
+ add_filter('the_excerpt', 'ztjalali_ch_arabic_to_persian');
74
+ add_filter('comment_text', 'ztjalali_ch_arabic_to_persian');
75
+ }
76
+ }
77
+
78
+ if ($ztjalali_option['change_commentcount_number_to_persian'])
79
+ add_filter('comments_number', 'ztjalali_ch_number_to_persian');
80
+
81
+
82
+ if ($ztjalali_option['change_category_number_to_persian'])
83
+ add_filter('wp_list_categories', 'ztjalali_ch_number_to_persian');
84
+
85
+ if ($ztjalali_option['change_arabic_to_persian']) {
86
+ add_filter('wp_list_categories', 'ztjalali_ch_arabic_to_persian');
87
+ }
88
+
89
+ // change archive title
90
+ if ($ztjalali_option['change_archive_title'])
91
+ add_filter('wp_title', 'ztjalali_ch_archive_title', 111, 3);
92
+ //}
93
+ /* =================================================================== */
94
+
95
+ /**
96
+ * force_locale filter fn
97
+ */
98
+ function ztjalali_force_locale() {
99
+ return 'fa_IR';
100
+ }
101
+
102
+ /* =================================================================== */
103
+
104
+ /**
105
+ * convert gregorian to jalali filter handler
106
+ * @param string $j Formatted date string.
107
+ * @param string $req_format Format to display the date.
108
+ * @param int $i Unix timestamp.
109
+ * @param bool $gmt Whether to convert to GMT for time. Default false.
110
+ * @return string
111
+ */
112
+ function ztjalali_ch_date_i18n($j, $req_format, $i, $gmt) {
113
+ return jdate($req_format, $i);
114
+ }
115
+
116
+ /* =================================================================== */
117
+
118
+ /**
119
+ * change archive title filter handler
120
+ * @global array $jdate_month_name
121
+ * @global array $wp_query
122
+ * @param string $title
123
+ * @param string $sep
124
+ * @param string $seplocation
125
+ * @return string
126
+ */
127
+ function ztjalali_ch_archive_title($title, $sep, $seplocation) {
128
+ global $jdate_month_name, $wp_query;
129
+ $query = $wp_query->query;
130
+ if (is_archive() and isset($query['monthnum'])) {
131
+ if ($seplocation == 'right')
132
+ $query = array_reverse($query);
133
+ $query['name'] = get_option('blogname');
134
+ $query['monthnum'] = $jdate_month_name[intval($query['monthnum'])];
135
+ return ztjalali_ch_number_to_persian(implode(" $sep ", $query));
136
+ }elseif (is_archive() and isset($query['year'])) {
137
+ if ($seplocation == 'right')
138
+ $query = array_reverse($query);
139
+ $query['name'] = get_option('blogname');
140
+ return ztjalali_ch_number_to_persian(implode(" $sep ", $query));
141
+ }
142
+ return $title;
143
+ }
144
+
145
+ /* =================================================================== */
146
+
147
+ /**
148
+ * posts where filter handler
149
+ */
150
+ function ztjalali_posts_where_filter_fn($where) {
151
+ global $wp_query, $wpdb, $pagenow;
152
+ if (empty($wp_query->query_vars))
153
+ return $where;
154
+ $m = $hour = $minute = $second = $year = $month = $day = "";
155
+ if (isset($wp_query->query_vars['m']))
156
+ $m = $wp_query->query_vars['m'];
157
+ if (isset($wp_query->query_vars['hour']))
158
+ $hour = $wp_query->query_vars['hour'];
159
+ if (isset($wp_query->query_vars['minute']))
160
+ $minute = $wp_query->query_vars['minute'];
161
+ if (isset($wp_query->query_vars['second']))
162
+ $second = $wp_query->query_vars['second'];
163
+ if (isset($wp_query->query_vars['year']))
164
+ $year = $wp_query->query_vars['year'];
165
+ if (isset($wp_query->query_vars['monthnum']))
166
+ $month = $wp_query->query_vars['monthnum'];
167
+ if (isset($wp_query->query_vars['day']))
168
+ $day = $wp_query->query_vars['day'];
169
+
170
+ if (!empty($m)) {
171
+ $len = strlen($m);
172
+ $year = substr($m, 0, 4);
173
+ if ($len > 5)
174
+ $month = substr($m, 4, 2);
175
+ if ($len > 7)
176
+ $day = substr($m, 6, 2);
177
+ if ($len > 9)
178
+ $hour = substr($m, 8, 2);
179
+ if ($len > 11)
180
+ $minute = substr($m, 10, 2);
181
+ if ($len > 13)
182
+ $second = substr($m, 12, 2);
183
+ }
184
+ if (empty($year) || $year > 1700)
185
+ return $where;
186
+
187
+ $start_month = $start_day = $end_month = $end_day = 1;
188
+ $start_hour = $start_min = $start_sec = $end_hour = $end_min = $end_sec = '00';
189
+ $start_year = $year;
190
+ $end_year = $year + 1;
191
+
192
+ if (!empty($month)) {
193
+ $start_month = $month;
194
+ if ($month == 12)
195
+ $end_month = 1;
196
+ else
197
+ $end_month = $month + 1;
198
+
199
+ if ($end_month == 1)
200
+ $end_year = $start_year + 1;
201
+ else
202
+ $end_year = $start_year;
203
+ }
204
+ $jday_count = array(NULL, 31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 29);
205
+
206
+ if (!empty($day)) {
207
+ $start_day = $day;
208
+ if ($day == $jday_count[$month])
209
+ $end_day = 1;
210
+ else
211
+ $end_day = $day + 1;
212
+
213
+ if ($end_day == 1)
214
+ $end_month = $start_month + 1;
215
+ else
216
+ $end_month = $start_month;
217
+ }
218
+
219
+ if (!empty($hour)) {
220
+ $start_hour = $hour;
221
+ if ($hour == 24)
222
+ $end_hour = '00';
223
+ else
224
+ $end_hour = $hour + 1;
225
+
226
+ if ($end_hour == '00')
227
+ $end_day = $start_day + 1;
228
+ else
229
+ $end_day = $start_day;
230
+ }
231
+
232
+ if (!empty($minute)) {
233
+ $start_min = $minute;
234
+ if ($minute == 59)
235
+ $end_min = '00';
236
+ else
237
+ $end_min = $minute + 1;
238
+ if ($end_min == '00')
239
+ $end_hour = $start_hour + 1;
240
+ else
241
+ $end_hour = $start_hour;
242
+ }
243
+
244
+ if (!empty($second)) {
245
+ $start_sec = $second;
246
+ if ($second == 59)
247
+ $end_sec = '00';
248
+ else
249
+ $end_sec = $second + 1;
250
+ if ($end_sec == '00')
251
+ $end_min = $start_min + 1;
252
+ else
253
+ $end_min = $start_min;
254
+ }
255
+
256
+ $start_date = jalali_to_gregorian($start_year, $start_month, $start_day);
257
+ $start_date.=" $start_hour:$start_min:$start_sec";
258
+ $end_date = jalali_to_gregorian($end_year, $end_month, $end_day);
259
+ $end_date.=" $end_hour:$end_min:$end_sec";
260
+ $paterns = array('/YEAR\((.*?)post_date\s*\)\s*=\s*[0-9\']*/',
261
+ '/DAYOFMONTH\((.*?)post_date\s*\)\s*=\s*[0-9\']*/',
262
+ '/MONTH\((.*?)post_date\s*\)\s*=\s*[0-9\']*/',
263
+ '/HOUR\((.*?)post_date\s*\)\s*=\s*[0-9\']*/',
264
+ '/MINUTE\((.*?)post_date\s*\)\s*=\s*[0-9\']*/',
265
+ '/SECOND\((.*?)post_date\s*\)\s*=\s*[0-9\']*/');
266
+ foreach ($paterns as $ptn) {
267
+ $where = preg_replace($ptn, '1=1', $where);
268
+ }
269
+ $prefixp = "{$wpdb->posts}.";
270
+ $prefixp = (strpos($where, $prefixp) === false) ? '' : $prefixp;
271
+ $where .= " AND {$prefixp}post_date >= '$start_date' AND {$prefixp}post_date < '$end_date' ";
272
+ return $where;
273
+ }
274
+
275
+ /* =================================================================== */
276
+
277
+ /**
278
+ * pre get posts filter handler
279
+ * @param object $post
280
+ */
281
+ function ztjalali_pre_get_posts_filter_fn($query) {
282
+ global $wpdb;
283
+ $query_vars = $query->query;
284
+ $year = $monthnum = $day = "";
285
+ if (isset($query_vars['m']) AND $query_vars['m']>100001) {
286
+ $year= (int)(substr($query_vars['m'],0, 4));
287
+ if($year < 1700){
288
+ $monthnum= (int)(substr($query_vars['m'], 4,2));
289
+ $start_date = jalali_to_gregorian($year, $monthnum, 1);
290
+ $end_date = jalali_to_gregorian($year, $monthnum, jday_of_month($year, $monthnum));
291
+
292
+ $date_query = array(
293
+ array(
294
+ 'after' => array(
295
+ 'year' => $start_date[0],
296
+ 'month' => $start_date[1],
297
+ 'day' => $start_date[2] - 1,
298
+ ),
299
+ 'before' => array(
300
+ 'year' => $end_date[0],
301
+ 'month' => $end_date[1],
302
+ 'day' => $end_date[2] + 1,
303
+ ),
304
+ 'inclusive' => TRUE,
305
+ ),
306
+ );
307
+ $query->set('date_query', $date_query);
308
+ $query->set('m', '');
309
+ }
310
+ return $query;
311
+ }
312
+
313
+ /* ------------------------------------------------------ */
314
+
315
+ if (isset($query_vars['year']))
316
+ $year = $query_vars['year'];
317
+ if (isset($query_vars['monthnum']))
318
+ $monthnum = $query_vars['monthnum'];
319
+ if (isset($query_vars['day']))
320
+ $day = $query_vars['day'];
321
+ if($year > 1700)
322
+ return $query;
323
+ if (isset($query_vars['name'])) {
324
+ $post_date = $wpdb->get_var($wpdb->prepare("select post_date from {$wpdb->posts} where post_name=%s order by ID", $query_vars['name']));
325
+ $Date = explode('-', date('Y-m-d', strtotime($post_date)));
326
+ $jDate = gregorian_to_jalali($Date[0], $Date[1], $Date[2]);
327
+
328
+ if ($year == $jDate[0])
329
+ $query->set('year', $Date[0]);
330
+
331
+ if ($monthnum == $jDate[1])
332
+ $query->set('monthnum', $Date[1]);
333
+
334
+ if ($day == $jDate[2])
335
+ $query->set('day', $Date[2]);
336
+
337
+ return $query;
338
+ }
339
+
340
+ if (isset($query_vars['post_id'])) {
341
+ $post_date = $wpdb->get_var($wpdb->prepare("select post_date from {$wpdb->posts} where ID=%d", $query_vars['post_id']));
342
+ $cDate = getdate(strtotime($post_date));
343
+ if (!empty($year))
344
+ $query->set('year', $cDate['year']);
345
+
346
+ if (!empty($monthnum))
347
+ $query->set('monthnum', $cDate['mon']);
348
+
349
+ if (!empty($day))
350
+ $query->set('day', $cDate['mday']);
351
+
352
+ return $query;
353
+ }
354
+
355
+ if (!empty($year) and ! empty($monthnum) and ! empty($day)) {
356
+ $post_date = jalali_to_gregorian($year, $monthnum, $day);
357
+ $query->set('year', $post_date[0]);
358
+ $query->set('monthnum', $post_date[1]);
359
+ $query->set('day', $post_date[2]);
360
+ return $query;
361
+ }
362
+
363
+ if (!empty($year) and ! empty($monthnum)) {
364
+ $start_date = jalali_to_gregorian($year, $monthnum, 1);
365
+ $end_date = jalali_to_gregorian($year, $monthnum, jday_of_month($year, $monthnum));
366
+
367
+ $date_query = array(
368
+ array(
369
+ 'after' => array(
370
+ 'year' => $start_date[0],
371
+ 'month' => $start_date[1],
372
+ 'day' => $start_date[2] - 1,
373
+ ),
374
+ 'before' => array(
375
+ 'year' => $end_date[0],
376
+ 'month' => $end_date[1],
377
+ 'day' => $end_date[2] + 1,
378
+ ),
379
+ 'inclusive' => TRUE,
380
+ ),
381
+ );
382
+ $query->set('date_query', $date_query);
383
+ $query->set('year', '');
384
+ $query->set('monthnum', '');
385
+
386
+ // $post_date = jalali_to_gregorian($year, $monthnum, 15);
387
+ // $query->set('year', $post_date[0]);
388
+ // $query->set('monthnum', $post_date[1]);
389
+ return $query;
390
+ }
391
+
392
+ if (!empty($year)) {
393
+ $start_date = jalali_to_gregorian($year, 1, 1);
394
+ if (is_jalali_leap_year($year))
395
+ $end_date = jalali_to_gregorian($year, 12, 30);
396
+ else
397
+ $end_date = jalali_to_gregorian($year, 12, 29);
398
+ $date_query = array(
399
+ array(
400
+ 'after' => array(
401
+ 'year' => $start_date[0],
402
+ 'month' => $start_date[1],
403
+ 'day' => $start_date[2] - 1,
404
+ ),
405
+ 'before' => array(
406
+ 'year' => $end_date[0],
407
+ 'month' => $end_date[1],
408
+ 'day' => $end_date[2] + 1,
409
+ ),
410
+ 'inclusive' => TRUE,
411
+ ),
412
+ );
413
+ $query->set('date_query', $date_query);
414
+ $query->set('year', '');
415
+ return $query;
416
+ }
417
+
418
+ return $query;
419
+ }
420
+
421
+ /* =================================================================== */
422
+
423
+ /**
424
+ * jalali link filter handlers
425
+ * @param string $perma
426
+ * @param string $post
427
+ * @param string $leavename
428
+ */
429
+ function ztjalali_permalink_filter_fn($perma, $post, $leavename = false) {
430
+ $rewritecode = array(
431
+ '%year%',
432
+ '%monthnum%',
433
+ '%day%',
434
+ '%hour%',
435
+ '%minute%',
436
+ '%second%',
437
+ $leavename ? '' : '%postname%',
438
+ '%post_id%',
439
+ '%category%',
440
+ '%author%',
441
+ $leavename ? '' : '%pagename%',
442
+ );
443
+
444
+ $sample = true;
445
+
446
+ if (empty($post->ID))
447
+ return false;
448
+
449
+ if ($post->post_type == 'page')
450
+ return get_page_link($post->ID, $leavename, $sample);
451
+ elseif ($post->post_type == 'attachment')
452
+ return get_attachment_link($post->ID, $leavename);
453
+ elseif (in_array($post->post_type, get_post_types(array('_builtin' => false))))
454
+ return get_post_permalink($post->ID, $leavename, $sample);
455
+ $permalink = get_option('permalink_structure');
456
+
457
+ if (empty($permalink) OR in_array($post->post_status, array('draft', 'pending', 'auto-draft')))
458
+ return home_url('?p=' . $post->ID);
459
+
460
+ $unixtime = strtotime($post->post_date);
461
+ $category = "";
462
+ if (strpos($permalink, '%category%') !== false) {
463
+ $cats = get_the_category($post->ID);
464
+ if ($cats) {
465
+ usort($cats, '_usort_terms_by_ID'); // order by ID
466
+ $category_object = get_term($category_object, 'category');
467
+ $category = $category_object->slug;
468
+ if ($parent = $category_object->parent)
469
+ $category = get_category_parents($parent, false, '/', true) . $category;
470
+ }
471
+ if (empty($category)) {
472
+ $default_category = get_term(get_option('default_category'), 'category');
473
+ $category = is_wp_error($default_category) ? '' : $default_category->slug;
474
+ }
475
+ }
476
+
477
+ $author = "";
478
+ if (strpos($permalink, '%author%') !== false) {
479
+ $authordata = get_user_by($post->post_author, $user_id);
480
+ $author = $authordata->user_nicename;
481
+ }
482
+
483
+ $date = explode("-", date('Y-m-d-H-i-s', $unixtime));
484
+ $jdate = gregorian_to_jalali($date[0], $date[1], $date[2]);
485
+ $rewritereplace = array(
486
+ $jdate[0],
487
+ $jdate[1],
488
+ $jdate[2],
489
+ $date[3],
490
+ $date[4],
491
+ $date[5],
492
+ $post->post_name,
493
+ $post->ID,
494
+ $category,
495
+ $author,
496
+ $post->post_name,
497
+ );
498
+ $permalink = home_url(str_replace($rewritecode, $rewritereplace, $permalink));
499
+ return user_trailingslashit($permalink, 'single');
500
+ }
501
+
502
+ //function ztjalali_year_link_filter_fn($link, $y) {
503
+ // if ($y < 1700)
504
+ // return;
505
+ //
506
+ //}
507
+ //
508
+ //function ztjalali_month_link_filter_fn($link, $y, $m) {
509
+ //
510
+ //}
511
+ //
512
+ //function ztjalali_day_link_filter_fn($link, $y, $m, $d) {
513
+ //
514
+ //}
515
+
516
+ /* =================================================================== */
inc/wp-jalali-help-page.php ADDED
@@ -0,0 +1,85 @@
1
+ <div class="wrap about-wrap">
2
+
3
+ <h1 id="ztjalali_wellcome">به وردپرس فارسی خوش آمدید</h1>
4
+
5
+ <div class="about-text ztjalali-welcome-top">از شما بابت استفاده از بروزترین نسخه افزونه وردپرس فارسی (wp-jalali) سپاسگزاریم.
6
+ افزونه جلالی (wp-jalali) برای رفاه کاربران از ابتدا بازنویسی شده است، امیدواریم با بازخوردهای موثر ما را در انجام ماموریتمان در خدمت‌رسانی به کاربران فارسی زبان همراهی نمایید.
7
+ </div>
8
+
9
+
10
+ <a href="http://wp-persian.com/"><div class="ztjalali-badge">وردپرس فارسی</div></a>
11
+ <a href="http://zakrot.com/"><div class="zt-badge">زاکروت</div></a>
12
+ <h2 class="nav-tab-wrapper">
13
+ <a class="nav-tab nav-tab-active" href="">
14
+ وردپرس فارسی </a>
15
+ </h2>
16
+
17
+ <div class="changelog">
18
+ <div class="about-overview">
19
+ <img src="<?php echo plugins_url('/assets', dirname(__FILE__)); ?>/banner-772x250.png" class="about-overview-img">
20
+ </div>
21
+ <h2 class="about-headline-callout">نفسی تازه برای وردپرس شما</h2>
22
+
23
+
24
+ <hr>
25
+
26
+ <div class="feature-section col three-col">
27
+ <div class="col-1">
28
+ <!--<img src="//s.w.org/images/core/3.9/editor.jpg?0">-->
29
+ <h4>بهینگی</h4>
30
+ <p>با استفاده از الگورتیم‌های بروزشده سرعت افزونه بالاتر و مصرف منابع تا نصف کاهش داده شده است.</p>
31
+ </div>
32
+ <div class="col-2">
33
+ <h4>کیفیت</h4>
34
+ <p>افزونه حاضر دارای بالاترین کیفیت کدنویسی بوده و بر روی پروژه‌های متعدد سنجیده شده است.</p>
35
+ </div>
36
+ <div class="col-3 last-feature">
37
+ <h4>امنیت</h4>
38
+ <p>ما به مهمترین دغدغه کاربران برای داشتن یک افزونه امن پاسخ مثبت داده‌ایم، آسوده خاطر باشید.</p>
39
+ </div>
40
+ </div>
41
+
42
+
43
+
44
+ <h2 class="about-headline-callout">تجربه&zwnj;ی ابزارک&zwnj;های خوش&zwnj;دست&zwnj;تر</h2>
45
+
46
+
47
+ <hr>
48
+
49
+ <div class="feature-section col two-col">
50
+ <div class="col-1">
51
+ <h4>تقویم جلالی</h4>
52
+ <p>تقویم با تاریخ شمسی پیاده‌سازی شده است و به راحتی می‌توانید از این ابزارک استفاده نمایید.</p>
53
+ </div>
54
+ <div class="col-2 last-feature">
55
+ <h4>بایگانی جلالی</h4>
56
+ <p>پس از مدتی دسترسی به مطالب قبلی سخت می‌شود، با این ابزارک می‌توانید بایگانی را در دسترس کاربران قرار دهید.</p>
57
+ </div>
58
+ </div>
59
+
60
+
61
+
62
+
63
+ <hr>
64
+
65
+ </div>
66
+ </div>
67
+ <?php
68
+ //$tour_cnt = '<h3>به وردپرس فارسی خوش آمدید</h3>';
69
+ //$tour_cnt .= '<p>افزونه وردپرس فارسی با موفقیت فعال شد</p>';
70
+ ?>
71
+ <!--<script type="text/javascript">
72
+ jQuery(document).ready(function($) {
73
+ $('#toplevel_page_ztjalali_admin_page').pointer({
74
+ content: '<?php echo $tour_cnt; ?>',
75
+ position: {
76
+ edge: 'top',
77
+ align: 'center',
78
+ },
79
+ close: function() {
80
+
81
+ }
82
+ }).pointer('open');
83
+
84
+ });
85
+ </script>-->
index.php ADDED
@@ -0,0 +1 @@
1
+ <?php
languages/ztjalali-fa_IR.mo ADDED
Binary file
languages/ztjalali-fa_IR.po ADDED
@@ -0,0 +1,328 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: wp-jalali v5.0.0-RC\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-09-04 19:29-0500\n"
7
+ "Last-Translator: superadmin <info@zakrot.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: Poedit 1.6.9\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Textdomain-Support: yes\n"
18
+ "Language: fa_IR\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ # @ ztjalali
22
+ #: inc/wp-jalali-admin-option.php:9
23
+ msgid "wp persian option"
24
+ msgstr "تنظیمات وردپرس فارسی"
25
+
26
+ # @ ztjalali
27
+ #: inc/wp-jalali-admin-option.php:143 inc/wp-jalali-admin-option.php:146
28
+ msgid "locale option"
29
+ msgstr "تنظیمات منطقه و زبان"
30
+
31
+ # @ ztjalali
32
+ #: inc/wp-jalali-admin-option.php:149
33
+ msgid "force locale Description"
34
+ msgstr "آیا تمایل دارید زبان سیستم بطور پیش‌فرض فارسی باشد؟"
35
+
36
+ # @ ztjalali
37
+ #: inc/wp-jalali-admin-option.php:154
38
+ msgid "force timezone Description"
39
+ msgstr "آیا تمایل دارید ساعت پیش‌فرض ایران/تهران باشد؟"
40
+
41
+ # @ ztjalali
42
+ #: inc/wp-jalali-admin-option.php:21 inc/wp-jalali-admin-option.php:24
43
+ msgid "date option"
44
+ msgstr "تنظیمات تاریخ"
45
+
46
+ # @ ztjalali
47
+ #: inc/wp-jalali-admin-option.php:27
48
+ msgid "change_date_to_jalali Description"
49
+ msgstr "آیا تمایل دارید تاریخ های میلادی به شمسی تبدیل شود؟"
50
+
51
+ # @ ztjalali
52
+ #: inc/wp-jalali-admin-option.php:32
53
+ msgid "change_jdate_number_to_persian Description"
54
+ msgstr "آیا تمایل دارید، اعداد لاتین به فارسی تبدیل گردد؟"
55
+
56
+ # @ ztjalali
57
+ #: inc/wp-jalali-admin-option.php:37
58
+ msgid "change_url_date_to_jalali Description"
59
+ msgstr "آیا تمایل دارید نشانی(url) به شمسی تبدیل شود؟"
60
+
61
+ # @ ztjalali
62
+ #: inc/wp-jalali-admin-option.php:44
63
+ msgid "month_name"
64
+ msgstr "نام ماه‌ها مطابق با کشور"
65
+
66
+ # @ ztjalali
67
+ #: inc/wp-jalali-admin-option.php:47
68
+ msgid "iran"
69
+ msgstr "ایران"
70
+
71
+ # @ ztjalali
72
+ #: inc/wp-jalali-admin-option.php:48
73
+ msgid "afghanistan"
74
+ msgstr "افغانستان"
75
+
76
+ # @ ztjalali
77
+ #: inc/wp-jalali-admin-option.php:54 inc/wp-jalali-admin-option.php:57
78
+ msgid "number option"
79
+ msgstr "تنظیمات اعداد"
80
+
81
+ # @ ztjalali
82
+ #: inc/wp-jalali-admin-option.php:60
83
+ msgid "change_title_number_to_persian Description"
84
+ msgstr "آیا تمایل دارید اعداد در عنوان نوشته به فارسی تبدیل شوند؟"
85
+
86
+ # @ ztjalali
87
+ #: inc/wp-jalali-admin-option.php:65
88
+ msgid "change_content_number_to_persian Description"
89
+ msgstr "آیا تمایل دارید اعداد در متن نوشته به فارسی تبدیل شوند؟"
90
+
91
+ # @ ztjalali
92
+ #: inc/wp-jalali-admin-option.php:70
93
+ msgid "change_excerpt_number_to_persian Description"
94
+ msgstr "آیا تمایل دارید اعداد در خلاصه نوشته به فارسی تبدیل شوند؟"
95
+
96
+ # @ ztjalali
97
+ #: inc/wp-jalali-admin-option.php:75
98
+ msgid "change_comment_number_to_persian Description"
99
+ msgstr "آیا تمایل دارید اعداد در دیدگاه‌ها به فارسی تبدیل شوند؟"
100
+
101
+ # @ ztjalali
102
+ #: inc/wp-jalali-admin-option.php:80
103
+ msgid "change_commentcount_number_to_persian Description"
104
+ msgstr "آیا تمایل دارید اعداد در شمارنده دیدگاه‌ها به فارسی تبدیل شوند؟"
105
+
106
+ # @ ztjalali
107
+ #: inc/wp-jalali-admin-option.php:85
108
+ msgid "change_category_number_to_persian Description"
109
+ msgstr "آیا تمایل دارید اعداد در دسته‌بندی‌ها به فارسی تبدیل شوند؟"
110
+
111
+ # @ ztjalali
112
+ #: inc/wp-jalali-admin-option.php:90
113
+ msgid "change_point_to_persian Description"
114
+ msgstr "آیا تمایل دارید ممیز اعداد اعشاری از نقطه به ٫ تبدیل شود؟"
115
+
116
+ # @ ztjalali
117
+ #: inc/wp-jalali-admin-option.php:97 inc/wp-jalali-admin-option.php:100
118
+ msgid "text option"
119
+ msgstr "تنظیمات متون"
120
+
121
+ # @ ztjalali
122
+ #: inc/wp-jalali-admin-option.php:103
123
+ msgid "change_arabic_to_persian Description"
124
+ msgstr ""
125
+ " تبدیل خودکار حروف (ي) و (ك) عربی به (ی) و (ک) فارسی در هنگام نمایش و جستجوی "
126
+ "هوشمند برای تمامی ترکیب‌های ممکن در هنگام جستجو. "
127
+
128
+ # @ ztjalali
129
+ #: inc/wp-jalali-admin-option.php:108
130
+ msgid "change_archive_title Description"
131
+ msgstr "آیا تمایل دارید نام ماهها در بایگانی شمسی باشد؟"
132
+
133
+ # @ ztjalali
134
+ #: inc/wp-jalali-admin-option.php:133
135
+ msgid "persian_planet"
136
+ msgstr "چگونگی نمایش اخبار در پیش‌خوان"
137
+
138
+ # @ ztjalali
139
+ #: inc/wp-jalali-admin-option.php:136 inc/wp-jalali-admin.php:106
140
+ msgid "wp-persian news Blog"
141
+ msgstr "نمایش اخبار وردپرس فارسی"