Comments – wpDiscuz - Version 2.1.4

Version Description

  • Added: CSS classes for blog users titles by rank
  • Fixed Bug: Phrases saving issue
Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 2.1.4
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.4

comment-form/form.php CHANGED
@@ -146,9 +146,12 @@ $header_text .= ' "' . get_the_title($post) . '"';
146
  <?php } ?>
147
  <div class="wc_notification_checkboxes">
148
  <?php
 
 
149
  if ($current_user->ID && $wc_core->wc_db_helper->wc_has_post_notification($post->ID, $current_user->user_email)) {
 
150
  ?>
151
- <label class="wc-label-comment-notify" style="cursor: default;"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_post']; ?> | <a href="<?php echo $wc_core->wc_db_helper->wc_unsubscribe_link($post->ID, $current_user->user_email, 'post'); ?>" rel="nofollow" class="unsubscribe"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe']; ?></a></label>
152
  <?php
153
  } else {
154
  if ($wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) {
@@ -158,10 +161,10 @@ $header_text .= ' "' . get_the_title($post) . '"';
158
  $none_status = 'checked="checked"';
159
  $post_sub_status = '';
160
  }
161
-
162
  if ($current_user->ID && $wc_core->wc_db_helper->wc_has_all_comments_notification($post->ID, $current_user->user_email)) {
 
163
  ?>
164
- <label class="wc-label-all-reply-notify" style="cursor: default;"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment']; ?> | <a href="<?php echo $wc_core->wc_db_helper->wc_unsubscribe_link($post->ID, $current_user->user_email, 'all_comment'); ?>" rel="nofollow" class="unsubscribe"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe']; ?></a></label><br/>
165
  <?php
166
  } else {
167
  if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox || $wc_core->wc_options->wc_options_serialized->wc_show_hide_all_reply_checkbox || $wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
@@ -251,7 +254,7 @@ $header_text .= ' "' . get_the_title($post) . '"';
251
  <?php if (comments_open($post->ID)) { ?>
252
  <?php if ($wc_core->wc_options->wc_options_serialized->wc_show_plugin_powerid_by) { ?>
253
  <div class="by-wpdiscuz"><span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
254
- document.getElementById("awpdiscuz").style.display = "none";'><img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/></span>&nbsp;<a href="http://gvectors.com/wpdiscuz/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option($wc_core->wc_version_slug); ?> - Interactive Comment System">wpDiscuz</a></div>
255
  <?php } ?>
256
  <?php } ?>
257
  <div id="wc_openModalFormAction" class="modalDialog">
146
  <?php } ?>
147
  <div class="wc_notification_checkboxes">
148
  <?php
149
+ $wc_is_user_subscription_confirmed = $wc_core->wc_db_helper->wc_is_user_subscription_confirmed($post->ID, $current_user->user_email);
150
+ $wc_subscription_phrase = ($wc_is_user_subscription_confirmed == 1) ? $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe'] : $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_ignore_subscription'];
151
  if ($current_user->ID && $wc_core->wc_db_helper->wc_has_post_notification($post->ID, $current_user->user_email)) {
152
+ $wc_confirmation_phrase = ($wc_is_user_subscription_confirmed == 1) ? $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_post'] : $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email'];
153
  ?>
154
+ <label class="wc-label-comment-notify" style="cursor: default;"><?php echo $wc_confirmation_phrase; ?> | <a href="<?php echo $wc_core->wc_db_helper->wc_unsubscribe_link($post->ID, $current_user->user_email, 'post'); ?>" rel="nofollow" class="unsubscribe"><?php echo $wc_subscription_phrase; ?></a></label>
155
  <?php
156
  } else {
157
  if ($wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) {
161
  $none_status = 'checked="checked"';
162
  $post_sub_status = '';
163
  }
 
164
  if ($current_user->ID && $wc_core->wc_db_helper->wc_has_all_comments_notification($post->ID, $current_user->user_email)) {
165
+ $wc_confirmation_phrase = ($wc_is_user_subscription_confirmed == 1) ? $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment'] : $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email'];
166
  ?>
167
+ <label class="wc-label-all-reply-notify" style="cursor: default;"><?php echo $wc_confirmation_phrase; ?> | <a href="<?php echo $wc_core->wc_db_helper->wc_unsubscribe_link($post->ID, $current_user->user_email, 'all_comment'); ?>" rel="nofollow" class="unsubscribe"><?php echo $wc_subscription_phrase; ?></a></label><br/>
168
  <?php
169
  } else {
170
  if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox || $wc_core->wc_options->wc_options_serialized->wc_show_hide_all_reply_checkbox || $wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
254
  <?php if (comments_open($post->ID)) { ?>
255
  <?php if ($wc_core->wc_options->wc_options_serialized->wc_show_plugin_powerid_by) { ?>
256
  <div class="by-wpdiscuz"><span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
257
+ document.getElementById("awpdiscuz").style.display = "none";'><img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/></span>&nbsp;<a href="http://gvectors.com/wpdiscuz/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option($wc_core->wc_version_slug); ?> - Interactive Comment System">wpDiscuz</a></div>
258
  <?php } ?>
259
  <?php } ?>
260
  <div id="wc_openModalFormAction" class="modalDialog">
comment-form/tpl-comment.php CHANGED
@@ -40,16 +40,21 @@ class WC_Comment_Template_Builder {
40
  $vote_cls = '';
41
  $vote_title_text = '';
42
  $user = get_user_by('id', $comment->user_id);
 
43
  if ($user) {
44
  $post = get_post($comment->comment_post_ID);
45
  if ($user->ID == $post->post_author) {
 
46
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_author_text'];
47
  } else if (in_array('administrator', $user->roles)) {
 
48
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_admin_text'];
49
  } else {
 
50
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_member_text'];
51
  }
52
  } else {
 
53
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_guest_text'];
54
  }
55
 
@@ -107,7 +112,7 @@ class WC_Comment_Template_Builder {
107
  $output = '<div id="wc-comm-' . $unique_id . '" class="' . $comment_wrapper_class . ' ' . $parent_comment . ' wc_comment_level-' . $depth . '">';
108
  $output .= '<div class="wc-comment-left" id="comment-' . $comment->comment_ID . '">' . $wc_comm_author_avatar;
109
  if (!$this->wc_options->wc_options_serialized->wc_author_titles_show_hide) {
110
- $output .= '<div class="wc-comment-label">' . $author_title . '</div>';
111
  }
112
  if (class_exists('userpro_api') && $comment->user_id) {
113
  $output .= userpro_show_badges($comment->user_id, $inline = true);
@@ -119,7 +124,7 @@ class WC_Comment_Template_Builder {
119
  $output .= '<div class="wc-comment-footer">';
120
  if (!$this->wc_options->wc_options_serialized->wc_voting_buttons_show_hide) {
121
  $output .= '<div id="vote-count-' . $unique_id . '" class="wc-vote-result">' . $vote_count . '</div>';
122
- $output .= ' <span id="wc-up-' . $unique_id . '" class="wc-vote-link wc-up ' . $vote_cls . '" title="' . $vote_up . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/thumbs-up.png').'" align="absmiddle" class="wc-vote-img-up" /></span> &nbsp;|&nbsp; <span id="wc-down-' . $unique_id . '" class="wc-vote-link wc-down ' . $vote_cls . '" title="' . $vote_down . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/thumbs-down.png').'" align="absmiddle" class="wc-vote-img-down" /></span>&nbsp;';
123
  }
124
 
125
  if (comments_open($comment->comment_post_ID)) {
@@ -209,15 +214,19 @@ class WC_Comment_Template_Builder {
209
  $output_form .= '<div class="wc_notification_checkboxes">';
210
 
211
 
212
-
 
213
  if ($current_user->ID && $this->wc_db_helper->wc_has_post_notification($comment->comment_post_ID, $current_user->user_email)) {
214
- $output_form .= '<label class="wc-label-comment-notify" style="cursor: default;">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_post'] . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_post_ID, $current_user->user_email, 'post') . '" rel="nofollow" class="unsubscribe">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe'] . '</a></label>';
 
215
  } else {
216
  if ($current_user->ID && $this->wc_db_helper->wc_has_all_comments_notification($comment->comment_post_ID, $current_user->user_email) && $current_user->user_email == $comment->comment_author_email) {
217
- $output_form .= '<label class="wc-label-all-reply-notify" style="cursor: default;">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment'] . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_post_ID, $current_user->user_email, 'all_comment') . '" rel="nofollow" class="unsubscribe">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe'] . '</a></label><br/>';
 
218
  } else {
219
  if ($current_user->ID && $this->wc_db_helper->wc_has_comment_notification($comment->comment_post_ID, $comment->comment_ID, $current_user->user_email) && $current_user->user_email == $comment->comment_author_email) {
220
- $output_form .= '<label class="wc-label-reply-notify" style="cursor: default;">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_comment'] . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_ID, $current_user->user_email, 'comment') . '" rel="nofollow" class="unsubscribe">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe'] . '</a></label><br/>';
 
221
  } else {
222
  if ($this->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) {
223
  $none_status = '';
40
  $vote_cls = '';
41
  $vote_title_text = '';
42
  $user = get_user_by('id', $comment->user_id);
43
+ $wc_author_title_class = '';
44
  if ($user) {
45
  $post = get_post($comment->comment_post_ID);
46
  if ($user->ID == $post->post_author) {
47
+ $wc_author_title_class = 'wc-post-author';
48
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_author_text'];
49
  } else if (in_array('administrator', $user->roles)) {
50
+ $wc_author_title_class = 'wc-blog-admin';
51
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_admin_text'];
52
  } else {
53
+ $wc_author_title_class = 'wc-blog-member';
54
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_member_text'];
55
  }
56
  } else {
57
+ $wc_author_title_class = 'wc-blog-guest';
58
  $author_title = $this->wc_options->wc_options_serialized->wc_phrases['wc_user_title_guest_text'];
59
  }
60
 
112
  $output = '<div id="wc-comm-' . $unique_id . '" class="' . $comment_wrapper_class . ' ' . $parent_comment . ' wc_comment_level-' . $depth . '">';
113
  $output .= '<div class="wc-comment-left" id="comment-' . $comment->comment_ID . '">' . $wc_comm_author_avatar;
114
  if (!$this->wc_options->wc_options_serialized->wc_author_titles_show_hide) {
115
+ $output .= '<div class="' . $wc_author_title_class . ' wc-comment-label">' . $author_title . '</div>';
116
  }
117
  if (class_exists('userpro_api') && $comment->user_id) {
118
  $output .= userpro_show_badges($comment->user_id, $inline = true);
124
  $output .= '<div class="wc-comment-footer">';
125
  if (!$this->wc_options->wc_options_serialized->wc_voting_buttons_show_hide) {
126
  $output .= '<div id="vote-count-' . $unique_id . '" class="wc-vote-result">' . $vote_count . '</div>';
127
+ $output .= ' <span id="wc-up-' . $unique_id . '" class="wc-vote-link wc-up ' . $vote_cls . '" title="' . $vote_up . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/thumbs-up.png') . '" align="absmiddle" class="wc-vote-img-up" /></span> &nbsp;|&nbsp; <span id="wc-down-' . $unique_id . '" class="wc-vote-link wc-down ' . $vote_cls . '" title="' . $vote_down . '"><img src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/thumbs-down.png') . '" align="absmiddle" class="wc-vote-img-down" /></span>&nbsp;';
128
  }
129
 
130
  if (comments_open($comment->comment_post_ID)) {
214
  $output_form .= '<div class="wc_notification_checkboxes">';
215
 
216
 
217
+ $wc_is_user_subscription_confirmed = $this->wc_db_helper->wc_is_user_subscription_confirmed($comment->comment_post_ID, $current_user->user_email);
218
+ $wc_subscription_phrase = ($wc_is_user_subscription_confirmed == 1) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe'] : $this->wc_options->wc_options_serialized->wc_phrases['wc_ignore_subscription'];
219
  if ($current_user->ID && $this->wc_db_helper->wc_has_post_notification($comment->comment_post_ID, $current_user->user_email)) {
220
+ $wc_confirmation_phrase = ($wc_is_user_subscription_confirmed == 1) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_post'] : $this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email'];
221
+ $output_form .= '<label class="wc-label-comment-notify" style="cursor: default;">' . $wc_confirmation_phrase . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_post_ID, $current_user->user_email, 'post') . '" rel="nofollow" class="unsubscribe">' . $wc_subscription_phrase . '</a></label>';
222
  } else {
223
  if ($current_user->ID && $this->wc_db_helper->wc_has_all_comments_notification($comment->comment_post_ID, $current_user->user_email) && $current_user->user_email == $comment->comment_author_email) {
224
+ $wc_confirmation_phrase = ($wc_is_user_subscription_confirmed == 1) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment'] : $this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email'];
225
+ $output_form .= '<label class="wc-label-all-reply-notify" style="cursor: default;">' . $wc_confirmation_phrase . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_post_ID, $current_user->user_email, 'all_comment') . '" rel="nofollow" class="unsubscribe">' . $wc_subscription_phrase . '</a></label><br/>';
226
  } else {
227
  if ($current_user->ID && $this->wc_db_helper->wc_has_comment_notification($comment->comment_post_ID, $comment->comment_ID, $current_user->user_email) && $current_user->user_email == $comment->comment_author_email) {
228
+ $wc_confirmation_phrase = ($wc_is_user_subscription_confirmed == 1) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_subscribed_on_comment'] : $this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email'];
229
+ $output_form .= '<label class="wc-label-reply-notify" style="cursor: default;">' . $wc_confirmation_phrase . ' | <a href="' . $this->wc_db_helper->wc_unsubscribe_link($comment->comment_ID, $current_user->user_email, 'comment') . '" rel="nofollow" class="unsubscribe">' . $wc_subscription_phrase . '</a></label><br/>';
230
  } else {
231
  if ($this->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) {
232
  $none_status = '';
includes/wc-db-helper.php CHANGED
@@ -27,7 +27,7 @@ class WC_DB_Helper {
27
  dbDelta($sql);
28
  }
29
  if (!$this->wc_is_table_exists($this->phrases)) {
30
- $sql = "CREATE TABLE `" . $this->phrases . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `phrase_key` VARCHAR(255) NOT NULL, `phrase_value` VARCHAR(255) NOT NULL, PRIMARY KEY (`id`), KEY `phrase_key` (`phrase_key`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
31
  dbDelta($sql);
32
  }
33
  $this->wc_create_email_notification_table();
@@ -249,19 +249,19 @@ class WC_DB_Helper {
249
  }
250
 
251
  public function wc_has_post_notification($post_id, $email) {
252
- $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `subscribtion_type` = 'post' AND `subscribtion_id` = %d AND `email` = %s", $post_id, $email);
253
  $result = $this->db->get_results($sql, ARRAY_N);
254
  return count($result);
255
  }
256
 
257
  public function wc_has_all_comments_notification($post_id, $email) {
258
- $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `subscribtion_type` IN('post', 'all_comment') AND `subscribtion_id` = %d AND `email` = %s", $post_id, $email);
259
  $result = $this->db->get_results($sql, ARRAY_N);
260
  return count($result);
261
  }
262
 
263
  public function wc_has_comment_notification($post_id, $comment_id, $email) {
264
- $sql_comments_notifications = $this->db->prepare("SELECT count(*) FROM `" . $this->email_notification . "` WHERE `email` LIKE %s AND `subscribtion_type` IN('post', 'all_comment') AND `subscribtion_id` = %d", $email, $post_id);
265
  if ($this->db->get_var($sql_comments_notifications)) {
266
  return 1;
267
  }
@@ -270,6 +270,14 @@ class WC_DB_Helper {
270
  $result = $this->db->get_results($sql, ARRAY_N);
271
  return count($result);
272
  }
 
 
 
 
 
 
 
 
273
 
274
  /**
275
  * delete comment thread subscribtions if new subscribtion type is post
@@ -291,17 +299,6 @@ class WC_DB_Helper {
291
  return $wc_unsubscribe_link;
292
  }
293
 
294
- /**
295
- * Alter notification table
296
- */
297
- public function wc_modification_notify_table() {
298
- $sql_alter = "ALTER TABLE `" . $this->email_notification . "` ADD `confirm` TINYINT DEFAULT 0, ADD `subscription_date` DATETIME DEFAULT NOW();";
299
- if ($this->db->query($sql_alter)) {
300
- $sql_update = "UPDATE `" . $this->email_notification . "` SET `confirm` = 1;";
301
- $this->db->query($sql_update);
302
- }
303
- }
304
-
305
  /**
306
  * generate confirm link
307
  */
@@ -328,6 +325,23 @@ class WC_DB_Helper {
328
  $sql_unsubscribe = $this->db->prepare("DELETE FROM `" . $this->email_notification . "` WHERE `id` = %d AND `activation_key` LIKE %s", $id, $activation_key);
329
  return $this->db->query($sql_unsubscribe);
330
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
  }
333
 
27
  dbDelta($sql);
28
  }
29
  if (!$this->wc_is_table_exists($this->phrases)) {
30
+ $sql = "CREATE TABLE `" . $this->phrases . "`(`id` INT(11) NOT NULL AUTO_INCREMENT, `phrase_key` VARCHAR(255) NOT NULL, `phrase_value` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `phrase_key` (`phrase_key`)) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci AUTO_INCREMENT=1;";
31
  dbDelta($sql);
32
  }
33
  $this->wc_create_email_notification_table();
249
  }
250
 
251
  public function wc_has_post_notification($post_id, $email) {
252
+ $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `subscribtion_type` = 'post' AND `subscribtion_id` = %d AND `email` = %s;", $post_id, $email);
253
  $result = $this->db->get_results($sql, ARRAY_N);
254
  return count($result);
255
  }
256
 
257
  public function wc_has_all_comments_notification($post_id, $email) {
258
+ $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `subscribtion_type` IN('post', 'all_comment') AND `subscribtion_id` = %d AND `email` = %s;", $post_id, $email);
259
  $result = $this->db->get_results($sql, ARRAY_N);
260
  return count($result);
261
  }
262
 
263
  public function wc_has_comment_notification($post_id, $comment_id, $email) {
264
+ $sql_comments_notifications = $this->db->prepare("SELECT count(*) FROM `" . $this->email_notification . "` WHERE `email` LIKE %s AND `subscribtion_type` IN('post', 'all_comment') AND `subscribtion_id` = %d;", $email, $post_id);
265
  if ($this->db->get_var($sql_comments_notifications)) {
266
  return 1;
267
  }
270
  $result = $this->db->get_results($sql, ARRAY_N);
271
  return count($result);
272
  }
273
+
274
+ /**
275
+ * check if user subscription is confirmed or not
276
+ */
277
+ public function wc_is_user_subscription_confirmed($post_id, $email) {
278
+ $sql_is_subscription_confirmed = $this->db->prepare("SELECT `confirm` FROM `" . $this->email_notification . "` WHERE `subscribtion_type` IN('post', 'all_comment', 'comment') AND `subscribtion_id` = %d AND `email` = %s;", $post_id, $email);
279
+ return $this->db->get_var($sql_is_subscription_confirmed);
280
+ }
281
 
282
  /**
283
  * delete comment thread subscribtions if new subscribtion type is post
299
  return $wc_unsubscribe_link;
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
302
  /**
303
  * generate confirm link
304
  */
325
  $sql_unsubscribe = $this->db->prepare("DELETE FROM `" . $this->email_notification . "` WHERE `id` = %d AND `activation_key` LIKE %s", $id, $activation_key);
326
  return $this->db->query($sql_unsubscribe);
327
  }
328
+
329
+
330
+ /**
331
+ * Alter notification table
332
+ */
333
+ public function wc_modification_notify_table() {
334
+ $sql_alter = "ALTER TABLE `" . $this->email_notification . "` ADD `confirm` TINYINT DEFAULT 0, ADD `subscription_date` DATETIME DEFAULT NOW();";
335
+ if ($this->db->query($sql_alter)) {
336
+ $sql_update = "UPDATE `" . $this->email_notification . "` SET `confirm` = 1;";
337
+ $this->db->query($sql_update);
338
+ }
339
+ }
340
+
341
+ public function wc_alter_phrases_table() {
342
+ $sql_alter = "ALTER TABLE `" . $this->phrases . "` MODIFY `phrase_value` TEXT NOT NULL;";
343
+ $this->db->query($sql_alter);
344
+ }
345
 
346
  }
347
 
options-templates/options-template-phrases.php CHANGED
@@ -376,7 +376,7 @@
376
 
377
  <tr valign="top">
378
  <th scope="row">
379
- <?php _e('New Reply Message', WC_Core::$TEXT_DOMAIN); ?>
380
  </th>
381
  <td colspan="3">
382
  <label for="wc_unsubscribe">
376
 
377
  <tr valign="top">
378
  <th scope="row">
379
+ <?php _e('Unsubscribe', WC_Core::$TEXT_DOMAIN); ?>
380
  </th>
381
  <td colspan="3">
382
  <label for="wc_unsubscribe">
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: wordpress comments, ajax comments, ajax, live update, theme, post comments, comments box, community, discussion, discuss, comment form, reply, comments, discussions, comment template, activity, comment author, comment system
5
  Requires at least: 2.7
6
  Tested up to: 4.1.1
7
- Stable tag: 2.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -122,6 +122,10 @@ http://www.gvectors.com/questions/wpdiscuz-comment-form-is-missing/
122
 
123
 
124
  == Changelog ==
 
 
 
 
125
  = 2.1.2 =
126
  * Added : Adapting with wordpress.org plugin repository guidelines
127
 
@@ -246,4 +250,4 @@ http://www.gvectors.com/questions/wpdiscuz-comment-form-is-missing/
246
  * Fixed Bug : Layout Issues with some themes
247
 
248
  = 1.0.0 =
249
- Initial version
4
  Tags: wordpress comments, ajax comments, ajax, live update, theme, post comments, comments box, community, discussion, discuss, comment form, reply, comments, discussions, comment template, activity, comment author, comment system
5
  Requires at least: 2.7
6
  Tested up to: 4.1.1
7
+ Stable tag: 2.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
122
 
123
 
124
  == Changelog ==
125
+ = 2.1.4 =
126
+ * Added: CSS classes for blog users titles by rank
127
+ * Fixed Bug: Phrases saving issue
128
+
129
  = 2.1.2 =
130
  * Added : Adapting with wordpress.org plugin repository guidelines
131
 
250
  * Fixed Bug : Layout Issues with some themes
251
 
252
  = 1.0.0 =
253
+ Initial version
wc-options.php CHANGED
@@ -226,6 +226,7 @@ class WC_Options {
226
  $this->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment'] = $_POST['wc_subscribed_on_all_comment'];
227
  $this->wc_options_serialized->wc_phrases['wc_subscribed_on_post'] = $_POST['wc_subscribed_on_post'];
228
  $this->wc_options_serialized->wc_phrases['wc_unsubscribe'] = $_POST['wc_unsubscribe'];
 
229
  $this->wc_options_serialized->wc_phrases['wc_unsubscribe_message'] = $_POST['wc_unsubscribe_message'];
230
  $this->wc_options_serialized->wc_phrases['wc_confirm_email'] = $_POST['wc_confirm_email'];
231
  $this->wc_options_serialized->wc_phrases['wc_comfirm_success_message'] = $_POST['wc_comfirm_success_message'];
226
  $this->wc_options_serialized->wc_phrases['wc_subscribed_on_all_comment'] = $_POST['wc_subscribed_on_all_comment'];
227
  $this->wc_options_serialized->wc_phrases['wc_subscribed_on_post'] = $_POST['wc_subscribed_on_post'];
228
  $this->wc_options_serialized->wc_phrases['wc_unsubscribe'] = $_POST['wc_unsubscribe'];
229
+ $this->wc_options_serialized->wc_phrases['wc_ignore_subscription'] = $_POST['wc_ignore_subscription'];
230
  $this->wc_options_serialized->wc_phrases['wc_unsubscribe_message'] = $_POST['wc_unsubscribe_message'];
231
  $this->wc_options_serialized->wc_phrases['wc_confirm_email'] = $_POST['wc_confirm_email'];
232
  $this->wc_options_serialized->wc_phrases['wc_comfirm_success_message'] = $_POST['wc_comfirm_success_message'];
wc.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: wpDiscuz - Wordpress Comments
5
  Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
- Version: 2.1.2
7
  Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  Author URI: http://www.gvectors.com/
9
  Plugin URI: http://www.gvectors.com/wpdiscuz/
@@ -88,7 +88,7 @@ class WC_Core {
88
  $plugin = plugin_basename(__FILE__);
89
  add_filter("plugin_action_links_$plugin", array(&$this, 'wc_add_plugin_settings_link'));
90
 
91
- add_action('wp_head', array(&$this, 'init_current_post_type'));
92
  }
93
 
94
  public function load_wpdiscuz_text_domain() {
@@ -113,11 +113,14 @@ class WC_Core {
113
  if ($wc_version === '1.0.0') {
114
  add_option($this->wc_version_slug, $wc_plugin_data['Version']);
115
  } else {
116
- if (version_compare('2.1.0', $wc_version, '>')){
117
  $this->wc_db_helper->wc_modification_notify_table();
118
  }
119
  update_option($this->wc_version_slug, $wc_plugin_data['Version']);
120
  }
 
 
 
121
  }
122
  }
123
 
@@ -335,22 +338,22 @@ class WC_Core {
335
  $new_commentdata['comment_approved'] = wp_blacklist_check($new_commentdata['comment_author'], $new_commentdata['comment_author_email'], $new_commentdata['comment_author_url'], $new_commentdata['comment_content'], $new_commentdata['comment_author_IP'], $new_commentdata['comment_agent']) ? 'spam' : $held_moderate;
336
  $new_comment_id = wp_insert_comment($new_commentdata);
337
  }
338
- $wp_notification_inserted_id = 0;
339
  if ($notification_type == 'post' && !$this->wc_db_helper->wc_has_post_notification($comment_post_ID, $email)) {
340
  if (class_exists('Prompt_Comment_Form_Handling') && $this->wc_options->wc_options_serialized->wc_use_postmatic_for_comment_notification) {
341
  $_POST[Prompt_Comment_Form_Handling::SUBSCRIBE_CHECKBOX_NAME] = 1;
342
  Prompt_Comment_Form_Handling::handle_form($new_comment_id, $held_moderate);
343
  } else {
344
- $wp_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($comment_post_ID, $comment_post_ID, $email, 1);
345
  }
346
  } else if ($notification_type == 'all_comment' && !$this->wc_db_helper->wc_has_all_comments_notification($comment_post_ID, $email)) {
347
- $wp_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($comment_post_ID, $comment_post_ID, $email, 2);
348
  } else if ($notification_type == 'reply' && !$this->wc_db_helper->wc_has_comment_notification($comment_post_ID, $new_comment_id, $email)) {
349
- $wp_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($new_comment_id, $comment_post_ID, $email, 3);
350
  }
351
 
352
- if ($wp_notification_inserted_id) {
353
- $this->wc_confirm_email_sender($wp_notification_inserted_id, $email, $comment_post_ID, $new_comment_id, $notification_type);
354
  }
355
 
356
  $new_comment = new WC_Comment(get_comment($new_comment_id, OBJECT));
@@ -871,9 +874,10 @@ class WC_Core {
871
 
872
  public function wc_confirm_email_sender($subscrib_id, $email, $post_id, $new_comment_id, $subscribtion_type) {
873
  $curr_post = get_post($post_id);
874
- $curr_post_author = get_userdata($curr_post->post_author);
875
- $subject = isset($this->wc_options_serialized->wc_phrases['wc_confirm_email_subject']) ? $this->wc_options_serialized->wc_phrases['wc_confirm_email_subject'] : __('Subscribe Confirmation', WC_Core::$TEXT_DOMAIN);
876
- $message = isset($this->wc_options_serialized->wc_phrases['wc_confirm_email_message']) ? $this->wc_options_serialized->wc_phrases['wc_confirm_email_message'] : __('Hi, <br/> You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you\'ve chosen. <br/> To activate, click confirm below. If you believe this is an error, ignore this message and we\'ll never bother you again.', WC_Core::$TEXT_DOMAIN);
 
877
  if ($email == $curr_post_author->user_email && (get_option('comments_notify') || get_option('moderation_notify'))) {
878
  return;
879
  }
@@ -1020,7 +1024,7 @@ class WC_Core {
1020
  $message_array['code'] = -2;
1021
  $message_array['phrase_message'] = $this->wc_options->wc_options_serialized->wc_phrases['wc_comment_not_edited'];
1022
  }
1023
- }
1024
 
1025
  echo json_encode($message_array);
1026
  exit;
3
  /*
4
  Plugin Name: wpDiscuz - Wordpress Comments
5
  Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
+ Version: 2.1.4
7
  Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  Author URI: http://www.gvectors.com/
9
  Plugin URI: http://www.gvectors.com/wpdiscuz/
88
  $plugin = plugin_basename(__FILE__);
89
  add_filter("plugin_action_links_$plugin", array(&$this, 'wc_add_plugin_settings_link'));
90
 
91
+ add_action('wp_head', array(&$this, 'init_current_post_type'));
92
  }
93
 
94
  public function load_wpdiscuz_text_domain() {
113
  if ($wc_version === '1.0.0') {
114
  add_option($this->wc_version_slug, $wc_plugin_data['Version']);
115
  } else {
116
+ if (version_compare('2.1.0', $wc_version, '>')) {
117
  $this->wc_db_helper->wc_modification_notify_table();
118
  }
119
  update_option($this->wc_version_slug, $wc_plugin_data['Version']);
120
  }
121
+ if (version_compare($wc_version, '2.1.2', '<=')) {
122
+ $this->wc_db_helper->wc_alter_phrases_table();
123
+ }
124
  }
125
  }
126
 
338
  $new_commentdata['comment_approved'] = wp_blacklist_check($new_commentdata['comment_author'], $new_commentdata['comment_author_email'], $new_commentdata['comment_author_url'], $new_commentdata['comment_content'], $new_commentdata['comment_author_IP'], $new_commentdata['comment_agent']) ? 'spam' : $held_moderate;
339
  $new_comment_id = wp_insert_comment($new_commentdata);
340
  }
341
+ $wc_notification_inserted_id = 0;
342
  if ($notification_type == 'post' && !$this->wc_db_helper->wc_has_post_notification($comment_post_ID, $email)) {
343
  if (class_exists('Prompt_Comment_Form_Handling') && $this->wc_options->wc_options_serialized->wc_use_postmatic_for_comment_notification) {
344
  $_POST[Prompt_Comment_Form_Handling::SUBSCRIBE_CHECKBOX_NAME] = 1;
345
  Prompt_Comment_Form_Handling::handle_form($new_comment_id, $held_moderate);
346
  } else {
347
+ $wc_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($comment_post_ID, $comment_post_ID, $email, 1);
348
  }
349
  } else if ($notification_type == 'all_comment' && !$this->wc_db_helper->wc_has_all_comments_notification($comment_post_ID, $email)) {
350
+ $wc_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($comment_post_ID, $comment_post_ID, $email, 2);
351
  } else if ($notification_type == 'reply' && !$this->wc_db_helper->wc_has_comment_notification($comment_post_ID, $new_comment_id, $email)) {
352
+ $wc_notification_inserted_id = $this->wc_db_helper->wc_add_email_notification($new_comment_id, $comment_post_ID, $email, 3);
353
  }
354
 
355
+ if ($wc_notification_inserted_id) {
356
+ $this->wc_confirm_email_sender($wc_notification_inserted_id, $email, $comment_post_ID, $new_comment_id, $notification_type);
357
  }
358
 
359
  $new_comment = new WC_Comment(get_comment($new_comment_id, OBJECT));
874
 
875
  public function wc_confirm_email_sender($subscrib_id, $email, $post_id, $new_comment_id, $subscribtion_type) {
876
  $curr_post = get_post($post_id);
877
+ $curr_post_author = get_userdata($curr_post->post_author);
878
+
879
+ $subject = isset($this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email_subject']) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email_subject'] : __('Subscribe Confirmation', WC_Core::$TEXT_DOMAIN);
880
+ $message = isset($this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email_message']) ? $this->wc_options->wc_options_serialized->wc_phrases['wc_confirm_email_message'] : __('Hi, <br/> You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you\'ve chosen. <br/> To activate, click confirm below. If you believe this is an error, ignore this message and we\'ll never bother you again.', WC_Core::$TEXT_DOMAIN);
881
  if ($email == $curr_post_author->user_email && (get_option('comments_notify') || get_option('moderation_notify'))) {
882
  return;
883
  }
1024
  $message_array['code'] = -2;
1025
  $message_array['phrase_message'] = $this->wc_options->wc_options_serialized->wc_phrases['wc_comment_not_edited'];
1026
  }
1027
+ }
1028
 
1029
  echo json_encode($message_array);
1030
  exit;