WP ULike - Version 1.5

Version Description

  • Added: Number format option to convert numbers of Likes with string (kilobyte) format.
  • Updated: Persian language.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

assets/css/wp-ulike.css CHANGED
@@ -48,7 +48,7 @@
48
  border-radius: 3px;
49
  margin-left: 8px;
50
  font-size: 16px;
51
- font-family: Arial;
52
  }
53
 
54
  .wpulike .count-box:before {
48
  border-radius: 3px;
49
  margin-left: 8px;
50
  font-size: 16px;
51
+ font-family: Tahoma;
52
  }
53
 
54
  .wpulike .count-box:before {
inc/wp-functions.php CHANGED
@@ -100,6 +100,15 @@
100
  ";
101
  }
102
 
 
 
 
 
 
 
 
 
 
103
  //Shortcode function
104
  function wp_ulike_shortcode(){
105
  return wp_ulike('put');
100
  ";
101
  }
102
 
103
+ //Convert numbers of Likes with string (kilobyte) format.
104
+ function wp_ulike_format_number($num){
105
+ if ($num >= 1000 && get_option('wp_ulike_format_number') == '1'){
106
+ return round($num/1000, 2) . 'K+';
107
+ }
108
+ else
109
+ return $num . '+';
110
+ }
111
+
112
  //Shortcode function
113
  function wp_ulike_shortcode(){
114
  return wp_ulike('put');
inc/wp-options.php CHANGED
@@ -14,6 +14,7 @@ function wp_ulike_register_mysettings() { // whitelist options
14
  register_setting( 'wp_ulike_options', 'wp_ulike_dislike_text' );
15
  register_setting( 'wp_ulike_options', 'wp_ulike_onlyRegistered' );
16
  register_setting( 'wp_ulike_options', 'wp_ulike_user_like_box' );
 
17
  register_setting( 'wp_ulike_options', 'wp_ulike_style' );
18
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_bg' );
19
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_border' );
@@ -93,7 +94,17 @@ function wp_ulike_settings_page() {
93
  </label>
94
  <p class="description"><?php _e('Active this option to show users avatar in like box.', 'alimir'); ?></p>
95
  </td>
96
- </tr>
 
 
 
 
 
 
 
 
 
 
97
  <tr>
98
  <th scope="row"><?php _e('Custom Style', 'alimir'); ?></th>
99
  <td>
14
  register_setting( 'wp_ulike_options', 'wp_ulike_dislike_text' );
15
  register_setting( 'wp_ulike_options', 'wp_ulike_onlyRegistered' );
16
  register_setting( 'wp_ulike_options', 'wp_ulike_user_like_box' );
17
+ register_setting( 'wp_ulike_options', 'wp_ulike_format_number' );
18
  register_setting( 'wp_ulike_options', 'wp_ulike_style' );
19
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_bg' );
20
  register_setting( 'wp_ulike_options', 'wp_ulike_btn_border' );
94
  </label>
95
  <p class="description"><?php _e('Active this option to show users avatar in like box.', 'alimir'); ?></p>
96
  </td>
97
+ </tr>
98
+ <tr>
99
+ <th scope="row"><?php _e('Format Number', 'alimir'); ?></th>
100
+ <td>
101
+ <label for="wp_ulike_format_number">
102
+ <input name="wp_ulike_format_number" id="wp_ulike_format_number" type="checkbox" value="1" <?php checked( '1', get_option( 'wp_ulike_format_number' ) ); ?> />
103
+ <?php _e('Activate', 'alimir'); ?>
104
+ </label>
105
+ <p class="description"><?php _e('Convert numbers of Likes with string (kilobyte) format.', 'alimir'); ?><strong> (if -> likes>=1000)</strong></p>
106
+ </td>
107
+ </tr>
108
  <tr>
109
  <th scope="row"><?php _e('Custom Style', 'alimir'); ?></th>
110
  <td>
inc/wp-widget.php CHANGED
@@ -25,7 +25,7 @@ class wp_ulike_posts_widget extends WP_Widget {
25
  $post_count = $post->meta_value;
26
 
27
  echo $before.'<a href="' . $permalink . '" title="' . $post_title.'" rel="nofollow">' . $post_title . '</a>';
28
- echo $show_count == '1' ? ' ('.$post_count.')' : '';
29
  echo $after;
30
  }
31
  }
25
  $post_count = $post->meta_value;
26
 
27
  echo $before.'<a href="' . $permalink . '" title="' . $post_title.'" rel="nofollow">' . $post_title . '</a>';
28
+ echo $show_count == '1' ? ' ('.wp_ulike_format_number($post_count).')' : '';
29
  echo $after;
30
  }
31
  }
lang/alimir-fa_IR.mo CHANGED
Binary file
lang/alimir-fa_IR.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
- "POT-Creation-Date: 2014-10-02 18:09+0330\n"
5
- "PO-Revision-Date: 2014-10-02 18:16+0330\n"
6
  "Last-Translator: Alimir <info@alimir.ir>\n"
7
  "Language-Team: alimir.ir <info@alimir.ir>\n"
8
  "Language: fa_IR\n"
@@ -44,19 +44,19 @@ msgstr "شما این را پسندیده اید"
44
  msgid "You Dislike This"
45
  msgstr "شما این را نپسندیده اید"
46
 
47
- #: ../wp-ulike.php:115 ../wp-ulike.php:131
48
  msgid "Already Voted"
49
  msgstr "قبلا لایک کرده اید"
50
 
51
- #: ../wp-ulike.php:143
52
  msgid "Users who have LIKED this post:"
53
  msgstr "کاربرانی که این مطلب را پسندیده اند:"
54
 
55
- #: ../wp-ulike.php:155
56
  msgid "You need to login in order to like this post: "
57
  msgstr "برای امتیاز دهی به این مطلب، لطفا وارد شوید: "
58
 
59
- #: ../wp-ulike.php:155
60
  msgid "click here"
61
  msgstr "برای ورود کلیک کنید"
62
 
@@ -64,11 +64,11 @@ msgstr "برای ورود کلیک کنید"
64
  msgid "WP Ulike"
65
  msgstr "تنظیمات افزونه یولایک"
66
 
67
- #: ../inc/wp-options.php:31
68
  msgid "Configuration"
69
  msgstr "پیکربندی"
70
 
71
- #: ../inc/wp-options.php:37
72
  msgid "Image or text?"
73
  msgstr "متن یا تصویر؟"
74
 
@@ -119,6 +119,7 @@ msgid "Show Users Like Box"
119
  msgstr "نمایش باکس کاربران لایک کرده"
120
 
121
  #: ../inc/wp-options.php:93 ../inc/wp-options.php:103
 
122
  msgid "Activate"
123
  msgstr "فعال سازی"
124
 
@@ -129,40 +130,50 @@ msgstr ""
129
  "مطلب، نمایش دهید."
130
 
131
  #: ../inc/wp-options.php:99
 
 
 
 
 
 
 
 
 
 
132
  msgid "Custom Style"
133
  msgstr "سفارشی سازی"
134
 
135
- #: ../inc/wp-options.php:105
136
  msgid "Active this option to see custom color settings."
137
  msgstr ""
138
  "با فعال سازی این گزینه، می توانید رنگ های دلخواه خود را در افزونه به کار "
139
  "ببرید."
140
 
141
- #: ../inc/wp-options.php:109
142
  msgid "Button style"
143
  msgstr "دکمه لایک"
144
 
145
- #: ../inc/wp-options.php:114 ../inc/wp-options.php:131
146
  msgid "Background"
147
  msgstr "رنگ پس زمینه"
148
 
149
- #: ../inc/wp-options.php:118 ../inc/wp-options.php:135
150
  msgid "Border Color"
151
  msgstr "رنگ حاشیه"
152
 
153
- #: ../inc/wp-options.php:122 ../inc/wp-options.php:139
154
  msgid "Text Color"
155
  msgstr "رنگ متن"
156
 
157
- #: ../inc/wp-options.php:126
158
  msgid "Counter Style"
159
  msgstr "باکس شمارنده"
160
 
161
- #: ../inc/wp-options.php:149
162
  msgid "Like this plugin?"
163
  msgstr "این پلاگین چندتا لایک داره؟!؟ :)"
164
 
165
- #: ../inc/wp-options.php:152
166
  msgid ""
167
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
168
  "wp-ulike\"> Plugin Directory reviews</a>"
@@ -170,14 +181,14 @@ msgstr ""
170
  "حمایتتون رو از این افزونه، با امتیاز 5 ستاره در <a href=\"http://wordpress."
171
  "org/plugins/wp-ulike\">مخزن وردپرس</a> مشخص کنید..."
172
 
173
- #: ../inc/wp-options.php:153
174
  msgid ""
175
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
176
  msgstr ""
177
  "دنیای وردپرس و برنامه نویسی را در <a href=\"https://www.facebook.com/alimir."
178
  "ir\"> فیسبوک</a> دنبال کنید..."
179
 
180
- #: ../inc/wp-options.php:154
181
  msgid ""
182
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
183
  "World.</a>"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WP ULike\n"
4
+ "POT-Creation-Date: 2014-10-15 18:38+0330\n"
5
+ "PO-Revision-Date: 2014-10-15 18:38+0330\n"
6
  "Last-Translator: Alimir <info@alimir.ir>\n"
7
  "Language-Team: alimir.ir <info@alimir.ir>\n"
8
  "Language: fa_IR\n"
44
  msgid "You Dislike This"
45
  msgstr "شما این را نپسندیده اید"
46
 
47
+ #: ../wp-ulike.php:121 ../wp-ulike.php:137
48
  msgid "Already Voted"
49
  msgstr "قبلا لایک کرده اید"
50
 
51
+ #: ../wp-ulike.php:149
52
  msgid "Users who have LIKED this post:"
53
  msgstr "کاربرانی که این مطلب را پسندیده اند:"
54
 
55
+ #: ../wp-ulike.php:161
56
  msgid "You need to login in order to like this post: "
57
  msgstr "برای امتیاز دهی به این مطلب، لطفا وارد شوید: "
58
 
59
+ #: ../wp-ulike.php:161
60
  msgid "click here"
61
  msgstr "برای ورود کلیک کنید"
62
 
64
  msgid "WP Ulike"
65
  msgstr "تنظیمات افزونه یولایک"
66
 
67
+ #: ../inc/wp-options.php:32
68
  msgid "Configuration"
69
  msgstr "پیکربندی"
70
 
71
+ #: ../inc/wp-options.php:38
72
  msgid "Image or text?"
73
  msgstr "متن یا تصویر؟"
74
 
119
  msgstr "نمایش باکس کاربران لایک کرده"
120
 
121
  #: ../inc/wp-options.php:93 ../inc/wp-options.php:103
122
+ #: ../inc/wp-options.php:113
123
  msgid "Activate"
124
  msgstr "فعال سازی"
125
 
130
  "مطلب، نمایش دهید."
131
 
132
  #: ../inc/wp-options.php:99
133
+ msgid "Format Number"
134
+ msgstr "فرمت اعداد"
135
+
136
+ #: ../inc/wp-options.php:105
137
+ msgid "Convert numbers of Likes with string (kilobyte) format."
138
+ msgstr ""
139
+ "با فعال سازی این گزینه، می توانید اعداد بالای 1000 را با فرمت رشته ای "
140
+ "(کیلوبایت) نمایش دهید."
141
+
142
+ #: ../inc/wp-options.php:109
143
  msgid "Custom Style"
144
  msgstr "سفارشی سازی"
145
 
146
+ #: ../inc/wp-options.php:115
147
  msgid "Active this option to see custom color settings."
148
  msgstr ""
149
  "با فعال سازی این گزینه، می توانید رنگ های دلخواه خود را در افزونه به کار "
150
  "ببرید."
151
 
152
+ #: ../inc/wp-options.php:119
153
  msgid "Button style"
154
  msgstr "دکمه لایک"
155
 
156
+ #: ../inc/wp-options.php:124 ../inc/wp-options.php:141
157
  msgid "Background"
158
  msgstr "رنگ پس زمینه"
159
 
160
+ #: ../inc/wp-options.php:128 ../inc/wp-options.php:145
161
  msgid "Border Color"
162
  msgstr "رنگ حاشیه"
163
 
164
+ #: ../inc/wp-options.php:132 ../inc/wp-options.php:149
165
  msgid "Text Color"
166
  msgstr "رنگ متن"
167
 
168
+ #: ../inc/wp-options.php:136
169
  msgid "Counter Style"
170
  msgstr "باکس شمارنده"
171
 
172
+ #: ../inc/wp-options.php:159
173
  msgid "Like this plugin?"
174
  msgstr "این پلاگین چندتا لایک داره؟!؟ :)"
175
 
176
+ #: ../inc/wp-options.php:162
177
  msgid ""
178
  "Show your support by Rating 5 Star in <a href=\"http://wordpress.org/plugins/"
179
  "wp-ulike\"> Plugin Directory reviews</a>"
181
  "حمایتتون رو از این افزونه، با امتیاز 5 ستاره در <a href=\"http://wordpress."
182
  "org/plugins/wp-ulike\">مخزن وردپرس</a> مشخص کنید..."
183
 
184
+ #: ../inc/wp-options.php:163
185
  msgid ""
186
  "Follow me on <a href=\"https://www.facebook.com/alimir.ir\"> Facebook</a>"
187
  msgstr ""
188
  "دنیای وردپرس و برنامه نویسی را در <a href=\"https://www.facebook.com/alimir."
189
  "ir\"> فیسبوک</a> دنبال کنید..."
190
 
191
+ #: ../inc/wp-options.php:164
192
  msgid ""
193
  "Plugin Author Blog: <a href=\"http://alimir.ir\"> Wordpress & Programming "
194
  "World.</a>"
readme.txt CHANGED
@@ -5,7 +5,7 @@ Author: Ali Mirzaei
5
  Tags: wp ulike, wordpress youlike plugin, like button, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
- Stable tag: 1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -13,7 +13,7 @@ WP ULike plugin allows to integrate Ajax Like Button into your WordPress website
13
 
14
  == Description ==
15
 
16
- WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and dislike pages and posts. Its very simple to use and support a widget to display the most liked posts.
17
 
18
  = Demo =
19
 
@@ -64,6 +64,10 @@ Screenshots are available in <a href="http://preview.alimir.ir/wp-ulike-plugin"
64
 
65
  == Changelog ==
66
 
 
 
 
 
67
  = 1.4 =
68
  * Added: Shortcode support.
69
 
5
  Tags: wp ulike, wordpress youlike plugin, like button, rating, vote, voting, most liked posts, wordpress like page, wordpress like post, wordpress vote page, wordpress vote post, wp like page, wp like post, wp like plugin
6
  Requires at least: 3.0
7
  Tested up to: 4.0
8
+ Stable tag: 1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
13
 
14
  == Description ==
15
 
16
+ WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and dislike pages and posts. Its very simple to use and support a widget to display the most liked posts.
17
 
18
  = Demo =
19
 
64
 
65
  == Changelog ==
66
 
67
+ = 1.5 =
68
+ * Added: Number format option to convert numbers of Likes with string (kilobyte) format.
69
+ * Updated: Persian language.
70
+
71
  = 1.4 =
72
  * Added: Shortcode support.
73
 
wp-ulike.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name:WP ULike
4
  Plugin URI: http://wordpress.org/plugins/wp-ulike
5
  Description: WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages and posts. Its very simple to use and support a widget to display the most liked posts.
6
- Version: 1.4
7
  Author: Ali Mirzaei
8
  Author URI: http://about.alimir.ir
9
  Text Domain: alimir
@@ -56,6 +56,7 @@ License: GPL2
56
  add_option('wp_ulike_text', __('Like','alimir'), '', 'yes');
57
  add_option('wp_ulike_btn_text', __('You Like This','alimir'), '', 'yes');
58
  add_option('wp_ulike_dislike_text', __('You Dislike This','alimir'), '', 'yes');
 
59
  add_option('wp_ulike_style', '0', '', 'yes');
60
  }
61
 
@@ -78,6 +79,7 @@ License: GPL2
78
  delete_option('wp_ulike_text');
79
  delete_option('wp_ulike_btn_text');
80
  delete_option('wp_ulike_dislike_text');
 
81
  delete_option('wp_ulike_style');
82
  }
83
 
@@ -89,7 +91,8 @@ License: GPL2
89
  global $post,$wpdb,$user_ID;
90
  $post_ID = $post->ID;
91
  $counter = '';
92
- $liked = get_post_meta($post_ID, '_liked', true) != '' ? '+' . get_post_meta($post_ID, '_liked', true) : '0';
 
93
 
94
  if ( (get_option('wp_ulike_onlyRegistered') != '1') or (get_option('wp_ulike_onlyRegistered') == '1' && is_user_logged_in()) ){
95
 
@@ -180,7 +183,7 @@ License: GPL2
180
  $wpdb->query("INSERT INTO ".$wpdb->prefix."ulike VALUES ('', '$post_ID', NOW(), '$ip', '$user_ID', 'like')");
181
  endif;
182
 
183
- echo '+' . $newLike;
184
  }
185
  else if ($user_status != 0) {
186
  if(get_user_status($post_ID,$user_ID) == "like"){
@@ -193,7 +196,7 @@ License: GPL2
193
  WHERE post_id = '$post_ID' AND user_id = '$user_ID'
194
  ");
195
 
196
- echo '+' . $newLike;
197
  }
198
  else{
199
  $newLike = $like + 1;
@@ -205,11 +208,11 @@ License: GPL2
205
  WHERE post_id = '$post_ID' AND user_id = '$user_ID'
206
  ");
207
 
208
- echo '+' . $newLike;
209
  }
210
  }
211
  else if (isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
212
- echo '+' . $like;
213
  }
214
  }
215
  die();
3
  Plugin Name:WP ULike
4
  Plugin URI: http://wordpress.org/plugins/wp-ulike
5
  Description: WP ULike plugin allows to integrate Like Button into your WordPress website to allow your visitors to like pages and posts. Its very simple to use and support a widget to display the most liked posts.
6
+ Version: 1.5
7
  Author: Ali Mirzaei
8
  Author URI: http://about.alimir.ir
9
  Text Domain: alimir
56
  add_option('wp_ulike_text', __('Like','alimir'), '', 'yes');
57
  add_option('wp_ulike_btn_text', __('You Like This','alimir'), '', 'yes');
58
  add_option('wp_ulike_dislike_text', __('You Dislike This','alimir'), '', 'yes');
59
+ add_option('wp_ulike_format_number', '0', '', 'yes');
60
  add_option('wp_ulike_style', '0', '', 'yes');
61
  }
62
 
79
  delete_option('wp_ulike_text');
80
  delete_option('wp_ulike_btn_text');
81
  delete_option('wp_ulike_dislike_text');
82
+ delete_option('wp_ulike_format_number');
83
  delete_option('wp_ulike_style');
84
  }
85
 
91
  global $post,$wpdb,$user_ID;
92
  $post_ID = $post->ID;
93
  $counter = '';
94
+ $get_like = get_post_meta($post_ID, '_liked', true) != '' ? get_post_meta($post_ID, '_liked', true) : '0';
95
+ $liked = wp_ulike_format_number($get_like);
96
 
97
  if ( (get_option('wp_ulike_onlyRegistered') != '1') or (get_option('wp_ulike_onlyRegistered') == '1' && is_user_logged_in()) ){
98
 
183
  $wpdb->query("INSERT INTO ".$wpdb->prefix."ulike VALUES ('', '$post_ID', NOW(), '$ip', '$user_ID', 'like')");
184
  endif;
185
 
186
+ echo wp_ulike_format_number($newLike);
187
  }
188
  else if ($user_status != 0) {
189
  if(get_user_status($post_ID,$user_ID) == "like"){
196
  WHERE post_id = '$post_ID' AND user_id = '$user_ID'
197
  ");
198
 
199
+ echo wp_ulike_format_number($newLike);
200
  }
201
  else{
202
  $newLike = $like + 1;
208
  WHERE post_id = '$post_ID' AND user_id = '$user_ID'
209
  ");
210
 
211
+ echo wp_ulike_format_number($newLike);
212
  }
213
  }
214
  else if (isset($_COOKIE['liked-'.$post_ID]) && $user_status == 0){
215
+ echo wp_ulike_format_number($like);
216
  }
217
  }
218
  die();