Comments – wpDiscuz - Version 2.0.1

Version Description

  • Fixed Bug: Problem with new options and phrase saving

IMPORTANT: If you have a Cache Plugin, please reset after wpDiscuz update

Download this release

Release Info

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

Code changes from version 2.0.0 to 2.0.1

comment-form/tpl-comment.php CHANGED
@@ -10,9 +10,7 @@ class WC_Comment_Template_Builder {
10
  $this->wc_helper = $wc_helper;
11
  $this->wc_db_helper = $wc_db_helper;
12
  $this->wc_options = $wc_options;
13
- if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
14
- $this->wc_options->wc_options_serialized->wc_phrases = $this->wc_db_helper->get_phrases();
15
- }
16
  }
17
 
18
  /**
@@ -107,8 +105,23 @@ class WC_Comment_Template_Builder {
107
  $output .= '<span id="wc-up-' . $unique_id . '" class="wc-vote-link wc-up ' . $vote_cls . '" title="' . $vote_up . '">&and;</span> | <span id="wc-down-' . $unique_id . '" class="wc-vote-link wc-down ' . $vote_cls . '" title="' . $vote_down . '">&or;</span> &nbsp;&nbsp;';
108
  }
109
 
110
- if ($this->is_guest_can_reply() && $this->is_customer_can_reply()) {
111
- $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
 
@@ -140,74 +153,67 @@ class WC_Comment_Template_Builder {
140
  $output .= '</div>';
141
  $output .= '<div style="clear:both"></div>';
142
 
143
- if ($this->is_guest_can_reply() && $this->is_customer_can_reply()) {
144
- $output .= '<div class="wc-form-wrapper wc-secondary-forms-wrapper" id="wc-secondary-forms-wrapper-' . $unique_id . '">';
145
- $output .= '<form action="" method="post" id="wc_comm_form-' . $unique_id . '" class="wc_comm_form wc_secondary_form">';
146
- $output .= '<div class="wc-field-comment"><div style="width:60px; float:left; position:absolute;">' . $this->wc_helper->get_comment_author_avatar() . '</div><div style="margin-left:65px;" class="item"><textarea id="wc_comment-' . $unique_id . '" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="' . $textarea_placeholder . '"></textarea></div><div style="clear:both"></div></div>';
147
 
148
- $output .= '<div id="wc-form-footer-' . $unique_id . '" class="wc-form-footer">';
149
 
150
- if (!is_user_logged_in()) {
151
- $output .= '<div class="wc-author-data"><div class="wc-field-name item"><input id="wc_name-' . $unique_id . '" name="wc_name" class="wc_name wc_field_input" required="required" value="" type="text" placeholder="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_name_text'] . '"/></div><div class="wc-field-email item"><input id="wc_email-' . $unique_id . '" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_email_text'] . '"/></div><div style="clear:both"></div></div>';
152
- }
153
-
154
- $output .= '<div class="wc-form-submit">';
155
 
156
- if (!$this->wc_options->wc_options_serialized->wc_captcha_show_hide) {
157
- if (!is_user_logged_in()) {
158
- $output .= '<div class="wc-field-captcha item">';
159
- $output .= '<input id="wc_captcha-' . $unique_id . '" class="wc_field_input wc_field_captcha" name="wc_captcha" required="required" value="" type="text" /><span class="wc-label wc-captcha-label">';
160
- $output .= '<img rel="nofollow" src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $comment->comment_post_ID . '-' . $comment->comment_ID) . '" id="wc_captcha_img-' . $unique_id . '" />';
161
- $output .= '<img rel="nofollow" src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png') . '" id="wc_captcha_refresh_img-' . $unique_id . '" class="wc_captcha_refresh_img" />';
162
- $output .= '</span><span class="captcha_msg">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_captcha_text'] . '</span></div>';
163
- }
164
- }
165
 
166
- $output .= '<div class="wc-field-submit"><input type="button" name="submit" value="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_submit_text'] . '" id="wc_comm-' . $unique_id . '" class="wc_comm_submit button alt"/></div>';
167
- $output .= '<div style="clear:both"></div>';
168
- $output .= '<div class="wc_notification_checkboxes">';
169
- if ($this->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox) {
170
- $output .= '<input class="wc-label-reply-notify" id="wc_notification_new_reply-' . $unique_id . '" class="wc_notification_new_reply" value="0" type="checkbox" name="wc_notification_new_reply"/> <label class="wc-label-comment-notify" for="wc_notification_new_reply-' . $unique_id . '">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_reply'] . '</label><br />';
171
- }
172
- if ($this->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
173
- $output .= '<input class="wc-label-comment-notify" id="wc_notification_new_comment-' . $unique_id . '" class="wc_notification_new_comment" value="0" type="checkbox" name="wc_notification_new_comment"/> <label class="wc-label-comment-notify" for="wc_notification_new_comment-' . $unique_id . '">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_comment'] . '</label><br />';
174
  }
175
- $output .= '</div>';
176
- $output .= '</div>';
177
- $output .= '</div>';
178
-
179
- $output .= '<input type="hidden" name="wc_home_url" value="' . plugins_url() . '" id="wc_home_url-' . $unique_id . '" />';
180
- $output .= '<input type="hidden" name="wc_comment_post_ID" value="' . $comment->comment_post_ID . '" id="wc_comment_post_ID-' . $unique_id . '" />';
181
- $output .= '<input type="hidden" name="wc_comment_parent" value="' . $comment->comment_ID . '" id="wc_comment_parent-' . $unique_id . '" />';
182
-
183
- $output .= '</form>';
184
- $output .= '</div>';
185
  }
186
- return $output;
187
- }
188
 
189
- public function is_guest_can_reply() {
190
- $user_can_comment = TRUE;
191
- if (!$this->wc_options->wc_options_serialized->wc_user_must_be_registered) {
192
- if ($this->wc_options->wc_options_serialized->wc_reply_button_guests_show_hide) {
193
- if (!is_user_logged_in()) {
194
- $user_can_comment = FALSE;
195
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  }
197
  } else {
198
- if (!is_user_logged_in()) {
199
- $user_can_comment = FALSE;
 
 
 
 
 
 
200
  }
201
  }
202
- return $user_can_comment;
203
- }
204
 
205
- public function is_customer_can_reply() {
206
- $user_can_comment = TRUE;
207
- if ($this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide) {
208
- $user_can_comment = $this->is_user_can_reply_by_role('customer');
209
- }
210
- return $user_can_comment;
211
  }
212
 
213
  /**
@@ -218,13 +224,19 @@ class WC_Comment_Template_Builder {
218
  if (is_user_logged_in()) {
219
  $current_user = wp_get_current_user();
220
  $roles = $current_user->roles;
221
- if (!in_array($role, $roles)) {
222
  $user_can_comment = TRUE;
223
  }
224
  }
225
  return $user_can_comment;
226
  }
227
 
 
 
 
 
 
 
228
  /**
229
  *
230
  * get profile url
10
  $this->wc_helper = $wc_helper;
11
  $this->wc_db_helper = $wc_db_helper;
12
  $this->wc_options = $wc_options;
13
+ add_action('plugins_loaded', array(&$this, 'init_phrases_on_load'), 2129);
 
 
14
  }
15
 
16
  /**
105
  $output .= '<span id="wc-up-' . $unique_id . '" class="wc-vote-link wc-up ' . $vote_cls . '" title="' . $vote_up . '">&and;</span> | <span id="wc-down-' . $unique_id . '" class="wc-vote-link wc-down ' . $vote_cls . '" title="' . $vote_down . '">&or;</span> &nbsp;&nbsp;';
106
  }
107
 
108
+
109
+ if ($this->wc_options->wc_options_serialized->wc_user_must_be_registered) {
110
+ if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && is_user_logged_in()) {
111
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
112
+ } else if ($this->is_user_can_reply_by_role('administrator')) {
113
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
114
+ }
115
+ } else {
116
+ if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && !$this->wc_options->wc_options_serialized->wc_reply_button_guests_show_hide) {
117
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
118
+ } else if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && is_user_logged_in()) {
119
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
120
+ } else if (!$this->wc_options->wc_options_serialized->wc_reply_button_guests_show_hide && !is_user_logged_in()) {
121
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
122
+ } else if ($this->is_user_can_reply_by_role('administrator')) {
123
+ $output .= '&nbsp;&nbsp;<span id="wc-comm-reply-' . $unique_id . '" class="wc-reply-link" title="' . $reply_text . '">' . $reply_text . '</span> &nbsp;&nbsp;';
124
+ }
125
  }
126
 
127
 
153
  $output .= '</div>';
154
  $output .= '<div style="clear:both"></div>';
155
 
156
+ $output_form = '<div class="wc-form-wrapper wc-secondary-forms-wrapper" id="wc-secondary-forms-wrapper-' . $unique_id . '">';
157
+ $output_form .= '<form action="" method="post" id="wc_comm_form-' . $unique_id . '" class="wc_comm_form wc_secondary_form">';
158
+ $output_form .= '<div class="wc-field-comment"><div style="width:60px; float:left; position:absolute;">' . $this->wc_helper->get_comment_author_avatar() . '</div><div style="margin-left:65px;" class="item"><textarea id="wc_comment-' . $unique_id . '" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="' . $textarea_placeholder . '"></textarea></div><div style="clear:both"></div></div>';
 
159
 
160
+ $output_form .= '<div id="wc-form-footer-' . $unique_id . '" class="wc-form-footer">';
161
 
162
+ if (!is_user_logged_in()) {
163
+ $output_form .= '<div class="wc-author-data"><div class="wc-field-name item"><input id="wc_name-' . $unique_id . '" name="wc_name" class="wc_name wc_field_input" required="required" value="" type="text" placeholder="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_name_text'] . '"/></div><div class="wc-field-email item"><input id="wc_email-' . $unique_id . '" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_email_text'] . '"/></div><div style="clear:both"></div></div>';
164
+ }
 
 
165
 
166
+ $output_form .= '<div class="wc-form-submit">';
 
 
 
 
 
 
 
 
167
 
168
+ if (!$this->wc_options->wc_options_serialized->wc_captcha_show_hide) {
169
+ if (!is_user_logged_in()) {
170
+ $output_form .= '<div class="wc-field-captcha item">';
171
+ $output_form .= '<input id="wc_captcha-' . $unique_id . '" class="wc_field_input wc_field_captcha" name="wc_captcha" required="required" value="" type="text" /><span class="wc-label wc-captcha-label">';
172
+ $output_form .= '<img rel="nofollow" src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $comment->comment_post_ID . '-' . $comment->comment_ID) . '" id="wc_captcha_img-' . $unique_id . '" />';
173
+ $output_form .= '<img rel="nofollow" src="' . plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png') . '" id="wc_captcha_refresh_img-' . $unique_id . '" class="wc_captcha_refresh_img" />';
174
+ $output_form .= '</span><span class="captcha_msg">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_captcha_text'] . '</span></div>';
 
175
  }
 
 
 
 
 
 
 
 
 
 
176
  }
 
 
177
 
178
+ $output_form .= '<div class="wc-field-submit"><input type="button" name="submit" value="' . $this->wc_options->wc_options_serialized->wc_phrases['wc_submit_text'] . '" id="wc_comm-' . $unique_id . '" class="wc_comm_submit button alt"/></div>';
179
+ $output_form .= '<div style="clear:both"></div>';
180
+ $output_form .= '<div class="wc_notification_checkboxes">';
181
+ if ($this->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox) {
182
+ $output_form .= '<input class="wc-label-reply-notify" id="wc_notification_new_reply-' . $unique_id . '" class="wc_notification_new_reply" value="0" type="checkbox" name="wc_notification_new_reply"/> <label class="wc-label-comment-notify" for="wc_notification_new_reply-' . $unique_id . '">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_reply'] . '</label><br />';
183
+ }
184
+ if ($this->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
185
+ $output_form .= '<input class="wc-label-comment-notify" id="wc_notification_new_comment-' . $unique_id . '" class="wc_notification_new_comment" value="0" type="checkbox" name="wc_notification_new_comment"/> <label class="wc-label-comment-notify" for="wc_notification_new_comment-' . $unique_id . '">' . $this->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_comment'] . '</label><br />';
186
+ }
187
+ $output_form .= '</div>';
188
+ $output_form .= '</div>';
189
+ $output_form .= '</div>';
190
+
191
+ $output_form .= '<input type="hidden" name="wc_home_url" value="' . plugins_url() . '" id="wc_home_url-' . $unique_id . '" />';
192
+ $output_form .= '<input type="hidden" name="wc_comment_post_ID" value="' . $comment->comment_post_ID . '" id="wc_comment_post_ID-' . $unique_id . '" />';
193
+ $output_form .= '<input type="hidden" name="wc_comment_parent" value="' . $comment->comment_ID . '" id="wc_comment_parent-' . $unique_id . '" />';
194
+
195
+ $output_form .= '</form>';
196
+ $output_form .= '</div>';
197
+
198
+ if ($this->wc_options->wc_options_serialized->wc_user_must_be_registered) {
199
+ if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && is_user_logged_in()) {
200
+ $output .= $output_form;
201
+ } else if ($this->is_user_can_reply_by_role('administrator')) {
202
+ $output .= $output_form;
203
  }
204
  } else {
205
+ if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && !$this->wc_options->wc_options_serialized->wc_reply_button_guests_show_hide) {
206
+ $output .= $output_form;
207
+ } else if (!$this->wc_options->wc_options_serialized->wc_reply_button_members_show_hide && is_user_logged_in()) {
208
+ $output .= $output_form;
209
+ } else if (!$this->wc_options->wc_options_serialized->wc_reply_button_guests_show_hide && !is_user_logged_in()) {
210
+ $output .= $output_form;
211
+ } else if ($this->is_user_can_reply_by_role('administrator')) {
212
+ $output .= $output_form;
213
  }
214
  }
 
 
215
 
216
+ return $output;
 
 
 
 
 
217
  }
218
 
219
  /**
224
  if (is_user_logged_in()) {
225
  $current_user = wp_get_current_user();
226
  $roles = $current_user->roles;
227
+ if (in_array($role, $roles)) {
228
  $user_can_comment = TRUE;
229
  }
230
  }
231
  return $user_can_comment;
232
  }
233
 
234
+ public function init_phrases_on_load() {
235
+ if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
236
+ $this->wc_options->wc_options_serialized->wc_phrases = $this->wc_db_helper->get_phrases();
237
+ }
238
+ }
239
+
240
  /**
241
  *
242
  * get profile url
includes/wc-db-helper.php CHANGED
@@ -94,6 +94,9 @@ class WC_DB_Helper {
94
  $phrases = $this->db->get_results($sql, ARRAY_A);
95
  $tmp_phrases = array();
96
  foreach ($phrases as $phrase) {
 
 
 
97
  $tmp_phrases[$phrase['phrase_key']] = WC_Helper::init_phrase_key_value($phrase);
98
  }
99
  return $tmp_phrases;
@@ -114,7 +117,7 @@ class WC_DB_Helper {
114
  }
115
  return $this->db->get_var($sql_new_comments);
116
  }
117
-
118
  /**
119
  * get current post all parent comments count
120
  */
@@ -177,25 +180,25 @@ class WC_DB_Helper {
177
  }
178
  $this->db->query($sql);
179
  }
180
-
181
- public function wc_get_post_new_comment_notification($post_id,$email){
182
- $sql = $this->db->prepare("SELECT `email` FROM `" . $this->email_notification . "` WHERE `post_id` = %d AND `email` != %s",$post_id,$email);
183
  return $this->db->get_results($sql, ARRAY_N);
184
  }
185
-
186
- public function wc_get_post_new_reply_notification($comment_id,$email){
187
- $sql = $this->db->prepare("SELECT `email` FROM `" . $this->email_notification . "` WHERE `comment_id` = %d AND `email` != %s",$comment_id,$email);
188
  return $this->db->get_results($sql, ARRAY_N);
189
  }
190
-
191
- public function wc_has_notification_in_comment($post_id,$email){
192
- $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `post_id` = %d AND `email` = %s",$post_id,$email);
193
  $result = $this->db->get_results($sql, ARRAY_N);
194
  return count($result);
195
  }
196
-
197
- public function wc_has_notification_in_reply($comment_id,$email){
198
- $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `comment_id` = %d AND `email` = %s",$comment_id,$email);
199
  $result = $this->db->get_results($sql, ARRAY_N);
200
  return count($result);
201
  }
94
  $phrases = $this->db->get_results($sql, ARRAY_A);
95
  $tmp_phrases = array();
96
  foreach ($phrases as $phrase) {
97
+ if (!is_array($phrase)) {
98
+ $phrase = stripslashes($phrase);
99
+ }
100
  $tmp_phrases[$phrase['phrase_key']] = WC_Helper::init_phrase_key_value($phrase);
101
  }
102
  return $tmp_phrases;
117
  }
118
  return $this->db->get_var($sql_new_comments);
119
  }
120
+
121
  /**
122
  * get current post all parent comments count
123
  */
180
  }
181
  $this->db->query($sql);
182
  }
183
+
184
+ public function wc_get_post_new_comment_notification($post_id, $email) {
185
+ $sql = $this->db->prepare("SELECT `email` FROM `" . $this->email_notification . "` WHERE `post_id` = %d AND `email` != %s", $post_id, $email);
186
  return $this->db->get_results($sql, ARRAY_N);
187
  }
188
+
189
+ public function wc_get_post_new_reply_notification($comment_id, $email) {
190
+ $sql = $this->db->prepare("SELECT `email` FROM `" . $this->email_notification . "` WHERE `comment_id` = %d AND `email` != %s", $comment_id, $email);
191
  return $this->db->get_results($sql, ARRAY_N);
192
  }
193
+
194
+ public function wc_has_notification_in_comment($post_id, $email) {
195
+ $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `post_id` = %d AND `email` = %s", $post_id, $email);
196
  $result = $this->db->get_results($sql, ARRAY_N);
197
  return count($result);
198
  }
199
+
200
+ public function wc_has_notification_in_reply($comment_id, $email) {
201
+ $sql = $this->db->prepare("SELECT `id` FROM `" . $this->email_notification . "` WHERE `comment_id` = %d AND `email` = %s", $comment_id, $email);
202
  $result = $this->db->get_results($sql, ARRAY_N);
203
  return count($result);
204
  }
options-templates/options-template-main.php CHANGED
@@ -193,7 +193,7 @@
193
  </th>
194
  <td colspan="3">
195
  <select id="wc_comments_max_depth" name="wc_comments_max_depth">
196
- <?php $wc_comments_max_depth = isset($this->wc_options_serialized->wc_comments_max_depth) ? $this->wc_options_serialized->wc_comments_max_depth : 2; ?>
197
  <option value="1" <?php selected($wc_comments_max_depth, '1'); ?>>1 <?php _e('Level', 'wpdiscuz'); ?></option>
198
  <option value="2" <?php selected($wc_comments_max_depth, '2'); ?>>2 <?php _e('Levels', 'wpdiscuz'); ?></option>
199
  <option value="3" <?php selected($wc_comments_max_depth, '3'); ?>>3 <?php _e('Levels', 'wpdiscuz'); ?></option>
@@ -218,6 +218,7 @@
218
  <tr valign="top">
219
  <th scope="row">
220
  <?php _e('Show "Notify of all new follow-up comments"', 'wpdiscuz'); ?>
 
221
  </th>
222
  <td colspan="3">
223
  <label for="wc_show_hide_comment_checkbox">
@@ -229,6 +230,7 @@
229
  <tr valign="top">
230
  <th scope="row">
231
  <?php _e('Show "Notify of new replies to my comments"', 'wpdiscuz'); ?>
 
232
  </th>
233
  <td colspan="3">
234
  <label for="wc_show_hide_reply_checkbox">
@@ -428,6 +430,6 @@
428
  <label for="wc_custom_css"><?php _e('Custom CSS Code', 'wpdiscuz'); ?></label>
429
  </th>
430
  <td>
431
- <textarea cols="50" rows="10" class="regular-text" id="wc_custom_css" name="wc_custom_css" placeholder=""><?php echo $this->wc_options_serialized->wc_custom_css; ?></textarea>
432
  </td>
433
  </tr>
193
  </th>
194
  <td colspan="3">
195
  <select id="wc_comments_max_depth" name="wc_comments_max_depth">
196
+ <?php $wc_comments_max_depth = isset($this->wc_options_serialized->wc_comments_max_depth) ? $this->wc_options_serialized->wc_comments_max_depth : 3; ?>
197
  <option value="1" <?php selected($wc_comments_max_depth, '1'); ?>>1 <?php _e('Level', 'wpdiscuz'); ?></option>
198
  <option value="2" <?php selected($wc_comments_max_depth, '2'); ?>>2 <?php _e('Levels', 'wpdiscuz'); ?></option>
199
  <option value="3" <?php selected($wc_comments_max_depth, '3'); ?>>3 <?php _e('Levels', 'wpdiscuz'); ?></option>
218
  <tr valign="top">
219
  <th scope="row">
220
  <?php _e('Show "Notify of all new follow-up comments"', 'wpdiscuz'); ?>
221
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;">Please keep this option on, otherwise users will not have any option for email notifications and they'll not get any.</p>
222
  </th>
223
  <td colspan="3">
224
  <label for="wc_show_hide_comment_checkbox">
230
  <tr valign="top">
231
  <th scope="row">
232
  <?php _e('Show "Notify of new replies to my comments"', 'wpdiscuz'); ?>
233
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;">Please keep this option on, otherwise users will not have any option for email notifications and they'll not get any.</p>
234
  </th>
235
  <td colspan="3">
236
  <label for="wc_show_hide_reply_checkbox">
430
  <label for="wc_custom_css"><?php _e('Custom CSS Code', 'wpdiscuz'); ?></label>
431
  </th>
432
  <td>
433
+ <textarea cols="50" rows="10" class="regular-text" id="wc_custom_css" name="wc_custom_css" placeholder=""><?php echo stripslashes($this->wc_options_serialized->wc_custom_css); ?></textarea>
434
  </td>
435
  </tr>
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
7
- Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -66,11 +66,15 @@ https://wordpress.org/plugins/woodiscuz-woocommerce-comments/
66
 
67
  == Installation ==
68
 
 
 
69
  1. Upload plugin folder to the '/wp-content/plugins/' directory,
70
  2. Activate the plugin through the 'Plugins' menu in WordPress.
71
 
72
  == Frequently Asked Questions ==
73
 
 
 
74
  = Q&A =
75
 
76
  * QUESTION: Does it fully replace the current comment system? That in this case what happens to old comments?
@@ -103,6 +107,12 @@ https://wordpress.org/plugins/woodiscuz-woocommerce-comments/
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
106
  = 2.0.0 =
107
  * Added : Live update of new comments with notifier buttons
108
  * Added : Multi-level (nested) comment threads, with maximum levels depth setting option
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
7
+ Stable tag: 2.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
66
 
67
  == Installation ==
68
 
69
+ IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz update.
70
+
71
  1. Upload plugin folder to the '/wp-content/plugins/' directory,
72
  2. Activate the plugin through the 'Plugins' menu in WordPress.
73
 
74
  == Frequently Asked Questions ==
75
 
76
+ IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz update.
77
+
78
  = Q&A =
79
 
80
  * QUESTION: Does it fully replace the current comment system? That in this case what happens to old comments?
107
 
108
  == Changelog ==
109
 
110
+ = 2.0.1 =
111
+ * Fixed Bug: Problem with new options and phrase saving
112
+
113
+ IMPORTANT: If you have a Cache Plugin, please reset after wpDiscuz update
114
+
115
+
116
  = 2.0.0 =
117
  * Added : Live update of new comments with notifier buttons
118
  * Added : Multi-level (nested) comment threads, with maximum levels depth setting option
wc-css.php CHANGED
@@ -13,7 +13,7 @@ class WC_CSS {
13
  */
14
  public function init_styles() {
15
  ?>
16
- <style type="text/css"> #wc-comment-header{ padding:20px 5px 1px 5px; display:block; float:none; clear:both; font-size:18px;} #wpcomm form .item {display: block;} .item input {} #wpcomm { margin:15px 5px; padding:1px 0px 10px 0px; border-top:#DDDDDD solid 1px; } #wpcomm form { margin:0px; padding:0px; background:none; border:none; } #wpcomm form div{ margin:0px; } #wpcomm .wc_new_comment_and_replies { margin:0px; padding:0px; width:100%; height:auto; background:transparent;} #wpcomm .wc_new_comment_and_replies .wc_new_comment{ float:right; display:none; background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; padding:3px 10px; font-size:12px; margin:1px 0px 1px 3px; cursor:pointer; color:#fff; line-height: 15px;} #wpcomm .wc_new_comment_and_replies .wc_new_reply{ float:right; display:none; background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; padding:3px 10px; font-size:12px; margin:1px 0px 1px 1px; cursor:pointer; color:#fff; line-height: 15px;} #wpcomm .wc-comment-title{ margin:0px; line-height:18px; font-weight:bold; padding:10px; margin-bottom:10px; font-size:13px; text-align:right; border-bottom:#CCCCCC dotted 1px; padding-bottom:10px; } #wpcomm .wc-form-wrapper{ padding:10px; background:<?php echo isset($this->wc_options->wc_options_serialized->wc_form_bg_color) ? $this->wc_options->wc_options_serialized->wc_form_bg_color : '#f9f9f9'; ?>; margin-top:20px; border:1px solid #F1F1F1; } #wpcomm .wc-author-data{ margin-bottom:10px; } #wpcomm .wc-field-submit{ padding:5px 0px 13px 0px; } #wpcomm .wc-field-name{ width:49%; float:left; } #wpcomm .wc-field-email{ width:49%; float:right; text-align:right; } #wpcomm .wc-field-comment{ margin:5px auto 10px auto; } #wpcomm .wc-field-captcha{ width:55%; float:left; margin:0px; height:auto!important; } #wpcomm .wc-field-submit{ width:45%; float:right; text-align:right; margin:0px; } #wpcomm .wc-field-name input[type="text"]{ width:99%; max-width:100%; padding:5px; font-size:14px; margin:0px; height:29px; } #wpcomm .wc-field-email input[type="email"]{ width:100%; max-width:100%; padding:5px; font-size:14px; margin:0px; height:29px; } #wpcomm .wc-field-captcha input[type="text"]{ width:40%; padding:5px; font-size:14px; margin:0px 5px 0px 0px; height:29px; } #wpcomm .wc-field-submit input[type="submit"]{ margin:1px; } #wpcomm .wc-field-submit input[type="button"]{ margin:1px; border:#DDDDDD 1px solid; font-size: 13px; line-height: 16px; padding: 6px 15px; } #wpcomm .captcha_msg{ color: #999999; font-family: Lato,sans-serif; font-size: 12px; line-height: 18px; display:block; clear:both; } #wpcomm .wc-field-comment textarea{ width:100%; max-width:100%; height:46px; min-height: 46px !important; padding:5px; box-sizing: border-box; } #wpcomm .wc-label{ display:block; font-size:14px; padding:5px; } #wpcomm .wc_notification_checkboxes{ padding:1px 0px 5px 0px;} #wpcomm .wc_notification_checkboxes input[type="checkbox"]{ overflow:none; font-size:13px; margin:0px; padding:0px; display:inline; } #wpcomm .wc-label-comment-notify{ display:inline; font-size:13px; padding:0px; margin:0px; border:none; line-height:15px; text-decoration:none; color:#999999; font-family:Lato,sans-serif; cursor:pointer; } #wpcomm .wc-label-reply-notify{ display:inline; font-size:13px; padding:0px; margin:0px; border:none; line-height:15px; text-decoration:none; color:#999999; font-family:Lato,sans-serif; cursor:pointer; } #wpcomm .wc-field-captcha .wc-label{ font-size:18px; padding:5px; text-align:center; display:inline; } #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm textarea{ font-size:14px; color:#666666; font-family:Lato,sans-serif; box-sizing: border-box; margin:0px; } #wpcomm .wc-copyright{ margin: 0px 0px 0px auto; text-align:right; display: block; padding-top: 2px; } #wpcomm .wc-copyright a{ font-size: 9px; color: #AAAAAA; cursor:help; text-decoration:none; margin:0px; padding:0px; border:none;} #wpcomm .wc-thread-wrapper{ padding:10px 0px; margin-bottom:10px;} #wpcomm .wc-comment { margin-bottom:13px; } #wpcomm .wc-comment .wc-field-submit{ padding:5px 0px 5px 0px; } #wpcomm .wc-comment .wc-form-wrapper{ padding:10px 10px 2px 10px; } #wpcomm .wc-comment .wc-comment-left{ width:62px; float:left; position:absolute; text-align:center; font-family:Lato,sans-serif; line-height:16px; } #wpcomm .wc-comment .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; background:<?php echo $this->wc_options->wc_options_serialized->wc_comment_bg_color; ?>} #wpcomm .wc-reply .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; } #wpcomm .wc-reply { margin-top: 10px; margin-bottom:0px; margin-left:40px; } #wpcomm .wc-reply .wc-comment-right{ background:<?php echo $this->wc_options->wc_options_serialized->wc_reply_bg_color; ?>; } #wpcomm .wc-must-login{ margin:0px; font-size:14px; line-height:16px; padding:10px } #wpcomm hr{ background-color: rgba(0, 0, 0, 0.1); border: 0 none; height: 1px; margin:10px 0px; } #wpcomm .avatar{ border: 1px solid rgba(0, 0, 0, 0.1); padding: 2px; margin:0px auto; float:none; display:inline; } #wpcomm .wc-comment-text{ font-size:<?php echo isset($this->wc_options->wc_options_serialized->wc_comment_text_size) ? $this->wc_options->wc_options_serialized->wc_comment_text_size : '14px'; ?>; text-align:left; color:<?php echo $this->wc_options->wc_options_serialized->wc_comment_text_color; ?>; padding-bottom:5px; line-height: 20px; } #wpcomm .wc-comment-header{ margin-bottom:7px; font-family:Lato,sans-serif; } #wpcomm .wc-comment-author{ color:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; font-size:16px; width:40%; float:left; white-space:nowrap; } #wpcomm .wc-comment-author a{ color:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; font-size:16px; white-space:nowrap; text-decoration:none; } #wpcomm .wc-comment-label{ background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; color:#FFFFFF; padding:2px 5px; font-size:12px; margin:4px auto; text-align:center; display:table; line-height:16px; } #wpcomm .wc-comment-date{ font-size:12px; color:#999999; float:right; text-align:right; white-space:nowrap; line-height:27px; } #wpcomm .wc-comment-footer { font-size:12px; font-weight:normal; color:#999999; margin-top:12px; min-height: 28px; font-family:Lato,sans-serif; } #wpcomm .wc-comment-footer a{ text-decoration:none; font-size:13px; font-weight:bold; color:<?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; } #wpcomm .wc-comment-footer .share_buttons_box img{ vertical-align:middle; } #wpcomm .wc-comment-footer .wc-voted{ color:#666666; cursor:default; } #wpcomm .wc-comment-footer .wc-vote-result{ padding:2px 6px 2px 5px; background:<?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; color:#FFFFFF; font-size:12px; font-weight:bold; display:inline; margin-right:5px;} #wpcomm .wc-toggle{ float:right; text-align:right; padding-right:0px; margin-right:0px; color:#999999; cursor:pointer; font-size:12px; white-space:nowrap; } #wpcomm .item { background: none; border-radius: 0px; box-shadow: none; } #wc_response_info img{ margin: 0px auto 0px auto; } #wpcomm .share_buttons_box img { display:inline!important; width:16px; height:16px; } #wpcomm .wc-captcha-label img{ display: inline!important; border:none; padding:0px 0px 0px 2px; margin:0px; vertical-align:middle; } #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link { cursor: pointer; font-size:13px; font-weight:bold; color: <?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; } #wpcomm .wc-form-footer, #wpcomm .wc-secondary-forms-wrapper {display: none;} #wpcomm .wc-field-captcha .wc-captcha-label { padding: 0; display: inline-block; } #wpcomm .wc_captcha_refresh_img {cursor: pointer; margin-left: 3px;} #wpcomm .share_buttons_box {display: none;} #wpcomm .wc-no-left-margin {margin-left: 0 !important;} div.wc_modal { background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;} .wc-load-more-submit-wrap { width: 100%; text-align: center; margin-bottom:20px; } .wc-load-more-submit { width: 100%; text-align: center; } #wc_openModalFormAction > div#wc_response_info { width: 200px; background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;} #wc_openModalFormAction > div#wc_response_info { } #wc_openModalFormAction > div#wc_response_info a.close { background: url("<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/x.png'); ?>") no-repeat; background-position-x: right; background-position-y: top; } #wpcomm #bywpdiscuz{ display:none; } #wpcomm .by-wpdiscuz{ text-align:right; border-top:#DDDDDD solid 1px; padding:1px 1px 1px 1px; } #wpcomm .by-wpdiscuz a{ font-size:11px; font-weight:bold; text-align:right; color:#CCCCCC; padding:1px; margin:0px; line-height:12px; border:none; text-decoration:none; } #wpcomm .wpdimg{ border:none; padding:0px; margin:0px; height:12px; cursor:pointer; display:inline; clear:both; } #wpcomm .wc-comment .wc-comment-right.wc_new_loaded_comment {background: <?php echo $this->wc_options->wc_options_serialized->wc_new_loaded_comment_bg_color; ?>;} <?php echo $this->wc_options->wc_options_serialized->wc_custom_css; ?></style>
17
  <?php
18
  }
19
 
13
  */
14
  public function init_styles() {
15
  ?>
16
+ <style type="text/css"> #wc-comment-header{ padding:20px 5px 1px 5px; display:block; float:none; clear:both; font-size:18px;} #wpcomm form .item {display: block;} .item input {} #wpcomm { margin:15px 5px; padding:1px 0px 10px 0px; border-top:#DDDDDD solid 1px; } #wpcomm form { margin:0px; padding:0px; background:none; border:none; } #wpcomm form div{ margin:0px; } #wpcomm .wc_new_comment_and_replies { margin:0px; padding:0px; width:100%; height:auto; background:transparent;} #wpcomm .wc_new_comment_and_replies .wc_new_comment{ float:right; display:none; background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; padding:3px 10px; font-size:12px; margin:1px 0px 1px 3px; cursor:pointer; color:#fff; line-height: 15px;} #wpcomm .wc_new_comment_and_replies .wc_new_reply{ float:right; display:none; background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; padding:3px 10px; font-size:12px; margin:1px 0px 1px 1px; cursor:pointer; color:#fff; line-height: 15px;} #wpcomm .wc-comment-title{ margin:0px; line-height:18px; font-weight:bold; padding:10px; margin-bottom:10px; font-size:13px; text-align:right; border-bottom:#CCCCCC dotted 1px; padding-bottom:10px; } #wpcomm .wc-form-wrapper{ padding:10px; background:<?php echo isset($this->wc_options->wc_options_serialized->wc_form_bg_color) ? $this->wc_options->wc_options_serialized->wc_form_bg_color : '#f9f9f9'; ?>; margin-top:20px; border:1px solid #F1F1F1; } #wpcomm .wc-author-data{ margin-bottom:10px; } #wpcomm .wc-field-submit{ padding:5px 0px 13px 0px; } #wpcomm .wc-field-name{ width:49%; float:left; } #wpcomm .wc-field-email{ width:49%; float:right; text-align:right; } #wpcomm .wc-field-comment{ margin:5px auto 10px auto; } #wpcomm .wc-field-captcha{ width:55%; float:left; margin:0px; height:auto!important; } #wpcomm .wc-field-submit{ width:45%; float:right; text-align:right; margin:0px; } #wpcomm .wc-field-name input[type="text"]{ width:99%; max-width:100%; padding:5px; font-size:14px; margin:0px; height:29px; } #wpcomm .wc-field-email input[type="email"]{ width:100%; max-width:100%; padding:5px; font-size:14px; margin:0px; height:29px; } #wpcomm .wc-field-captcha input[type="text"]{ width:40%; padding:5px; font-size:14px; margin:0px 5px 0px 0px; height:29px; } #wpcomm .wc-field-submit input[type="submit"]{ margin:1px; } #wpcomm .wc-field-submit input[type="button"]{ margin:1px; border:#DDDDDD 1px solid; font-size: 13px; line-height: 16px; padding: 6px 15px; } #wpcomm .captcha_msg{ color: #999999; font-family: Lato,sans-serif; font-size: 12px; line-height: 18px; display:block; clear:both; } #wpcomm .wc-field-comment textarea{ width:100%; max-width:100%; height:46px; min-height: 46px !important; padding:5px; box-sizing: border-box; } #wpcomm .wc-label{ display:block; font-size:14px; padding:5px; } #wpcomm .wc_notification_checkboxes{ padding:1px 0px 5px 0px; text-align:left;} #wpcomm .wc_notification_checkboxes input[type="checkbox"]{ overflow:none; width:inherit; font-size:13px; margin:0px; padding:0px; display:inline; } #wpcomm .wc-label-comment-notify{ display:inline; font-size:13px; padding:0px; margin:0px; border:none; line-height:15px; text-decoration:none; color:#999999; font-family:Lato,sans-serif; cursor:pointer; } #wpcomm .wc-label-reply-notify{ display:inline; font-size:13px; padding:0px; margin:0px; border:none; line-height:15px; text-decoration:none; color:#999999; font-family:Lato,sans-serif; cursor:pointer; } #wpcomm .wc-field-captcha .wc-label{ font-size:18px; padding:5px; text-align:center; display:inline; } #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm textarea{ font-size:14px; color:#666666; font-family:Lato,sans-serif; box-sizing: border-box; margin:0px; } #wpcomm .wc-copyright{ margin: 0px 0px 0px auto; text-align:right; display: block; padding-top: 2px; } #wpcomm .wc-copyright a{ font-size: 9px; color: #AAAAAA; cursor:help; text-decoration:none; margin:0px; padding:0px; border:none;} #wpcomm .wc-thread-wrapper{ padding:10px 0px; margin-bottom:10px;} #wpcomm .wc-comment { margin-bottom:13px; } #wpcomm .wc-comment .wc-field-submit{ padding:5px 0px 5px 0px; } #wpcomm .wc-comment .wc-form-wrapper{ padding:10px 10px 2px 10px; } #wpcomm .wc-comment .wc-comment-left{ width:62px; float:left; position:absolute; text-align:center; font-family:Lato,sans-serif; line-height:16px; } #wpcomm .wc-comment .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; background:<?php echo $this->wc_options->wc_options_serialized->wc_comment_bg_color; ?>} #wpcomm .wc-reply .wc-comment-right{ margin-left:70px; border:#F5F5F5 1px solid; padding:10px 10px 3px 10px; } #wpcomm .wc-reply { margin-top: 10px; margin-bottom:0px; margin-left:40px; } #wpcomm .wc-reply .wc-comment-right{ background:<?php echo $this->wc_options->wc_options_serialized->wc_reply_bg_color; ?>; } #wpcomm .wc-must-login{ margin:0px; font-size:14px; line-height:16px; padding:10px; text-align:center; } #wpcomm hr{ background-color: rgba(0, 0, 0, 0.1); border: 0 none; height: 1px; margin:10px 0px; } #wpcomm .avatar{ border: 1px solid rgba(0, 0, 0, 0.1); padding: 2px; margin:0px auto; float:none; display:inline; } #wpcomm .wc-comment-text{ font-size:<?php echo isset($this->wc_options->wc_options_serialized->wc_comment_text_size) ? $this->wc_options->wc_options_serialized->wc_comment_text_size : '14px'; ?>; text-align:left; color:<?php echo $this->wc_options->wc_options_serialized->wc_comment_text_color; ?>; padding-bottom:5px; line-height: 20px; } #wpcomm .wc-comment-header{ margin-bottom:7px; font-family:Lato,sans-serif; } #wpcomm .wc-comment-author{ color:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; font-size:16px; width:40%; float:left; white-space:nowrap; } #wpcomm .wc-comment-author a{ color:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; font-size:16px; white-space:nowrap; text-decoration:none; } #wpcomm .wc-comment-label{ background:<?php echo $this->wc_options->wc_options_serialized->wc_author_title_color; ?>; color:#FFFFFF; padding:2px 5px; font-size:12px; margin:4px auto; text-align:center; display:table; line-height:16px; } #wpcomm .wc-comment-date{ font-size:12px; color:#999999; float:right; text-align:right; white-space:nowrap; line-height:27px; } #wpcomm .wc-comment-footer { font-size:12px; font-weight:normal; color:#999999; margin-top:12px; min-height: 28px; font-family:Lato,sans-serif; } #wpcomm .wc-comment-footer a{ text-decoration:none; font-size:13px; font-weight:bold; color:<?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; } #wpcomm .wc-comment-footer .share_buttons_box img{ vertical-align:middle; } #wpcomm .wc-comment-footer .wc-voted{ color:#666666; cursor:default; } #wpcomm .wc-comment-footer .wc-vote-result{ padding:2px 6px 2px 5px; background:<?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; color:#FFFFFF; font-size:12px; font-weight:bold; display:inline; margin-right:5px;} #wpcomm .wc-toggle{ float:right; text-align:right; padding-right:0px; margin-right:0px; color:#999999; cursor:pointer; font-size:12px; white-space:nowrap; } #wpcomm .item { background: none; border-radius: 0px; box-shadow: none; } #wc_response_info img{ margin: 0px auto 0px auto; } #wpcomm .share_buttons_box img { display:inline!important; width:16px; height:16px; } #wpcomm .wc-captcha-label img{ display: inline!important; border:none; padding:0px 0px 0px 2px; margin:0px; vertical-align:middle; } #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link { cursor: pointer; font-size:13px; font-weight:bold; color: <?php echo $this->wc_options->wc_options_serialized->wc_vote_reply_color; ?>; } #wpcomm .wc-form-footer, #wpcomm .wc-secondary-forms-wrapper {display: none;} #wpcomm .wc-field-captcha .wc-captcha-label { padding: 0; display: inline-block; } #wpcomm .wc_captcha_refresh_img {cursor: pointer; margin-left: 3px;} #wpcomm .share_buttons_box {display: none;} #wpcomm .wc-no-left-margin {margin-left: 0 !important;} div.wc_modal { background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;} .wc-load-more-submit-wrap { width: 100%; text-align: center; margin-bottom:20px; } .wc-load-more-submit { width: 100%; text-align: center; } #wc_openModalFormAction > div#wc_response_info { width: 200px; background: none repeat scroll 0 0 #EDEDED; color:#444444; font-size: 18px; font-weight: normal; padding: 45px 10px 50px 10px!important; text-align: center; line-height:25px;} #wc_openModalFormAction > div#wc_response_info { } #wc_openModalFormAction > div#wc_response_info a.close { background: url("<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/x.png'); ?>") no-repeat; background-position-x: right; background-position-y: top; } #wpcomm #bywpdiscuz{ display:none; } #wpcomm .by-wpdiscuz{ text-align:right; border-top:#DDDDDD solid 1px; padding:1px 1px 1px 1px; } #wpcomm .by-wpdiscuz a{ font-size:11px; font-weight:bold; text-align:right; color:#CCCCCC; padding:1px; margin:0px; line-height:12px; border:none; text-decoration:none; } #wpcomm .wpdimg{ border:none; padding:0px; margin:0px; height:12px; cursor:pointer; display:inline; clear:both; } #wpcomm .wc-comment .wc-comment-right.wc_new_loaded_comment {background: <?php echo $this->wc_options->wc_options_serialized->wc_new_loaded_comment_bg_color; ?>;} <?php echo stripslashes($this->wc_options->wc_options_serialized->wc_custom_css); ?></style>
17
  <?php
18
  }
19
 
wc-options-serialize.php CHANGED
@@ -228,7 +228,7 @@ class WC_Options_Serialize {
228
  * helper class for database operations
229
  */
230
  public $wc_db_helper;
231
-
232
  function __construct($wc_db_helper) {
233
  $this->wc_db_helper = $wc_db_helper;
234
  $this->init_phrases();
@@ -403,7 +403,7 @@ class WC_Options_Serialize {
403
  }
404
 
405
  public function init_phrases_on_load() {
406
- if ($this->wc_db_helper->is_phrase_exists('wc_discuss_tab')) {
407
  $this->wc_phrases = $this->wc_db_helper->get_phrases();
408
  }
409
  }
228
  * helper class for database operations
229
  */
230
  public $wc_db_helper;
231
+
232
  function __construct($wc_db_helper) {
233
  $this->wc_db_helper = $wc_db_helper;
234
  $this->init_phrases();
403
  }
404
 
405
  public function init_phrases_on_load() {
406
+ if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
407
  $this->wc_phrases = $this->wc_db_helper->get_phrases();
408
  }
409
  }
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.0.0
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/
@@ -30,21 +30,23 @@ class WC_Core {
30
  public $comment_count_text;
31
  public static $PLUGIN_DIRECTORY;
32
  public $post_type;
 
33
 
34
  function __construct() {
35
- add_action('init', array(&$this, 'init_plugin_dir_name'), 1);
36
 
37
  $this->wc_options = new WC_Options();
38
  $this->wc_db_helper = $this->wc_options->wc_db_helper;
39
 
40
  register_activation_hook(__FILE__, array($this, 'db_operations'));
41
- $this->wc_db_helper->wc_create_email_notification_tabel();
42
 
43
  $this->wc_helper = new WC_Helper($this->wc_options->wc_options_serialized);
44
  $this->wc_css = new WC_CSS($this->wc_options);
45
  $this->comment_tpl_builder = new WC_Comment_Template_Builder($this->wc_helper, $this->wc_db_helper, $this->wc_options);
46
 
47
  add_action('init', array(&$this, 'register_session'), 2);
 
48
 
49
  add_action('admin_enqueue_scripts', array(&$this, 'admin_page_styles_scripts'), 2315);
50
  add_action('wp_enqueue_scripts', array(&$this, 'front_end_styles_scripts'));
@@ -83,6 +85,37 @@ class WC_Core {
83
  $this->wc_db_helper->create_tables();
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  /*
87
  * register new session
88
  */
@@ -153,7 +186,7 @@ class WC_Core {
153
  wp_register_style('validator-style', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/fv.css'));
154
  wp_enqueue_style('validator-style');
155
 
156
- wp_enqueue_script('wc-ajax-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/wc-ajax.js'), array('jquery'), '2.0.0', false);
157
  wp_localize_script('wc-ajax-js', 'wc_ajax_obj', array('url' => admin_url('admin-ajax.php')));
158
 
159
  wp_enqueue_script('wc-cookie-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/jquery.cookie.js'), array('jquery'), '1.4.1', false);
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.0.1
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/
30
  public $comment_count_text;
31
  public static $PLUGIN_DIRECTORY;
32
  public $post_type;
33
+ private $wc_version_slug = 'wc_plugin_version';
34
 
35
  function __construct() {
36
+ add_action('init', array(&$this, 'init_plugin_dir_name'), 1);
37
 
38
  $this->wc_options = new WC_Options();
39
  $this->wc_db_helper = $this->wc_options->wc_db_helper;
40
 
41
  register_activation_hook(__FILE__, array($this, 'db_operations'));
42
+
43
 
44
  $this->wc_helper = new WC_Helper($this->wc_options->wc_options_serialized);
45
  $this->wc_css = new WC_CSS($this->wc_options);
46
  $this->comment_tpl_builder = new WC_Comment_Template_Builder($this->wc_helper, $this->wc_db_helper, $this->wc_options);
47
 
48
  add_action('init', array(&$this, 'register_session'), 2);
49
+ add_action('admin_init', array(&$this, 'wc_plugin_new_version'), 2);
50
 
51
  add_action('admin_enqueue_scripts', array(&$this, 'admin_page_styles_scripts'), 2315);
52
  add_action('wp_enqueue_scripts', array(&$this, 'front_end_styles_scripts'));
85
  $this->wc_db_helper->create_tables();
86
  }
87
 
88
+ public function wc_plugin_new_version() {
89
+ $this->wc_db_helper->wc_create_email_notification_tabel();
90
+ $wc_version = ( !get_option($this->wc_version_slug) ) ? '1.0.0' : get_option($this->wc_version_slug);
91
+ $wc_plugin_data = get_plugin_data(__FILE__);
92
+ if (version_compare($wc_plugin_data['Version'], $wc_version)) {
93
+ $this->wc_add_new_options();
94
+ $this->wc_add_new_phrases();
95
+ if ($wc_version === '1.0.0') {
96
+ add_option($this->wc_version_slug, $wc_plugin_data['Version']);
97
+ } else {
98
+ update_option($this->wc_version_slug, $wc_plugin_data['Version']);
99
+ }
100
+ }
101
+ }
102
+
103
+ private function wc_add_new_options() {
104
+ $this->wc_options->wc_options_serialized->init_options(get_option($this->wc_options->wc_options_serialized->wc_options_slug));
105
+ $wc_new_options = $this->wc_options->wc_options_serialized->to_array();
106
+ update_option($this->wc_options->wc_options_serialized->wc_options_slug, serialize($wc_new_options));
107
+ }
108
+
109
+ private function wc_add_new_phrases() {
110
+ if ($this->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
111
+ $wc_saved_phrases = $this->wc_db_helper->get_phrases();
112
+ $this->wc_options->wc_options_serialized->init_phrases();
113
+ $wc_phrases = $this->wc_options->wc_options_serialized->wc_phrases;
114
+ $wc_new_phrases = array_merge($wc_phrases, $wc_saved_phrases);
115
+ $this->wc_db_helper->update_phrases($wc_new_phrases);
116
+ }
117
+ }
118
+
119
  /*
120
  * register new session
121
  */
186
  wp_register_style('validator-style', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/css/fv.css'));
187
  wp_enqueue_style('validator-style');
188
 
189
+ wp_enqueue_script('wc-ajax-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/wc-ajax.js'), array('jquery'), '2.0.1', false);
190
  wp_localize_script('wc-ajax-js', 'wc_ajax_obj', array('url' => admin_url('admin-ajax.php')));
191
 
192
  wp_enqueue_script('wc-cookie-js', plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/js/jquery.cookie.js'), array('jquery'), '1.4.1', false);