Version Description
Download this release
Release Info
Developer | Gonahkar |
Plugin | wp-jalali |
Version | 4.2.1 |
Comparing to | |
See all releases |
Code changes from version 4.2 to 4.2.1
- inc/editjalali-core.php +47 -48
- inc/farsinum-core.php +1 -1
- readme.txt +2 -2
- screenshot-1.png +0 -0
- wp-jalali.php +6 -6
inc/editjalali-core.php
CHANGED
@@ -13,7 +13,8 @@ function jalali_touch_time( $edit = 1, $for_post = 1 ) {
|
|
13 |
$hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );
|
14 |
$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
|
15 |
$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );
|
16 |
-
|
|
|
17 |
$jalali_time = gregorian_to_jalali($aa,$mm,$jj);
|
18 |
$jy = $jalali_time[0];
|
19 |
$jm = $jalali_time[1];
|
@@ -21,56 +22,54 @@ function jalali_touch_time( $edit = 1, $for_post = 1 ) {
|
|
21 |
|
22 |
echo "\n<script type=\"text/javascript\" src=\"" . get_option('siteurl') ."/wp-content/plugins/wp-jalali/inc/js/editjalali.js\"></script>\n";
|
23 |
?>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
text-align: right;
|
28 |
-
}
|
29 |
-
</style>
|
30 |
<script type="text/javascript">
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
function inject_jalali_div() { // injecting jalali input boxes and month list under the default georgian date place
|
49 |
-
jQuery("#timestampdiv *").hide();
|
50 |
-
jQuery("#timestampdiv").append('<div id="jalalitimestamp"></div>');
|
51 |
-
jQuery("#jalalitimestamp").append('<select tabindex="501" onchange="jalali_timestamp_func()" name="jm" id="jm_select"></select> ');
|
52 |
-
<?php
|
53 |
-
for ( $i = 1; $i < 13; $i = $i +1 ) {
|
54 |
-
echo "\tjQuery(\"#jm_select\").append('<option value=\"$i\" id=\"jm_$i\">$j_month_name[$i]</option>');\n";
|
55 |
}
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
}
|
67 |
-
|
68 |
-
}
|
69 |
-
</script>
|
70 |
-
<script type="text/javascript">
|
71 |
-
jQuery(document).ready(function() {
|
72 |
-
inject_jalali_div();
|
73 |
-
});
|
74 |
</script>
|
75 |
<?php
|
76 |
|
13 |
$hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );
|
14 |
$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
|
15 |
$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );
|
16 |
+
|
17 |
+
// making jalali date from post time/current time
|
18 |
$jalali_time = gregorian_to_jalali($aa,$mm,$jj);
|
19 |
$jy = $jalali_time[0];
|
20 |
$jm = $jalali_time[1];
|
22 |
|
23 |
echo "\n<script type=\"text/javascript\" src=\"" . get_option('siteurl') ."/wp-content/plugins/wp-jalali/inc/js/editjalali.js\"></script>\n";
|
24 |
?>
|
25 |
+
|
26 |
+
<style>#jmonths {direction:rtl;text-align: right}</style>
|
27 |
+
|
|
|
|
|
|
|
28 |
<script type="text/javascript">
|
29 |
+
|
30 |
+
function jalali_timestamp_func() {
|
31 |
+
var jd = jQuery('#jd').attr('value');
|
32 |
+
var jy = jQuery('#jy').attr('value');
|
33 |
+
var jm = jQuery('select#jm_select > option:selected').attr('value');
|
34 |
+
if(!jd) jd = <?php echo $jd; ?>;
|
35 |
+
if(!jm) jm = <?php echo $jm; ?>;
|
36 |
+
if(!jy) jy = <?php echo $jy; ?>;
|
37 |
+
var j_time_array = new Array(jy,jm,jd);
|
38 |
+
var j2g = jalali_to_gregorian(j_time_array);
|
39 |
+
var gy = j2g[0];
|
40 |
+
var gm = j2g[1];
|
41 |
+
var gd = j2g[2];
|
42 |
+
jQuery('#jj').attr('value',gd);
|
43 |
+
jQuery('#aa').attr('value',gy);
|
44 |
+
if(gm<10) gm = "0"+gm;
|
45 |
+
jQuery('select[@name=mm] > option[value='+gm+']').attr('selected','selected');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
+
|
48 |
+
// injecting jalali input boxes and month list under the default georgian date place
|
49 |
+
function inject_jalali_div() {
|
50 |
+
jQuery("#timestampdiv *").hide();
|
51 |
+
jQuery("#timestampdiv").append('<div id="jalalitimestamp"></div>');
|
52 |
+
jQuery("#jalalitimestamp").append('<select tabindex="501" onchange="jalali_timestamp_func()" name="jm" id="jm_select"></select> ');
|
53 |
+
<?php
|
54 |
+
for ( $i = 1; $i < 13; $i = $i +1 ) {
|
55 |
+
if($i == $jm) $selected_month = 'selected="selected"';
|
56 |
+
echo "\tjQuery(\"#jm_select\").append('<option $selected_month value=\"$i\" id=\"jm_$i\">$j_month_name[$i]</option>');\n";
|
57 |
+
$selected_month = '';
|
58 |
+
}
|
59 |
+
?>
|
60 |
+
jQuery("#jalalitimestamp").append('<input tabindex="502" type="text" id="jd" name="jd" value="<?php echo $jd; ?>" size="2" maxlength="2" onchange="jalali_timestamp_func()"/> ');
|
61 |
+
jQuery("#jalalitimestamp").append('<input tabindex="500" type="text" id="jy" name="jy" value="<?php echo $jy ?>" size="4" maxlength="5" onchange="jalali_timestamp_func()" />');
|
62 |
+
jQuery("#jalalitimestamp").append('<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="jalali_timestamp_func()" />');
|
63 |
+
jQuery("#jalalitimestamp").append('<br />ساعت: <input tabindex="503" type="text" id="hh" name="hh" value="<?php echo $hh ?>" size="2" maxlength="2" onchange="jalali_timestamp_func()" /> : <input tabindex="504" type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="jalali_timestamp_func()" /> دقیقه');
|
64 |
+
|
65 |
+
jQuery("select#mm, input#jj, input#aa").attr("onchange","georgian_timestamp_func()");
|
66 |
+
<?php
|
67 |
+
if ( $edit ) {
|
68 |
+
echo "jQuery(\"a.edit-timestamp\").before('" . farsi_num(sprintf( __('<br /> %2$s %1$s / %3$s در %4$s:%5$s' ), $j_month_name[$jm], $jd, $jy, $hh, $mn )) . " <br />');\n";
|
69 |
+
}
|
70 |
+
?>
|
71 |
}
|
72 |
+
inject_jalali_div();
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
</script>
|
74 |
<?php
|
75 |
|
inc/farsinum-core.php
CHANGED
@@ -8,7 +8,7 @@ function convertToFarsi($matches) {
|
|
8 |
$mps_jd_decimal = $mps_jd_optionsDB['mps_jd_decimal'];
|
9 |
if($mps_jd_decimal == true)
|
10 |
//$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "<sub><small>/</small></sub>");
|
11 |
-
$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "
|
12 |
else
|
13 |
$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", ".");
|
14 |
|
8 |
$mps_jd_decimal = $mps_jd_optionsDB['mps_jd_decimal'];
|
9 |
if($mps_jd_decimal == true)
|
10 |
//$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "<sub><small>/</small></sub>");
|
11 |
+
$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "٫");
|
12 |
else
|
13 |
$farsi_array = array("۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", ".");
|
14 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ 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: 2.8
|
7 |
-
Stable tag: 4.2
|
8 |
|
9 |
Turn you Wordpress into a full featured Persian (Iranian) Blogging Platform.
|
10 |
|
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: 2.8
|
7 |
+
Stable tag: 4.2.1
|
8 |
|
9 |
Turn you Wordpress into a full featured Persian (Iranian) Blogging Platform.
|
10 |
|
screenshot-1.png
CHANGED
Binary file
|
wp-jalali.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: wp-jalali
|
4 |
Plugin URI: http://wp-persian.com/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.2
|
7 |
Author: Vali Allah(Mani) Monajjemi
|
8 |
Author URI: http://www.manionline.org/
|
9 |
*/
|
@@ -268,16 +268,16 @@ function mps_jd_optionpage(){
|
|
268 |
</td>
|
269 |
</tr>
|
270 |
<tr>
|
271 |
-
<th scope="row">استفاده از <code
|
272 |
<td>
|
273 |
<select name="mps_jd_decimal" id="mps_jd_decimal">
|
274 |
<option value="1" <?=$mps_jd_decimal==true? 'selected="selected"':'' ?>>بله</option>
|
275 |
<option value="0" <?=$mps_jd_decimal==false?'selected="selected"':'' ?>>خیر</option>
|
276 |
</select>
|
277 |
<br />
|
278 |
-
<strong>مثال:</strong> استفاده از
|
279 |
<br />
|
280 |
-
<strong>توضیح:</strong> همانطور که میدانیم نشانهی اعشار در فارسی
|
281 |
</td>
|
282 |
</tr>
|
283 |
<tr valign="top">
|
@@ -288,7 +288,7 @@ function mps_jd_optionpage(){
|
|
288 |
<option value="0" <?=$mps_jd_mcertl==false?'selected="selected"':'' ?>>چپ به راست</option>
|
289 |
</select>
|
290 |
<br />
|
291 |
-
در نگارشهای بالاتر از وردپرس
|
292 |
</td>
|
293 |
</tr>
|
294 |
<tr valign="top">
|
@@ -321,7 +321,7 @@ function mps_jd_optionpage(){
|
|
321 |
<option value="0" <?=$mps_jd_editjalali==false?'selected="selected"':'' ?>>میلادی</option>
|
322 |
</select>
|
323 |
<br />
|
324 |
-
در نگارشهای بالاتر از وردپرس
|
325 |
</td>
|
326 |
</tr>
|
327 |
</table>
|
3 |
Plugin Name: wp-jalali
|
4 |
Plugin URI: http://wp-persian.com/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.2.1
|
7 |
Author: Vali Allah(Mani) Monajjemi
|
8 |
Author URI: http://www.manionline.org/
|
9 |
*/
|
268 |
</td>
|
269 |
</tr>
|
270 |
<tr>
|
271 |
+
<th scope="row">استفاده از <code>٫</code> بهجای نقطه بهعنوان نشانهی اعداد اعشاری</th>
|
272 |
<td>
|
273 |
<select name="mps_jd_decimal" id="mps_jd_decimal">
|
274 |
<option value="1" <?=$mps_jd_decimal==true? 'selected="selected"':'' ?>>بله</option>
|
275 |
<option value="0" <?=$mps_jd_decimal==false?'selected="selected"':'' ?>>خیر</option>
|
276 |
</select>
|
277 |
<br />
|
278 |
+
<strong>مثال:</strong> استفاده از ۲٫۶ بهجای ۲<span lang="en">.</span>۶
|
279 |
<br />
|
280 |
+
<strong>توضیح:</strong> همانطور که میدانیم نشانهی اعشار در فارسی (٫) است٬ اما بهدلیل ناسازگاری برخی مرورگرها با اعداد ممیزدار٬ این گزینه را بهانتخاب کاربران گذاشتیم.
|
281 |
</td>
|
282 |
</tr>
|
283 |
<tr valign="top">
|
288 |
<option value="0" <?=$mps_jd_mcertl==false?'selected="selected"':'' ?>>چپ به راست</option>
|
289 |
</select>
|
290 |
<br />
|
291 |
+
در نگارشهای بالاتر از وردپرس ۲٫۳ در صورتی که زبان وردپرس خود را فارسی انتخاب کنید، جهت ویرایشگر به صورت خودکار راست به چپ خواهد بود. در این نگارشها تنها در صورتی از این گزینه استفاده کنید که زبان وردپرس خود را انگلیسی انتخاب کرده باشید.
|
292 |
</td>
|
293 |
</tr>
|
294 |
<tr valign="top">
|
321 |
<option value="0" <?=$mps_jd_editjalali==false?'selected="selected"':'' ?>>میلادی</option>
|
322 |
</select>
|
323 |
<br />
|
324 |
+
در نگارشهای بالاتر از وردپرس ۲٫۵ می توانید نحوه ویرایش تاریخ نوشتهها و برگهها را تنظیم کنید.
|
325 |
</td>
|
326 |
</tr>
|
327 |
</table>
|