Comments – wpDiscuz - Version 3.0.4

Version Description

Big news! wpDiscuz comes with comments Lazy Loading feature.

  • Added: Lazy load comments on scrolling.
  • Added: Compatible with WordPress Zero Spam plugin

IMPORTANT: If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.

Download this release

Release Info

Developer gzakar
Plugin Icon 128x128 Comments – wpDiscuz
Version 3.0.4
Comparing to
See all releases

Code changes from version 3.0.3 to 3.0.4

assets/js/wpdiscuz.js CHANGED
@@ -11,7 +11,8 @@ jQuery(document).ready(function ($) {
11
  var isShowCaptchaForMembers = parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members) > 0 && wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;
12
  var mainFormTimeOut = wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;
13
  var secondaryFormTimeOut = wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;
14
- var isLoadAllComments = wpdiscuz_ajax_obj.wpdiscuz_options.wc_load_all_comments;
 
15
  var wpdiscuzPostId = wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;
16
  var commentListUpdateType = wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;
17
  var commentListUpdateTimer = wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;
@@ -30,7 +31,7 @@ jQuery(document).ready(function ($) {
30
 
31
  $('#wc_unsubscribe_message').delay(7000).fadeOut(1500, function () {
32
  $(this).remove();
33
- location.href = location.href.substring(0, location.href.indexOf('subscribeAnchor'));
34
  });
35
 
36
  if ($('.wc_main_comm_form').length) {
@@ -90,7 +91,7 @@ jQuery(document).ready(function ($) {
90
  changeCaptchaImage($(this));
91
  });
92
 
93
- function changeCaptchaImage(reloadImage) {
94
  if (isShowCaptchaForGuests || isShowCaptchaForMembers) {
95
  var captchaImg = $(reloadImage).prev().children('.wc_captcha_img');
96
  var src = captchaImg.attr('src');
@@ -126,6 +127,9 @@ jQuery(document).ready(function ($) {
126
  var messageKey = '';
127
  var message = '';
128
  var data = wcForm.serialize() + '&wc_comment_depth=' + depth + '&comment_post_ID=' + wpdiscuzPostId;
 
 
 
129
  getAjaxObject('addComment', data).done(function (response) {
130
  try {
131
  var obj = $.parseJSON(response);
@@ -308,6 +312,23 @@ jQuery(document).ready(function ($) {
308
  //============================== EDIT COMMENT FUNCTION ============================== //
309
  //============================== LOAD MORE ============================== //
310
  $(document).delegate('.wc-load-more-submit', 'click', function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  var data;
312
  if (wpdiscuzCommentOrderBy == 'vote') {
313
  data = 'offset=' + wpdiscuzLoadCount + '&orderBy=' + wpdiscuzCommentOrderBy + '&order=' + wpdiscuzCommentOrder;
@@ -315,13 +336,15 @@ jQuery(document).ready(function ($) {
315
  } else {
316
  data = 'orderBy=' + wpdiscuzCommentOrderBy + '&order=' + wpdiscuzCommentOrder + '&lastParentId=' + getLastParentID();
317
  }
318
- data += '&postId=' + wpdiscuzPostId + '&loadAllCommnts=' + isLoadAllComments;
319
  getAjaxObject('loadMoreComments', data).done(function (response) {
320
  try {
321
  var obj = $.parseJSON(response);
322
  $('.wpdiscuz-comment-pagination').before(obj.comment_list);
323
  setLoadMoreVisibility(obj);
324
  $('.wpdiscuz_single').remove();
 
 
325
  } catch (e) {
326
  console.log(e);
327
  }
@@ -329,7 +352,7 @@ jQuery(document).ready(function ($) {
329
  $('.wpdiscuz-loading-bar').hide();
330
  $('.wc-load-more-submit').blur();
331
  });
332
- });
333
 
334
  function setLoadMoreVisibility(obj) {
335
  if (obj.is_show_load_more != false) {
@@ -375,6 +398,7 @@ jQuery(document).ready(function ($) {
375
  //============================== VOTE ============================== //
376
  //============================== SORTING ============================== //
377
  $(document).delegate('.wpdiscuz-sort-button', 'click', function () {
 
378
  if (!($(this).hasClass('wpdiscuz-sort-button-active'))) {
379
  var clickedBtn = $(this);
380
  if ($(this).hasClass('wpdiscuz-vote-sort-up')) {
@@ -594,7 +618,9 @@ jQuery(document).ready(function ($) {
594
  function setLastParentID(lastParentID) {
595
  var url = $('.wc-load-more-link').attr("href");
596
  $('.wc-load-more-link').attr("href", url.replace(/[\d]+$/m, lastParentID));
597
- $('.wpdiscuz-comment-pagination').show();
 
 
598
  }
599
 
600
 
11
  var isShowCaptchaForMembers = parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members) > 0 && wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;
12
  var mainFormTimeOut = wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;
13
  var secondaryFormTimeOut = wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;
14
+ var commentListLoadType = wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;
15
+ var wordpressIsPaginate = wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;
16
  var wpdiscuzPostId = wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;
17
  var commentListUpdateType = wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;
18
  var commentListUpdateTimer = wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;
31
 
32
  $('#wc_unsubscribe_message').delay(7000).fadeOut(1500, function () {
33
  $(this).remove();
34
+ location.href = location.href.substring(0, location.href.indexOf('subscribeAnchor') - 1);
35
  });
36
 
37
  if ($('.wc_main_comm_form').length) {
91
  changeCaptchaImage($(this));
92
  });
93
 
94
+ function changeCaptchaImage(reloadImage) {
95
  if (isShowCaptchaForGuests || isShowCaptchaForMembers) {
96
  var captchaImg = $(reloadImage).prev().children('.wc_captcha_img');
97
  var src = captchaImg.attr('src');
127
  var messageKey = '';
128
  var message = '';
129
  var data = wcForm.serialize() + '&wc_comment_depth=' + depth + '&comment_post_ID=' + wpdiscuzPostId;
130
+ if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){
131
+ data += '&wpdiscuz_zs=' + wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs;
132
+ }
133
  getAjaxObject('addComment', data).done(function (response) {
134
  try {
135
  var obj = $.parseJSON(response);
312
  //============================== EDIT COMMENT FUNCTION ============================== //
313
  //============================== LOAD MORE ============================== //
314
  $(document).delegate('.wc-load-more-submit', 'click', function () {
315
+ wpdiscuzLoadComments();
316
+ });
317
+
318
+ var wpdiscuzHasMoreComments = $('#wpdiscuzHasMoreComments').val();
319
+ var isRun = false;
320
+ if (commentListLoadType == 2 && !wordpressIsPaginate) {
321
+ $('.wc-load-more-submit').parents('.wpdiscuz-comment-pagination').hide();
322
+ $(window).scroll(function () {
323
+ var scrollHeight = document.getElementById('wcThreadWrapper').scrollHeight;
324
+ if ($(window).scrollTop() >= scrollHeight && isRun === false && wpdiscuzHasMoreComments) {
325
+ isRun = true;
326
+ wpdiscuzLoadComments();
327
+ }
328
+ });
329
+ }
330
+
331
+ function wpdiscuzLoadComments() {
332
  var data;
333
  if (wpdiscuzCommentOrderBy == 'vote') {
334
  data = 'offset=' + wpdiscuzLoadCount + '&orderBy=' + wpdiscuzCommentOrderBy + '&order=' + wpdiscuzCommentOrder;
336
  } else {
337
  data = 'orderBy=' + wpdiscuzCommentOrderBy + '&order=' + wpdiscuzCommentOrder + '&lastParentId=' + getLastParentID();
338
  }
339
+ data += '&postId=' + wpdiscuzPostId + '&loadAllCommnts=' + commentListLoadType;
340
  getAjaxObject('loadMoreComments', data).done(function (response) {
341
  try {
342
  var obj = $.parseJSON(response);
343
  $('.wpdiscuz-comment-pagination').before(obj.comment_list);
344
  setLoadMoreVisibility(obj);
345
  $('.wpdiscuz_single').remove();
346
+ isRun = false;
347
+ wpdiscuzHasMoreComments = obj.is_show_load_more;
348
  } catch (e) {
349
  console.log(e);
350
  }
352
  $('.wpdiscuz-loading-bar').hide();
353
  $('.wc-load-more-submit').blur();
354
  });
355
+ }
356
 
357
  function setLoadMoreVisibility(obj) {
358
  if (obj.is_show_load_more != false) {
398
  //============================== VOTE ============================== //
399
  //============================== SORTING ============================== //
400
  $(document).delegate('.wpdiscuz-sort-button', 'click', function () {
401
+ wpdiscuzHasMoreComments = 1;
402
  if (!($(this).hasClass('wpdiscuz-sort-button-active'))) {
403
  var clickedBtn = $(this);
404
  if ($(this).hasClass('wpdiscuz-vote-sort-up')) {
618
  function setLastParentID(lastParentID) {
619
  var url = $('.wc-load-more-link').attr("href");
620
  $('.wc-load-more-link').attr("href", url.replace(/[\d]+$/m, lastParentID));
621
+ if (commentListLoadType != 2) {
622
+ $('.wpdiscuz-comment-pagination').show();
623
+ }
624
  }
625
 
626
 
assets/js/wpdiscuz.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- jQuery(document).ready(function(C){wpdiscuzValidator.message.invalid=wpdiscuz_ajax_obj.wpdiscuz_options.wc_invalid_field;wpdiscuzValidator.message.empty=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_empty_text;wpdiscuzValidator.message.email=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_email_text;wpdiscuzValidator.message.url=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_url_text;wpdiscuzValidator.message.min=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_min_length;wpdiscuzValidator.message.max=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_max_length;var O=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!O;var N=parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members)>0&&wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var w=wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;var l=wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;var b=wpdiscuz_ajax_obj.wpdiscuz_options.wc_load_all_comments;var o=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var j=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var i=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var F=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var P=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var c;var m="date";var J=[];var u=[];D();g();C(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active");C("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){C(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor"))});if(C(".wc_main_comm_form").length){var E=n(C(".wc_main_comm_form"),1);f()}C(document).delegate(".wc-reply-link","click",function(){if(C(this).hasClass("wpdiscuz-clonned")){C("#wc-secondary-form-wrapper-"+n(C(this),0)).slideToggle(700)}else{h(C(this))}f()});C(document).delegate("textarea.wc_comment","focus",function(){C(this).autoGrow();var U=C(this).parents(".wc-form-wrapper");C(".wc-form-footer",U).slideDown(700)});C(document).delegate(".wc-share-link","click",function(){var U=C(this).parents(".wc-comment-right");C(".share_buttons_box",U).slideToggle(1000)});C(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(U){U.preventDefault()});C(document).delegate(".wc-toggle","click",function(){var V=n(C(this),0);var U=C(this);C("#wc-comm-"+V+"> .wc-reply").slideToggle(700,function(){if(C(this).is(":hidden")){U.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{U.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" &and;")}})});C(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(C(this).hasClass("wc-reply")){C(">.wc-comment-right",C(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{C(">.wc-comment-right",C(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});C(document).delegate(".wc_captcha_refresh_img","click",function(){M(C(this))});function M(Y){if(q||N){var W=C(Y).prev().children(".wc_captcha_img");var X=W.attr("src");var U=X.substring(0,X.lastIndexOf("="))+"="+Math.random();W.attr("src",U);var V=Y.parents(".wc-form-wrapper").hasClass("wc-secondary-form-wrapper")?0:1;var Z=n(Y,V)}}C(document).delegate(".wc_comm_submit","click",function(){var Y=true;var Z=1;var X=C(this).parents("form");if(!X.hasClass("wc_main_comm_form")){Z=B(C(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&C(".wc_email",X).val()){C(".wc_email",X).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(C(".wc_email",X).val())){C(".wc_email",X).removeAttr("required");C(".wc_email",X).next(".alert").html("")}if(!wpdiscuzValidator.checkAll(X)){Y=false}else{var U="";var V="";var W=X.serialize()+"&wc_comment_depth="+Z+"&comment_post_ID="+o;e("addComment",W).done(function(ab){try{var ad=C.parseJSON(ab);U=ad.code;if(parseInt(U)>=0){var aa=ad.is_main;V=ad.message;C(".wc_header_text_count").html(ad.wc_all_comments_count_new);if(aa){C(".wc-thread-wrapper").prepend(V)}else{C("#wc-secondary-form-wrapper-"+U).slideToggle(700);if(ad.is_in_same_container==1){C("#wc-secondary-form-wrapper-"+U).after(V)}else{C("#wc-secondary-form-wrapper-"+U).after(V.replace("wc-reply","wc-reply wc-no-left-margin"))}}p(ad);R(ad);t(X,ad);X.get(0).reset();f()}else{V=wpdiscuz_ajax_obj.wpdiscuz_options[U];s(X,U,V,true)}}catch(ac){if(ab.indexOf("<")>=0&&ab.indexOf(">")>=0){V=ac}else{V=ab}s(X,"wc_invalid_field",V,true)}M(C(".wc_captcha_refresh_img",X));D();C(".wpdiscuz-loading-bar").hide()})}});function p(W){if(!W.held_moderate){var V="post_id="+o+"&comment_id="+W.new_comment_id+"&email="+W.user_email+"&isParent="+W.is_main;var U=e("checkNotificationType",V);U.done(function(X){try{W=C.parseJSON(X)}catch(Y){console.log(Y)}})}}function R(W){if(W.redirect>0&&W.new_comment_id){var V="commentId="+W.new_comment_id;var U=e("redirect",V);U.done(function(X){W=C.parseJSON(X);if(W.code==1){setTimeout(function(){window.location.href=W.redirect_to},5000)}})}}function f(){if(C.cookie("wc_author_name")){C(".wc_comm_form .wc_name").val(C.cookie("wc_author_name"))}if(C.cookie("wc_author_email")){C(".wc_comm_form .wc_email").val(C.cookie("wc_author_email"))}if(C.cookie("wc_author_website")){C(".wc_comm_form .wc_website").val(C.cookie("wc_author_website"))}}function t(U,V){if(C(".wc_email",U).val()){C.cookie("wc_author_email",C(".wc_email",U).val())}else{C.cookie("wc_author_email",V.user_email)}if(C(".wc_name",U).val()){C.cookie("wc_author_name",C(".wc_name",U).val())}else{C.cookie("wc_author_name",V.user_name)}C.cookie("wc_author_website",C(".wc_website",U).val())}var Q;C(document).delegate(".wc_editable_comment","click",function(){var X=n(C(this),0);var U=S(X);var W=C(this);var V="commentId="+U;e("editComment",V).done(function(Z){try{var ad=C.parseJSON(Z);var ab="";var aa=ad.code;if(parseInt(aa)>=0){Q=ad.message;var Y='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+X+'" style="min-height: 2em;">'+ad.message+"</textarea>";C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-text").replaceWith(Y);document.getElementById("wc_edit_comment-"+X).focus();C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();Y="";C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ab=wpdiscuz_ajax_obj.wpdiscuz_options[aa];s(W,aa,ab,false)}}catch(ac){console.log(ac)}C(".wpdiscuz-loading-bar").hide()})});C(document).delegate(".wc_save_edited_comment","click",function(){var Z=n(C(this));var V=S(Z);var U=C("#wc-comm-"+Z+" textarea#wc_edit_comment-"+Z);var W=U.val();var Y=C(this);if(C.trim(W).length>0){var X="commentId="+V+"&commentContent="+W;e("saveEditedComment",X).done(function(aa){try{var ae=C.parseJSON(aa);var ab=ae.code;var ac="";if(parseInt(ab)>=0){G(Z,ae.message)}else{ac=wpdiscuz_ajax_obj.wpdiscuz_options[ab];s(Y,ab,ac,false)}U="";W=""}catch(ad){console.log(ad)}C(".wpdiscuz-loading-bar").hide()})}});C(document).delegate(".wc_cancel_edit","click",function(){var U=n(C(this));G(U,Q)});function G(W,V){C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var U='<div class="wc-comment-text">'+k(V)+"</div>";C("#wc-comm-"+W+" #wc_edit_comment-"+W).replaceWith(U)}function k(X,W){var V=(W||typeof W==="undefined")?"<br/>":"<br>";var U=(X+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+V+"$2");return U.replace("<br><br>","<br/>")}C(document).delegate(".wc-load-more-submit","click",function(){var U;if(m=="vote"){U="offset="+c+"&orderBy="+m+"&order="+a;c++}else{U="orderBy="+m+"&order="+a+"&lastParentId="+v()}U+="&postId="+o+"&loadAllCommnts="+b;e("loadMoreComments",U).done(function(V){try{var X=C.parseJSON(V);C(".wpdiscuz-comment-pagination").before(X.comment_list);r(X);C(".wpdiscuz_single").remove()}catch(W){console.log(W)}D();C(".wpdiscuz-loading-bar").hide();C(".wc-load-more-submit").blur()})});function r(U){if(U.is_show_load_more!=false){L(U.last_parent_id)}else{C(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}}C(document).delegate(".wc_vote","click",function(){var U=C(this);var X="";var Y="";var V=C(this).parents(".wc-comment-right").attr("id");V=V.substring(V.lastIndexOf("-")+1);var W;if(C(this).hasClass("wc-up")){W=1}else{W=-1}var Z="commentId="+V+"&voteType="+W;e("voteOnComment",Z).done(function(aa){try{var ac=C.parseJSON(aa);X=ac.code;if(parseInt(X)>=0){var ad=C(".wc-comment-footer .wc-vote-result",C("#comment-"+V));C(ad).text(parseInt(C(ad).text())+W)}else{Y=wpdiscuz_ajax_obj.wpdiscuz_options[X];s(U,X,Y,false)}}catch(ab){console.log(ab)}C(".wpdiscuz-loading-bar").hide()})});C(document).delegate(".wpdiscuz-sort-button","click",function(){if(!(C(this).hasClass("wpdiscuz-sort-button-active"))){var X=C(this);if(C(this).hasClass("wpdiscuz-vote-sort-up")){m="vote";a="desc"}else{m="date";a=C(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var W="postId="+o+"&orderBy="+m+"&order="+a;var U="";var V="";e("wpdiscuzSorting",W).done(function(Y){try{var aa=C.parseJSON(Y);U=aa.code;V=aa.message;if(parseInt(U)>0){C("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){C(this).remove()});C("#wpcomm .wc-thread-wrapper").prepend(V);c=parseInt(aa.loadCount)}else{}I(X);r(aa)}catch(Z){console.log(Z)}D();C(".wpdiscuz-loading-bar").hide()})}});function I(U){C(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){C(this).removeClass("wpdiscuz-sort-button-active")});U.addClass("wpdiscuz-sort-button-active")}function T(){var Y=location.href;var X=Y.match(/#comment\-(\d+)/);if(X!==null){var V=X[1];if(!C("#comment-"+V).length){var W="commentId="+V;var U=e("getSingleComment",W);U.done(function(Z){try{var ab=C.parseJSON(Z);C(".wc-thread-wrapper").prepend(ab.message);C("html, body").animate({scrollTop:C(".wc-thread-wrapper").offset().top},1000)}catch(aa){console.log(aa)}D();C(".wpdiscuz-loading-bar").hide()})}}}T();if(j>0&&P&&(O||(!O&&!F))){setInterval(K,parseInt(i)*1000)}function K(){var X=A();var V=(C.cookie("wc_author_email")!=undefined&&C.cookie("wc_author_email")!="")?C.cookie("wc_author_email"):"";var W="postId="+o+"&loadLastCommentId="+P+"&visibleCommentIds="+X+"&email="+V;var U=e("liveUpdate",W);U.done(function(Z){try{var ae=C.parseJSON(Z);if(ae.code==1){if(j==1){y(ae)}else{u=u.concat(ae.message.comments);J=J.concat(ae.message.author_replies);var aa=u.length;var Y=J.length;if(aa>0){var ac=aa+" ";ac+=aa>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;C(".wc_new_comment").html(ac).show()}else{C(".wc_new_comment").hide()}if(Y>0){var ab=Y+" ";ab+=Y>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;C(".wc_new_reply").html(ab).show()}else{C(".wc_new_reply").hide()}}C(".wc_header_text_count").html(ae.wc_all_comments_count_new);P=ae.loadLastCommentId}}catch(ad){console.log(ad)}D();C(".wpdiscuz-loading-bar").hide()})}function y(X){if(X.message!==undefined){var U;var W=X.message;for(var V=0;V<W.length;V++){U=W[V];x(U.comment_parent,U.comment_html)}}}C(document).delegate(".wc-update-on-click","click",function(){var U;var V=C(this);if(V.hasClass("wc_new_comment")){U=u.join()}else{U=J.join()}e("updateOnClick",U).done(function(W){try{var Y=C.parseJSON(W);y(Y);if(V.hasClass("wc_new_comment")){u=[];C(".wc_new_comment").hide()}else{J=[];C(".wc_new_reply").hide()}}catch(X){console.log(X)}D();C(".wpdiscuz-loading-bar").hide()})});function s(Y,V,X,W){var U;var Z;if(W){Z=Y.parents(".wc-form-wrapper")}else{Z=Y.closest(".wc-comment")}U=Z.children(".wpdiscuz-comment-message");U.addClass(V);U.html(X);U.show().delay(5000).fadeOut(1000,function(){U.removeClass();U.addClass("wpdiscuz-comment-message");U.html("")})}function h(U){var V=n(U,0);C("#wpdiscuz_form_anchor-"+V).before(H(V));C("#wc-secondary-form-wrapper-"+V).slideToggle(700,function(){U.addClass("wpdiscuz-clonned")})}function H(V){var U=C("#wpdiscuz_hidden_secondary_form").html();return U.replace(/wpdiscuzuniqueid/g,V)}function n(W,V){var U="";if(V){U=W.parents(".wc-main-form-wrapper").attr("id")}else{U=W.parents(".wc-comment").attr("id")}var X=U.substring(U.lastIndexOf("-")+1);return X}function S(U){return U.substring(0,U.indexOf("_"))}function z(V){var U=V.substring(V.indexOf("_")+1);return U}function v(){var U=C(".wc-load-more-link").attr("href");return U.substring(U.lastIndexOf("=")+1)}function L(U){var V=C(".wc-load-more-link").attr("href");C(".wc-load-more-link").attr("href",V.replace(/[\d]+$/m,U));C(".wpdiscuz-comment-pagination").show()}function B(W){var V=W.attr("class");var U=V.split(" ");var X="";C.each(U,function(Y,Z){if("wc_comment_level"===d(Z,false)){X=d(Z,true)}});return parseInt(X)+1}function d(U,V){var W="";if(V){W=U.substring(U.indexOf("-")+1)}else{W=U.substring(0,U.indexOf("-"))}return W}function e(V,U){if(V!=="liveUpdate"){C(".wpdiscuz-loading-bar").show()}return C.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:U,action:V}})}function x(W,V){if(W==0){C(".wc-thread-wrapper").prepend(V)}else{var U=n(C("#comment-"+W),0);C("#wpdiscuz_form_anchor-"+U).after(V)}}function A(){var W;var U;var V="";C(".wc-comment-right").each(function(){W=n(C(this),0);U=S(W);V+=U+","});return V}function D(){C(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});C(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function g(){if(C(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){C(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .the_champ_login_container").length){C(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .social_connect_form").length){C(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .oneall_social_login_providers").length){C(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}}}}}});
1
 
2
+ jQuery(document).ready(function(D){wpdiscuzValidator.message.invalid=wpdiscuz_ajax_obj.wpdiscuz_options.wc_invalid_field;wpdiscuzValidator.message.empty=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_empty_text;wpdiscuzValidator.message.email=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_email_text;wpdiscuzValidator.message.url=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_url_text;wpdiscuzValidator.message.min=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_min_length;wpdiscuzValidator.message.max=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_max_length;var R=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!R;var Q=parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members)>0&&wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var w=wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;var k=wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;var B=wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;var V=wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;var n=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var i=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var h=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var I=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var S=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var b;var l="date";var M=[];var u=[];E();f();D(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active");D("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){D(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor")-1)});if(D(".wc_main_comm_form").length){var G=m(D(".wc_main_comm_form"),1);e()}D(document).delegate(".wc-reply-link","click",function(){if(D(this).hasClass("wpdiscuz-clonned")){D("#wc-secondary-form-wrapper-"+m(D(this),0)).slideToggle(700)}else{g(D(this))}e()});D(document).delegate("textarea.wc_comment","focus",function(){D(this).autoGrow();var Y=D(this).parents(".wc-form-wrapper");D(".wc-form-footer",Y).slideDown(700)});D(document).delegate(".wc-share-link","click",function(){var Y=D(this).parents(".wc-comment-right");D(".share_buttons_box",Y).slideToggle(1000)});D(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(Y){Y.preventDefault()});D(document).delegate(".wc-toggle","click",function(){var Z=m(D(this),0);var Y=D(this);D("#wc-comm-"+Z+"> .wc-reply").slideToggle(700,function(){if(D(this).is(":hidden")){Y.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{Y.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" &and;")}})});D(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(D(this).hasClass("wc-reply")){D(">.wc-comment-right",D(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{D(">.wc-comment-right",D(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});D(document).delegate(".wc_captcha_refresh_img","click",function(){P(D(this))});function P(ac){if(q||Q){var aa=D(ac).prev().children(".wc_captcha_img");var ab=aa.attr("src");var Y=ab.substring(0,ab.lastIndexOf("="))+"="+Math.random();aa.attr("src",Y);var Z=ac.parents(".wc-form-wrapper").hasClass("wc-secondary-form-wrapper")?0:1;var ad=m(ac,Z)}}D(document).delegate(".wc_comm_submit","click",function(){var ac=true;var ad=1;var ab=D(this).parents("form");if(!ab.hasClass("wc_main_comm_form")){ad=C(D(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&D(".wc_email",ab).val()){D(".wc_email",ab).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(D(".wc_email",ab).val())){D(".wc_email",ab).removeAttr("required");D(".wc_email",ab).next(".alert").html("")}if(!wpdiscuzValidator.checkAll(ab)){ac=false}else{var Y="";var Z="";var aa=ab.serialize()+"&wc_comment_depth="+ad+"&comment_post_ID="+n;if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){aa+="&wpdiscuz_zs="+wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs}d("addComment",aa).done(function(af){try{var ah=D.parseJSON(af);Y=ah.code;if(parseInt(Y)>=0){var ae=ah.is_main;Z=ah.message;D(".wc_header_text_count").html(ah.wc_all_comments_count_new);if(ae){D(".wc-thread-wrapper").prepend(Z)}else{D("#wc-secondary-form-wrapper-"+Y).slideToggle(700);if(ah.is_in_same_container==1){D("#wc-secondary-form-wrapper-"+Y).after(Z)}else{D("#wc-secondary-form-wrapper-"+Y).after(Z.replace("wc-reply","wc-reply wc-no-left-margin"))}}o(ah);U(ah);t(ab,ah);ab.get(0).reset();e()}else{Z=wpdiscuz_ajax_obj.wpdiscuz_options[Y];s(ab,Y,Z,true)}}catch(ag){if(af.indexOf("<")>=0&&af.indexOf(">")>=0){Z=ag}else{Z=af}s(ab,"wc_invalid_field",Z,true)}P(D(".wc_captcha_refresh_img",ab));E();D(".wpdiscuz-loading-bar").hide()})}});function o(aa){if(!aa.held_moderate){var Z="post_id="+n+"&comment_id="+aa.new_comment_id+"&email="+aa.user_email+"&isParent="+aa.is_main;var Y=d("checkNotificationType",Z);Y.done(function(ab){try{aa=D.parseJSON(ab)}catch(ac){console.log(ac)}})}}function U(aa){if(aa.redirect>0&&aa.new_comment_id){var Z="commentId="+aa.new_comment_id;var Y=d("redirect",Z);Y.done(function(ab){aa=D.parseJSON(ab);if(aa.code==1){setTimeout(function(){window.location.href=aa.redirect_to},5000)}})}}function e(){if(D.cookie("wc_author_name")){D(".wc_comm_form .wc_name").val(D.cookie("wc_author_name"))}if(D.cookie("wc_author_email")){D(".wc_comm_form .wc_email").val(D.cookie("wc_author_email"))}if(D.cookie("wc_author_website")){D(".wc_comm_form .wc_website").val(D.cookie("wc_author_website"))}}function t(Y,Z){if(D(".wc_email",Y).val()){D.cookie("wc_author_email",D(".wc_email",Y).val())}else{D.cookie("wc_author_email",Z.user_email)}if(D(".wc_name",Y).val()){D.cookie("wc_author_name",D(".wc_name",Y).val())}else{D.cookie("wc_author_name",Z.user_name)}D.cookie("wc_author_website",D(".wc_website",Y).val())}var T;D(document).delegate(".wc_editable_comment","click",function(){var ab=m(D(this),0);var Y=W(ab);var aa=D(this);var Z="commentId="+Y;d("editComment",Z).done(function(ad){try{var ah=D.parseJSON(ad);var af="";var ae=ah.code;if(parseInt(ae)>=0){T=ah.message;var ac='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+ab+'" style="min-height: 2em;">'+ah.message+"</textarea>";D("#wc-comm-"+ab+" > .wc-comment-right .wc-comment-text").replaceWith(ac);document.getElementById("wc_edit_comment-"+ab).focus();D("#wc-comm-"+ab+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ac="";D("#wc-comm-"+ab+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();D("#wc-comm-"+ab+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{af=wpdiscuz_ajax_obj.wpdiscuz_options[ae];s(aa,ae,af,false)}}catch(ag){console.log(ag)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wc_save_edited_comment","click",function(){var ad=m(D(this));var Z=W(ad);var Y=D("#wc-comm-"+ad+" textarea#wc_edit_comment-"+ad);var aa=Y.val();var ac=D(this);if(D.trim(aa).length>0){var ab="commentId="+Z+"&commentContent="+aa;d("saveEditedComment",ab).done(function(ae){try{var ai=D.parseJSON(ae);var af=ai.code;var ag="";if(parseInt(af)>=0){J(ad,ai.message)}else{ag=wpdiscuz_ajax_obj.wpdiscuz_options[af];s(ac,af,ag,false)}Y="";aa=""}catch(ah){console.log(ah)}D(".wpdiscuz-loading-bar").hide()})}});D(document).delegate(".wc_cancel_edit","click",function(){var Y=m(D(this));J(Y,T)});function J(aa,Z){D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var Y='<div class="wc-comment-text">'+j(Z)+"</div>";D("#wc-comm-"+aa+" #wc_edit_comment-"+aa).replaceWith(Y)}function j(ab,aa){var Z=(aa||typeof aa==="undefined")?"<br/>":"<br>";var Y=(ab+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+Z+"$2");return Y.replace("<br><br>","<br/>")}D(document).delegate(".wc-load-more-submit","click",function(){H()});var p=D("#wpdiscuzHasMoreComments").val();var F=false;if(B==2&&!V){D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();D(window).scroll(function(){var Y=document.getElementById("wcThreadWrapper").scrollHeight;if(D(window).scrollTop()>=Y&&F===false&&p){F=true;H()}})}function H(){var Y;if(l=="vote"){Y="offset="+b+"&orderBy="+l+"&order="+a;b++}else{Y="orderBy="+l+"&order="+a+"&lastParentId="+v()}Y+="&postId="+n+"&loadAllCommnts="+B;d("loadMoreComments",Y).done(function(Z){try{var ab=D.parseJSON(Z);D(".wpdiscuz-comment-pagination").before(ab.comment_list);r(ab);D(".wpdiscuz_single").remove();F=false;p=ab.is_show_load_more}catch(aa){console.log(aa)}E();D(".wpdiscuz-loading-bar").hide();D(".wc-load-more-submit").blur()})}function r(Y){if(Y.is_show_load_more!=false){O(Y.last_parent_id)}else{D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}}D(document).delegate(".wc_vote","click",function(){var Y=D(this);var ab="";var ac="";var Z=D(this).parents(".wc-comment-right").attr("id");Z=Z.substring(Z.lastIndexOf("-")+1);var aa;if(D(this).hasClass("wc-up")){aa=1}else{aa=-1}var ad="commentId="+Z+"&voteType="+aa;d("voteOnComment",ad).done(function(ae){try{var ag=D.parseJSON(ae);ab=ag.code;if(parseInt(ab)>=0){var ah=D(".wc-comment-footer .wc-vote-result",D("#comment-"+Z));D(ah).text(parseInt(D(ah).text())+aa)}else{ac=wpdiscuz_ajax_obj.wpdiscuz_options[ab];s(Y,ab,ac,false)}}catch(af){console.log(af)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wpdiscuz-sort-button","click",function(){p=1;if(!(D(this).hasClass("wpdiscuz-sort-button-active"))){var ab=D(this);if(D(this).hasClass("wpdiscuz-vote-sort-up")){l="vote";a="desc"}else{l="date";a=D(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var aa="postId="+n+"&orderBy="+l+"&order="+a;var Y="";var Z="";d("wpdiscuzSorting",aa).done(function(ac){try{var ae=D.parseJSON(ac);Y=ae.code;Z=ae.message;if(parseInt(Y)>0){D("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){D(this).remove()});D("#wpcomm .wc-thread-wrapper").prepend(Z);b=parseInt(ae.loadCount)}else{}L(ab);r(ae)}catch(ad){console.log(ad)}E();D(".wpdiscuz-loading-bar").hide()})}});function L(Y){D(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){D(this).removeClass("wpdiscuz-sort-button-active")});Y.addClass("wpdiscuz-sort-button-active")}function X(){var ac=location.href;var ab=ac.match(/#comment\-(\d+)/);if(ab!==null){var Z=ab[1];if(!D("#comment-"+Z).length){var aa="commentId="+Z;var Y=d("getSingleComment",aa);Y.done(function(ad){try{var af=D.parseJSON(ad);D(".wc-thread-wrapper").prepend(af.message);D("html, body").animate({scrollTop:D(".wc-thread-wrapper").offset().top},1000)}catch(ae){console.log(ae)}E();D(".wpdiscuz-loading-bar").hide()})}}}X();if(i>0&&S&&(R||(!R&&!I))){setInterval(N,parseInt(h)*1000)}function N(){var ab=A();var Z=(D.cookie("wc_author_email")!=undefined&&D.cookie("wc_author_email")!="")?D.cookie("wc_author_email"):"";var aa="postId="+n+"&loadLastCommentId="+S+"&visibleCommentIds="+ab+"&email="+Z;var Y=d("liveUpdate",aa);Y.done(function(ad){try{var ai=D.parseJSON(ad);if(ai.code==1){if(i==1){y(ai)}else{u=u.concat(ai.message.comments);M=M.concat(ai.message.author_replies);var ae=u.length;var ac=M.length;if(ae>0){var ag=ae+" ";ag+=ae>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;D(".wc_new_comment").html(ag).show()}else{D(".wc_new_comment").hide()}if(ac>0){var af=ac+" ";af+=ac>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;D(".wc_new_reply").html(af).show()}else{D(".wc_new_reply").hide()}}D(".wc_header_text_count").html(ai.wc_all_comments_count_new);S=ai.loadLastCommentId}}catch(ah){console.log(ah)}E();D(".wpdiscuz-loading-bar").hide()})}function y(ab){if(ab.message!==undefined){var Y;var aa=ab.message;for(var Z=0;Z<aa.length;Z++){Y=aa[Z];x(Y.comment_parent,Y.comment_html)}}}D(document).delegate(".wc-update-on-click","click",function(){var Y;var Z=D(this);if(Z.hasClass("wc_new_comment")){Y=u.join()}else{Y=M.join()}d("updateOnClick",Y).done(function(aa){try{var ac=D.parseJSON(aa);y(ac);if(Z.hasClass("wc_new_comment")){u=[];D(".wc_new_comment").hide()}else{M=[];D(".wc_new_reply").hide()}}catch(ab){console.log(ab)}E();D(".wpdiscuz-loading-bar").hide()})});function s(ac,Z,ab,aa){var Y;var ad;if(aa){ad=ac.parents(".wc-form-wrapper")}else{ad=ac.closest(".wc-comment")}Y=ad.children(".wpdiscuz-comment-message");Y.addClass(Z);Y.html(ab);Y.show().delay(5000).fadeOut(1000,function(){Y.removeClass();Y.addClass("wpdiscuz-comment-message");Y.html("")})}function g(Y){var Z=m(Y,0);D("#wpdiscuz_form_anchor-"+Z).before(K(Z));D("#wc-secondary-form-wrapper-"+Z).slideToggle(700,function(){Y.addClass("wpdiscuz-clonned")})}function K(Z){var Y=D("#wpdiscuz_hidden_secondary_form").html();return Y.replace(/wpdiscuzuniqueid/g,Z)}function m(aa,Z){var Y="";if(Z){Y=aa.parents(".wc-main-form-wrapper").attr("id")}else{Y=aa.parents(".wc-comment").attr("id")}var ab=Y.substring(Y.lastIndexOf("-")+1);return ab}function W(Y){return Y.substring(0,Y.indexOf("_"))}function z(Z){var Y=Z.substring(Z.indexOf("_")+1);return Y}function v(){var Y=D(".wc-load-more-link").attr("href");return Y.substring(Y.lastIndexOf("=")+1)}function O(Y){var Z=D(".wc-load-more-link").attr("href");D(".wc-load-more-link").attr("href",Z.replace(/[\d]+$/m,Y));if(B!=2){D(".wpdiscuz-comment-pagination").show()}}function C(aa){var Z=aa.attr("class");var Y=Z.split(" ");var ab="";D.each(Y,function(ac,ad){if("wc_comment_level"===c(ad,false)){ab=c(ad,true)}});return parseInt(ab)+1}function c(Y,Z){var aa="";if(Z){aa=Y.substring(Y.indexOf("-")+1)}else{aa=Y.substring(0,Y.indexOf("-"))}return aa}function d(Z,Y){if(Z!=="liveUpdate"){D(".wpdiscuz-loading-bar").show()}return D.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:Y,action:Z}})}function x(aa,Z){if(aa==0){D(".wc-thread-wrapper").prepend(Z)}else{var Y=m(D("#comment-"+aa),0);D("#wpdiscuz_form_anchor-"+Y).after(Z)}}function A(){var aa;var Y;var Z="";D(".wc-comment-right").each(function(){aa=m(D(this),0);Y=W(aa);Z+=Y+","});return Z}function E(){D(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});D(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function f(){if(D(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){D(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(D(".wc_social_plugin_wrapper .the_champ_login_container").length){D(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(D(".wc_social_plugin_wrapper .social_connect_form").length){D(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(D(".wc_social_plugin_wrapper .oneall_social_login_providers").length){D(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}}}}}});
class.WpdiscuzCore.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Plugin Name: wpDiscuz - Supercharged native comments
5
  * Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
- * Version: 3.0.3
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/
@@ -172,6 +172,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
172
  $isAnonymous = false;
173
  if ($commentData) {
174
  parse_str($commentData);
 
 
 
175
  if (wp_verify_nonce($wpdiscuz_comment_form_nonce, 'wpdiscuz_comment_form_nonce_action') && isset($wpdiscuz_unique_id) && $wpdiscuz_unique_id && isset($comment_post_ID) && $comment_post_ID) {
176
  $wpdiscuz_unique_id = filter_var($wpdiscuz_unique_id);
177
  $wc_comment_depth = isset($wc_comment_depth) && intval($wc_comment_depth) ? $wc_comment_depth : 1;
@@ -416,7 +419,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
416
  global $wp_version;
417
  parse_str($_POST['wpdiscuzAjaxData']);
418
  $postId = intval(trim($postId));
419
- $limit = intval(trim($loadAllCommnts)) ? 0 : $this->optionsSerialized->wordpressCommentPerPage;
420
  $args = array('limit' => $limit);
421
  $orderBy = trim($orderBy);
422
  if ($orderBy == 'vote') {
@@ -719,6 +722,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
719
  if (isset($oldOptions['wc_comment_count'])) {
720
  update_option('comments_per_page', $oldOptions['wc_comment_count']);
721
  }
 
 
 
722
  $this->addNewOptions();
723
  $this->addNewPhrases();
724
  if ($wc_version === '1.0.0') {
@@ -737,6 +743,10 @@ class WpdiscuzCore implements WpDiscuzConstants {
737
  if (version_compare($wc_version, '3.0.0', '<=') && version_compare($wc_version, '1.0.0', '!=')) {
738
  $this->dbManager->alterNotificationTable();
739
  }
 
 
 
 
740
  }
741
  }
742
 
3
  /*
4
  * Plugin Name: wpDiscuz - Supercharged native comments
5
  * Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
6
+ * Version: 3.0.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/
172
  $isAnonymous = false;
173
  if ($commentData) {
174
  parse_str($commentData);
175
+ if(function_exists('zerospam_get_key')&& isset($wpdiscuz_zs)){
176
+ $_POST['zerospam_key'] = $wpdiscuz_zs;
177
+ }
178
  if (wp_verify_nonce($wpdiscuz_comment_form_nonce, 'wpdiscuz_comment_form_nonce_action') && isset($wpdiscuz_unique_id) && $wpdiscuz_unique_id && isset($comment_post_ID) && $comment_post_ID) {
179
  $wpdiscuz_unique_id = filter_var($wpdiscuz_unique_id);
180
  $wc_comment_depth = isset($wc_comment_depth) && intval($wc_comment_depth) ? $wc_comment_depth : 1;
419
  global $wp_version;
420
  parse_str($_POST['wpdiscuzAjaxData']);
421
  $postId = intval(trim($postId));
422
+ $limit = intval(trim($loadAllCommnts) == 1) ? 0 : $this->optionsSerialized->wordpressCommentPerPage;
423
  $args = array('limit' => $limit);
424
  $orderBy = trim($orderBy);
425
  if ($orderBy == 'vote') {
722
  if (isset($oldOptions['wc_comment_count'])) {
723
  update_option('comments_per_page', $oldOptions['wc_comment_count']);
724
  }
725
+ if (isset($oldOptions['wc_load_all_comments'])) {
726
+ $this->optionsSerialized->commentListLoadType = 1;
727
+ }
728
  $this->addNewOptions();
729
  $this->addNewPhrases();
730
  if ($wc_version === '1.0.0') {
743
  if (version_compare($wc_version, '3.0.0', '<=') && version_compare($wc_version, '1.0.0', '!=')) {
744
  $this->dbManager->alterNotificationTable();
745
  }
746
+
747
+ if (version_compare($wc_version, '3.0.4', '<=')) {
748
+ $this->dbManager->alterNotificationTable();
749
+ }
750
  }
751
  }
752
 
manager/class.WpdiscuzDBManager.php CHANGED
@@ -333,12 +333,12 @@ class WpdiscuzDBManager {
333
 
334
  public function checkVoteData($postId) {
335
  $sql_query = $this->db->prepare("INSERT INTO `" . $this->dbprefix . "commentmeta` (`meta_id`,`comment_id`, `meta_key`, `meta_value`)(
336
- SELECT cm.`meta_key` AS m_k , c.`comment_ID`, %s, IFNULL(cm.`meta_key`,'0')
337
- FROM `" . $this->dbprefix . "comments` c
338
- LEFT JOIN `" . $this->dbprefix . "commentmeta` cm ON cm.`comment_id` = c.`comment_ID` AND cm.`meta_key` = %s
339
- WHERE c.`comment_post_ID` = %d
340
- HAVING m_k IS NULL
341
- );", WpdiscuzCore::META_KEY_VOTES, WpdiscuzCore::META_KEY_VOTES, $postId);
342
  $this->db->query($sql_query);
343
  }
344
 
333
 
334
  public function checkVoteData($postId) {
335
  $sql_query = $this->db->prepare("INSERT INTO `" . $this->dbprefix . "commentmeta` (`meta_id`,`comment_id`, `meta_key`, `meta_value`)(
336
+ SELECT NULL,c.`comment_ID`,%s,'0' FROM `" . $this->dbprefix . "comments` c
337
+ LEFT JOIN `" . $this->dbprefix . "commentmeta` cm
338
+ ON cm.`comment_id` = c.`comment_ID`
339
+ AND cm.`meta_key` = %s
340
+ WHERE cm.`meta_key` IS NULL AND c.`comment_post_ID` = %d
341
+ );", WpdiscuzCore::META_KEY_VOTES, WpdiscuzCore::META_KEY_VOTES, $postId);
342
  $this->db->query($sql_query);
343
  }
344
 
options/class.WpdiscuzOptions.php CHANGED
@@ -48,7 +48,7 @@ class WpdiscuzOptions {
48
  $this->optionsSerialized->commentEditableTime = isset($_POST['wc_comment_editable_time']) ? $_POST['wc_comment_editable_time'] : 900;
49
  $this->optionsSerialized->redirectPage = isset($_POST['wpdiscuz_redirect_page']) ? $_POST['wpdiscuz_redirect_page'] : 0;
50
  $this->optionsSerialized->isGuestCanVote = isset($_POST['wc_is_guest_can_vote']) ? $_POST['wc_is_guest_can_vote'] : 0;
51
- $this->optionsSerialized->loadAllComments = isset($_POST['wc_load_all_comments']) ? $_POST['wc_load_all_comments'] : 0;
52
  $this->optionsSerialized->votingButtonsShowHide = isset($_POST['wc_voting_buttons_show_hide']) ? $_POST['wc_voting_buttons_show_hide'] : 0;
53
  $this->optionsSerialized->shareButtons = isset($_POST['wpdiscuz_share_buttons']) ? $_POST['wpdiscuz_share_buttons'] : array();
54
  $this->optionsSerialized->captchaShowHide = isset($_POST['wc_captcha_show_hide']) ? $_POST['wc_captcha_show_hide'] : 0;
48
  $this->optionsSerialized->commentEditableTime = isset($_POST['wc_comment_editable_time']) ? $_POST['wc_comment_editable_time'] : 900;
49
  $this->optionsSerialized->redirectPage = isset($_POST['wpdiscuz_redirect_page']) ? $_POST['wpdiscuz_redirect_page'] : 0;
50
  $this->optionsSerialized->isGuestCanVote = isset($_POST['wc_is_guest_can_vote']) ? $_POST['wc_is_guest_can_vote'] : 0;
51
+ $this->optionsSerialized->commentListLoadType = isset($_POST['commentListLoadType']) ? $_POST['commentListLoadType'] : 0;
52
  $this->optionsSerialized->votingButtonsShowHide = isset($_POST['wc_voting_buttons_show_hide']) ? $_POST['wc_voting_buttons_show_hide'] : 0;
53
  $this->optionsSerialized->shareButtons = isset($_POST['wpdiscuz_share_buttons']) ? $_POST['wpdiscuz_share_buttons'] : array();
54
  $this->optionsSerialized->captchaShowHide = isset($_POST['wc_captcha_show_hide']) ? $_POST['wc_captcha_show_hide'] : 0;
options/class.WpdiscuzOptionsSerialized.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  class WpdiscuzOptionsSerialized {
4
-
5
  /**
6
  * Type - Checkbox array
7
  * Available Values - Checked/Unchecked
@@ -25,8 +25,8 @@ class WpdiscuzOptionsSerialized {
25
  * Default Value - Comment list update timer value
26
  */
27
  public $commentListUpdateTimer;
28
-
29
- /**
30
  * Type - Checkbox
31
  * Available Values - Checked/Unchecked
32
  * Description - Allow guests to vote on comments
@@ -57,14 +57,14 @@ class WpdiscuzOptionsSerialized {
57
  * Default Value - Checked
58
  */
59
  public $isGuestCanVote;
60
-
61
- /**
62
- * Type - Checkbox
63
- * Available Values - Checked/Unchecked
64
- * Description - Load all comments on click load more button
65
- * Default Value - Unchecked
66
  */
67
- public $loadAllComments;
68
 
69
  /**
70
  * Type - Checkbox
@@ -242,14 +242,14 @@ class WpdiscuzOptionsSerialized {
242
  */
243
  public $commentTextColor;
244
 
245
- /**
246
  * Type - Input
247
  * Available Values - color codes
248
  * Description - Comment Username Color
249
  * Default Value - #00B38F
250
  */
251
  public $primaryColor;
252
-
253
  /**
254
  * Type - Input
255
  * Available Values - color codes
@@ -318,7 +318,7 @@ class WpdiscuzOptionsSerialized {
318
  * Default Value - Unchecked
319
  */
320
  public $isUsePoMo;
321
-
322
  /**
323
  * Type - Checkbox
324
  * Available Values - Checked/Unchecked
@@ -334,7 +334,7 @@ class WpdiscuzOptionsSerialized {
334
  * Default Value - 1 characters
335
  */
336
  public $commentTextMinLength;
337
-
338
  /**
339
  * Type - Input
340
  * Available Values - Integer (comment text length)
@@ -351,7 +351,7 @@ class WpdiscuzOptionsSerialized {
351
  public $wordpressCommentOrder;
352
  public $wordpressDefaultCommentsPage;
353
  public $wordpressCommentPerPage;
354
- public $wordpressShowAvatars;
355
 
356
  function __construct($dbmanager) {
357
  $this->dbManager = $dbmanager;
@@ -380,7 +380,7 @@ class WpdiscuzOptionsSerialized {
380
  $this->commentEditableTime = isset($options['wc_comment_editable_time']) ? $options['wc_comment_editable_time'] : 900;
381
  $this->redirectPage = isset($options['wpdiscuz_redirect_page']) ? $options['wpdiscuz_redirect_page'] : 0;
382
  $this->isGuestCanVote = isset($options['wc_is_guest_can_vote']) ? $options['wc_is_guest_can_vote'] : 0;
383
- $this->loadAllComments = isset($options['wc_load_all_comments']) ? $options['wc_load_all_comments'] : 0;
384
  $this->votingButtonsShowHide = isset($options['wc_voting_buttons_show_hide']) ? $options['wc_voting_buttons_show_hide'] : 0;
385
  $this->shareButtons = isset($options['wpdiscuz_share_buttons']) ? $options['wpdiscuz_share_buttons'] : array('fb', 'twitter', 'google');
386
  $this->captchaShowHide = isset($options['wc_captcha_show_hide']) ? $options['wc_captcha_show_hide'] : 0;
@@ -534,7 +534,7 @@ class WpdiscuzOptionsSerialized {
534
  'wc_comment_editable_time' => $this->commentEditableTime,
535
  'wpdiscuz_redirect_page' => $this->redirectPage,
536
  'wc_is_guest_can_vote' => $this->isGuestCanVote,
537
- 'wc_load_all_comments' => $this->loadAllComments,
538
  'wc_voting_buttons_show_hide' => $this->votingButtonsShowHide,
539
  'wpdiscuz_share_buttons' => $this->shareButtons,
540
  'wc_captcha_show_hide' => $this->captchaShowHide,
@@ -585,7 +585,8 @@ class WpdiscuzOptionsSerialized {
585
  'wc_comment_editable_time' => '900',
586
  'wpdiscuz_redirect_page' => '0',
587
  'wc_is_guest_can_vote' => '1',
588
- 'wc_load_all_comments' => '0',
 
589
  'wc_voting_buttons_show_hide' => '0',
590
  'wpdiscuz_share_buttons' => $this->shareButtons,
591
  'wc_captcha_show_hide' => '0',
@@ -663,7 +664,7 @@ class WpdiscuzOptionsSerialized {
663
  $js_options['is_user_logged_in'] = is_user_logged_in();
664
  $js_options['main_form_time_out'] = WpdiscuzCore::JS_MAIN_FORM_TIME_OUT;
665
  $js_options['secondary_form_time_out'] = WpdiscuzCore::JS_SECONDARY_FORM_TIME_OUT;
666
- $js_options['wc_load_all_comments'] = $this->loadAllComments;
667
  $js_options['commentListUpdateType'] = $this->commentListUpdateType;
668
  $js_options['commentListUpdateTimer'] = $this->commentListUpdateTimer;
669
  $js_options['liveUpdateGuests'] = $this->liveUpdateGuests;
@@ -671,7 +672,11 @@ class WpdiscuzOptionsSerialized {
671
  $js_options['wc_reply_bg_color'] = $this->replyBGColor;
672
  $js_options['wordpress_comment_order'] = $this->wordpressCommentOrder;
673
  $js_options['wordpressThreadCommentsDepth'] = $this->wordpressThreadCommentsDepth;
 
 
 
 
674
  return $js_options;
675
  }
676
 
677
- }
1
  <?php
2
 
3
  class WpdiscuzOptionsSerialized {
4
+
5
  /**
6
  * Type - Checkbox array
7
  * Available Values - Checked/Unchecked
25
  * Default Value - Comment list update timer value
26
  */
27
  public $commentListUpdateTimer;
28
+
29
+ /**
30
  * Type - Checkbox
31
  * Available Values - Checked/Unchecked
32
  * Description - Allow guests to vote on comments
57
  * Default Value - Checked
58
  */
59
  public $isGuestCanVote;
60
+
61
+ /**
62
+ * Type - Radio Button
63
+ * Available Values - 0 Default (Load More) / 1 Load Rest Of Comments / 2 Lazy Load comments on scrolling
64
+ * Description - Comment list load type
65
+ * Default Value - Disabled
66
  */
67
+ public $commentListLoadType;
68
 
69
  /**
70
  * Type - Checkbox
242
  */
243
  public $commentTextColor;
244
 
245
+ /**
246
  * Type - Input
247
  * Available Values - color codes
248
  * Description - Comment Username Color
249
  * Default Value - #00B38F
250
  */
251
  public $primaryColor;
252
+
253
  /**
254
  * Type - Input
255
  * Available Values - color codes
318
  * Default Value - Unchecked
319
  */
320
  public $isUsePoMo;
321
+
322
  /**
323
  * Type - Checkbox
324
  * Available Values - Checked/Unchecked
334
  * Default Value - 1 characters
335
  */
336
  public $commentTextMinLength;
337
+
338
  /**
339
  * Type - Input
340
  * Available Values - Integer (comment text length)
351
  public $wordpressCommentOrder;
352
  public $wordpressDefaultCommentsPage;
353
  public $wordpressCommentPerPage;
354
+ public $wordpressShowAvatars;
355
 
356
  function __construct($dbmanager) {
357
  $this->dbManager = $dbmanager;
380
  $this->commentEditableTime = isset($options['wc_comment_editable_time']) ? $options['wc_comment_editable_time'] : 900;
381
  $this->redirectPage = isset($options['wpdiscuz_redirect_page']) ? $options['wpdiscuz_redirect_page'] : 0;
382
  $this->isGuestCanVote = isset($options['wc_is_guest_can_vote']) ? $options['wc_is_guest_can_vote'] : 0;
383
+ $this->commentListLoadType = isset($options['commentListLoadType']) ? $options['commentListLoadType'] : 0;
384
  $this->votingButtonsShowHide = isset($options['wc_voting_buttons_show_hide']) ? $options['wc_voting_buttons_show_hide'] : 0;
385
  $this->shareButtons = isset($options['wpdiscuz_share_buttons']) ? $options['wpdiscuz_share_buttons'] : array('fb', 'twitter', 'google');
386
  $this->captchaShowHide = isset($options['wc_captcha_show_hide']) ? $options['wc_captcha_show_hide'] : 0;
534
  'wc_comment_editable_time' => $this->commentEditableTime,
535
  'wpdiscuz_redirect_page' => $this->redirectPage,
536
  'wc_is_guest_can_vote' => $this->isGuestCanVote,
537
+ 'commentListLoadType' => $this->commentListLoadType,
538
  'wc_voting_buttons_show_hide' => $this->votingButtonsShowHide,
539
  'wpdiscuz_share_buttons' => $this->shareButtons,
540
  'wc_captcha_show_hide' => $this->captchaShowHide,
585
  'wc_comment_editable_time' => '900',
586
  'wpdiscuz_redirect_page' => '0',
587
  'wc_is_guest_can_vote' => '1',
588
+ 'commentsLoadType' => '0',
589
+ 'commentListLoadType' => '0',
590
  'wc_voting_buttons_show_hide' => '0',
591
  'wpdiscuz_share_buttons' => $this->shareButtons,
592
  'wc_captcha_show_hide' => '0',
664
  $js_options['is_user_logged_in'] = is_user_logged_in();
665
  $js_options['main_form_time_out'] = WpdiscuzCore::JS_MAIN_FORM_TIME_OUT;
666
  $js_options['secondary_form_time_out'] = WpdiscuzCore::JS_SECONDARY_FORM_TIME_OUT;
667
+ $js_options['commentListLoadType'] = $this->commentListLoadType;
668
  $js_options['commentListUpdateType'] = $this->commentListUpdateType;
669
  $js_options['commentListUpdateTimer'] = $this->commentListUpdateTimer;
670
  $js_options['liveUpdateGuests'] = $this->liveUpdateGuests;
672
  $js_options['wc_reply_bg_color'] = $this->replyBGColor;
673
  $js_options['wordpress_comment_order'] = $this->wordpressCommentOrder;
674
  $js_options['wordpressThreadCommentsDepth'] = $this->wordpressThreadCommentsDepth;
675
+ $js_options['wordpressIsPaginate'] = $this->wordpressIsPaginate;
676
+ if (function_exists('zerospam_get_key')) {
677
+ $js_options['wpdiscuz_zs'] = urlencode(zerospam_get_key());
678
+ }
679
  return $js_options;
680
  }
681
 
682
+ }
options/options-layouts/settings-general.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  if (!defined('ABSPATH')) {
3
  exit();
4
  }
@@ -126,53 +126,69 @@ if (!defined('ABSPATH')) {
126
  </tr>
127
  <tr valign="top">
128
  <th scope="row">
129
- <?php _e('Load rest of all comments on clicking the [Load More Comments] button', 'wpdiscuz'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  </th>
131
  <td>
132
- <label for="wc_load_all_comments">
133
- <input type="checkbox" <?php checked($this->optionsSerialized->loadAllComments == 1) ?> value="1" name="wc_load_all_comments" id="wc_load_all_comments" />
 
 
 
134
  </label>
135
  </td>
136
  </tr>
137
  <tr valign="top">
138
- <th scope="row">
139
- <?php _e('Use WordPress Date/Time format', 'wpdiscuz'); ?>
140
- <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('wpDiscuz shows Human Readable date format. If you check this option it\'ll show the date/time format set in WordPress General Settings.', 'wpdiscuz'); ?></p>
141
- </th>
142
- <td>
143
- <label for="wc_simple_comment_date">
144
- <input type="checkbox" <?php checked($this->optionsSerialized->simpleCommentDate == 1) ?> value="1" name="wc_simple_comment_date" id="wc_simple_comment_date" />&nbsp;
145
- <span style="font-size:13px; color:#999999; padding-left:0px; margin-left:0px; line-height:15px">
146
- <?php echo date(get_option('date_format')); ?> / <?php echo date(get_option('time_format')); ?><br />
147
- <?php _e('Current Wordpress date/time format', 'wpdiscuz'); ?></span>
148
- </label>
149
- </td>
150
- </tr>
151
- <tr valign="top">
152
- <th scope="row" >
153
- <?php _e('Use Plugin .PO/.MO files', 'wpdiscuz'); ?>
154
- <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('wpDiscuz phrase system allows you to translate all front-end phrases. However if you have a multi-language website it\'ll not allow you to add more than one language translation. The only way to get it is the plugin translation files (.PO / .MO). If wpDiscuz has the languages you need you should check this option to disable phrase system and it\'ll automatically translate all phrases based on language files according to current language.', 'wpdiscuz'); ?></p>
155
- </th>
156
- <td colspan="3">
157
- <label for="wc_is_use_po_mo">
158
- <input type="checkbox" <?php checked($this->optionsSerialized->isUsePoMo == 1) ?> value="1" name="wc_is_use_po_mo" id="wc_is_use_po_mo" />
159
- </label>
160
- </td>
161
- </tr>
162
- <tr valign="top">
163
- <th scope="row" >
164
- <label for="wc_show_plugin_powerid_by">
165
- <?php _e('Help wpDiscuz to grow allowing people to recognize which comment plugin you use', 'wpdiscuz'); ?>
166
- </label>
167
- <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('Please check this option on to help wpDiscuz get more popularity as your thank to the hard work we do for you totally free. This option adds a very small (16x16px) icon under the comment section which will allow your site visitors recognize the name of comment solution you use.', 'wpdiscuz'); ?></p>
168
- </th>
169
- <td colspan="3">
170
- <label for="wc_show_plugin_powerid_by">
171
- <input type="checkbox" <?php checked($this->optionsSerialized->showPluginPoweredByLink == 1) ?> value="1" name="wc_show_plugin_powerid_by" id="wc_show_plugin_powerid_by" />
172
- <span id="wpdiscuz_thank_you" style="color:#006600; font-size:13px;"><?php _e('Thank you!', 'wpdiscuz'); ?></span>
173
- </label>
174
- </td>
175
- </tr>
176
  </tbody>
177
  </table>
178
  </div>
1
+ <?php
2
  if (!defined('ABSPATH')) {
3
  exit();
4
  }
126
  </tr>
127
  <tr valign="top">
128
  <th scope="row">
129
+ <?php _e('Comments loading/pagination type', 'wpdiscuz'); ?>
130
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;">
131
+ You can manage the number of comments for [Load more] option in Settings > Discussion page, using "Break comments into pages with [X] top level comments per page" option.
132
+ To show the default Wordpress comment pagination you should enable the checkbox on bigining of the same option.
133
+ </p>
134
+ </th>
135
+ <td>
136
+ <fieldset class="commentListLoadType">
137
+ <?php $commentListLoadType = isset($this->optionsSerialized->commentListLoadType) ? $this->optionsSerialized->commentListLoadType : 0; ?>
138
+ <label title="<?php _e('[Load more] Button', 'wpdiscuz') ?>">
139
+ <input type="radio" value="0" <?php checked('0' == $commentListLoadType); ?> name="commentListLoadType" id="commentListLoadDefault" />
140
+ <span><?php _e('[Load more] Button', 'wpdiscuz') ?></span>
141
+ </label> &nbsp;<br/>
142
+ <label title="<?php _e('[Load rest of all comments] Button', 'wpdiscuz') ?>">
143
+ <input type="radio" value="1" <?php checked('1' == $commentListLoadType); ?> name="commentListLoadType" id="commentListLoadRest" />
144
+ <span><?php _e('[Load rest of all comments] Button', 'wpdiscuz') ?></span>
145
+ </label><br>
146
+ <label title="<?php _e('Lazy load comments on scrolling', 'wpdiscuz') ?>">
147
+ <input type="radio" value="2" <?php checked('2' == $commentListLoadType); ?> name="commentListLoadType" id="commentListLoadLazy" />
148
+ <span><?php _e('Lazy load comments on scrolling', 'wpdiscuz') ?></span>
149
+ </label> &nbsp;<br/>
150
+ </fieldset>
151
+ </td>
152
+ </tr>
153
+ <tr valign="top">
154
+ <th scope="row">
155
+ <?php _e('Use WordPress Date/Time format', 'wpdiscuz'); ?>
156
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('wpDiscuz shows Human Readable date format. If you check this option it\'ll show the date/time format set in WordPress General Settings.', 'wpdiscuz'); ?></p>
157
  </th>
158
  <td>
159
+ <label for="wc_simple_comment_date">
160
+ <input type="checkbox" <?php checked($this->optionsSerialized->simpleCommentDate == 1) ?> value="1" name="wc_simple_comment_date" id="wc_simple_comment_date" />&nbsp;
161
+ <span style="font-size:13px; color:#999999; padding-left:0px; margin-left:0px; line-height:15px">
162
+ <?php echo date(get_option('date_format')); ?> / <?php echo date(get_option('time_format')); ?><br />
163
+ <?php _e('Current Wordpress date/time format', 'wpdiscuz'); ?></span>
164
  </label>
165
  </td>
166
  </tr>
167
  <tr valign="top">
168
+ <th scope="row" >
169
+ <?php _e('Use Plugin .PO/.MO files', 'wpdiscuz'); ?>
170
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('wpDiscuz phrase system allows you to translate all front-end phrases. However if you have a multi-language website it\'ll not allow you to add more than one language translation. The only way to get it is the plugin translation files (.PO / .MO). If wpDiscuz has the languages you need you should check this option to disable phrase system and it\'ll automatically translate all phrases based on language files according to current language.', 'wpdiscuz'); ?></p>
171
+ </th>
172
+ <td colspan="3">
173
+ <label for="wc_is_use_po_mo">
174
+ <input type="checkbox" <?php checked($this->optionsSerialized->isUsePoMo == 1) ?> value="1" name="wc_is_use_po_mo" id="wc_is_use_po_mo" />
175
+ </label>
176
+ </td>
177
+ </tr>
178
+ <tr valign="top">
179
+ <th scope="row" >
180
+ <label for="wc_show_plugin_powerid_by">
181
+ <?php _e('Help wpDiscuz to grow allowing people to recognize which comment plugin you use', 'wpdiscuz'); ?>
182
+ </label>
183
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;"><?php _e('Please check this option on to help wpDiscuz get more popularity as your thank to the hard work we do for you totally free. This option adds a very small (16x16px) icon under the comment section which will allow your site visitors recognize the name of comment solution you use.', 'wpdiscuz'); ?></p>
184
+ </th>
185
+ <td colspan="3">
186
+ <label for="wc_show_plugin_powerid_by">
187
+ <input type="checkbox" <?php checked($this->optionsSerialized->showPluginPoweredByLink == 1) ?> value="1" name="wc_show_plugin_powerid_by" id="wc_show_plugin_powerid_by" />
188
+ <span id="wpdiscuz_thank_you" style="color:#006600; font-size:13px;"><?php _e('Thank you!', 'wpdiscuz'); ?></span>
189
+ </label>
190
+ </td>
191
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  </tbody>
193
  </table>
194
  </div>
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, live comments, realtime chat, chat, realtime commenting, mobile commenting, post comments, advanced comment, comments box, community, discussion, discuss, disqus, discuz, Disqus alternative, Livefyre alternative, Jatpack comments alternative, Facebook comments alternative, comment form, commenting, reply, comments, better comments, discussions, comment notifications, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter, email commenting, social login, boost comments, native comments
5
  Requires at least: 4.1
6
  Tested up to: 4.3.1
7
- Stable tag: 3.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -39,6 +39,7 @@ wpDiscuz 3.0 and all future 3.x versions have been named as Supercharged. It's s
39
  * | Multi-level (nested) comment threads, with maximum levels depth setting option
40
  * | Allows to create a new discussion thread and reply to existing comment
41
  * | Ajax button "Load More Comments" instead of simple comments pagination
 
42
  * | Different comment date formats, reflects Wordpress date format settings
43
  * | Users can edit their comments (time-frame can be limited by admin)
44
  * | Automatic URLs to link conversion in comment texts
@@ -138,6 +139,15 @@ wpDiscuz Documentation: http://wpdiscuz.com/wpdiscuz-documentation/
138
 
139
  == Changelog ==
140
 
 
 
 
 
 
 
 
 
 
141
  = 3.0.3 =
142
 
143
  wpDiscuz 3 requires at least WordPress 4.1 version.
4
  Tags: wordpress comments, ajax comments, ajax, live update, live comments, realtime chat, chat, realtime commenting, mobile commenting, post comments, advanced comment, comments box, community, discussion, discuss, disqus, discuz, Disqus alternative, Livefyre alternative, Jatpack comments alternative, Facebook comments alternative, comment form, commenting, reply, comments, better comments, discussions, comment notifications, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter, email commenting, social login, boost comments, native comments
5
  Requires at least: 4.1
6
  Tested up to: 4.3.1
7
+ Stable tag: 3.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
39
  * | Multi-level (nested) comment threads, with maximum levels depth setting option
40
  * | Allows to create a new discussion thread and reply to existing comment
41
  * | Ajax button "Load More Comments" instead of simple comments pagination
42
+ * | Lazy load wpDiscuz comments on scrolling
43
  * | Different comment date formats, reflects Wordpress date format settings
44
  * | Users can edit their comments (time-frame can be limited by admin)
45
  * | Automatic URLs to link conversion in comment texts
139
 
140
  == Changelog ==
141
 
142
+ = 3.0.4 =
143
+
144
+ Big news! wpDiscuz comes with comments Lazy Loading feature.
145
+
146
+ * Added: Lazy load comments on scrolling.
147
+ * Added: Compatible with WordPress Zero Spam plugin
148
+
149
+ IMPORTANT: If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
150
+
151
  = 3.0.3 =
152
 
153
  wpDiscuz 3 requires at least WordPress 4.1 version.
templates/comment/comment-form.php CHANGED
@@ -198,7 +198,7 @@ if (comments_open($post->ID)) {
198
  </div>
199
  <div style="clear:both"></div>
200
  <?php } ?>
201
- <div class="wc-thread-wrapper">
202
  <?php
203
  $args = array();
204
  $showLoadeMore = 1;
@@ -210,11 +210,11 @@ if (comments_open($post->ID)) {
210
  }
211
  $commentData = $wpdiscuz->getWPComments($args);
212
  echo $commentData['comment_list'];
213
- ?>
214
  <div class="wpdiscuz-comment-pagination">
215
  <?php
216
  if (!$wpdiscuz->optionsSerialized->wordpressIsPaginate && $commentData['is_show_load_more']) {
217
- $loadMoreButtonText = ($wpdiscuz->optionsSerialized->loadAllComments) ? $wpdiscuz->optionsSerialized->phrases['wc_load_rest_comments_submit_text'] : $wpdiscuz->optionsSerialized->phrases['wc_load_more_submit_text'];
218
  ?>
219
  <div class="wc-load-more-submit-wrap">
220
  <a class="wc-load-more-link" href="<?php echo get_permalink($post->ID) . '#!loadmore&parentId=' . $commentData['last_parent_id']; ?>">
@@ -229,13 +229,14 @@ if (comments_open($post->ID)) {
229
  }
230
  ?>
231
  </div>
 
232
  </div>
233
  <div style="clear:both"></div>
234
  <?php if (comments_open($post->ID) && $commentsCount > 0) { ?>
235
  <?php if ($wpdiscuz->optionsSerialized->showPluginPoweredByLink) { ?>
236
  <div class="by-wpdiscuz">
237
  <span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
238
- document.getElementById("awpdiscuz").style.display = "none";'>
239
  <img src="<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/>
240
  </span>&nbsp;
241
  <a href="http://wpdiscuz.com/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option(WpdiscuzCore::OPTION_SLUG_VERSION); ?> - Supercharged native comments">wpDiscuz</a>
198
  </div>
199
  <div style="clear:both"></div>
200
  <?php } ?>
201
+ <div id="wcThreadWrapper" class="wc-thread-wrapper">
202
  <?php
203
  $args = array();
204
  $showLoadeMore = 1;
210
  }
211
  $commentData = $wpdiscuz->getWPComments($args);
212
  echo $commentData['comment_list'];
213
+ ?>
214
  <div class="wpdiscuz-comment-pagination">
215
  <?php
216
  if (!$wpdiscuz->optionsSerialized->wordpressIsPaginate && $commentData['is_show_load_more']) {
217
+ $loadMoreButtonText = ($wpdiscuz->optionsSerialized->commentListLoadType == 1) ? $wpdiscuz->optionsSerialized->phrases['wc_load_rest_comments_submit_text'] : $wpdiscuz->optionsSerialized->phrases['wc_load_more_submit_text'];
218
  ?>
219
  <div class="wc-load-more-submit-wrap">
220
  <a class="wc-load-more-link" href="<?php echo get_permalink($post->ID) . '#!loadmore&parentId=' . $commentData['last_parent_id']; ?>">
229
  }
230
  ?>
231
  </div>
232
+ <input id="wpdiscuzHasMoreComments" type="hidden" value="<?php echo $commentData['is_show_load_more']; ?>" />
233
  </div>
234
  <div style="clear:both"></div>
235
  <?php if (comments_open($post->ID) && $commentsCount > 0) { ?>
236
  <?php if ($wpdiscuz->optionsSerialized->showPluginPoweredByLink) { ?>
237
  <div class="by-wpdiscuz">
238
  <span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
239
+ document.getElementById("awpdiscuz").style.display = "none";'>
240
  <img src="<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/>
241
  </span>&nbsp;
242
  <a href="http://wpdiscuz.com/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option(WpdiscuzCore::OPTION_SLUG_VERSION); ?> - Supercharged native comments">wpDiscuz</a>
utils/class.WpdiscuzHelper.php CHANGED
@@ -477,7 +477,7 @@ class WpdiscuzHelper {
477
  }
478
  $showLoadeMore = $showLoadeMore && $this->optionsSerialized->wordpressCommentPerPage && (count($postAllParent) > $this->optionsSerialized->wordpressCommentPerPage);
479
  } else {
480
- if ($this->optionsSerialized->loadAllComments && $args['limit'] == 0) {
481
  $showLoadeMore = false;
482
  } else {
483
  $showLoadeMore = $args['offset'] + $this->optionsSerialized->wordpressCommentPerPage < count($postAllParent);
477
  }
478
  $showLoadeMore = $showLoadeMore && $this->optionsSerialized->wordpressCommentPerPage && (count($postAllParent) > $this->optionsSerialized->wordpressCommentPerPage);
479
  } else {
480
+ if ($this->optionsSerialized->commentListLoadType == 1 && $args['limit'] == 0) {
481
  $showLoadeMore = false;
482
  } else {
483
  $showLoadeMore = $args['offset'] + $this->optionsSerialized->wordpressCommentPerPage < count($postAllParent);