Comments – wpDiscuz - Version 3.2.4

Version Description

  • Fixed Bug: Guest comment form warning message - Cannot modify header information - headers already sent...

IMPORTANT:

  • This update is only for wpDiscuz users who have this error on guest comment form above CAPTCHA
  • This release does not require CDN Purging, you only need to delete page cache after update.
Download this release

Release Info

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

Code changes from version 3.2.3 to 3.2.4

assets/js/wpdiscuz.js CHANGED
@@ -174,24 +174,24 @@ jQuery(document).ready(function ($) {
174
  }
175
 
176
  if (wpdiscuzUploader == 1) {
177
- var images = $(wcForm).find('input.wu-image');
178
- var videos = $(wcForm).find('input.wu-video');
179
- var files = $(wcForm).find('input.wu-file');
180
- $.each($(images), function (i, file) {
181
- $.each(file.files, function (j, image) {
182
- data.append('images[' + j + ']', image.name);
183
  });
184
  });
185
 
186
- $.each($(videos), function (i, file) {
187
- $.each(file.files, function (j, video) {
188
- data.append('videos[' + j + ']', video.name);
189
  });
190
  });
191
 
192
  $.each($(files), function (i, file) {
193
- $.each(file.files, function (j, allFiles) {
194
- data.append('files[' + j + ']', allFiles.name);
195
  });
196
  });
197
  }
@@ -243,6 +243,7 @@ jQuery(document).ready(function ($) {
243
  setCookieInForm();
244
  displayShowHideReplies();
245
  $('.wc_comment', wcForm).css('height', '45.6px');
 
246
  } else {
247
  message = wpdiscuz_ajax_obj.wpdiscuz_options[messageKey];
248
  wpdiscuzSetCommentMsg(wcForm, messageKey, message, true);
@@ -870,6 +871,6 @@ jQuery(document).ready(function ($) {
870
 
871
  function wpdiscuzReset() {
872
  $('.wpdiscuz_reset').val("");
873
- }
874
  //============================== FUNCTIONS ============================== //
875
  });
174
  }
175
 
176
  if (wpdiscuzUploader == 1) {
177
+ var images = $(wcForm).find('input.wmu-image');
178
+ var videoAudio = $(wcForm).find('input.wmu-video-audio');
179
+ var files = $(wcForm).find('input.wmu-file');
180
+ $.each($(images), function (i, imageFile) {
181
+ $.each(imageFile.files, function (j, imageObj) {
182
+ data.append('wmu_images[' + j + ']', imageObj);
183
  });
184
  });
185
 
186
+ $.each($(videoAudio), function (i, videoAudioFile) {
187
+ $.each(videoAudioFile.files, function (j, videoAudioObj) {
188
+ data.append('wmu_videos_audios[' + j + ']', videoAudioObj);
189
  });
190
  });
191
 
192
  $.each($(files), function (i, file) {
193
+ $.each(file.files, function (j, fileObj) {
194
+ data.append('wmu_files[' + j + ']', fileObj);
195
  });
196
  });
197
  }
243
  setCookieInForm();
244
  displayShowHideReplies();
245
  $('.wc_comment', wcForm).css('height', '45.6px');
246
+ $('.wmu-preview-wrap', wcForm).remove();
247
  } else {
248
  message = wpdiscuz_ajax_obj.wpdiscuz_options[messageKey];
249
  wpdiscuzSetCommentMsg(wcForm, messageKey, message, true);
871
 
872
  function wpdiscuzReset() {
873
  $('.wpdiscuz_reset').val("");
874
+ }
875
  //============================== FUNCTIONS ============================== //
876
  });
assets/js/wpdiscuz.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- jQuery(document).ready(function(H){H("body").addClass("wpdiscuz_"+wpdiscuz_ajax_obj.wpdiscuz_options.version);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_input_min_length;wpdiscuzValidator.message.max=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_input_max_length;var W=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var t=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!W;var V=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members>0&&W;var B=wpdiscuz_ajax_obj.wpdiscuz_options.isCaptchaInSession;var F=wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;var aa=wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var l=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var j=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var A=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var X=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var L=wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;var D=wpdiscuz_ajax_obj.wpdiscuz_options.storeCommenterData;var b=1;var o="comment_date_gmt";var Q=[];var x=[];var n=wpdiscuz_ajax_obj.wpdiscuz_options.wpDiscuzReCaptcha;var k=wpdiscuz_ajax_obj.wpdiscuz_options.uploader;I();g();e();if(L){H(".wpdiscuz-vote-sort-up").addClass("wpdiscuz-sort-button-active");o="by_vote"}else{H(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active")}H("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){H(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor")-1)});if(H(".wc_main_comm_form").length){d()}H(document).delegate(".wc-reply-link","click",function(){if(H(this).hasClass("wpdiscuz-clonned")){H("#wc-secondary-form-wrapper-"+p(H(this),0)).slideToggle(700)}else{h(H(this))}d()});H(document).delegate("textarea.wc_comment","focus",function(){if(!(H(this).next(".autogrow-textarea-mirror").length)){H(this).autoGrow()}var ad=H(this).parents(".wc-form-wrapper");H(".wc-form-footer",ad).slideDown(700)});H(document).delegate(".wc-share-link","click",function(){var ad=H(this).parents(".wc-comment-right");H(".share_buttons_box",ad).slideToggle(1000)});H(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(ad){ad.preventDefault()});H(document).delegate(".wc-toggle","click",function(){var ae=p(H(this),0);var ad=H(this);H("#wc-comm-"+ae+"> .wc-reply").slideToggle(700,function(){if(H(this).is(":hidden")){ad.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{ad.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" &and;")}})});H(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(H(this).hasClass("wc-reply")){H(">.wc-comment-right",this).css("backgroundColor",wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color)}else{H(">.wc-comment-right",this).css("backgroundColor",wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color)}});H(document).delegate(".wc_captcha_refresh_img","click",function(){T(H(this))});function T(am){if(!n&&(t||V)){var ae=am.parents(".wc-form-wrapper");var ag=H(".wpdiscuz-cnonce",ae);if(B){var af=f();var an=H(am).prev().children(".wc_captcha_img");var ad=an.attr("src");var ak=ad.substring(0,ad.indexOf("=")+1);an.attr("src",ak+af+"&r="+Math.random());ag.attr("id",af);ag.attr("value",af)}else{var ah=new FormData();ah.append("action","generateCaptcha");var aj=ae.hasClass("wc-secondary-form-wrapper")?0:1;var ai=p(am,aj);ah.append("wpdiscuz_unique_id",ai);var al=U(ah);al.done(function(ap){try{var au=H.parseJSON(ap);if(au.code==1){var ar=H(am).prev().children(".wc_captcha_img");var av=ar.attr("src");var ao=av.lastIndexOf("/")+1;var aq=av.substring(0,ao)+au.message;ar.attr("src",aq);ag.attr("id",au.key);ag.attr("value",au.key)}}catch(at){console.log(at)}H(".wpdiscuz-loading-bar").hide()})}}}function f(){var ad="123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var ae="c";for(i=0;i<13;i++){ae+=ad[Math.floor(Math.random()*(ad.length-1)+1)]}return ae}H(document).delegate(".wc_comm_submit","click",function(){var aj=1;var ah=H(this).parents("form");if(!ah.hasClass("wc_main_comm_form")){aj=G(H(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&H(".wc_email",ah).val()){H(".wc_email",ah).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(H(".wc_email",ah).val())){H(".wc_email",ah).removeAttr("required");H(".wc_email",ah).next(".alert").html("")}if(wpdiscuzValidator.checkAll(ah)){var ak=new FormData();ak.append("action","addComment");var am=H(':input:not([type="checkbox"])',ah);am.each(function(){ak.append(this.name+"",H(this).val())});ak.append("wc_comment_depth",aj);if(H('input[name="wpdiscuz_notification_type"]',ah).is(":checked")){ak.append("wpdiscuz_notification_type",H('input[name="wpdiscuz_notification_type"]',ah).val())}if(k==1){var an=H(ah).find("input.wu-image");var ag=H(ah).find("input.wu-video");var ae=H(ah).find("input.wu-file");H.each(H(an),function(ap,ao){H.each(ao.files,function(aq,ar){ak.append("images["+aq+"]",ar.name)})});H.each(H(ag),function(ap,ao){H.each(ao.files,function(aq,ar){ak.append("videos["+aq+"]",ar.name)})});H.each(H(ae),function(ap,ao){H.each(ao.files,function(aq,ar){ak.append("files["+aq+"]",ar.name)})})}if(!n&&(t||V)&&!B){var af=H(".wc_captcha_img",ah);var ad=af.attr("src");var al=ad.lastIndexOf("/")+1;var ai=ad.substring(al);ak.append("fileName",ai)}if(H.cookie("wc_author_name")&&!H(".wc_name",ah).val()){ak.append("wc_name",H.cookie("wc_author_name"))}if(H.cookie("wc_author_email")&&!H(".wc_email",ah).val()){ak.append("wc_email",H.cookie("wc_author_email"))}if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){ak.append("wpdiscuz_zs",wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs)}U(ak).done(function(ap){var aq="";var ar="";try{var au=H.parseJSON(ap);aq=au.code;if(parseInt(aq)>=0){var ao=au.is_main;ar=au.message;H(".wc_header_text_count").html(au.wc_all_comments_count_new);if(ao){H(".wc-thread-wrapper").prepend(ar)}else{H("#wc-secondary-form-wrapper-"+aq).slideToggle(700);if(au.is_in_same_container==1){H("#wc-secondary-form-wrapper-"+aq).after(ar)}else{H("#wc-secondary-form-wrapper-"+aq).after(ar.replace("wc-reply","wc-reply wc-no-left-margin"))}}r(au);Z(au);w(ah,au);ah.get(0).reset();d();e();H(".wc_comment",ah).css("height","45.6px")}else{ar=wpdiscuz_ajax_obj.wpdiscuz_options[aq];v(ah,aq,ar,true)}}catch(at){if(ap.indexOf("<")>=0&&ap.indexOf(">")>=0){ar=at}else{ar=ap}v(ah,"wc_invalid_field",ar,true)}I();H(".wpdiscuz-loading-bar").hide()})}T(H(".wc_captcha_refresh_img",ah));P()});function r(af){if(!af.held_moderate){var ae=new FormData();ae.append("action","checkNotificationType");ae.append("comment_id",af.new_comment_id);ae.append("email",af.user_email);ae.append("isParent",af.is_main);var ad=U(ae);ad.done(function(ag){try{af=H.parseJSON(ag)}catch(ah){console.log(ah)}})}}function Z(af){if(af.redirect>0&&af.new_comment_id){var ae=new FormData();ae.append("action","redirect");ae.append("commentId",af.new_comment_id);var ad=U(ae);ad.done(function(ag){af=H.parseJSON(ag);if(af.code==1){setTimeout(function(){window.location.href=af.redirect_to},5000)}})}}function d(){if(H.cookie("wc_author_name")&&H.cookie("wc_author_name").indexOf("Anonymous")<0){H(".wc_comm_form .wc_name").val(H.cookie("wc_author_name"))}if(H.cookie("wc_author_email")&&H.cookie("wc_author_email").indexOf("@example.com")<0){H(".wc_comm_form .wc_email").val(H.cookie("wc_author_email"))}if(H.cookie("wc_author_website")){H(".wc_comm_form .wc_website").val(H.cookie("wc_author_website"))}}function w(af,ag){var ae="";var ad="";if(H(".wc_email",af).val()){ae=H(".wc_email",af).val()}else{ae=ag.user_email}if(H(".wc_name",af).val()){ad=H(".wc_name",af).val()}else{ad=ag.user_name}if(D==null){H.cookie("wc_author_email",ae);H.cookie("wc_author_name",ad);H.cookie("wc_author_website",H(".wc_website",af).val())}else{D=parseInt(D);H.cookie("wc_author_email",ae,{expires:D,path:"/"});H.cookie("wc_author_name",ad,{expires:D,path:"/"});H.cookie("wc_author_website",H(".wc_website",af).val(),{expires:D,path:"/"})}}var Y;H(document).delegate(".wc_editable_comment","click",function(){var ag=p(H(this),0);var ad=ab(ag);var af=H(this);var ae=new FormData();ae.append("action","editComment");ae.append("commentId",ad);Y=H("#wc-comm-"+ag+" .wc-comment-text").html();U(ae).done(function(ai){try{var am=H.parseJSON(ai);var ak="";var aj=am.code;if(parseInt(aj)>=0){var ah='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+ag+'" style="min-height: 2em;">'+am.message+"</textarea>";H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-text").replaceWith(ah);document.getElementById("wc_edit_comment-"+ag).focus();H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ah="";H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ak=wpdiscuz_ajax_obj.wpdiscuz_options[aj];v(af,aj,ak,false)}}catch(al){console.log(al)}H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wc_save_edited_comment","click",function(){var ai=p(H(this));var ae=ab(ai);var ad=H("#wc-comm-"+ai+" textarea#wc_edit_comment-"+ai);var af=ad.val();var ah=H(this);if(H.trim(af).length>0){var ag=new FormData();ag.append("action","saveEditedComment");ag.append("commentId",ae);ag.append("commentContent",af);U(ag).done(function(aj){try{var an=H.parseJSON(aj);var ak=an.code;var al="";if(parseInt(ak)>=0){M(ai,an.message)}else{al=wpdiscuz_ajax_obj.wpdiscuz_options[ak];v(ah,ak,al,false)}ad="";af=""}catch(am){console.log(am)}H(".wpdiscuz-loading-bar").hide()})}});H(document).delegate(".wc_cancel_edit","click",function(){var ad=p(H(this));M(ad,Y)});function M(af,ae){H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var ad='<div class="wc-comment-text">'+m(ae)+"</div>";H("#wc-comm-"+af+" #wc_edit_comment-"+af).replaceWith(ad)}function m(ag,af){var ae=(af||typeof af==="undefined")?"<br/>":"<br>";var ad=(ag+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+ae+"$2");return ad.replace("<br><br>","<br/>")}H(document).delegate(".wc-load-more-submit","click",function(){K()});var s=H("#wpdiscuzHasMoreComments").val();var J=false;if(F==2&&!aa){H(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();H(window).scroll(function(){var ad=document.getElementById("wcThreadWrapper").scrollHeight;if(H(window).scrollTop()>=ad&&J===false&&s==1){J=true;K()}})}function K(){var ad=new FormData();ad.append("action","loadMoreComments");ad.append("offset",b);ad.append("orderBy",o);ad.append("order",a);ad.append("lastParentId",y());b++;U(ad).done(function(ae){try{var ag=H.parseJSON(ae);H(".wpdiscuz-comment-pagination").before(ag.comment_list);u(ag);H(".wpdiscuz_single").remove();J=false;e()}catch(af){console.log(af)}I();H(".wpdiscuz-loading-bar").hide();H(".wc-load-more-submit").blur()})}function u(ae){var ad=0;if(ae.is_show_load_more==false){ad=0;s=0;H(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}else{S(ae.last_parent_id);s=1;ad=1}H("#wpdiscuzHasMoreComments").val(ad)}H(document).delegate(".wc_vote.wc_not_clicked","click",function(){var ad=H(this);H(ad).removeClass("wc_not_clicked");var ag="";var ah="";var ae=H(this).parents(".wc-comment-right").attr("id");ae=ae.substring(ae.lastIndexOf("-")+1);var af;if(H(this).hasClass("wc-up")){af=1}else{af=-1}var ai=new FormData();ai.append("action","voteOnComment");ai.append("commentId",ae);ai.append("voteType",af);U(ai).done(function(aj){H(ad).addClass("wc_not_clicked");try{var al=H.parseJSON(aj);ag=al.code;if(parseInt(ag)>=0){var am=H(".wc-comment-footer .wc-vote-result",H("#comment-"+ae));H(am).text(parseInt(H(am).text())+af)}else{ah=wpdiscuz_ajax_obj.wpdiscuz_options[ag];v(ad,ag,ah,false)}}catch(ak){console.log(ak)}H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wpdiscuz-sort-button","click",function(){s=H("#wpdiscuzHasMoreComments").val();if(!(H(this).hasClass("wpdiscuz-sort-button-active"))){var ag=H(this);if(H(this).hasClass("wpdiscuz-vote-sort-up")){o="by_vote";a="desc"}else{o="comment_date_gmt";a=H(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var af=new FormData();af.append("action","wpdiscuzSorting");af.append("orderBy",o);af.append("order",a);var ad="";var ae="";U(af).done(function(ah){try{var aj=H.parseJSON(ah);ad=aj.code;ae=aj.message;if(parseInt(ad)>0){H("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){H(this).remove()});H("#wpcomm .wc-thread-wrapper").prepend(ae);b=parseInt(aj.loadCount)}else{}O(ag);u(aj)}catch(ai){console.log(ai)}e();I();H(".wpdiscuz-loading-bar").hide()})}});function O(ad){H(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){H(this).removeClass("wpdiscuz-sort-button-active")});ad.addClass("wpdiscuz-sort-button-active")}function ac(){var ah=location.href;var ag=ah.match(/#comment\-(\d+)/);if(ag!==null){var ae=ag[1];if(!H("#comment-"+ae).length){var af=new FormData();af.append("action","getSingleComment");af.append("commentId",ae);var ad=U(af);ad.done(function(ai){try{var ak=H.parseJSON(ai);H(".wc-thread-wrapper").prepend(ak.message);H("html, body").animate({scrollTop:H(".wc-thread-wrapper").offset().top},1000)}catch(aj){console.log(aj)}I();H(".wpdiscuz-loading-bar").hide()})}}}ac();if(l>0&&X&&(W||(!W&&!A))){setInterval(R,parseInt(j)*1000)}function R(){var ag=E();var ae=(H.cookie("wc_author_email")!=undefined&&H.cookie("wc_author_email")!="")?H.cookie("wc_author_email"):"";var af=new FormData();af.append("action","updateAutomatically");af.append("loadLastCommentId",X);af.append("visibleCommentIds",ag);af.append("email",ae);var ad=U(af);ad.done(function(ai){try{var an=H.parseJSON(ai);if(an.code==1){if(l==1){C(an)}else{x=x.concat(an.message.comments);Q=Q.concat(an.message.author_replies);var aj=x.length;var ah=Q.length;if(aj>0){var al=aj+" ";al+=aj>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;H(".wc_new_comment").html(al).show()}else{H(".wc_new_comment").hide()}if(ah>0){var ak=ah+" ";ak+=ah>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;H(".wc_new_reply").html(ak).show()}else{H(".wc_new_reply").hide()}}H(".wc_header_text_count").html(an.wc_all_comments_count_new);X=an.loadLastCommentId}}catch(am){console.log(am)}I();H(".wpdiscuz-loading-bar").hide()})}function C(ag){if(ag.message!==undefined){var ad;var af=ag.message;for(var ae=0;ae<af.length;ae++){ad=af[ae];z(ad.comment_parent,ad.comment_html)}e()}}H(document).delegate(".wc-update-on-click","click",function(){var ad=new FormData();ad.append("action","updateOnClick");var ae=H(this);if(ae.hasClass("wc_new_comment")){ad.append("newCommentIds",x.join())}else{ad.append("newCommentIds",Q.join())}U(ad).done(function(af){try{var ah=H.parseJSON(af);C(ah);if(ae.hasClass("wc_new_comment")){x=[];H(".wc_new_comment").hide()}else{Q=[];H(".wc_new_reply").hide()}}catch(ag){console.log(ag)}I();H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wpdiscuz-readmore","click",function(){var af=p(H(this));var ad=ab(af);var ae=new FormData();ae.append("action","readMore");ae.append("commentId",ad);U(ae).done(function(ag){try{var ai=H.parseJSON(ag);if(ai.code){H("#comment-"+ad+" > .wc-comment-text").html(" "+ai.message);H("#wpdiscuz-readmore-"+af).remove()}}catch(ah){console.log(ah)}H(".wpdiscuz-loading-bar").hide()})});function v(ah,ae,ag,af){var ad;var ai;if(af){ai=ah.parents(".wc-form-wrapper")}else{ai=ah.closest(".wc-comment")}ad=ai.children(".wpdiscuz-comment-message");ad.addClass(ae);ad.html(ag);ad.show().delay(4000).fadeOut(1000,function(){ad.removeClass();ad.addClass("wpdiscuz-comment-message");ad.html("")})}function h(ae){var af=p(ae,0);H("#wpdiscuz_form_anchor-"+af).before(N(af));var ad=H("#wc-secondary-form-wrapper-"+af);ad.slideToggle(700,function(){ae.addClass("wpdiscuz-clonned")});T(H(".wc_captcha_refresh_img",ad))}function N(ae){var ad=H("#wpdiscuz_hidden_secondary_form").html();return ad.replace(/wpdiscuzuniqueid/g,ae)}function p(af,ae){var ad="";if(ae){ad=af.parents(".wc-main-form-wrapper").attr("id")}else{ad=af.parents(".wc-comment").attr("id")}var ag=ad.substring(ad.lastIndexOf("-")+1);return ag}function ab(ad){return ad.substring(0,ad.indexOf("_"))}function y(){var ad=H(".wc-load-more-link").attr("href");return ad.substring(ad.lastIndexOf("=")+1)}function S(ad){var ae=H(".wc-load-more-link").attr("href");H(".wc-load-more-link").attr("href",ae.replace(/[\d]+$/m,ad));if(F!=2){H(".wpdiscuz-comment-pagination").show()}}function G(af){var ae=af.attr("class");var ad=ae.split(" ");var ag="";H.each(ad,function(ah,ai){if("wc_comment_level"===c(ai,false)){ag=c(ai,true)}});return parseInt(ag)+1}function c(ad,ae){var af="";if(ae){af=ad.substring(ad.indexOf("-")+1)}else{af=ad.substring(0,ad.indexOf("-"))}return af}function z(af,ae){if(af==0){H(".wc-thread-wrapper").prepend(ae)}else{var ad=p(H("#comment-"+af),0);H("#wpdiscuz_form_anchor-"+ad).after(ae)}}function E(){var af;var ad;var ae="";H(".wc-comment-right").each(function(){af=p(H(this),0);ad=ab(af);ae+=ad+","});return ae}function I(){H(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});H(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function g(){if(H(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){H(".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(H(".wc_social_plugin_wrapper .the_champ_login_container").length){H(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(H(".wc_social_plugin_wrapper .social_connect_form").length){H(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(H(".wc_social_plugin_wrapper .oneall_social_login_providers").length){H(".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 e(){H("#wcThreadWrapper .wc-comment").each(function(ad){if(H("> .wc-reply",this).length){H("> .wc-comment-right .wc-comment-footer .wc-toggle",this).removeClass("wpdiscuz-hidden")}})}function U(ad){if(ad.action!=="liveUpdate"){H(".wpdiscuz-loading-bar").show()}ad.append("postId",q);return H.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:ad,contentType:false,processData:false,})}function P(){H(".wpdiscuz_reset").val("")}});
1
 
2
+ jQuery(document).ready(function(H){H("body").addClass("wpdiscuz_"+wpdiscuz_ajax_obj.wpdiscuz_options.version);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_input_min_length;wpdiscuzValidator.message.max=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_input_max_length;var W=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var t=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!W;var V=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members>0&&W;var B=wpdiscuz_ajax_obj.wpdiscuz_options.isCaptchaInSession;var F=wpdiscuz_ajax_obj.wpdiscuz_options.commentListLoadType;var aa=wpdiscuz_ajax_obj.wpdiscuz_options.wordpressIsPaginate;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var l=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var j=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var A=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var X=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var L=wpdiscuz_ajax_obj.wpdiscuz_options.commentsVoteOrder;var D=wpdiscuz_ajax_obj.wpdiscuz_options.storeCommenterData;var b=1;var o="comment_date_gmt";var Q=[];var x=[];var n=wpdiscuz_ajax_obj.wpdiscuz_options.wpDiscuzReCaptcha;var k=wpdiscuz_ajax_obj.wpdiscuz_options.uploader;I();g();e();if(L){H(".wpdiscuz-vote-sort-up").addClass("wpdiscuz-sort-button-active");o="by_vote"}else{H(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active")}H("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){H(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor")-1)});if(H(".wc_main_comm_form").length){d()}H(document).delegate(".wc-reply-link","click",function(){if(H(this).hasClass("wpdiscuz-clonned")){H("#wc-secondary-form-wrapper-"+p(H(this),0)).slideToggle(700)}else{h(H(this))}d()});H(document).delegate("textarea.wc_comment","focus",function(){if(!(H(this).next(".autogrow-textarea-mirror").length)){H(this).autoGrow()}var ad=H(this).parents(".wc-form-wrapper");H(".wc-form-footer",ad).slideDown(700)});H(document).delegate(".wc-share-link","click",function(){var ad=H(this).parents(".wc-comment-right");H(".share_buttons_box",ad).slideToggle(1000)});H(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(ad){ad.preventDefault()});H(document).delegate(".wc-toggle","click",function(){var ae=p(H(this),0);var ad=H(this);H("#wc-comm-"+ae+"> .wc-reply").slideToggle(700,function(){if(H(this).is(":hidden")){ad.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" &or;")}else{ad.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" &and;")}})});H(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(H(this).hasClass("wc-reply")){H(">.wc-comment-right",this).css("backgroundColor",wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color)}else{H(">.wc-comment-right",this).css("backgroundColor",wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color)}});H(document).delegate(".wc_captcha_refresh_img","click",function(){T(H(this))});function T(am){if(!n&&(t||V)){var ae=am.parents(".wc-form-wrapper");var ag=H(".wpdiscuz-cnonce",ae);if(B){var af=f();var an=H(am).prev().children(".wc_captcha_img");var ad=an.attr("src");var ak=ad.substring(0,ad.indexOf("=")+1);an.attr("src",ak+af+"&r="+Math.random());ag.attr("id",af);ag.attr("value",af)}else{var ah=new FormData();ah.append("action","generateCaptcha");var aj=ae.hasClass("wc-secondary-form-wrapper")?0:1;var ai=p(am,aj);ah.append("wpdiscuz_unique_id",ai);var al=U(ah);al.done(function(ap){try{var au=H.parseJSON(ap);if(au.code==1){var ar=H(am).prev().children(".wc_captcha_img");var av=ar.attr("src");var ao=av.lastIndexOf("/")+1;var aq=av.substring(0,ao)+au.message;ar.attr("src",aq);ag.attr("id",au.key);ag.attr("value",au.key)}}catch(at){console.log(at)}H(".wpdiscuz-loading-bar").hide()})}}}function f(){var ad="123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";var ae="c";for(i=0;i<13;i++){ae+=ad[Math.floor(Math.random()*(ad.length-1)+1)]}return ae}H(document).delegate(".wc_comm_submit","click",function(){var aj=1;var ah=H(this).parents("form");if(!ah.hasClass("wc_main_comm_form")){aj=G(H(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&H(".wc_email",ah).val()){H(".wc_email",ah).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(H(".wc_email",ah).val())){H(".wc_email",ah).removeAttr("required");H(".wc_email",ah).next(".alert").html("")}if(wpdiscuzValidator.checkAll(ah)){var ak=new FormData();ak.append("action","addComment");var am=H(':input:not([type="checkbox"])',ah);am.each(function(){ak.append(this.name+"",H(this).val())});ak.append("wc_comment_depth",aj);if(H('input[name="wpdiscuz_notification_type"]',ah).is(":checked")){ak.append("wpdiscuz_notification_type",H('input[name="wpdiscuz_notification_type"]',ah).val())}if(k==1){var an=H(ah).find("input.wmu-image");var af=H(ah).find("input.wmu-video-audio");var ae=H(ah).find("input.wmu-file");H.each(H(an),function(ao,ap){H.each(ap.files,function(aq,ar){ak.append("wmu_images["+aq+"]",ar)})});H.each(H(af),function(ap,ao){H.each(ao.files,function(aq,ar){ak.append("wmu_videos_audios["+aq+"]",ar)})});H.each(H(ae),function(ap,ao){H.each(ao.files,function(aq,ar){ak.append("wmu_files["+aq+"]",ar)})})}if(!n&&(t||V)&&!B){var ag=H(".wc_captcha_img",ah);var ad=ag.attr("src");var al=ad.lastIndexOf("/")+1;var ai=ad.substring(al);ak.append("fileName",ai)}if(H.cookie("wc_author_name")&&!H(".wc_name",ah).val()){ak.append("wc_name",H.cookie("wc_author_name"))}if(H.cookie("wc_author_email")&&!H(".wc_email",ah).val()){ak.append("wc_email",H.cookie("wc_author_email"))}if(wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs){ak.append("wpdiscuz_zs",wpdiscuz_ajax_obj.wpdiscuz_options.wpdiscuz_zs)}U(ak).done(function(ap){var aq="";var ar="";try{var au=H.parseJSON(ap);aq=au.code;if(parseInt(aq)>=0){var ao=au.is_main;ar=au.message;H(".wc_header_text_count").html(au.wc_all_comments_count_new);if(ao){H(".wc-thread-wrapper").prepend(ar)}else{H("#wc-secondary-form-wrapper-"+aq).slideToggle(700);if(au.is_in_same_container==1){H("#wc-secondary-form-wrapper-"+aq).after(ar)}else{H("#wc-secondary-form-wrapper-"+aq).after(ar.replace("wc-reply","wc-reply wc-no-left-margin"))}}r(au);Z(au);w(ah,au);ah.get(0).reset();d();e();H(".wc_comment",ah).css("height","45.6px");H(".wmu-preview-wrap",ah).remove()}else{ar=wpdiscuz_ajax_obj.wpdiscuz_options[aq];v(ah,aq,ar,true)}}catch(at){if(ap.indexOf("<")>=0&&ap.indexOf(">")>=0){ar=at}else{ar=ap}v(ah,"wc_invalid_field",ar,true)}I();H(".wpdiscuz-loading-bar").hide()})}T(H(".wc_captcha_refresh_img",ah));P()});function r(af){if(!af.held_moderate){var ae=new FormData();ae.append("action","checkNotificationType");ae.append("comment_id",af.new_comment_id);ae.append("email",af.user_email);ae.append("isParent",af.is_main);var ad=U(ae);ad.done(function(ag){try{af=H.parseJSON(ag)}catch(ah){console.log(ah)}})}}function Z(af){if(af.redirect>0&&af.new_comment_id){var ae=new FormData();ae.append("action","redirect");ae.append("commentId",af.new_comment_id);var ad=U(ae);ad.done(function(ag){af=H.parseJSON(ag);if(af.code==1){setTimeout(function(){window.location.href=af.redirect_to},5000)}})}}function d(){if(H.cookie("wc_author_name")&&H.cookie("wc_author_name").indexOf("Anonymous")<0){H(".wc_comm_form .wc_name").val(H.cookie("wc_author_name"))}if(H.cookie("wc_author_email")&&H.cookie("wc_author_email").indexOf("@example.com")<0){H(".wc_comm_form .wc_email").val(H.cookie("wc_author_email"))}if(H.cookie("wc_author_website")){H(".wc_comm_form .wc_website").val(H.cookie("wc_author_website"))}}function w(af,ag){var ae="";var ad="";if(H(".wc_email",af).val()){ae=H(".wc_email",af).val()}else{ae=ag.user_email}if(H(".wc_name",af).val()){ad=H(".wc_name",af).val()}else{ad=ag.user_name}if(D==null){H.cookie("wc_author_email",ae);H.cookie("wc_author_name",ad);H.cookie("wc_author_website",H(".wc_website",af).val())}else{D=parseInt(D);H.cookie("wc_author_email",ae,{expires:D,path:"/"});H.cookie("wc_author_name",ad,{expires:D,path:"/"});H.cookie("wc_author_website",H(".wc_website",af).val(),{expires:D,path:"/"})}}var Y;H(document).delegate(".wc_editable_comment","click",function(){var ag=p(H(this),0);var ad=ab(ag);var af=H(this);var ae=new FormData();ae.append("action","editComment");ae.append("commentId",ad);Y=H("#wc-comm-"+ag+" .wc-comment-text").html();U(ae).done(function(ai){try{var am=H.parseJSON(ai);var ak="";var aj=am.code;if(parseInt(aj)>=0){var ah='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+ag+'" style="min-height: 2em;">'+am.message+"</textarea>";H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-text").replaceWith(ah);document.getElementById("wc_edit_comment-"+ag).focus();H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ah="";H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();H("#wc-comm-"+ag+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ak=wpdiscuz_ajax_obj.wpdiscuz_options[aj];v(af,aj,ak,false)}}catch(al){console.log(al)}H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wc_save_edited_comment","click",function(){var ai=p(H(this));var ae=ab(ai);var ad=H("#wc-comm-"+ai+" textarea#wc_edit_comment-"+ai);var af=ad.val();var ah=H(this);if(H.trim(af).length>0){var ag=new FormData();ag.append("action","saveEditedComment");ag.append("commentId",ae);ag.append("commentContent",af);U(ag).done(function(aj){try{var an=H.parseJSON(aj);var ak=an.code;var al="";if(parseInt(ak)>=0){M(ai,an.message)}else{al=wpdiscuz_ajax_obj.wpdiscuz_options[ak];v(ah,ak,al,false)}ad="";af=""}catch(am){console.log(am)}H(".wpdiscuz-loading-bar").hide()})}});H(document).delegate(".wc_cancel_edit","click",function(){var ad=p(H(this));M(ad,Y)});function M(af,ae){H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();H("#wc-comm-"+af+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var ad='<div class="wc-comment-text">'+m(ae)+"</div>";H("#wc-comm-"+af+" #wc_edit_comment-"+af).replaceWith(ad)}function m(ag,af){var ae=(af||typeof af==="undefined")?"<br/>":"<br>";var ad=(ag+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+ae+"$2");return ad.replace("<br><br>","<br/>")}H(document).delegate(".wc-load-more-submit","click",function(){K()});var s=H("#wpdiscuzHasMoreComments").val();var J=false;if(F==2&&!aa){H(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide();H(window).scroll(function(){var ad=document.getElementById("wcThreadWrapper").scrollHeight;if(H(window).scrollTop()>=ad&&J===false&&s==1){J=true;K()}})}function K(){var ad=new FormData();ad.append("action","loadMoreComments");ad.append("offset",b);ad.append("orderBy",o);ad.append("order",a);ad.append("lastParentId",y());b++;U(ad).done(function(ae){try{var ag=H.parseJSON(ae);H(".wpdiscuz-comment-pagination").before(ag.comment_list);u(ag);H(".wpdiscuz_single").remove();J=false;e()}catch(af){console.log(af)}I();H(".wpdiscuz-loading-bar").hide();H(".wc-load-more-submit").blur()})}function u(ae){var ad=0;if(ae.is_show_load_more==false){ad=0;s=0;H(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}else{S(ae.last_parent_id);s=1;ad=1}H("#wpdiscuzHasMoreComments").val(ad)}H(document).delegate(".wc_vote.wc_not_clicked","click",function(){var ad=H(this);H(ad).removeClass("wc_not_clicked");var ag="";var ah="";var ae=H(this).parents(".wc-comment-right").attr("id");ae=ae.substring(ae.lastIndexOf("-")+1);var af;if(H(this).hasClass("wc-up")){af=1}else{af=-1}var ai=new FormData();ai.append("action","voteOnComment");ai.append("commentId",ae);ai.append("voteType",af);U(ai).done(function(aj){H(ad).addClass("wc_not_clicked");try{var al=H.parseJSON(aj);ag=al.code;if(parseInt(ag)>=0){var am=H(".wc-comment-footer .wc-vote-result",H("#comment-"+ae));H(am).text(parseInt(H(am).text())+af)}else{ah=wpdiscuz_ajax_obj.wpdiscuz_options[ag];v(ad,ag,ah,false)}}catch(ak){console.log(ak)}H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wpdiscuz-sort-button","click",function(){s=H("#wpdiscuzHasMoreComments").val();if(!(H(this).hasClass("wpdiscuz-sort-button-active"))){var ag=H(this);if(H(this).hasClass("wpdiscuz-vote-sort-up")){o="by_vote";a="desc"}else{o="comment_date_gmt";a=H(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var af=new FormData();af.append("action","wpdiscuzSorting");af.append("orderBy",o);af.append("order",a);var ad="";var ae="";U(af).done(function(ah){try{var aj=H.parseJSON(ah);ad=aj.code;ae=aj.message;if(parseInt(ad)>0){H("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){H(this).remove()});H("#wpcomm .wc-thread-wrapper").prepend(ae);b=parseInt(aj.loadCount)}else{}O(ag);u(aj)}catch(ai){console.log(ai)}e();I();H(".wpdiscuz-loading-bar").hide()})}});function O(ad){H(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){H(this).removeClass("wpdiscuz-sort-button-active")});ad.addClass("wpdiscuz-sort-button-active")}function ac(){var ah=location.href;var ag=ah.match(/#comment\-(\d+)/);if(ag!==null){var ae=ag[1];if(!H("#comment-"+ae).length){var af=new FormData();af.append("action","getSingleComment");af.append("commentId",ae);var ad=U(af);ad.done(function(ai){try{var ak=H.parseJSON(ai);H(".wc-thread-wrapper").prepend(ak.message);H("html, body").animate({scrollTop:H(".wc-thread-wrapper").offset().top},1000)}catch(aj){console.log(aj)}I();H(".wpdiscuz-loading-bar").hide()})}}}ac();if(l>0&&X&&(W||(!W&&!A))){setInterval(R,parseInt(j)*1000)}function R(){var ag=E();var ae=(H.cookie("wc_author_email")!=undefined&&H.cookie("wc_author_email")!="")?H.cookie("wc_author_email"):"";var af=new FormData();af.append("action","updateAutomatically");af.append("loadLastCommentId",X);af.append("visibleCommentIds",ag);af.append("email",ae);var ad=U(af);ad.done(function(ai){try{var an=H.parseJSON(ai);if(an.code==1){if(l==1){C(an)}else{x=x.concat(an.message.comments);Q=Q.concat(an.message.author_replies);var aj=x.length;var ah=Q.length;if(aj>0){var al=aj+" ";al+=aj>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;H(".wc_new_comment").html(al).show()}else{H(".wc_new_comment").hide()}if(ah>0){var ak=ah+" ";ak+=ah>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;H(".wc_new_reply").html(ak).show()}else{H(".wc_new_reply").hide()}}H(".wc_header_text_count").html(an.wc_all_comments_count_new);X=an.loadLastCommentId}}catch(am){console.log(am)}I();H(".wpdiscuz-loading-bar").hide()})}function C(ag){if(ag.message!==undefined){var ad;var af=ag.message;for(var ae=0;ae<af.length;ae++){ad=af[ae];z(ad.comment_parent,ad.comment_html)}e()}}H(document).delegate(".wc-update-on-click","click",function(){var ad=new FormData();ad.append("action","updateOnClick");var ae=H(this);if(ae.hasClass("wc_new_comment")){ad.append("newCommentIds",x.join())}else{ad.append("newCommentIds",Q.join())}U(ad).done(function(af){try{var ah=H.parseJSON(af);C(ah);if(ae.hasClass("wc_new_comment")){x=[];H(".wc_new_comment").hide()}else{Q=[];H(".wc_new_reply").hide()}}catch(ag){console.log(ag)}I();H(".wpdiscuz-loading-bar").hide()})});H(document).delegate(".wpdiscuz-readmore","click",function(){var af=p(H(this));var ad=ab(af);var ae=new FormData();ae.append("action","readMore");ae.append("commentId",ad);U(ae).done(function(ag){try{var ai=H.parseJSON(ag);if(ai.code){H("#comment-"+ad+" > .wc-comment-text").html(" "+ai.message);H("#wpdiscuz-readmore-"+af).remove()}}catch(ah){console.log(ah)}H(".wpdiscuz-loading-bar").hide()})});function v(ah,ae,ag,af){var ad;var ai;if(af){ai=ah.parents(".wc-form-wrapper")}else{ai=ah.closest(".wc-comment")}ad=ai.children(".wpdiscuz-comment-message");ad.addClass(ae);ad.html(ag);ad.show().delay(4000).fadeOut(1000,function(){ad.removeClass();ad.addClass("wpdiscuz-comment-message");ad.html("")})}function h(ae){var af=p(ae,0);H("#wpdiscuz_form_anchor-"+af).before(N(af));var ad=H("#wc-secondary-form-wrapper-"+af);ad.slideToggle(700,function(){ae.addClass("wpdiscuz-clonned")});T(H(".wc_captcha_refresh_img",ad))}function N(ae){var ad=H("#wpdiscuz_hidden_secondary_form").html();return ad.replace(/wpdiscuzuniqueid/g,ae)}function p(af,ae){var ad="";if(ae){ad=af.parents(".wc-main-form-wrapper").attr("id")}else{ad=af.parents(".wc-comment").attr("id")}var ag=ad.substring(ad.lastIndexOf("-")+1);return ag}function ab(ad){return ad.substring(0,ad.indexOf("_"))}function y(){var ad=H(".wc-load-more-link").attr("href");return ad.substring(ad.lastIndexOf("=")+1)}function S(ad){var ae=H(".wc-load-more-link").attr("href");H(".wc-load-more-link").attr("href",ae.replace(/[\d]+$/m,ad));if(F!=2){H(".wpdiscuz-comment-pagination").show()}}function G(af){var ae=af.attr("class");var ad=ae.split(" ");var ag="";H.each(ad,function(ah,ai){if("wc_comment_level"===c(ai,false)){ag=c(ai,true)}});return parseInt(ag)+1}function c(ad,ae){var af="";if(ae){af=ad.substring(ad.indexOf("-")+1)}else{af=ad.substring(0,ad.indexOf("-"))}return af}function z(af,ae){if(af==0){H(".wc-thread-wrapper").prepend(ae)}else{var ad=p(H("#comment-"+af),0);H("#wpdiscuz_form_anchor-"+ad).after(ae)}}function E(){var af;var ad;var ae="";H(".wc-comment-right").each(function(){af=p(H(this),0);ad=ab(af);ae+=ad+","});return ae}function I(){H(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});H(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function g(){if(H(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){H(".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(H(".wc_social_plugin_wrapper .the_champ_login_container").length){H(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(H(".wc_social_plugin_wrapper .social_connect_form").length){H(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(H(".wc_social_plugin_wrapper .oneall_social_login_providers").length){H(".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 e(){H("#wcThreadWrapper .wc-comment").each(function(ad){if(H("> .wc-reply",this).length){H("> .wc-comment-right .wc-comment-footer .wc-toggle",this).removeClass("wpdiscuz-hidden")}})}function U(ad){if(ad.action!=="liveUpdate"){H(".wpdiscuz-loading-bar").show()}ad.append("postId",q);return H.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:ad,contentType:false,processData:false,})}function P(){H(".wpdiscuz_reset").val("")}});
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.2.3
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: http://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
@@ -133,7 +133,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
133
  $loadLastCommentId = isset($_POST['loadLastCommentId']) ? intval($_POST['loadLastCommentId']) : 0;
134
  $visibleCommentIds = isset($_POST['visibleCommentIds']) ? trim($_POST['visibleCommentIds'], ',') : '';
135
  $sentEmail = isset($_POST['email']) ? trim($_POST['email']) : '';
136
- $email = $currentUser->ID ? $currentUser->user_email : $sentEmail;
137
  if ($visibleCommentIds && $postId && $loadLastCommentId && $email) {
138
  $lastCommentId = $this->dbManager->getLastCommentId($postId);
139
  if ($lastCommentId > $loadLastCommentId) {
@@ -219,7 +219,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
219
  $formNonce = isset($_POST['wpdiscuz_comment_form_nonce']) ? trim($_POST['wpdiscuz_comment_form_nonce']) : '';
220
  if ($uniqueId && $postId && wp_verify_nonce($formNonce, self::ACTION_FORM_NONCE)) {
221
  do_action('wpdiscuz_add_comment');
222
- if (function_exists('zerospam_get_key') && isset($_POST['wpdiscuz_zs']) && $wpdiscuzZS = $_POST['wpdiscuz_zs']) {
223
  $_POST['zerospam_key'] = $wpdiscuzZS == md5(zerospam_get_key()) ? zerospam_get_key() : '';
224
  }
225
  $commentDepth = isset($_POST['wc_comment_depth']) && intval($_POST['wc_comment_depth']) ? intval($_POST['wc_comment_depth']) : 1;
@@ -256,9 +256,9 @@ class WpdiscuzCore implements WpDiscuzConstants {
256
  }
257
 
258
  $website_url = '';
259
- if ($current_user->ID) {
260
- $user_id = $current_user->ID;
261
  $user = $current_user;
 
262
  $name = $current_user->display_name;
263
  $email = $current_user->user_email;
264
  } else {
@@ -420,7 +420,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
420
  if ($this->optionsSerialized->commentReadMoreLimit && count(explode(' ', strip_tags($commentContent))) > $this->optionsSerialized->commentReadMoreLimit) {
421
  $commentContent = $this->helper->getCommentExcerpt($commentContent, $uniqueId);
422
  }
423
- $commentContent = apply_filters('comment_text', $commentContent);
424
  $commentContent = $this->helper->makeClickable($commentContent);
425
  $messageArray['message'] = $commentContent;
426
  } else {
@@ -584,7 +584,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
584
  if ($commentId) {
585
  $comment = get_comment($commentId);
586
  $commentContent = wp_kses($comment->comment_content, $this->helper->wc_allowed_tags);
587
- $commentContent = apply_filters('comment_text', $commentContent);
588
  $commentContent = $this->helper->makeClickable($commentContent);
589
  $messageArray['code'] = 1;
590
  $messageArray['message'] = $commentContent;
@@ -751,6 +751,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
751
  $this->wpdiscuzOptionsJs['version'] = $this->version;
752
  $this->wpdiscuzOptionsJs['wc_post_id'] = $post->ID;
753
  $this->wpdiscuzOptionsJs['loadLastCommentId'] = $this->dbManager->getLastCommentId($post->ID);
 
754
  wp_enqueue_script('jquery-form');
755
  wp_register_script('wpdiscuz-ajax-js', plugins_url(WPDISCUZ_DIR_NAME . '/assets/js/wpdiscuz.min.js'), array('jquery'), $this->version);
756
  wp_enqueue_script('wpdiscuz-ajax-js');
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.2.4
7
  * Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
8
  * Author URI: http://gvectors.com/
9
  * Plugin URI: http://wpdiscuz.com/
133
  $loadLastCommentId = isset($_POST['loadLastCommentId']) ? intval($_POST['loadLastCommentId']) : 0;
134
  $visibleCommentIds = isset($_POST['visibleCommentIds']) ? trim($_POST['visibleCommentIds'], ',') : '';
135
  $sentEmail = isset($_POST['email']) ? trim($_POST['email']) : '';
136
+ $email = $currentUser ? $currentUser->user_email : $sentEmail;
137
  if ($visibleCommentIds && $postId && $loadLastCommentId && $email) {
138
  $lastCommentId = $this->dbManager->getLastCommentId($postId);
139
  if ($lastCommentId > $loadLastCommentId) {
219
  $formNonce = isset($_POST['wpdiscuz_comment_form_nonce']) ? trim($_POST['wpdiscuz_comment_form_nonce']) : '';
220
  if ($uniqueId && $postId && wp_verify_nonce($formNonce, self::ACTION_FORM_NONCE)) {
221
  do_action('wpdiscuz_add_comment');
222
+ if (function_exists('zerospam_get_key') && isset($_POST['wpdiscuz_zs']) && ($wpdiscuzZS = $_POST['wpdiscuz_zs'])) {
223
  $_POST['zerospam_key'] = $wpdiscuzZS == md5(zerospam_get_key()) ? zerospam_get_key() : '';
224
  }
225
  $commentDepth = isset($_POST['wc_comment_depth']) && intval($_POST['wc_comment_depth']) ? intval($_POST['wc_comment_depth']) : 1;
256
  }
257
 
258
  $website_url = '';
259
+ if ($current_user) {
 
260
  $user = $current_user;
261
+ $user_id = $current_user->ID;
262
  $name = $current_user->display_name;
263
  $email = $current_user->user_email;
264
  } else {
420
  if ($this->optionsSerialized->commentReadMoreLimit && count(explode(' ', strip_tags($commentContent))) > $this->optionsSerialized->commentReadMoreLimit) {
421
  $commentContent = $this->helper->getCommentExcerpt($commentContent, $uniqueId);
422
  }
423
+ $commentContent = apply_filters('comment_text', $commentContent, $comment);
424
  $commentContent = $this->helper->makeClickable($commentContent);
425
  $messageArray['message'] = $commentContent;
426
  } else {
584
  if ($commentId) {
585
  $comment = get_comment($commentId);
586
  $commentContent = wp_kses($comment->comment_content, $this->helper->wc_allowed_tags);
587
+ $commentContent = apply_filters('comment_text', $commentContent, $comment);
588
  $commentContent = $this->helper->makeClickable($commentContent);
589
  $messageArray['code'] = 1;
590
  $messageArray['message'] = $commentContent;
751
  $this->wpdiscuzOptionsJs['version'] = $this->version;
752
  $this->wpdiscuzOptionsJs['wc_post_id'] = $post->ID;
753
  $this->wpdiscuzOptionsJs['loadLastCommentId'] = $this->dbManager->getLastCommentId($post->ID);
754
+ $this->wpdiscuzOptionsJs = apply_filters('wpdiscuz_js_options', $this->wpdiscuzOptionsJs);
755
  wp_enqueue_script('jquery-form');
756
  wp_register_script('wpdiscuz-ajax-js', plugins_url(WPDISCUZ_DIR_NAME . '/assets/js/wpdiscuz.min.js'), array('jquery'), $this->version);
757
  wp_enqueue_script('wpdiscuz-ajax-js');
options/class.WpdiscuzOptionsSerialized.php CHANGED
@@ -771,9 +771,7 @@ class WpdiscuzOptionsSerialized {
771
  if (function_exists('zerospam_get_key')) {
772
  $js_options['wpdiscuz_zs'] = md5(zerospam_get_key());
773
  }
774
- $js_options['wpDiscuzReCaptcha'] = class_exists("wpDiscuzReCaptcha") ? true : false;
775
  $js_options['isCaptchaInSession'] = (boolean) $this->isCaptchaInSession;
776
- $js_options['uploader'] = class_exists('WpdiscuzUploader') ? 1 : 0;
777
  return $js_options;
778
  }
779
 
771
  if (function_exists('zerospam_get_key')) {
772
  $js_options['wpdiscuz_zs'] = md5(zerospam_get_key());
773
  }
 
774
  $js_options['isCaptchaInSession'] = (boolean) $this->isCaptchaInSession;
 
775
  return $js_options;
776
  }
777
 
options/html-options.php CHANGED
@@ -42,6 +42,7 @@
42
  $this->optionsSerialized->blogRoles['guest'] = '#00B38F';
43
  $this->optionsSerialized->showPluginPoweredByLink = 1;
44
  $this->optionsSerialized->updateOptions();
 
45
  }
46
  ?>
47
 
42
  $this->optionsSerialized->blogRoles['guest'] = '#00B38F';
43
  $this->optionsSerialized->showPluginPoweredByLink = 1;
44
  $this->optionsSerialized->updateOptions();
45
+ do_action('wpdiscuz_reset_options');
46
  }
47
  ?>
48
 
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, Jetpack 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.1
7
- Stable tag: 3.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,15 +126,19 @@ Support Forum: http://gvectors.com/forum/
126
 
127
  == Changelog ==
128
 
129
- = 3.2.3 =
130
 
131
- * Fixed Bug: Unable to post a comment as guest on some servers
132
- * Fixed Bug: Post comment button doesn't work on some servers
133
 
134
  IMPORTANT:
135
 
136
- - If you have JetPack installed please deactivate Jetpack comments, it affects wpDiscuz
137
- - If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
 
 
 
 
 
138
 
139
  = 3.2.2 =
140
 
@@ -146,6 +150,11 @@ IMPORTANT:
146
  * Fixed Bug: Form layout issue when avatars are disabled
147
  * Fixed Bug: Incorrect comment escaping/slashing on some servers
148
 
 
 
 
 
 
149
  = 3.2.1 =
150
 
151
  * Fixed Bug: Notice Error Message - wp_register_script was called incorrectly.
@@ -529,4 +538,4 @@ http://gvectors.com/questions/wpdiscuz-comment-form-is-missing/
529
  * Fixed Bug : Layout Issues with some themes
530
 
531
  = 1.0.0 =
532
- Initial version
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, Jetpack 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.1
7
+ Stable tag: 3.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 3.2.4 =
130
 
131
+ * Fixed Bug: Guest comment form warning message - Cannot modify header information - headers already sent...
 
132
 
133
  IMPORTANT:
134
 
135
+ - This update is only for wpDiscuz users who have this error on guest comment form above CAPTCHA
136
+ - This release does not require CDN Purging, you only need to delete page cache after update.
137
+
138
+ = 3.2.3 =
139
+
140
+ * Fixed Bug: Unable to post a comment as guest on some servers
141
+ * Fixed Bug: Post comment button doesn't work on some servers
142
 
143
  = 3.2.2 =
144
 
150
  * Fixed Bug: Form layout issue when avatars are disabled
151
  * Fixed Bug: Incorrect comment escaping/slashing on some servers
152
 
153
+ IMPORTANT:
154
+
155
+ - If you have JetPack installed please deactivate Jetpack comments, it affects wpDiscuz
156
+ - If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
157
+
158
  = 3.2.1 =
159
 
160
  * Fixed Bug: Notice Error Message - wp_register_script was called incorrectly.
538
  * Fixed Bug : Layout Issues with some themes
539
 
540
  = 1.0.0 =
541
+ Initial version
templates/comment/class.WpdiscuzWalker.php CHANGED
@@ -32,9 +32,11 @@ class WpdiscuzWalker extends Walker_Comment {
32
  $commentContent = $this->helper->getCommentExcerpt($commentContent, $uniqueId);
33
  }
34
  $commentContent = wp_kses($commentContent, $this->helper->wc_allowed_tags);
 
35
  $commentContent = $this->helper->makeClickable($commentContent);
36
  $commentContent = apply_filters('comment_text', $commentContent, $comment, $args);
37
  $commentContent .= $comment->comment_approved == 0 ? '<p class="wc_held_for_moderate">' . $this->optionsSerialized->phrases['wc_held_for_moderate'] . '</p>' : '';
 
38
  $hideAvatarStyle = $this->optionsSerialized->wordpressShowAvatars ? '' : 'style = "margin-left : 0;"';
39
  if ($this->optionsSerialized->wordpressIsPaginate && $comment->comment_parent) {
40
  $rootComment = $this->optimizationHelper->getCommentRoot($comment->comment_parent);
32
  $commentContent = $this->helper->getCommentExcerpt($commentContent, $uniqueId);
33
  }
34
  $commentContent = wp_kses($commentContent, $this->helper->wc_allowed_tags);
35
+ $commentContent = apply_filters('wpdiscuz_before_comment_text', $commentContent, $comment);
36
  $commentContent = $this->helper->makeClickable($commentContent);
37
  $commentContent = apply_filters('comment_text', $commentContent, $comment, $args);
38
  $commentContent .= $comment->comment_approved == 0 ? '<p class="wc_held_for_moderate">' . $this->optionsSerialized->phrases['wc_held_for_moderate'] . '</p>' : '';
39
+
40
  $hideAvatarStyle = $this->optionsSerialized->wordpressShowAvatars ? '' : 'style = "margin-left : 0;"';
41
  if ($this->optionsSerialized->wordpressIsPaginate && $comment->comment_parent) {
42
  $rootComment = $this->optimizationHelper->getCommentRoot($comment->comment_parent);