Comments – wpDiscuz - Version 3.1.3

Version Description

  • Added: Option to keep guest commenter credentials in browser for x days
    • Set this option value -1 to make it unlimit.
    • Set this option value 0 to clear those data when user closes browser.
  • Fixed Bug: CSS Issues

IMPORTANT:

  • If you have JatPack installed please deactivate JatPack comments, it affects wpDiscuz
  • If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
Download this release

Release Info

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

Code changes from version 3.1.2 to 3.1.3

assets/css/options-css.min.css CHANGED
@@ -4,4 +4,12 @@
4
  .wc-form input[type="text"].regular-text{ width:160px; }
5
  .wc-form .wpdiscuz-option-title {vertical-align: middle;}
6
  .wc-form .wc-hidden {display: none;}
7
- .wc-form .resp-tabs-container.integrationsChild {margin-bottom: 5px;}
 
 
 
 
 
 
 
 
4
  .wc-form input[type="text"].regular-text{ width:160px; }
5
  .wc-form .wpdiscuz-option-title {vertical-align: middle;}
6
  .wc-form .wc-hidden {display: none;}
7
+ .wc-form .resp-tabs-container.integrationsChild {margin-bottom: 5px;}
8
+
9
+ /*addons*/
10
+ /* #menu-comments ul > li:nth-child(3) a{ color:#25ACEA!important; text-shadow: 1px 1px 1px #000; } */
11
+ .wpdiscuz_addons_page .wpdiscuz-addons-wrapper {box-sizing: border-box;}
12
+ .wpdiscuz_addons_page .wpdiscuz-addon-block {width: 32%; height: 250px; max-height: 250px; float: left; margin-left: 1%; margin-bottom: 10px; background: #eee;}
13
+ .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-thumb {float: left; margin: 10px;}
14
+ .wpdiscuz_addons_page .wpdiscuz-addon-block .addon-info {display: inline; margin-top: 10px;}
15
+ .wpdiscuz_addons_page .addon-isactive {margin: 20px;}
assets/js/wpdiscuz.js CHANGED
@@ -1,4 +1,5 @@
1
  jQuery(document).ready(function ($) {
 
2
  wpdiscuzValidator.message['invalid'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_invalid_field;
3
  wpdiscuzValidator.message['empty'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_empty_text;
4
  wpdiscuzValidator.message['email'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_email_text;
@@ -18,6 +19,7 @@ jQuery(document).ready(function ($) {
18
  var loadLastCommentId = wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;
19
  var wpdiscuzCommentOrder = wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;
20
  var commentsVoteOrder = wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;
 
21
  var wpdiscuzLoadCount = 1;
22
  var wpdiscuzCommentOrderBy = 'comment_date_gmt';
23
  var wpdiscuzReplyArray = [];
@@ -238,17 +240,29 @@ jQuery(document).ready(function ($) {
238
  }
239
 
240
  function addCookie(wcForm, obj) {
 
 
241
  if ($('.wc_email', wcForm).val()) {
242
- $.cookie('wc_author_email', $('.wc_email', wcForm).val());
243
  } else {
244
- $.cookie('wc_author_email', obj.user_email);
245
  }
246
  if ($('.wc_name', wcForm).val()) {
247
- $.cookie('wc_author_name', $('.wc_name', wcForm).val());
248
  } else {
249
- $.cookie('wc_author_name', obj.user_name);
 
 
 
 
 
 
 
 
 
 
 
250
  }
251
- $.cookie('wc_author_website', $('.wc_website', wcForm).val());
252
  }
253
  //============================== ADD COMMENT FUNCTION ============================== //
254
  //============================== EDIT COMMENT FUNCTION ============================== //
1
  jQuery(document).ready(function ($) {
2
+ $('body').addClass('wpdiscuz_313');
3
  wpdiscuzValidator.message['invalid'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_invalid_field;
4
  wpdiscuzValidator.message['empty'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_empty_text;
5
  wpdiscuzValidator.message['email'] = wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_email_text;
19
  var loadLastCommentId = wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;
20
  var wpdiscuzCommentOrder = wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;
21
  var commentsVoteOrder = wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;
22
+ var storeCommenterData = wpdiscuz_ajax_obj.wpdiscuz_options.storeCommenterData;
23
  var wpdiscuzLoadCount = 1;
24
  var wpdiscuzCommentOrderBy = 'comment_date_gmt';
25
  var wpdiscuzReplyArray = [];
240
  }
241
 
242
  function addCookie(wcForm, obj) {
243
+ var email = '';
244
+ var name = '';
245
  if ($('.wc_email', wcForm).val()) {
246
+ email = $('.wc_email', wcForm).val();
247
  } else {
248
+ email = obj.user_email;
249
  }
250
  if ($('.wc_name', wcForm).val()) {
251
+ name = $('.wc_name', wcForm).val();
252
  } else {
253
+ name = obj.user_name;
254
+ }
255
+ console.log(storeCommenterData);
256
+ if (storeCommenterData == null) {
257
+ $.cookie('wc_author_email', email);
258
+ $.cookie('wc_author_name', name);
259
+ $.cookie('wc_author_website', $('.wc_website', wcForm).val());
260
+ } else {
261
+ storeCommenterData = parseInt(storeCommenterData);
262
+ $.cookie('wc_author_email', email, {expires: storeCommenterData, path: '/'});
263
+ $.cookie('wc_author_name', name, {expires: storeCommenterData, path: '/'});
264
+ $.cookie('wc_author_website', $('.wc_website', wcForm).val(), {expires: storeCommenterData, path: '/'});
265
  }
 
266
  }
267
  //============================== ADD COMMENT FUNCTION ============================== //
268
  //============================== EDIT COMMENT FUNCTION ============================== //
assets/js/wpdiscuz.min.js CHANGED
@@ -1,2 +1,2 @@
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 Q=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!Q;var P=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members>0&&Q;var B=wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;var U=wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;var n=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 x=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var R=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var H=wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;var b=1;var l="comment_date_gmt";var L=[];var u=[];E();g();f();if(H){D(".wpdiscuz-vote-sort-up").addClass("wpdiscuz-sort-button-active");l="by_vote"}else{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){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{h(D(this))}e()});D(document).delegate("textarea.wc_comment","focus",function(){if(!(D(this).next(".autogrow-textarea-mirror").length)){D(this).autoGrow()}var X=D(this).parents(".wc-form-wrapper");D(".wc-form-footer",X).slideDown(700)});D(document).delegate(".wc-share-link","click",function(){var X=D(this).parents(".wc-comment-right");D(".share_buttons_box",X).slideToggle(1000)});D(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(X){X.preventDefault()});D(document).delegate(".wc-toggle","click",function(){var Y=m(D(this),0);var X=D(this);D("#wc-comm-"+Y+"> .wc-reply").slideToggle(700,function(){if(D(this).is(":hidden")){X.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{X.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",this).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{D(">.wc-comment-right",this).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});D(document).delegate(".wc_captcha_refresh_img","click",function(){O(D(this))});function O(ab){if(q||P){var Z=ab.parents(".wc-form-wrapper");var X=Z.hasClass("wc-secondary-form-wrapper")?0:1;var ac=m(ab,X);var aa="uniqueId="+ac;var Y=d("generateCaptcha",aa);Y.done(function(ae){try{var ai=D.parseJSON(ae);if(ai.code==1){var ag=D(ab).prev().children(".wc_captcha_img");var ak=ag.attr("src");var ad=ak.lastIndexOf("/")+1;var af=ak.substring(0,ad)+ai.message;ag.attr("src",af);var aj=D(".wpdiscuz-cnonce",Z);aj.attr("id",ai.key);aj.attr("value",ai.key)}}catch(ah){console.log(ah)}D(".wpdiscuz-loading-bar").hide()})}}D(document).delegate(".wc_comm_submit","click",function(){var ab=1;var Y=D(this).parents("form");if(!Y.hasClass("wc_main_comm_form")){ab=C(D(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&D(".wc_email",Y).val()){D(".wc_email",Y).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(D(".wc_email",Y).val())){D(".wc_email",Y).removeAttr("required");D(".wc_email",Y).next(".alert").html("")}if(wpdiscuzValidator.checkAll(Y)){var X=Y.serialize()+"&wc_comment_depth="+ab;if(q||P){var Z=D(".wc_captcha_img",Y);var aa=Z.attr("src");var ad=aa.lastIndexOf("/")+1;var ac=aa.substring(ad);X+="&fileName="+ac}if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){X+="&wpdiscuz_zs="+wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs}d("addComment",X).done(function(af){var ag="";var ah="";try{var aj=D.parseJSON(af);ag=aj.code;if(parseInt(ag)>=0){var ae=aj.is_main;ah=aj.message;D(".wc_header_text_count").html(aj.wc_all_comments_count_new);if(ae){D(".wc-thread-wrapper").prepend(ah)}else{D("#wc-secondary-form-wrapper-"+ag).slideToggle(700);if(aj.is_in_same_container==1){D("#wc-secondary-form-wrapper-"+ag).after(ah)}else{D("#wc-secondary-form-wrapper-"+ag).after(ah.replace("wc-reply","wc-reply wc-no-left-margin"))}}o(aj);T(aj);t(Y,aj);Y.get(0).reset();e();f();D(".wc_comment",Y).css("height","45.6px")}else{ah=wpdiscuz_ajax_obj.wpdiscuz_options[ag];s(Y,ag,ah,true)}}catch(ai){if(af.indexOf("<")>=0&&af.indexOf(">")>=0){ah=ai}else{ah=af}s(Y,"wc_invalid_field",ah,true)}E();D(".wpdiscuz-loading-bar").hide()})}O(D(".wc_captcha_refresh_img",Y))});function o(Z){if(!Z.held_moderate){var Y="comment_id="+Z.new_comment_id+"&email="+Z.user_email+"&isParent="+Z.is_main;var X=d("checkNotificationType",Y);X.done(function(aa){try{Z=D.parseJSON(aa)}catch(ab){console.log(ab)}})}}function T(Z){if(Z.redirect>0&&Z.new_comment_id){var Y="commentId="+Z.new_comment_id;var X=d("redirect",Y);X.done(function(aa){Z=D.parseJSON(aa);if(Z.code==1){setTimeout(function(){window.location.href=Z.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(X,Y){if(D(".wc_email",X).val()){D.cookie("wc_author_email",D(".wc_email",X).val())}else{D.cookie("wc_author_email",Y.user_email)}if(D(".wc_name",X).val()){D.cookie("wc_author_name",D(".wc_name",X).val())}else{D.cookie("wc_author_name",Y.user_name)}D.cookie("wc_author_website",D(".wc_website",X).val())}var S;D(document).delegate(".wc_editable_comment","click",function(){var aa=m(D(this),0);var X=V(aa);var Z=D(this);var Y="commentId="+X;S=D("#wc-comm-"+aa+" .wc-comment-text").html();d("editComment",Y).done(function(ac){try{var ag=D.parseJSON(ac);var ae="";var ad=ag.code;if(parseInt(ad)>=0){var ab='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+aa+'" style="min-height: 2em;">'+ag.message+"</textarea>";D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-text").replaceWith(ab);document.getElementById("wc_edit_comment-"+aa).focus();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ab="";D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ae=wpdiscuz_ajax_obj.wpdiscuz_options[ad];s(Z,ad,ae,false)}}catch(af){console.log(af)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wc_save_edited_comment","click",function(){var ac=m(D(this));var Y=V(ac);var X=D("#wc-comm-"+ac+" textarea#wc_edit_comment-"+ac);var Z=X.val();var ab=D(this);if(D.trim(Z).length>0){var aa="commentId="+Y+"&commentContent="+Z;d("saveEditedComment",aa).done(function(ad){try{var ah=D.parseJSON(ad);var ae=ah.code;var af="";if(parseInt(ae)>=0){I(ac,ah.message)}else{af=wpdiscuz_ajax_obj.wpdiscuz_options[ae];s(ab,ae,af,false)}X="";Z=""}catch(ag){console.log(ag)}D(".wpdiscuz-loading-bar").hide()})}});D(document).delegate(".wc_cancel_edit","click",function(){var X=m(D(this));I(X,S)});function I(Z,Y){D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var X='<div class="wc-comment-text">'+k(Y)+"</div>";D("#wc-comm-"+Z+" #wc_edit_comment-"+Z).replaceWith(X)}function k(aa,Z){var Y=(Z||typeof Z==="undefined")?"<br/>":"<br>";var X=(aa+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+Y+"$2");return X.replace("<br><br>","<br/>")}D(document).delegate(".wc-load-more-submit","click",function(){G()});var p=D("#wpdiscuzHasMoreComments").val();var F=false;if(B==2&&!U){D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();D(window).scroll(function(){var X=document.getElementById("wcThreadWrapper").scrollHeight;if(D(window).scrollTop()>=X&&F===false&&p==1){F=true;G()}})}function G(){var X;X="offset="+b+"&orderBy="+l+"&order="+a+"&lastParentId="+v();b++;d("loadMoreComments",X).done(function(Y){try{var aa=D.parseJSON(Y);D(".wpdiscuz-comment-pagination").before(aa.comment_list);r(aa);D(".wpdiscuz_single").remove();F=false;f()}catch(Z){console.log(Z)}E();D(".wpdiscuz-loading-bar").hide();D(".wc-load-more-submit").blur()})}function r(Y){var X=0;if(Y.is_show_load_more==false){X=0;p=0;D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}else{N(Y.last_parent_id);p=1;X=1}D("#wpdiscuzHasMoreComments").val(X)}D(document).delegate(".wc_vote","click",function(){var X=D(this);var aa="";var ab="";var Y=D(this).parents(".wc-comment-right").attr("id");Y=Y.substring(Y.lastIndexOf("-")+1);var Z;if(D(this).hasClass("wc-up")){Z=1}else{Z=-1}var ac="commentId="+Y+"&voteType="+Z;d("voteOnComment",ac).done(function(ad){try{var af=D.parseJSON(ad);aa=af.code;if(parseInt(aa)>=0){var ag=D(".wc-comment-footer .wc-vote-result",D("#comment-"+Y));D(ag).text(parseInt(D(ag).text())+Z)}else{ab=wpdiscuz_ajax_obj.wpdiscuz_options[aa];s(X,aa,ab,false)}}catch(ae){console.log(ae)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wpdiscuz-sort-button","click",function(){p=D("#wpdiscuzHasMoreComments").val();if(!(D(this).hasClass("wpdiscuz-sort-button-active"))){var aa=D(this);if(D(this).hasClass("wpdiscuz-vote-sort-up")){l="by_vote";a="desc"}else{l="comment_date_gmt";a=D(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var Z="orderBy="+l+"&order="+a;var X="";var Y="";d("wpdiscuzSorting",Z).done(function(ab){try{var ad=D.parseJSON(ab);X=ad.code;Y=ad.message;if(parseInt(X)>0){D("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){D(this).remove()});D("#wpcomm .wc-thread-wrapper").prepend(Y);b=parseInt(ad.loadCount)}else{}K(aa);r(ad)}catch(ac){console.log(ac)}f();E();D(".wpdiscuz-loading-bar").hide()})}});function K(X){D(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){D(this).removeClass("wpdiscuz-sort-button-active")});X.addClass("wpdiscuz-sort-button-active")}function W(){var ab=location.href;var aa=ab.match(/#comment\-(\d+)/);if(aa!==null){var Y=aa[1];if(!D("#comment-"+Y).length){var Z="commentId="+Y;var X=d("getSingleComment",Z);X.done(function(ac){try{var ae=D.parseJSON(ac);D(".wc-thread-wrapper").prepend(ae.message);D("html, body").animate({scrollTop:D(".wc-thread-wrapper").offset().top},1000)}catch(ad){console.log(ad)}E();D(".wpdiscuz-loading-bar").hide()})}}}W();if(j>0&&R&&(Q||(!Q&&!x))){setInterval(M,parseInt(i)*1000)}function M(){var aa=A();var Y=(D.cookie("wc_author_email")!=undefined&&D.cookie("wc_author_email")!="")?D.cookie("wc_author_email"):"";var Z="loadLastCommentId="+R+"&visibleCommentIds="+aa+"&email="+Y;var X=d("liveUpdate",Z);X.done(function(ac){try{var ah=D.parseJSON(ac);if(ah.code==1){if(j==1){y(ah)}else{u=u.concat(ah.message.comments);L=L.concat(ah.message.author_replies);var ad=u.length;var ab=L.length;if(ad>0){var af=ad+" ";af+=ad>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(af).show()}else{D(".wc_new_comment").hide()}if(ab>0){var ae=ab+" ";ae+=ab>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(ae).show()}else{D(".wc_new_reply").hide()}}D(".wc_header_text_count").html(ah.wc_all_comments_count_new);R=ah.loadLastCommentId}}catch(ag){console.log(ag)}E();D(".wpdiscuz-loading-bar").hide()})}function y(aa){if(aa.message!==undefined){var X;var Z=aa.message;for(var Y=0;Y<Z.length;Y++){X=Z[Y];w(X.comment_parent,X.comment_html)}f()}}D(document).delegate(".wc-update-on-click","click",function(){var X;var Y=D(this);if(Y.hasClass("wc_new_comment")){X="newCommentIds="+u.join()}else{X="newCommentIds="+L.join()}d("updateOnClick",X).done(function(Z){try{var ab=D.parseJSON(Z);y(ab);if(Y.hasClass("wc_new_comment")){u=[];D(".wc_new_comment").hide()}else{L=[];D(".wc_new_reply").hide()}}catch(aa){console.log(aa)}E();D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wpdiscuz-readmore","click",function(){var Z=m(D(this));var X=V(Z);var Y="commentId="+X;d("readMore",Y).done(function(aa){try{var ac=D.parseJSON(aa);if(ac.code){D("#comment-"+X+" > .wc-comment-text").html(" "+ac.message);D("#wpdiscuz-readmore-"+Z).remove()}}catch(ab){console.log(ab)}D(".wpdiscuz-loading-bar").hide()})});function s(ab,Y,aa,Z){var X;var ac;if(Z){ac=ab.parents(".wc-form-wrapper")}else{ac=ab.closest(".wc-comment")}X=ac.children(".wpdiscuz-comment-message");X.addClass(Y);X.html(aa);X.show().delay(4000).fadeOut(1000,function(){X.removeClass();X.addClass("wpdiscuz-comment-message");X.html("")})}function h(Y){var Z=m(Y,0);D("#wpdiscuz_form_anchor-"+Z).before(J(Z));var X=D("#wc-secondary-form-wrapper-"+Z);X.slideToggle(700,function(){Y.addClass("wpdiscuz-clonned")});O(D(".wc_captcha_refresh_img",X))}function J(Y){var X=D("#wpdiscuz_hidden_secondary_form").html();return X.replace(/wpdiscuzuniqueid/g,Y)}function m(Z,Y){var X="";if(Y){X=Z.parents(".wc-main-form-wrapper").attr("id")}else{X=Z.parents(".wc-comment").attr("id")}var aa=X.substring(X.lastIndexOf("-")+1);return aa}function V(X){return X.substring(0,X.indexOf("_"))}function z(Y){var X=Y.substring(Y.indexOf("_")+1);return X}function v(){var X=D(".wc-load-more-link").attr("href");return X.substring(X.lastIndexOf("=")+1)}function N(X){var Y=D(".wc-load-more-link").attr("href");D(".wc-load-more-link").attr("href",Y.replace(/[\d]+$/m,X));if(B!=2){D(".wpdiscuz-comment-pagination").show()}}function C(Z){var Y=Z.attr("class");var X=Y.split(" ");var aa="";D.each(X,function(ab,ac){if("wc_comment_level"===c(ac,false)){aa=c(ac,true)}});return parseInt(aa)+1}function c(X,Y){var Z="";if(Y){Z=X.substring(X.indexOf("-")+1)}else{Z=X.substring(0,X.indexOf("-"))}return Z}function w(Z,Y){if(Z==0){D(".wc-thread-wrapper").prepend(Y)}else{var X=m(D("#comment-"+Z),0);D("#wpdiscuz_form_anchor-"+X).after(Y)}}function A(){var Z;var X;var Y="";D(".wc-comment-right").each(function(){Z=m(D(this),0);X=V(Z);Y+=X+","});return Y}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 g(){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")}}}}}function f(){D("#wcThreadWrapper .wc-comment").each(function(X){if(D("> .wc-reply",this).length){D("> .wc-comment-right .wc-comment-footer .wc-toggle",this).removeClass("wpdiscuz-hidden")}})}function d(Y,X){if(Y!=="liveUpdate"){D(".wpdiscuz-loading-bar").show()}X+="&postId="+n;return D.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:X,action:Y}})}});
1
+
2
+ jQuery(document).ready(function(D){D("body").addClass("wpdiscuz_313");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 Q=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!Q;var P=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members>0&&Q;var B=wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;var U=wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;var n=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 x=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var R=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var H=wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;var z=wpdiscuz_ajax_obj.wpdiscuz_options.storeCommenterData;var b=1;var l="comment_date_gmt";var L=[];var u=[];E();g();f();if(H){D(".wpdiscuz-vote-sort-up").addClass("wpdiscuz-sort-button-active");l="by_vote"}else{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){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{h(D(this))}e()});D(document).delegate("textarea.wc_comment","focus",function(){if(!(D(this).next(".autogrow-textarea-mirror").length)){D(this).autoGrow()}var X=D(this).parents(".wc-form-wrapper");D(".wc-form-footer",X).slideDown(700)});D(document).delegate(".wc-share-link","click",function(){var X=D(this).parents(".wc-comment-right");D(".share_buttons_box",X).slideToggle(1000)});D(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(X){X.preventDefault()});D(document).delegate(".wc-toggle","click",function(){var Y=m(D(this),0);var X=D(this);D("#wc-comm-"+Y+"> .wc-reply").slideToggle(700,function(){if(D(this).is(":hidden")){X.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{X.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",this).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{D(">.wc-comment-right",this).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});D(document).delegate(".wc_captcha_refresh_img","click",function(){O(D(this))});function O(ab){if(q||P){var Z=ab.parents(".wc-form-wrapper");var X=Z.hasClass("wc-secondary-form-wrapper")?0:1;var ac=m(ab,X);var aa="uniqueId="+ac;var Y=d("generateCaptcha",aa);Y.done(function(ae){try{var ai=D.parseJSON(ae);if(ai.code==1){var ag=D(ab).prev().children(".wc_captcha_img");var ak=ag.attr("src");var ad=ak.lastIndexOf("/")+1;var af=ak.substring(0,ad)+ai.message;ag.attr("src",af);var aj=D(".wpdiscuz-cnonce",Z);aj.attr("id",ai.key);aj.attr("value",ai.key)}}catch(ah){console.log(ah)}D(".wpdiscuz-loading-bar").hide()})}}D(document).delegate(".wc_comm_submit","click",function(){var ab=1;var Y=D(this).parents("form");if(!Y.hasClass("wc_main_comm_form")){ab=C(D(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&D(".wc_email",Y).val()){D(".wc_email",Y).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(D(".wc_email",Y).val())){D(".wc_email",Y).removeAttr("required");D(".wc_email",Y).next(".alert").html("")}if(wpdiscuzValidator.checkAll(Y)){var X=Y.serialize()+"&wc_comment_depth="+ab;if(q||P){var Z=D(".wc_captcha_img",Y);var aa=Z.attr("src");var ad=aa.lastIndexOf("/")+1;var ac=aa.substring(ad);X+="&fileName="+ac}if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){X+="&wpdiscuz_zs="+wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs}d("addComment",X).done(function(af){var ag="";var ah="";try{var aj=D.parseJSON(af);ag=aj.code;if(parseInt(ag)>=0){var ae=aj.is_main;ah=aj.message;D(".wc_header_text_count").html(aj.wc_all_comments_count_new);if(ae){D(".wc-thread-wrapper").prepend(ah)}else{D("#wc-secondary-form-wrapper-"+ag).slideToggle(700);if(aj.is_in_same_container==1){D("#wc-secondary-form-wrapper-"+ag).after(ah)}else{D("#wc-secondary-form-wrapper-"+ag).after(ah.replace("wc-reply","wc-reply wc-no-left-margin"))}}o(aj);T(aj);t(Y,aj);Y.get(0).reset();e();f();D(".wc_comment",Y).css("height","45.6px")}else{ah=wpdiscuz_ajax_obj.wpdiscuz_options[ag];s(Y,ag,ah,true)}}catch(ai){if(af.indexOf("<")>=0&&af.indexOf(">")>=0){ah=ai}else{ah=af}s(Y,"wc_invalid_field",ah,true)}E();D(".wpdiscuz-loading-bar").hide()})}O(D(".wc_captcha_refresh_img",Y))});function o(Z){if(!Z.held_moderate){var Y="comment_id="+Z.new_comment_id+"&email="+Z.user_email+"&isParent="+Z.is_main;var X=d("checkNotificationType",Y);X.done(function(aa){try{Z=D.parseJSON(aa)}catch(ab){console.log(ab)}})}}function T(Z){if(Z.redirect>0&&Z.new_comment_id){var Y="commentId="+Z.new_comment_id;var X=d("redirect",Y);X.done(function(aa){Z=D.parseJSON(aa);if(Z.code==1){setTimeout(function(){window.location.href=Z.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(Z,aa){var Y="";var X="";if(D(".wc_email",Z).val()){Y=D(".wc_email",Z).val()}else{Y=aa.user_email}if(D(".wc_name",Z).val()){X=D(".wc_name",Z).val()}else{X=aa.user_name}console.log(z);if(z==null){D.cookie("wc_author_email",Y);D.cookie("wc_author_name",X);D.cookie("wc_author_website",D(".wc_website",Z).val())}else{z=parseInt(z);D.cookie("wc_author_email",Y,{expires:z,path:"/"});D.cookie("wc_author_name",X,{expires:z,path:"/"});D.cookie("wc_author_website",D(".wc_website",Z).val(),{expires:z,path:"/"})}}var S;D(document).delegate(".wc_editable_comment","click",function(){var aa=m(D(this),0);var X=V(aa);var Z=D(this);var Y="commentId="+X;S=D("#wc-comm-"+aa+" .wc-comment-text").html();d("editComment",Y).done(function(ac){try{var ag=D.parseJSON(ac);var ae="";var ad=ag.code;if(parseInt(ad)>=0){var ab='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+aa+'" style="min-height: 2em;">'+ag.message+"</textarea>";D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-text").replaceWith(ab);document.getElementById("wc_edit_comment-"+aa).focus();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ab="";D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();D("#wc-comm-"+aa+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ae=wpdiscuz_ajax_obj.wpdiscuz_options[ad];s(Z,ad,ae,false)}}catch(af){console.log(af)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wc_save_edited_comment","click",function(){var ac=m(D(this));var Y=V(ac);var X=D("#wc-comm-"+ac+" textarea#wc_edit_comment-"+ac);var Z=X.val();var ab=D(this);if(D.trim(Z).length>0){var aa="commentId="+Y+"&commentContent="+Z;d("saveEditedComment",aa).done(function(ad){try{var ah=D.parseJSON(ad);var ae=ah.code;var af="";if(parseInt(ae)>=0){I(ac,ah.message)}else{af=wpdiscuz_ajax_obj.wpdiscuz_options[ae];s(ab,ae,af,false)}X="";Z=""}catch(ag){console.log(ag)}D(".wpdiscuz-loading-bar").hide()})}});D(document).delegate(".wc_cancel_edit","click",function(){var X=m(D(this));I(X,S)});function I(Z,Y){D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();D("#wc-comm-"+Z+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var X='<div class="wc-comment-text">'+k(Y)+"</div>";D("#wc-comm-"+Z+" #wc_edit_comment-"+Z).replaceWith(X)}function k(aa,Z){var Y=(Z||typeof Z==="undefined")?"<br/>":"<br>";var X=(aa+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+Y+"$2");return X.replace("<br><br>","<br/>")}D(document).delegate(".wc-load-more-submit","click",function(){G()});var p=D("#wpdiscuzHasMoreComments").val();var F=false;if(B==2&&!U){D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();D(window).scroll(function(){var X=document.getElementById("wcThreadWrapper").scrollHeight;if(D(window).scrollTop()>=X&&F===false&&p==1){F=true;G()}})}function G(){var X;X="offset="+b+"&orderBy="+l+"&order="+a+"&lastParentId="+v();b++;d("loadMoreComments",X).done(function(Y){try{var aa=D.parseJSON(Y);D(".wpdiscuz-comment-pagination").before(aa.comment_list);r(aa);D(".wpdiscuz_single").remove();F=false;f()}catch(Z){console.log(Z)}E();D(".wpdiscuz-loading-bar").hide();D(".wc-load-more-submit").blur()})}function r(Y){var X=0;if(Y.is_show_load_more==false){X=0;p=0;D(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}else{N(Y.last_parent_id);p=1;X=1}D("#wpdiscuzHasMoreComments").val(X)}D(document).delegate(".wc_vote","click",function(){var X=D(this);var aa="";var ab="";var Y=D(this).parents(".wc-comment-right").attr("id");Y=Y.substring(Y.lastIndexOf("-")+1);var Z;if(D(this).hasClass("wc-up")){Z=1}else{Z=-1}var ac="commentId="+Y+"&voteType="+Z;d("voteOnComment",ac).done(function(ad){try{var af=D.parseJSON(ad);aa=af.code;if(parseInt(aa)>=0){var ag=D(".wc-comment-footer .wc-vote-result",D("#comment-"+Y));D(ag).text(parseInt(D(ag).text())+Z)}else{ab=wpdiscuz_ajax_obj.wpdiscuz_options[aa];s(X,aa,ab,false)}}catch(ae){console.log(ae)}D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wpdiscuz-sort-button","click",function(){p=D("#wpdiscuzHasMoreComments").val();if(!(D(this).hasClass("wpdiscuz-sort-button-active"))){var aa=D(this);if(D(this).hasClass("wpdiscuz-vote-sort-up")){l="by_vote";a="desc"}else{l="comment_date_gmt";a=D(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var Z="orderBy="+l+"&order="+a;var X="";var Y="";d("wpdiscuzSorting",Z).done(function(ab){try{var ad=D.parseJSON(ab);X=ad.code;Y=ad.message;if(parseInt(X)>0){D("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){D(this).remove()});D("#wpcomm .wc-thread-wrapper").prepend(Y);b=parseInt(ad.loadCount)}else{}K(aa);r(ad)}catch(ac){console.log(ac)}f();E();D(".wpdiscuz-loading-bar").hide()})}});function K(X){D(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){D(this).removeClass("wpdiscuz-sort-button-active")});X.addClass("wpdiscuz-sort-button-active")}function W(){var ab=location.href;var aa=ab.match(/#comment\-(\d+)/);if(aa!==null){var Y=aa[1];if(!D("#comment-"+Y).length){var Z="commentId="+Y;var X=d("getSingleComment",Z);X.done(function(ac){try{var ae=D.parseJSON(ac);D(".wc-thread-wrapper").prepend(ae.message);D("html, body").animate({scrollTop:D(".wc-thread-wrapper").offset().top},1000)}catch(ad){console.log(ad)}E();D(".wpdiscuz-loading-bar").hide()})}}}W();if(j>0&&R&&(Q||(!Q&&!x))){setInterval(M,parseInt(i)*1000)}function M(){var aa=A();var Y=(D.cookie("wc_author_email")!=undefined&&D.cookie("wc_author_email")!="")?D.cookie("wc_author_email"):"";var Z="loadLastCommentId="+R+"&visibleCommentIds="+aa+"&email="+Y;var X=d("liveUpdate",Z);X.done(function(ac){try{var ah=D.parseJSON(ac);if(ah.code==1){if(j==1){y(ah)}else{u=u.concat(ah.message.comments);L=L.concat(ah.message.author_replies);var ad=u.length;var ab=L.length;if(ad>0){var af=ad+" ";af+=ad>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(af).show()}else{D(".wc_new_comment").hide()}if(ab>0){var ae=ab+" ";ae+=ab>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(ae).show()}else{D(".wc_new_reply").hide()}}D(".wc_header_text_count").html(ah.wc_all_comments_count_new);R=ah.loadLastCommentId}}catch(ag){console.log(ag)}E();D(".wpdiscuz-loading-bar").hide()})}function y(aa){if(aa.message!==undefined){var X;var Z=aa.message;for(var Y=0;Y<Z.length;Y++){X=Z[Y];w(X.comment_parent,X.comment_html)}f()}}D(document).delegate(".wc-update-on-click","click",function(){var X;var Y=D(this);if(Y.hasClass("wc_new_comment")){X="newCommentIds="+u.join()}else{X="newCommentIds="+L.join()}d("updateOnClick",X).done(function(Z){try{var ab=D.parseJSON(Z);y(ab);if(Y.hasClass("wc_new_comment")){u=[];D(".wc_new_comment").hide()}else{L=[];D(".wc_new_reply").hide()}}catch(aa){console.log(aa)}E();D(".wpdiscuz-loading-bar").hide()})});D(document).delegate(".wpdiscuz-readmore","click",function(){var Z=m(D(this));var X=V(Z);var Y="commentId="+X;d("readMore",Y).done(function(aa){try{var ac=D.parseJSON(aa);if(ac.code){D("#comment-"+X+" > .wc-comment-text").html(" "+ac.message);D("#wpdiscuz-readmore-"+Z).remove()}}catch(ab){console.log(ab)}D(".wpdiscuz-loading-bar").hide()})});function s(ab,Y,aa,Z){var X;var ac;if(Z){ac=ab.parents(".wc-form-wrapper")}else{ac=ab.closest(".wc-comment")}X=ac.children(".wpdiscuz-comment-message");X.addClass(Y);X.html(aa);X.show().delay(4000).fadeOut(1000,function(){X.removeClass();X.addClass("wpdiscuz-comment-message");X.html("")})}function h(Y){var Z=m(Y,0);D("#wpdiscuz_form_anchor-"+Z).before(J(Z));var X=D("#wc-secondary-form-wrapper-"+Z);X.slideToggle(700,function(){Y.addClass("wpdiscuz-clonned")});O(D(".wc_captcha_refresh_img",X))}function J(Y){var X=D("#wpdiscuz_hidden_secondary_form").html();return X.replace(/wpdiscuzuniqueid/g,Y)}function m(Z,Y){var X="";if(Y){X=Z.parents(".wc-main-form-wrapper").attr("id")}else{X=Z.parents(".wc-comment").attr("id")}var aa=X.substring(X.lastIndexOf("-")+1);return aa}function V(X){return X.substring(0,X.indexOf("_"))}function v(){var X=D(".wc-load-more-link").attr("href");return X.substring(X.lastIndexOf("=")+1)}function N(X){var Y=D(".wc-load-more-link").attr("href");D(".wc-load-more-link").attr("href",Y.replace(/[\d]+$/m,X));if(B!=2){D(".wpdiscuz-comment-pagination").show()}}function C(Z){var Y=Z.attr("class");var X=Y.split(" ");var aa="";D.each(X,function(ab,ac){if("wc_comment_level"===c(ac,false)){aa=c(ac,true)}});return parseInt(aa)+1}function c(X,Y){var Z="";if(Y){Z=X.substring(X.indexOf("-")+1)}else{Z=X.substring(0,X.indexOf("-"))}return Z}function w(Z,Y){if(Z==0){D(".wc-thread-wrapper").prepend(Y)}else{var X=m(D("#comment-"+Z),0);D("#wpdiscuz_form_anchor-"+X).after(Y)}}function A(){var Z;var X;var Y="";D(".wc-comment-right").each(function(){Z=m(D(this),0);X=V(Z);Y+=X+","});return Y}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 g(){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")}}}}}function f(){D("#wcThreadWrapper .wc-comment").each(function(X){if(D("> .wc-reply",this).length){D("> .wc-comment-right .wc-comment-footer .wc-toggle",this).removeClass("wpdiscuz-hidden")}})}function d(Y,X){if(Y!=="liveUpdate"){D(".wpdiscuz-loading-bar").show()}X+="&postId="+n;return D.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:X,action:Y}})}});
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.1.2
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: http://www.gvectors.com/
9
  * Plugin URI: http://www.gvectors.com/wpdiscuz/
@@ -684,9 +684,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
684
  * register options page for plugin
685
  */
686
  public function addPluginOptionsPage() {
687
- add_submenu_page('edit-comments.php', 'wpdiscuz Settings', 'wpdiscuz Settings', 'manage_options', 'wpdiscuz_options_page', array(&$this->options, 'mainOptionsForm'));
688
  if (!$this->optionsSerialized->isUsePoMo) {
689
- add_submenu_page('edit-comments.php', 'wpdiscuz Phrases', 'wpdiscuz Phrases', 'manage_options', 'wpdiscuz_phrases_page', array(&$this->options, 'phrasesOptionsForm'));
690
  }
691
  }
692
 
@@ -727,11 +727,11 @@ class WpdiscuzCore implements WpDiscuzConstants {
727
  if ($post && in_array($post->post_type, $this->optionsSerialized->postTypes) && (is_singular() || is_front_page()) && post_type_supports($post->post_type, 'comments')) {
728
 
729
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
730
- wp_register_style('wpdiscuz-frontend-css', plugins_url(WPDISCUZ_DIR_NAME . '/assets/css/wpdiscuz.min.css'), null, get_option(WpdiscuzCore::OPTION_SLUG_VERSION));
731
  wp_enqueue_style('wpdiscuz-frontend-css');
732
 
733
  if (is_rtl()) {
734
- wp_register_style('wpdiscuz-frontend-rtl-css', plugins_url(WPDISCUZ_DIR_NAME . '/assets/css/wpdiscuz-rtl.min.css'), null, get_option(WpdiscuzCore::OPTION_SLUG_VERSION));
735
  wp_enqueue_style('wpdiscuz-frontend-rtl-css');
736
  }
737
 
@@ -758,7 +758,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
758
  $wpdiscuz_js_options = $this->optionsSerialized->getOptionsForJs();
759
  $wpdiscuz_js_options['wc_post_id'] = $post->ID;
760
  $wpdiscuz_js_options['loadLastCommentId'] = $this->dbManager->getLastCommentId($post->ID);
761
- wp_register_script('wpdiscuz-ajax-js', plugins_url(WPDISCUZ_DIR_NAME . '/assets/js/wpdiscuz.min.js'), array('jquery'), get_option(WpdiscuzCore::OPTION_SLUG_VERSION));
762
  wp_enqueue_script('wpdiscuz-ajax-js');
763
  wp_localize_script('wpdiscuz-ajax-js', 'wpdiscuz_ajax_obj', array('url' => admin_url('admin-ajax.php'), 'wpdiscuz_options' => $wpdiscuz_js_options));
764
  }
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.1.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/
684
  * register options page for plugin
685
  */
686
  public function addPluginOptionsPage() {
687
+ add_submenu_page('edit-comments.php', 'wpDiscuz Settings', 'wpDiscuz Settings', 'manage_options', 'wpdiscuz_options_page', array(&$this->options, 'mainOptionsForm'));
688
  if (!$this->optionsSerialized->isUsePoMo) {
689
+ add_submenu_page('edit-comments.php', 'wpDiscuz Phrases', 'wpDiscuz Phrases', 'manage_options', 'wpdiscuz_phrases_page', array(&$this->options, 'phrasesOptionsForm'));
690
  }
691
  }
692
 
727
  if ($post && in_array($post->post_type, $this->optionsSerialized->postTypes) && (is_singular() || is_front_page()) && post_type_supports($post->post_type, 'comments')) {
728
 
729
  $u_agent = $_SERVER['HTTP_USER_AGENT'];
730
+ wp_register_style('wpdiscuz-frontend-css', plugins_url(WPDISCUZ_DIR_NAME . '/assets/css/wpdiscuz.min.css'), null, get_option(self::OPTION_SLUG_VERSION));
731
  wp_enqueue_style('wpdiscuz-frontend-css');
732
 
733
  if (is_rtl()) {
734
+ wp_register_style('wpdiscuz-frontend-rtl-css', plugins_url(WPDISCUZ_DIR_NAME . '/assets/css/wpdiscuz-rtl.min.css'));
735
  wp_enqueue_style('wpdiscuz-frontend-rtl-css');
736
  }
737
 
758
  $wpdiscuz_js_options = $this->optionsSerialized->getOptionsForJs();
759
  $wpdiscuz_js_options['wc_post_id'] = $post->ID;
760
  $wpdiscuz_js_options['loadLastCommentId'] = $this->dbManager->getLastCommentId($post->ID);
761
+ wp_register_script('wpdiscuz-ajax-js', plugins_url(WPDISCUZ_DIR_NAME . '/assets/js/wpdiscuz.min.js'), array('jquery'), get_option(self::OPTION_SLUG_VERSION));
762
  wp_enqueue_script('wpdiscuz-ajax-js');
763
  wp_localize_script('wpdiscuz-ajax-js', 'wpdiscuz_ajax_obj', array('url' => admin_url('admin-ajax.php'), 'wpdiscuz_options' => $wpdiscuz_js_options));
764
  }
options/class.WpdiscuzOptions.php CHANGED
@@ -48,6 +48,7 @@ class WpdiscuzOptions {
48
  $this->optionsSerialized->headerTextShowHide = isset($_POST['wc_header_text_show_hide']) ? $_POST['wc_header_text_show_hide'] : 0;
49
  $this->optionsSerialized->isNameFieldRequired = isset($_POST['wc_is_name_field_required']) ? $_POST['wc_is_name_field_required'] : 0;
50
  $this->optionsSerialized->isEmailFieldRequired = isset($_POST['wc_is_email_field_required']) ? $_POST['wc_is_email_field_required'] : 0;
 
51
  $this->optionsSerialized->showHideLoggedInUsername = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
52
  $this->optionsSerialized->replyButtonGuestsShowHide = isset($_POST['wc_reply_button_guests_show_hide']) ? $_POST['wc_reply_button_guests_show_hide'] : 0;
53
  $this->optionsSerialized->replyButtonMembersShowHide = isset($_POST['wc_reply_button_members_show_hide']) ? $_POST['wc_reply_button_members_show_hide'] : 0;
@@ -200,10 +201,6 @@ class WpdiscuzOptions {
200
  include_once 'html-phrases.php';
201
  }
202
 
203
- public function addons() {
204
- include_once 'html-addons.php';
205
- }
206
-
207
  private function initShareButtons() {
208
  $this->shareButtons[] = 'fb';
209
  $this->shareButtons[] = 'twitter';
48
  $this->optionsSerialized->headerTextShowHide = isset($_POST['wc_header_text_show_hide']) ? $_POST['wc_header_text_show_hide'] : 0;
49
  $this->optionsSerialized->isNameFieldRequired = isset($_POST['wc_is_name_field_required']) ? $_POST['wc_is_name_field_required'] : 0;
50
  $this->optionsSerialized->isEmailFieldRequired = isset($_POST['wc_is_email_field_required']) ? $_POST['wc_is_email_field_required'] : 0;
51
+ $this->optionsSerialized->storeCommenterData = isset($_POST['storeCommenterData']) && (intval($_POST['storeCommenterData']) || $_POST['storeCommenterData'] == 0)? $_POST['storeCommenterData'] : -1;
52
  $this->optionsSerialized->showHideLoggedInUsername = isset($_POST['wc_show_hide_loggedin_username']) ? $_POST['wc_show_hide_loggedin_username'] : 0;
53
  $this->optionsSerialized->replyButtonGuestsShowHide = isset($_POST['wc_reply_button_guests_show_hide']) ? $_POST['wc_reply_button_guests_show_hide'] : 0;
54
  $this->optionsSerialized->replyButtonMembersShowHide = isset($_POST['wc_reply_button_members_show_hide']) ? $_POST['wc_reply_button_members_show_hide'] : 0;
201
  include_once 'html-phrases.php';
202
  }
203
 
 
 
 
 
204
  private function initShareButtons() {
205
  $this->shareButtons[] = 'fb';
206
  $this->shareButtons[] = 'twitter';
options/class.WpdiscuzOptionsSerialized.php CHANGED
@@ -130,6 +130,14 @@ class WpdiscuzOptionsSerialized {
130
  */
131
  public $isEmailFieldRequired;
132
 
 
 
 
 
 
 
 
 
133
  /**
134
  * Type - Checkbox
135
  * Available Values - Checked/Unchecked
@@ -413,6 +421,7 @@ class WpdiscuzOptionsSerialized {
413
  $this->headerTextShowHide = isset($options['wc_header_text_show_hide']) ? $options['wc_header_text_show_hide'] : 0;
414
  $this->isNameFieldRequired = isset($options['wc_is_name_field_required']) ? $options['wc_is_name_field_required'] : 0;
415
  $this->isEmailFieldRequired = isset($options['wc_is_email_field_required']) ? $options['wc_is_email_field_required'] : 0;
 
416
  $this->showHideLoggedInUsername = isset($options['wc_show_hide_loggedin_username']) ? $options['wc_show_hide_loggedin_username'] : 0;
417
  $this->replyButtonGuestsShowHide = isset($options['wc_reply_button_guests_show_hide']) ? $options['wc_reply_button_guests_show_hide'] : 0;
418
  $this->replyButtonMembersShowHide = isset($options['wc_reply_button_members_show_hide']) ? $options['wc_reply_button_members_show_hide'] : 0;
@@ -567,6 +576,7 @@ class WpdiscuzOptionsSerialized {
567
  'wc_header_text_show_hide' => $this->headerTextShowHide,
568
  'wc_is_name_field_required' => $this->isNameFieldRequired,
569
  'wc_is_email_field_required' => $this->isEmailFieldRequired,
 
570
  'wc_show_hide_loggedin_username' => $this->showHideLoggedInUsername,
571
  'wc_reply_button_guests_show_hide' => $this->replyButtonGuestsShowHide,
572
  'wc_reply_button_members_show_hide' => $this->replyButtonMembersShowHide,
@@ -623,6 +633,7 @@ class WpdiscuzOptionsSerialized {
623
  'wc_avatar_show_hide' => '0',
624
  'wc_is_name_field_required' => '1',
625
  'wc_is_email_field_required' => '1',
 
626
  'wc_show_hide_loggedin_username' => '1',
627
  'wc_reply_button_guests_show_hide' => '0',
628
  'wc_reply_button_members_show_hide' => '0',
@@ -702,6 +713,13 @@ class WpdiscuzOptionsSerialized {
702
  $js_options['commentsVoteOrder'] = $this->showSortingButtons && $this->mostVotedByDefault;
703
  $js_options['wordpressThreadCommentsDepth'] = $this->wordpressThreadCommentsDepth;
704
  $js_options['wordpressIsPaginate'] = $this->wordpressIsPaginate;
 
 
 
 
 
 
 
705
  if (function_exists('zerospam_get_key')) {
706
  $js_options['wpdiscuz_zs'] = md5(zerospam_get_key());
707
  }
130
  */
131
  public $isEmailFieldRequired;
132
 
133
+ /**
134
+ * Type - input
135
+ * Available Values - 0 to unlimit
136
+ * Description - If setted 0 commenter data will be stored for current session else days count
137
+ * Default Value - Checked
138
+ */
139
+ public $storeCommenterData;
140
+
141
  /**
142
  * Type - Checkbox
143
  * Available Values - Checked/Unchecked
421
  $this->headerTextShowHide = isset($options['wc_header_text_show_hide']) ? $options['wc_header_text_show_hide'] : 0;
422
  $this->isNameFieldRequired = isset($options['wc_is_name_field_required']) ? $options['wc_is_name_field_required'] : 0;
423
  $this->isEmailFieldRequired = isset($options['wc_is_email_field_required']) ? $options['wc_is_email_field_required'] : 0;
424
+ $this->storeCommenterData = isset($options['storeCommenterData']) ? $options['storeCommenterData'] : -1;
425
  $this->showHideLoggedInUsername = isset($options['wc_show_hide_loggedin_username']) ? $options['wc_show_hide_loggedin_username'] : 0;
426
  $this->replyButtonGuestsShowHide = isset($options['wc_reply_button_guests_show_hide']) ? $options['wc_reply_button_guests_show_hide'] : 0;
427
  $this->replyButtonMembersShowHide = isset($options['wc_reply_button_members_show_hide']) ? $options['wc_reply_button_members_show_hide'] : 0;
576
  'wc_header_text_show_hide' => $this->headerTextShowHide,
577
  'wc_is_name_field_required' => $this->isNameFieldRequired,
578
  'wc_is_email_field_required' => $this->isEmailFieldRequired,
579
+ 'storeCommenterData' => $this->storeCommenterData,
580
  'wc_show_hide_loggedin_username' => $this->showHideLoggedInUsername,
581
  'wc_reply_button_guests_show_hide' => $this->replyButtonGuestsShowHide,
582
  'wc_reply_button_members_show_hide' => $this->replyButtonMembersShowHide,
633
  'wc_avatar_show_hide' => '0',
634
  'wc_is_name_field_required' => '1',
635
  'wc_is_email_field_required' => '1',
636
+ 'storeCommenterData' => '-1',
637
  'wc_show_hide_loggedin_username' => '1',
638
  'wc_reply_button_guests_show_hide' => '0',
639
  'wc_reply_button_members_show_hide' => '0',
713
  $js_options['commentsVoteOrder'] = $this->showSortingButtons && $this->mostVotedByDefault;
714
  $js_options['wordpressThreadCommentsDepth'] = $this->wordpressThreadCommentsDepth;
715
  $js_options['wordpressIsPaginate'] = $this->wordpressIsPaginate;
716
+ if ($this->storeCommenterData < 0) {
717
+ $js_options['storeCommenterData'] = 100000;
718
+ } else if ($this->storeCommenterData == 0) {
719
+ $js_options['storeCommenterData'] = null;
720
+ } else {
721
+ $js_options['storeCommenterData'] = $this->storeCommenterData;
722
+ }
723
  if (function_exists('zerospam_get_key')) {
724
  $js_options['wpdiscuz_zs'] = md5(zerospam_get_key());
725
  }
options/options-layouts/settings-general.php CHANGED
@@ -47,6 +47,20 @@ if (!defined('ABSPATH')) {
47
  </label>
48
  </td>
49
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  <tr valign="top">
51
  <th scope="row">
52
  <?php _e('Comment text min length', 'wpdiscuz'); ?>
47
  </label>
48
  </td>
49
  </tr>
50
+ <tr valign="top">
51
+ <th scope="row">
52
+ <?php _e('Keep guest commenter credentials in browser cookies for x days', 'wpdiscuz'); ?>
53
+ <p style="font-size:13px; color:#999999; width:80%; padding-left:0px; margin-left:0px;">
54
+ Set this option value -1 to make it unlimited.<br />
55
+ Set this option value 0 to clear those data when user closes browser.
56
+ </p>
57
+ </th>
58
+ <td>
59
+ <label for="storeCommenterData">
60
+ <input type="number" value="<?php echo isset($this->optionsSerialized->storeCommenterData) ? $this->optionsSerialized->storeCommenterData : -1; ?>" name="storeCommenterData" id="storeCommenterData" />
61
+ </label><br/>
62
+ </td>
63
+ </tr>
64
  <tr valign="top">
65
  <th scope="row">
66
  <?php _e('Comment text min length', 'wpdiscuz'); ?>
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, Lazy load, Lazy load comments, 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: 3.8.0
6
  Tested up to: 4.4
7
- Stable tag: 3.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -145,17 +145,23 @@ Support Forum: http://gvectors.com/forum/
145
 
146
  == Changelog ==
147
 
148
- = 3.1.2 =
149
-
150
- * Fixed Bug: CAPTCHA issue on some hosting services and with some secure plugins
151
- * Updated: Polish (pl_PL) translation, thanks to Radosław Rak
152
 
 
 
 
 
153
 
154
  IMPORTANT:
155
 
156
  - If you have JatPack installed please deactivate JatPack comments, it affects wpDiscuz
157
  - If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
158
 
 
 
 
 
 
159
  = 3.1.1 =
160
 
161
  * Fixed Bug: Conflict with Woocommerce
4
  Tags: wordpress comments, ajax comments, ajax, live update, live comments, realtime chat, chat, realtime commenting, Lazy load, Lazy load comments, 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: 3.8.0
6
  Tested up to: 4.4
7
+ Stable tag: 3.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
145
 
146
  == Changelog ==
147
 
148
+ = 3.1.3 =
 
 
 
149
 
150
+ * Added: Option to keep guest commenter credentials in browser for x days
151
+ * Set this option value -1 to make it unlimit.
152
+ * Set this option value 0 to clear those data when user closes browser.
153
+ * Fixed Bug: CSS Issues
154
 
155
  IMPORTANT:
156
 
157
  - If you have JatPack installed please deactivate JatPack comments, it affects wpDiscuz
158
  - If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
159
 
160
+ = 3.1.2 =
161
+
162
+ * Fixed Bug: CAPTCHA issue on some hosting services and with some secure plugins
163
+ * Updated: Polish (pl_PL) translation, thanks to Radosław Rak
164
+
165
  = 3.1.1 =
166
 
167
  * Fixed Bug: Conflict with Woocommerce
utils/class.WpdiscuzHelper.php CHANGED
@@ -461,30 +461,30 @@ class WpdiscuzHelper {
461
  }
462
 
463
  $captchaData = array();
464
- $filesPath = plugin_dir_path(__FILE__) . WPDISCUZ_DS . 'captcha' . WPDISCUZ_DS;
465
 
466
- if (!function_exists('imagecreatefrompng')) {
467
- $captchaData['code'] = 0;
468
- $captchaData['key'] = '';
469
- $captchaData['message'] = $this->msgGDLibraryDisabled;
470
- return $captchaData;
 
 
 
 
 
 
 
 
471
  }
472
 
473
- if (!@chmod($filesPath, 0777) || !@chmod($this->captchaDir, 0777)) {
474
- $captchaData['code'] = 0;
475
- $captchaData['key'] = '';
476
- $captchaData['message'] = $this->msgPermsDeniedError;
477
- return $captchaData;
478
- }
479
-
480
- if (!(@is_writable($this->captchaDir))) {
481
  $captchaData['code'] = 0;
482
  $captchaData['key'] = '';
483
- $captchaData['message'] = $this->msgDirectoryNotWritable;
484
  return $captchaData;
485
  }
486
 
487
-
488
  if (($im = @imagecreatefrompng($filesPath . 'captcha_bg_easy.png')) === false) {
489
  $captchaData['code'] = 0;
490
  $captchaData['key'] = '';
@@ -531,7 +531,6 @@ class WpdiscuzHelper {
531
  imagedestroy($im);
532
  $key = $this->createAnswer($prefix, $t);
533
  $captchaData['key'] = $prefix . $key;
534
- @chmod($filesPath, 0755);
535
  @chmod($this->captchaDir, 0755);
536
  return $captchaData;
537
  }
461
  }
462
 
463
  $captchaData = array();
464
+ $filesPath = plugin_dir_path(__FILE__) . 'captcha' . WPDISCUZ_DS;
465
 
466
+ if (!(@is_writable($this->captchaDir))) {
467
+ if (!@chmod($this->captchaDir, 0777)) {
468
+ $captchaData['code'] = 0;
469
+ $captchaData['key'] = '';
470
+ $captchaData['message'] = $this->msgPermsDeniedError;
471
+ return $captchaData;
472
+ }
473
+ if (!(@is_writable($this->captchaDir))) {
474
+ $captchaData['code'] = 0;
475
+ $captchaData['key'] = '';
476
+ $captchaData['message'] = $this->msgDirectoryNotWritable;
477
+ return $captchaData;
478
+ }
479
  }
480
 
481
+ if (!function_exists('imagecreatefrompng')) {
 
 
 
 
 
 
 
482
  $captchaData['code'] = 0;
483
  $captchaData['key'] = '';
484
+ $captchaData['message'] = $this->msgGDLibraryDisabled;
485
  return $captchaData;
486
  }
487
 
 
488
  if (($im = @imagecreatefrompng($filesPath . 'captcha_bg_easy.png')) === false) {
489
  $captchaData['code'] = 0;
490
  $captchaData['key'] = '';
531
  imagedestroy($im);
532
  $key = $this->createAnswer($prefix, $t);
533
  $captchaData['key'] = $prefix . $key;
 
534
  @chmod($this->captchaDir, 0755);
535
  return $captchaData;
536
  }