Comments – wpDiscuz - Version 2.0.7

Version Description

  • Fixed Bug: Comment system hiding problem on posts with disabled discussion option.
Download this release

Release Info

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

Code changes from version 2.0.6 to 2.0.7

Files changed (5) hide show
  1. comment-form/form.php +199 -196
  2. files/js/wc-ajax.js +10 -3
  3. includes/wc-db-helper.php +0 -1
  4. readme.txt +4 -1
  5. wc.php +3 -6
comment-form/form.php CHANGED
@@ -2,244 +2,247 @@
2
  global $post, $wc_core, $current_user;
3
  get_currentuserinfo();
4
 
5
- if ($wc_core->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
6
- $wc_core->wc_options->wc_options_serialized->wc_phrases = $wc_core->wc_db_helper->get_phrases();
7
- }
8
-
9
- $wc_comment_list_update_type = $wc_core->wc_options->wc_options_serialized->wc_comment_list_update_type;
10
- ?>
11
- <script type="text/javascript">
12
- // initialize the validator function
13
- validator.message['invalid'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_invalid_field']; ?>';
14
- validator.message['empty'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_error_empty_text']; ?>';
15
- validator.message['email'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_error_email_text']; ?>';
16
-
17
- jQuery(document).ready(function ($) {
18
- $(document).delegate('.wc-toggle', 'click', function () {
19
- var toggleID = $(this).attr('id');
20
- var uniqueID = toggleID.substring(toggleID.lastIndexOf('-') + 1);
21
- $('#wc-comm-' + uniqueID + ' .wc-reply').slideToggle(500, function () {
22
- if ($(this).is(':hidden')) {
23
- $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_show_replies_text']; ?> &or;');
24
- } else {
25
- $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_hide_replies_text']; ?> &and;');
26
- }
27
- });
28
- });
29
 
30
- if ($.cookie('wc_author_name') !== '' && $.cookie('wc_author_email')) {
31
- $('#wpcomm .wc_name').val($.cookie('wc_author_name'));
32
- $('#wpcomm .wc_email').val($.cookie('wc_author_email'));
33
- }
34
 
35
- $('#wc_unsubscribe_message').delay(7000).fadeOut(1500, function () {
36
- $(this).remove();
37
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
- });
40
- </script>
41
- <?php
42
- $textarea_placeholder = '';
43
- if ($post->comment_count) {
44
- $textarea_placeholder = $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_comment_join_text'];
45
- } else {
46
- $textarea_placeholder = $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_comment_start_text'];
47
- }
48
- $unique_id = $post->ID . '_' . 0;
49
- $header_text = '<span class="wc_header_text_count">' . $post->comment_count . '</span> ';
50
- $header_text .= $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_header_text'];
51
- $header_text .= ($post->comment_count > 1) ? $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_plural_text'] : '';
52
- $header_text .= ' ' . $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_header_on_text'];
53
- $header_text .= ' "' . get_the_title($post) . '"';
54
- ?>
55
- <div style="clear:both"></div>
56
- <div class="comments-area">
57
 
 
 
 
58
 
 
 
59
  <?php
60
- if (isset($_GET['wpdiscuzSubscribeID']) && isset($_GET['key'])) {
61
- $wc_core->wc_unsubscribe($_GET['wpdiscuzSubscribeID'], $_GET['key']);
62
- ?>
63
- <div id="wc_unsubscribe_message">
64
- <span class="wc_unsubscribe_message"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe_message']; ?></span>
65
- </div>
66
- <?php
67
  }
 
 
 
 
 
 
68
  ?>
 
 
69
 
70
- <?php if (comments_open($post->ID)) { ?>
71
- <h3 id="wc-comment-header"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_leave_a_reply_text']; ?></h3>
72
- <?php } ?>
73
- <?php do_action('comment_form_before'); ?>
74
 
75
-
76
- <?php
77
- if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_loggedin_username) {
78
- if (is_user_logged_in()) {
79
- global $current_user;
80
- get_currentuserinfo();
81
- $user_url = get_author_posts_url($current_user->ID);
82
  ?>
83
- <div id="wc_show_hide_loggedin_username">
84
- <span class="wc_show_hide_loggedin_username">
85
- <?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_logged_in_as'] . ' <a href="' . $user_url . '">' . $current_user->display_name . '</a> | <a href="' . wp_logout_url() . '">' . $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_log_out'] . '</a>'; ?>
86
- </span>
87
  </div>
88
  <?php
89
  }
90
- }
91
- ?>
92
-
93
 
94
- <div id="wpcomm">
95
  <?php if (comments_open($post->ID)) { ?>
96
- <p class="wc-comment-title">
97
- <?php echo ($post->comment_count) ? $header_text : $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_be_the_first_text']; ?>
98
- </p>
99
- <?php do_action('comment_form_top'); ?>
100
- <div class="wc-form-wrapper">
 
 
 
 
 
 
 
 
 
 
 
 
101
  <?php
102
- if ($wc_core->is_guest_can_comment()) {
103
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
- <form action="" method="post" id="wc_comm_form-<?php echo $unique_id; ?>" class="wc_comm_form wc_main_comm_form">
106
- <div class="wc-field-comment">
107
- <div style="width:60px; float:left; position:absolute;">
108
- <?php echo $wc_core->wc_helper->get_comment_author_avatar(); ?>
 
 
 
109
  </div>
110
- <div style="margin-left:65px;" class="item"><textarea id="wc_comment-<?php echo $unique_id; ?>" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="<?php echo $textarea_placeholder; ?>"></textarea></div>
111
- <div style="clear:both"></div>
112
- </div>
113
- <div id="wc-form-footer-<?php echo $unique_id; ?>" class="wc-form-footer">
114
- <?php if (!is_user_logged_in()) { ?>
115
- <div class="wc-author-data">
116
- <div class="wc-field-name item"><input id="wc_name-<?php echo $unique_id; ?>" class="wc_name wc_field_input" name="wc_name" required="required" value="" type="text" placeholder="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_name_text'] ?>"/></div>
117
- <div class="wc-field-email item"><input id="wc_email-<?php echo $unique_id; ?>" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_email_text']; ?>"/></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  <div style="clear:both"></div>
119
  </div>
120
- <?php } ?>
121
- <div class="wc-form-submit">
122
- <?php if (!$wc_core->wc_options->wc_options_serialized->wc_captcha_show_hide) { ?>
123
- <?php if (!is_user_logged_in()) { ?>
124
- <div class="wc-field-captcha item">
125
- <input id="wc_captcha-<?php echo $unique_id; ?>" class="wc_field_input wc_field_captcha" name="wc_captcha" required="required" value="" type="text" />
126
- <span class="wc-label wc-captcha-label">
127
- <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $post->ID . '-' . 0); ?>" id="wc_captcha_img-<?php echo $unique_id; ?>" rel="nofollow"/>
128
- <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png'); ?>" id="wc_captcha_refresh_img-<?php echo $unique_id; ?>" class="wc_captcha_refresh_img" rel="nofollow"/>
129
- </span>
130
- <span class="captcha_msg"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_captcha_text']; ?></span>
131
- </div>
132
- <?php } ?>
133
  <?php } ?>
134
- <div class="wc-field-submit"><input type="button" name="submit" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_submit_text']; ?>" id="wc_comm-<?php echo $unique_id; ?>" class="wc_comm_submit button alt"/></div>
135
- <div style="clear:both"></div>
136
- </div>
137
- <?php if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox || $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) { ?>
138
- <span class="wc_manage_subscribtions"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_manage_subscribtions']; ?></span>
139
- <?php } ?>
140
- <div class="wc_notification_checkboxes">
141
- <?php
142
- if ($current_user->ID && $wc_core->wc_db_helper->wc_has_post_notification($post->ID, $current_user->user_email)) {
143
- ?>
144
- <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>
145
  <?php
146
- } else {
147
- $wc_notification_state = ($wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) ? 'checked="checked" value="1"' : 'value="0"';
148
-
149
- if ($current_user->ID && $wc_core->wc_db_helper->wc_has_all_comments_notification($post->ID, $current_user->user_email)) {
150
  ?>
151
- <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/>
152
  <?php
153
  } else {
 
154
 
155
- if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox) {
156
  ?>
157
- <input id="wc_notification_new_reply-<?php echo $unique_id; ?>" class="wc_notification_new_reply" <?php echo $wc_notification_state; ?> type="checkbox" name="wp_comment_reply_notification"/> <label class="wc-label-reply-notify" for="wc_notification_new_reply-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_reply']; ?></label><br />
158
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  }
160
 
161
- if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_all_reply_checkbox) {
162
- ?>
163
- <input id="wc_notification_all_new_reply-<?php echo $unique_id; ?>" class="wc_notification_all_new_reply" <?php echo $wc_notification_state; ?> type="checkbox" name="wc_notification_all_new_reply"/> <label class="wc-label-all-reply-notify" for="wc_notification_all_new_reply-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_all_new_reply']; ?></label><br />
164
  <?php
165
  }
166
  }
 
167
 
168
- if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
169
- ?>
170
- <input id="wc_notification_new_comment-<?php echo $unique_id; ?>" class="wc_notification_new_comment" <?php echo $wc_notification_state; ?> type="checkbox" name="wp_post_comment_notification"/> <label class="wc-label-comment-notify" for="wc_notification_new_comment-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_comment']; ?></label><br />
171
- <?php
172
- }
173
- }
174
- ?>
175
-
176
- </div>
177
 
178
- </div>
179
- <input type="hidden" name="wc_comment_post_ID" value="<?php echo $post->ID; ?>" id="wc_comment_post_ID-<?php echo $unique_id; ?>" />
180
- <input type="hidden" name="wc_comment_parent" value="0" id="wc_comment_parent-<?php echo $unique_id; ?>" />
181
- </form>
182
- <?php } else { ?>
183
- <p class="wc-must-login"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_you_must_be_text']; ?> <a href="<?php echo wp_login_url(); ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_logged_in_text']; ?></a> <?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_to_post_comment_text']; ?></p>
184
- <?php
185
- }
186
- ?>
187
- </div>
188
- <hr/>
189
- <?php if ($wc_comment_list_update_type == 2) { ?>
190
- <div class="wc_new_comment_and_replies">
191
- <div class="wc_new_comment"><span class="wc_new_comment_button_text"></span></div>
192
- <div class="wc_new_reply"><span class="wc_new_reply_button_text"></span></div>
193
- <div style="clear:both"></div>
194
  </div>
195
- <div style="clear:both"></div>
 
 
 
 
 
 
 
 
196
  <?php } ?>
197
- <?php } ?>
198
 
199
- <div class="wc-thread-wrapper">
200
- <?php
201
- $wc_wp_comments = $wc_core->get_wp_comments(1);
202
- $wc_parent_comments_count = $wc_wp_comments['wc_parent_comments_count'];
203
- echo $wc_wp_comments['wc_list'];
204
- ?>
205
- </div>
206
 
207
- <span style="display: none;">
208
- <input type="hidden" name="wc_home_url" value="<?php echo plugins_url(); ?>" id="wc_home_url" />
209
- <input type="hidden" name="wc_plugin_dir_url" value="<?php echo WC_Core::$PLUGIN_DIRECTORY; ?>" id="wc_plugin_dir_url" />
210
- <input type="hidden" name="wc_comments_offset" id="wc_comments_offset" value="1" />
211
- <input type="hidden" name="wc_parent_per_page" id="wc_parent_per_page" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_count; ?>" />
212
- <input type="hidden" name="wc_parent_comments_count" id="wc_parent_comments_count" value="<?php echo $wc_parent_comments_count; ?>" />
213
- <input type="hidden" name="wc_curr_user_comment_count" id="wc_curr_user_comment_count" class="wc_curr_user_comment_count" value="0" />
214
- <?php
215
- $wc_all_comments_count_old = $post->comment_count;
216
- $wc_last_comment_id = $wc_core->wc_db_helper->get_last_comment_id_by_post_id($post->ID);
217
- ?>
218
- <input type="hidden" name="wc_last_comment_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_comment_id" />
219
- <input type="hidden" name="wc_last_comment_id_before_update" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_comment_id_before_update" />
220
- <input type="hidden" name="wc_all_comments_count_old" value="<?php echo $wc_all_comments_count_old; ?>" id="wc_all_comments_count_old" />
221
- <input type="hidden" name="wc_comment_list_update_type" value="<?php echo $wc_comment_list_update_type; ?>" id="wc_comment_list_update_type" />
222
- <input type="hidden" name="wc_comment_list_update_timer" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_list_update_timer; ?>" id="wc_comment_list_update_timer" />
223
-
224
- <input type="hidden" name="wc_last_new_comment_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_new_comment_id" />
225
- <input type="hidden" name="wc_last_new_reply_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_new_reply_id" />
226
- <input type="hidden" name="wc_comment_reply_checkboxes_default_checked" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked; ?>" id="wc_comment_reply_checkboxes_default_checked" />
227
- </span>
228
-
229
- <div style="clear:both"></div>
230
- <div class="by-wpdiscuz"><span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
231
- 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>
232
-
233
- <div id="wc_openModalFormAction" class="modalDialog">
234
- <div id="wc_response_info" class="wc_modal">
235
- <div id="wc_response_info_box">
236
- <a href="#close" title="Close" class="close">&nbsp;</a>
237
- <img width="64" height="64" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/loader/ajax-loader-200x200.gif'); ?>" />
 
238
  </div>
239
  </div>
240
  </div>
241
  </div>
242
- </div>
243
- <?php if (comments_open($post->ID)) { ?>
244
- <?php do_action('comment_form_after'); ?>
245
  <?php } ?>
2
  global $post, $wc_core, $current_user;
3
  get_currentuserinfo();
4
 
5
+ if ($post->comment_count > 0) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ if ($wc_core->wc_db_helper->is_phrase_exists('wc_leave_a_reply_text')) {
8
+ $wc_core->wc_options->wc_options_serialized->wc_phrases = $wc_core->wc_db_helper->get_phrases();
9
+ }
 
10
 
11
+ $wc_comment_list_update_type = $wc_core->wc_options->wc_options_serialized->wc_comment_list_update_type;
12
+ ?>
13
+ <script type="text/javascript">
14
+ // initialize the validator function
15
+ validator.message['invalid'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_invalid_field']; ?>';
16
+ validator.message['empty'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_error_empty_text']; ?>';
17
+ validator.message['email'] = '<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_error_email_text']; ?>';
18
+
19
+ jQuery(document).ready(function ($) {
20
+ $(document).delegate('.wc-toggle', 'click', function () {
21
+ var toggleID = $(this).attr('id');
22
+ var uniqueID = toggleID.substring(toggleID.lastIndexOf('-') + 1);
23
+ $('#wc-comm-' + uniqueID + ' .wc-reply').slideToggle(500, function () {
24
+ if ($(this).is(':hidden')) {
25
+ $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_show_replies_text']; ?> &or;');
26
+ } else {
27
+ $('#' + toggleID).html('<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_hide_replies_text']; ?> &and;');
28
+ }
29
+ });
30
+ });
31
 
32
+ if ($.cookie('wc_author_name') !== '' && $.cookie('wc_author_email')) {
33
+ $('#wpcomm .wc_name').val($.cookie('wc_author_name'));
34
+ $('#wpcomm .wc_email').val($.cookie('wc_author_email'));
35
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ $('#wc_unsubscribe_message').delay(7000).fadeOut(1500, function () {
38
+ $(this).remove();
39
+ });
40
 
41
+ });
42
+ </script>
43
  <?php
44
+ $textarea_placeholder = '';
45
+ if ($post->comment_count) {
46
+ $textarea_placeholder = $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_comment_join_text'];
47
+ } else {
48
+ $textarea_placeholder = $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_comment_start_text'];
 
 
49
  }
50
+ $unique_id = $post->ID . '_' . 0;
51
+ $header_text = '<span class="wc_header_text_count">' . $post->comment_count . '</span> ';
52
+ $header_text .= $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_header_text'];
53
+ $header_text .= ($post->comment_count > 1) ? $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_plural_text'] : '';
54
+ $header_text .= ' ' . $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_header_on_text'];
55
+ $header_text .= ' "' . get_the_title($post) . '"';
56
  ?>
57
+ <div style="clear:both"></div>
58
+ <div class="comments-area">
59
 
 
 
 
 
60
 
61
+ <?php
62
+ if (isset($_GET['wpdiscuzSubscribeID']) && isset($_GET['key'])) {
63
+ $wc_core->wc_unsubscribe($_GET['wpdiscuzSubscribeID'], $_GET['key']);
 
 
 
 
64
  ?>
65
+ <div id="wc_unsubscribe_message">
66
+ <span class="wc_unsubscribe_message"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_unsubscribe_message']; ?></span>
 
 
67
  </div>
68
  <?php
69
  }
70
+ ?>
 
 
71
 
 
72
  <?php if (comments_open($post->ID)) { ?>
73
+ <h3 id="wc-comment-header"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_leave_a_reply_text']; ?></h3>
74
+ <?php } ?>
75
+ <?php do_action('comment_form_before'); ?>
76
+
77
+
78
+ <?php
79
+ if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_loggedin_username) {
80
+ if (is_user_logged_in()) {
81
+ global $current_user;
82
+ get_currentuserinfo();
83
+ $user_url = get_author_posts_url($current_user->ID);
84
+ ?>
85
+ <div id="wc_show_hide_loggedin_username">
86
+ <span class="wc_show_hide_loggedin_username">
87
+ <?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_logged_in_as'] . ' <a href="' . $user_url . '">' . $current_user->display_name . '</a> | <a href="' . wp_logout_url() . '">' . $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_log_out'] . '</a>'; ?>
88
+ </span>
89
+ </div>
90
  <?php
91
+ }
92
+ }
93
+ ?>
94
+
95
+
96
+ <div id="wpcomm">
97
+ <?php if (comments_open($post->ID)) { ?>
98
+ <p class="wc-comment-title">
99
+ <?php echo ($post->comment_count) ? $header_text : $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_be_the_first_text']; ?>
100
+ </p>
101
+ <?php do_action('comment_form_top'); ?>
102
+ <div class="wc-form-wrapper">
103
+ <?php
104
+ if ($wc_core->is_guest_can_comment()) {
105
+ ?>
106
 
107
+ <form action="" method="post" id="wc_comm_form-<?php echo $unique_id; ?>" class="wc_comm_form wc_main_comm_form">
108
+ <div class="wc-field-comment">
109
+ <div style="width:60px; float:left; position:absolute;">
110
+ <?php echo $wc_core->wc_helper->get_comment_author_avatar(); ?>
111
+ </div>
112
+ <div style="margin-left:65px;" class="item"><textarea id="wc_comment-<?php echo $unique_id; ?>" class="wc_comment wc_field_input" name="wc_comment" required="required" placeholder="<?php echo $textarea_placeholder; ?>"></textarea></div>
113
+ <div style="clear:both"></div>
114
  </div>
115
+ <div id="wc-form-footer-<?php echo $unique_id; ?>" class="wc-form-footer">
116
+ <?php if (!is_user_logged_in()) { ?>
117
+ <div class="wc-author-data">
118
+ <div class="wc-field-name item"><input id="wc_name-<?php echo $unique_id; ?>" class="wc_name wc_field_input" name="wc_name" required="required" value="" type="text" placeholder="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_name_text'] ?>"/></div>
119
+ <div class="wc-field-email item"><input id="wc_email-<?php echo $unique_id; ?>" class="wc_email wc_field_input email" name="wc_email" required="required" value="" type="email" placeholder="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_email_text']; ?>"/></div>
120
+ <div style="clear:both"></div>
121
+ </div>
122
+ <?php } ?>
123
+ <div class="wc-form-submit">
124
+ <?php if (!$wc_core->wc_options->wc_options_serialized->wc_captcha_show_hide) { ?>
125
+ <?php if (!is_user_logged_in()) { ?>
126
+ <div class="wc-field-captcha item">
127
+ <input id="wc_captcha-<?php echo $unique_id; ?>" class="wc_field_input wc_field_captcha" name="wc_captcha" required="required" value="" type="text" />
128
+ <span class="wc-label wc-captcha-label">
129
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/captcha/captcha.php?comm_id=' . $post->ID . '-' . 0); ?>" id="wc_captcha_img-<?php echo $unique_id; ?>" rel="nofollow"/>
130
+ <img src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/refresh-16x16.png'); ?>" id="wc_captcha_refresh_img-<?php echo $unique_id; ?>" class="wc_captcha_refresh_img" rel="nofollow"/>
131
+ </span>
132
+ <span class="captcha_msg"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_captcha_text']; ?></span>
133
+ </div>
134
+ <?php } ?>
135
+ <?php } ?>
136
+ <div class="wc-field-submit"><input type="button" name="submit" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_submit_text']; ?>" id="wc_comm-<?php echo $unique_id; ?>" class="wc_comm_submit button alt"/></div>
137
  <div style="clear:both"></div>
138
  </div>
139
+ <?php if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox || $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) { ?>
140
+ <span class="wc_manage_subscribtions"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_manage_subscribtions']; ?></span>
 
 
 
 
 
 
 
 
 
 
 
141
  <?php } ?>
142
+ <div class="wc_notification_checkboxes">
 
 
 
 
 
 
 
 
 
 
143
  <?php
144
+ if ($current_user->ID && $wc_core->wc_db_helper->wc_has_post_notification($post->ID, $current_user->user_email)) {
 
 
 
145
  ?>
146
+ <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>
147
  <?php
148
  } else {
149
+ $wc_notification_state = ($wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked == 1) ? 'checked="checked" value="1"' : 'value="0"';
150
 
151
+ if ($current_user->ID && $wc_core->wc_db_helper->wc_has_all_comments_notification($post->ID, $current_user->user_email)) {
152
  ?>
153
+ <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/>
154
  <?php
155
+ } else {
156
+
157
+ if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_reply_checkbox) {
158
+ ?>
159
+ <input id="wc_notification_new_reply-<?php echo $unique_id; ?>" class="wc_notification_new_reply" <?php echo $wc_notification_state; ?> type="checkbox" name="wp_comment_reply_notification"/> <label class="wc-label-reply-notify" for="wc_notification_new_reply-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_reply']; ?></label><br />
160
+ <?php
161
+ }
162
+
163
+ if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_all_reply_checkbox) {
164
+ ?>
165
+ <input id="wc_notification_all_new_reply-<?php echo $unique_id; ?>" class="wc_notification_all_new_reply" <?php echo $wc_notification_state; ?> type="checkbox" name="wc_notification_all_new_reply"/> <label class="wc-label-all-reply-notify" for="wc_notification_all_new_reply-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_all_new_reply']; ?></label><br />
166
+ <?php
167
+ }
168
  }
169
 
170
+ if ($wc_core->wc_options->wc_options_serialized->wc_show_hide_comment_checkbox) {
171
+ ?>
172
+ <input id="wc_notification_new_comment-<?php echo $unique_id; ?>" class="wc_notification_new_comment" <?php echo $wc_notification_state; ?> type="checkbox" name="wp_post_comment_notification"/> <label class="wc-label-comment-notify" for="wc_notification_new_comment-<?php echo $unique_id; ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_notify_on_new_comment']; ?></label><br />
173
  <?php
174
  }
175
  }
176
+ ?>
177
 
178
+ </div>
 
 
 
 
 
 
 
 
179
 
180
+ </div>
181
+ <input type="hidden" name="wc_comment_post_ID" value="<?php echo $post->ID; ?>" id="wc_comment_post_ID-<?php echo $unique_id; ?>" />
182
+ <input type="hidden" name="wc_comment_parent" value="0" id="wc_comment_parent-<?php echo $unique_id; ?>" />
183
+ </form>
184
+ <?php } else { ?>
185
+ <p class="wc-must-login"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_you_must_be_text']; ?> <a href="<?php echo wp_login_url(); ?>"><?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_logged_in_text']; ?></a> <?php echo $wc_core->wc_options->wc_options_serialized->wc_phrases['wc_to_post_comment_text']; ?></p>
186
+ <?php
187
+ }
188
+ ?>
 
 
 
 
 
 
 
189
  </div>
190
+ <hr/>
191
+ <?php if ($wc_comment_list_update_type == 2) { ?>
192
+ <div class="wc_new_comment_and_replies">
193
+ <div class="wc_new_comment"><span class="wc_new_comment_button_text"></span></div>
194
+ <div class="wc_new_reply"><span class="wc_new_reply_button_text"></span></div>
195
+ <div style="clear:both"></div>
196
+ </div>
197
+ <div style="clear:both"></div>
198
+ <?php } ?>
199
  <?php } ?>
 
200
 
201
+ <div class="wc-thread-wrapper">
202
+ <?php
203
+ $wc_wp_comments = $wc_core->get_wp_comments(1);
204
+ $wc_parent_comments_count = $wc_wp_comments['wc_parent_comments_count'];
205
+ echo $wc_wp_comments['wc_list'];
206
+ ?>
207
+ </div>
208
 
209
+ <span style="display: none;">
210
+ <input type="hidden" name="wc_home_url" value="<?php echo plugins_url(); ?>" id="wc_home_url" />
211
+ <input type="hidden" name="wc_plugin_dir_url" value="<?php echo WC_Core::$PLUGIN_DIRECTORY; ?>" id="wc_plugin_dir_url" />
212
+ <input type="hidden" name="wc_comments_offset" id="wc_comments_offset" value="1" />
213
+ <input type="hidden" name="wc_parent_per_page" id="wc_parent_per_page" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_count; ?>" />
214
+ <input type="hidden" name="wc_parent_comments_count" id="wc_parent_comments_count" value="<?php echo $wc_parent_comments_count; ?>" />
215
+ <input type="hidden" name="wc_curr_user_comment_count" id="wc_curr_user_comment_count" class="wc_curr_user_comment_count" value="0" />
216
+ <?php
217
+ $wc_all_comments_count_old = $post->comment_count;
218
+ $wc_last_comment_id = $wc_core->wc_db_helper->get_last_comment_id_by_post_id($post->ID);
219
+ ?>
220
+ <input type="hidden" name="wc_last_comment_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_comment_id" />
221
+ <input type="hidden" name="wc_last_comment_id_before_update" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_comment_id_before_update" />
222
+ <input type="hidden" name="wc_all_comments_count_old" value="<?php echo $wc_all_comments_count_old; ?>" id="wc_all_comments_count_old" />
223
+ <input type="hidden" name="wc_comment_list_update_type" value="<?php echo $wc_comment_list_update_type; ?>" id="wc_comment_list_update_type" />
224
+ <input type="hidden" name="wc_comment_list_update_timer" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_list_update_timer; ?>" id="wc_comment_list_update_timer" />
225
+
226
+ <input type="hidden" name="wc_last_new_comment_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_new_comment_id" />
227
+ <input type="hidden" name="wc_last_new_reply_id" value="<?php echo $wc_last_comment_id; ?>" id="wc_last_new_reply_id" />
228
+ <input type="hidden" name="wc_comment_reply_checkboxes_default_checked" value="<?php echo $wc_core->wc_options->wc_options_serialized->wc_comment_reply_checkboxes_default_checked; ?>" id="wc_comment_reply_checkboxes_default_checked" />
229
+ </span>
230
+
231
+ <div style="clear:both"></div>
232
+ <div class="by-wpdiscuz"><span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
233
+ 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>
234
+
235
+ <div id="wc_openModalFormAction" class="modalDialog">
236
+ <div id="wc_response_info" class="wc_modal">
237
+ <div id="wc_response_info_box">
238
+ <a href="#close" title="Close" class="close">&nbsp;</a>
239
+ <img width="64" height="64" src="<?php echo plugins_url(WC_Core::$PLUGIN_DIRECTORY . '/files/img/loader/ajax-loader-200x200.gif'); ?>" />
240
+ </div>
241
  </div>
242
  </div>
243
  </div>
244
  </div>
245
+ <?php if (comments_open($post->ID)) { ?>
246
+ <?php do_action('comment_form_after'); ?>
247
+ <?php } ?>
248
  <?php } ?>
files/js/wc-ajax.js CHANGED
@@ -334,9 +334,16 @@ jQuery(document).ready(function ($) {
334
  $('#wc_last_new_comment_id').val(obj.wc_last_comment_id);
335
  $('.wc_new_comment').hide();
336
  $(document).delegate('.wc_new_loaded_comment', 'mouseenter', function () {
337
- $(this, '.wc-comment-right').animate({
338
- backgroundColor: "#fefefe"
339
- }, 1500);
 
 
 
 
 
 
 
340
  $(this, '.wc-comment-right').removeClass('wc_new_loaded_comment');
341
  });
342
  }
334
  $('#wc_last_new_comment_id').val(obj.wc_last_comment_id);
335
  $('.wc_new_comment').hide();
336
  $(document).delegate('.wc_new_loaded_comment', 'mouseenter', function () {
337
+ if ($(this).parent('.wc-comment').hasClass('wc-reply')) {
338
+ $(this, '.wc-comment-right').animate({
339
+ backgroundColor: "#f8f8f8"
340
+ }, 1500);
341
+ } else {
342
+ $(this, '.wc-comment-right').animate({
343
+ backgroundColor: "#fefefe"
344
+ }, 1500);
345
+ }
346
+
347
  $(this, '.wc-comment-right').removeClass('wc_new_loaded_comment');
348
  });
349
  }
includes/wc-db-helper.php CHANGED
@@ -255,7 +255,6 @@ class WC_DB_Helper {
255
 
256
  public function wc_has_all_comments_notification($post_id, $email) {
257
  $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);
258
- // echo $sql;
259
  $result = $this->db->get_results($sql, ARRAY_N);
260
  return count($result);
261
  }
255
 
256
  public function wc_has_all_comments_notification($post_id, $email) {
257
  $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);
 
258
  $result = $this->db->get_results($sql, ARRAY_N);
259
  return count($result);
260
  }
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.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -110,6 +110,9 @@ IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz u
110
 
111
  == Changelog ==
112
 
 
 
 
113
  = 2.0.6 =
114
  * Fixed Bug: Problem with saving new pharses (Same text on checboxes)
115
 
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.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
110
 
111
  == Changelog ==
112
 
113
+ = 2.0.7 =
114
+ * Fixed Bug: Comment system hiding problem on posts with disabled discussion option.
115
+
116
  = 2.0.6 =
117
  * Fixed Bug: Problem with saving new pharses (Same text on checboxes)
118
 
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.6
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/
@@ -111,10 +111,7 @@ class WC_Core {
111
 
112
  private function wc_add_new_options() {
113
  $this->wc_options->wc_options_serialized->init_options(get_option($this->wc_options->wc_options_serialized->wc_options_slug));
114
- $wc_new_options = $this->wc_options->wc_options_serialized->to_array();
115
- $wc_new_options['wc_show_hide_comment_checkbox'] = '1';
116
- $wc_new_options['wc_show_hide_reply_checkbox'] = '1';
117
- $wc_new_options['wc_show_hide_all_reply_checkbox'] = '1';
118
  update_option($this->wc_options->wc_options_serialized->wc_options_slug, serialize($wc_new_options));
119
  }
120
 
@@ -767,7 +764,7 @@ class WC_Core {
767
 
768
  public function init_current_post_type() {
769
  global $post;
770
- if (in_array($post->post_type, $this->wc_options->wc_options_serialized->wc_post_types)) {
771
  add_filter('comments_template', array(&$this, 'remove_comments_template_on_pages'), 1);
772
  }
773
  }
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.7
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/
111
 
112
  private function wc_add_new_options() {
113
  $this->wc_options->wc_options_serialized->init_options(get_option($this->wc_options->wc_options_serialized->wc_options_slug));
114
+ $wc_new_options = $this->wc_options->wc_options_serialized->to_array();
 
 
 
115
  update_option($this->wc_options->wc_options_serialized->wc_options_slug, serialize($wc_new_options));
116
  }
117
 
764
 
765
  public function init_current_post_type() {
766
  global $post;
767
+ if (in_array($post->post_type, $this->wc_options->wc_options_serialized->wc_post_types)) {
768
  add_filter('comments_template', array(&$this, 'remove_comments_template_on_pages'), 1);
769
  }
770
  }