Version Description
wpDiscuz 3 requires at least WordPress 4.1 version. We're currently working on core functions to make it compatible on lower versions (>3.8)
IMPORTANT: If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
- Added: Requires at least Wordpress 4.1
- Added: Comments auto-optimizer, you don't need to use [Supercharge My Comments] button anymore
- Optimized: Less ajax requests for CAPTCHA
- Fixed Bug: RTL issues
- Fixed Bug: Reversed subscription message on subscribe bar
- Fixed Bug: Label coloring issue
Download this release
Release Info
Developer | gzakar |
Plugin | Comments – wpDiscuz |
Version | 3.0.3 |
Comparing to | |
See all releases |
Code changes from version 3.0.2 to 3.0.3
- assets/css/wpdiscuz-rtl.min.css +4 -0
- assets/css/wpdiscuz.min.css +1 -1
- assets/js/wpdiscuz-captcha.js +0 -60
- assets/js/wpdiscuz-captcha.min.js +0 -2
- assets/js/wpdiscuz-synch-comments.js +0 -66
- assets/js/wpdiscuz-synch-comments.min.js +0 -2
- assets/js/wpdiscuz.js +0 -53
- assets/js/wpdiscuz.min.js +2 -2
- class.WpdiscuzCore.php +34 -16
- includes/class.WpdiscuzCss.php +1 -1
- manager/class.WpdiscuzDBManager.php +32 -11
- options/class.WpdiscuzOptions.php +9 -11
- options/options-layouts/settings-synch-comments.php +0 -53
- readme.txt +17 -12
- templates/comment/class.WpdiscuzTemplateBuilder.php +1 -1
- templates/comment/comment-form.php +21 -24
- utils/class.WpdiscuzOptimizationHelper.php +17 -48
- utils/interface.WpDiscuzConstants.php +0 -1
assets/css/wpdiscuz-rtl.min.css
CHANGED
@@ -17,6 +17,10 @@
|
|
17 |
#wpcomm .wpdiscuz-subscribe-form-option{ float: right; }
|
18 |
#wpcomm .wpdiscuz-subscribe-form-intro{ float: right; }
|
19 |
#wpcomm .wpdiscuz-subscribe-form-email{ float: right; }
|
|
|
|
|
|
|
|
|
20 |
@media screen and (max-width:600px){
|
21 |
#wpcomm .wc-field-comment .wc-field-textarea{ margin-right: 30px; }
|
22 |
#wpcomm .wc-reply{ margin-right:25px!important }
|
17 |
#wpcomm .wpdiscuz-subscribe-form-option{ float: right; }
|
18 |
#wpcomm .wpdiscuz-subscribe-form-intro{ float: right; }
|
19 |
#wpcomm .wpdiscuz-subscribe-form-email{ float: right; }
|
20 |
+
#wpcomm .wc-reply{ margin-right: 40px; margin-left: 0px!important; }
|
21 |
+
#wpcomm .wc_comment_level-3{ margin-right: 40px!important; margin-left: 0px!important;}
|
22 |
+
#wpcomm .wc_comment_level-4 { margin-right: 40px!important; margin-left: 0px!important; }
|
23 |
+
#wpcomm .wc_comment_level-5 { margin-right: 40px!important; margin-left: 0px!important; }
|
24 |
@media screen and (max-width:600px){
|
25 |
#wpcomm .wc-field-comment .wc-field-textarea{ margin-right: 30px; }
|
26 |
#wpcomm .wc-reply{ margin-right:25px!important }
|
assets/css/wpdiscuz.min.css
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
#wpcomm * { box-sizing:border-box; }#wpcomm span{ display:inline; }#wpcomm{ margin:15px 5px;padding:1px 0 10px 0;border-top:#ddd solid 1px }#wc-comment-header{ padding:20px 5px 1px 5px;display:block;float:none;clear:both;font-size:18px }#wpcomm form .wpdiscuz-item{ display:block; height:auto;}.wpdiscuz-item input{border-radius:0;height:auto;width:auto}#wpcomm form{ margin:0!important;padding:0!important;background:none;border:0;width:auto!important }#wpcomm form div{ margin:0 }#wc_show_hide_loggedin_username{padding:10px 5px 5px 5px;font-size:13px}#wpcomm .wc_new_comment_and_replies{margin:0;padding:0;width:100%;height:auto;background:transparent}#wpcomm .wc_new_comment_and_replies .wc_new_comment{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 3px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc_new_comment_and_replies .wc_new_reply{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 1px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc-comment-bar{width:100%;padding:0;display:block}#wpcomm .wc-comment-title{margin:0;line-height:18px;font-weight:bold;padding:10px;margin-bottom:10px;font-size:13px;text-align:right;border-bottom:#ccc dotted 1px;padding-bottom:10px}#wpcomm .wc-form-wrapper{padding:10px;margin-top:0px;border:1px solid #f1f1f1;clear:both;}#wpcomm .wc-author-data{margin-bottom:0px}#wpcomm .wc-field-name{width:49%;float:left}#wpcomm .wc-field-email{width:49%;float:right;text-align:right}#wpcomm .wc-field-comment{margin:5px auto 1px auto}#wpcomm .wc-field-comment .wc-field-avatararea{width:60px;float:left}#wpcomm .wc-field-comment .wc-field-textarea{margin-left:65px}#wpcomm .wc-field-captcha{width:49%;float:left;text-align:left;margin:0;height:auto!important}#wpcomm .wc-field-submit{width:49%;float:right;text-align:right;margin:0;padding:5px 0 13px 0;}#wpcomm .wc-field-website{width:100%;padding:0 0 10px 0;margin:0;display:block}#wpcomm .wc-field-name input[type="text"]{width:99%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-website input[type="url"],#wpcomm .wc-field-website input[type="text"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-email input[type="email"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-captcha input[type="text"]{max-width:45%;min-width:85px;padding:3px 5px;font-size:14px;margin:0 5px 2px 0;height:27px}#wpcomm .wc-field-submit input[type="button"]{margin:1px;border:#ddd 1px solid;font-size:13px;line-height:16px;padding:6px 15px;clear:both;float:none}#wpcomm .captcha_msg{color:#999;font-family:Lato,sans-serif;font-size:13px;line-height:18px;display:block;clear:both;padding:5px 0 0 0}#wpcomm .wc-field-comment textarea,#wpcomm .wc-comment .wc-comment-right textarea{width:100%;max-width:100%;height:48px;min-height:48px!important;padding:5px;box-sizing:border-box;border-radius:0}#wpcomm .wc-label{display:block;font-size:14px;padding:5px}#wpcomm .wc_manage_subscribtions{cursor:pointer;padding:0 0 5px 0;display:block;font-size:13px;line-height:16px;font-family:Lato,sans-serif}#wpcomm .wc_notification_checkboxes{padding:7px 0 7px 0;text-align:right;display:none;border-top:1px dotted #ddd;line-height:18px;font-size:13px}#wpcomm .wc_notification_checkboxes input[type="checkbox"],#wpcomm .wc_notification_checkboxes input[type="radio"]{overflow:none;width:inherit;font-size:13px;margin:0;padding:0;display:inline;clear:both;float:none;max-height:20px;margin:0 3px}#wpcomm .wc_notification_checkboxes label{clear:both;float:none;font-weight:normal}#wpcomm .wc-label-comment-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-reply-notify,#wpcomm .wc-notification-none{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-all-reply-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-field-captcha .wc-label{font-size:14px;padding:5px;text-align:center;display:inline}#wpcomm input[type="text"],#wpcomm input[type="email"],#wpcomm input[type="url"],#wpcomm textarea{font-size:14px;color:#777;font-family:Lato,sans-serif;box-sizing:border-box;margin:0;clear:both;float:none;display:inline}#wpcomm .wc-copyright{margin:0 0 0 auto;text-align:right;display:block;padding-top:2px}#wpcomm .wc-copyright a{font-size:9px;color:#aaa;cursor:help;text-decoration:none;margin:0;padding:0;border:0}#wpcomm .wc-thread-wrapper{padding:10px 0;margin-bottom:10px}#wpcomm .wc-comment{margin-bottom:13px}#wpcomm .wc-comment .wc-field-submit{padding:5px 0 5px 0}#wpcomm .wc-comment .wc-form-wrapper{padding:10px 10px 7px 10px}#wpcomm .wc-comment .wc-comment-left{width:62px;float:left;text-align:center;font-family:Lato,sans-serif;line-height:16px}#wpcomm .wc-comment .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px; display:block; }#wpcomm .wc-reply .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px}#wpcomm .wc-reply{margin-top:10px;margin-bottom:0;margin-left:40px}#wpcomm .wc-must-login{margin:0;font-size:14px;line-height:16px;padding:10px;text-align:center}#wpcomm hr{background-color:rgba(0,0,0,0.1);border:0 none;height:1px;margin:10px 0}#wpcomm .avatar{border:1px solid rgba(0,0,0,0.1);padding:2px;margin:0 auto;float:none;display:inline;width:48px;height:auto}#wpcomm .wc-form-wrapper .avatar{margin-top:3px}#wpcomm .wc-comment-text{text-align:left;padding-bottom:5px;line-height:20px;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}#wpcomm .wc-comment-text img{max-width:90%;height:auto}#wpcomm .wc-comment-header{margin-bottom:7px;font-family:Lato,sans-serif}#wpcomm .wc-comment-author{font-size:16px;width:40%;float:left;white-space:normal; text-align:left;}#wpcomm .wc-comment-author a{font-size:16px;white-space:normal;text-decoration:none; line-height:25px; }#wpcomm .wc-comment-label{color:#fff;padding:2px 5px;font-size:12px;margin:4px auto;text-align:center;display:table;line-height:16px}#wpcomm .wc-comment-date{font-size:12px;color:#999;float:right;text-align:right;white-space:nowrap;line-height:23px}#wpcomm .wc-comment-footer{font-size:12px;font-weight:normal;color:#999;margin-top:12px;min-height:28px;font-family:Lato,sans-serif; text-align:left;}#wpcomm .wc-comment-footer a,#wpcomm .wc-comment-footer span.wc_editable_comment,#wpcomm .wc-comment-footer span.wc_save_edited_comment,#wpcomm span.wc_cancel_edit{text-decoration:none;font-size:13px;font-weight:bold;cursor:pointer}#wpcomm .wc-comment-footer .share_buttons_box img{vertical-align:middle}#wpcomm .wc-comment-footer .wc-voted{color:#666;cursor:default}#wpcomm .wc-comment-footer .wc-vote-img-up{padding:0;margin:0 0 -2px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-img-down{padding:0;margin:0 0 -6px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-result{padding:2px 6px 2px 5px;color:#fff;font-size:12px;font-weight:bold;display:inline;margin-right:5px}#wpcomm .wc-toggle{float:right;text-align:right;padding-right:0;margin-right:0;color:#999;cursor:pointer;font-size:12px;white-space:nowrap; line-height:24px;}#wpcomm .wpdiscuz-item{background:0;border-radius:0;box-shadow:none}#wc_response_info img{margin:0 auto 0 auto;box-shadow:none}#wpcomm .share_buttons_box img{display:inline!important;width:16px;height:16px}#wpcomm .wc-captcha-label img{display:inline!important;border:0;padding:0 0 0 2px;margin:0;vertical-align:middle}#wpcomm .wc-reply-link,#wpcomm .wc-vote-link,#wpcomm .wc-share-link{cursor:pointer;font-size:13px;font-weight:bold}#wpcomm .wc-form-footer{display:none}#wpcomm .wc-field-captcha .wc-captcha-label{padding:0;display:inline-block}#wpcomm .wc_captcha_refresh_img{cursor:pointer;margin-left:3px}#wpcomm .share_buttons_box{display:none}#wpcomm .wc-comment.wc-no-left-margin{margin-left:0!important}div.wc_modal{background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}.wc-load-more-submit-wrap{width:100%;text-align:center;margin-bottom:20px;margin-top:25px}.wc-load-more-submit{width:auto!important;padding:10px 20px;text-align:center;background-color:#fafafa;border-radius:3px;color:#555;cursor:pointer}.wc-load-more-submit:hover{background-image:-moz-linear-gradient(center top,#f4f4f4,#e6e6e6);background-repeat:repeat-x;box-shadow:0 1px 2px rgba(64,64,64,0.1);color:#7c7c7c}#wc_openModalFormAction>div#wc_response_info{width:200px;background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}#wc_openModalFormAction>div#wc_response_info a.close{background-position-x:right;background-position-y:top}#wpcomm #bywpdiscuz{display:none}#wpcomm .by-wpdiscuz{text-align:right;border-top:#ddd solid 1px;padding:1px 1px 1px 1px}#wpcomm .by-wpdiscuz a{font-size:11px;font-weight:bold;text-align:right;color:#ccc;padding:1px;margin:0;line-height:12px;border:0;text-decoration:none}#wpcomm .wpdimg{border:0;padding:0;margin:0;height:12px;cursor:pointer;display:inline;clear:both}#wc_unsubscribe_message{margin:10px auto 1px auto;padding:10px;text-align:center;border:#0d0 1px dotted;background:#cfc}.wc_unsubscribe_message{font-size:14px;color:#444}#wpcomm .wc_comment_level-3{margin-left:40px!important}#wpcomm .wc_comment_level-4{margin-left:40px!important}#wpcomm .wc_comment_level-5{margin-left:40px!important}#wpcomm .wc_editable_div{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;border:1px solid #ccc;border-radius:0;font:medium -moz-fixed;font:-webkit-small-control;overflow:auto;resize:both;box-sizing:border-box;height:46px;max-width:100%;min-height:46px!important;padding:5px;width:100%}#wpcomm .wc_cancel_edit{display:none}#wpcomm .wc-comment-text p{margin-bottom:10px}#wpcomm .wc-comment-right textarea.wc_edit_comment{height:80px;max-height:200px}#wpcomm .wc_social_plugin_wrapper{width:auto;}#wpcomm .wc_comm_form .wc_secondary_form{clear:both}#wpcomm .wc_comm_form .wc-field-comment{clear:both}#wpcomm .wp-social-login-widget{margin-bottom:15px; }#wpcomm .wc_social_plugin_wrapper .wp-social-login-connect-with{float:left;font-size:13px;padding:2px 7px 0 0;text-transform:uppercase}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list{padding:1px;text-align:left;margin-bottom:-10px}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list{padding:1px;text-align:right}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list img{width:20px;height:20px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .social_connect_ui{padding:0;clear:both;margin:0;margin-top:-20px;margin-bottom:-10px}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc_social_plugin_wrapper .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .social_connect_form{float:left;line-height:35px;text-align:left;vertical-align:middle}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#social_connect_facebook_auth,#social_connect_twitter_auth,#social_connect_google_auth,#social_connect_google_plus_auth,#social_connect_yahoo_auth,#social_connect_wordpress_auth{clear:both;padding:0;margin:0}#wpcomm .wc-secondary-forms-social-content .social_connect_ui{padding:0;clear:both;margin:0;text-align:right}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc-secondary-forms-social-content .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc-secondary-forms-social-content .social_connect_form{float:left;width:100%;text-align:right;padding:0 0 5px 0;line-height:20px;vertical-align:middle}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="password"], #wpcomm input[type="url"]{ line-height: inherit!important;}#wpcomm .wc-comment-text ol li, #wpcomm .wc-comment-text ul li{ margin-left:20px; }#wpcomm .wc-comment-text blockquote { font-size: inherit; line-height: inherit; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; }.wpdiscuz-nofollow,.wpdiscuz-nofollow:hover{text-decoration: none!important;}#wpcomm .wc-field-comment textarea, #wpcomm .wc-comment .wc-comment-right textarea{ display: inline; }#wpcomm .input-text, #wpcomm input[type="text"], #wpcomm input[type="input"], #wpcomm input[type="password"], #wpcomm input[type="email"], #wpcomm input[type="number"], #wpcomm input[type="url"], #wpcomm input[type="tel"], #wpcomm input[type="search"], #wpcomm textarea, #wpcomm select{ margin:0px;}.wc_msg_required_fields,.wc_invalid_field,.wc_invalid_captcha, .wc_error_url_text,.wc_error_email_text,.wpdiscuz-sendmail-error, .wc_msg_comment_text_min_length,.wc_msg_comment_text_max_length, .wc_login_to_vote, .wc_deny_voting_from_same_ip, .wc_self_vote, .wc_vote_only_one_time, .wc_voting_error,.wc_comment_edit_not_possible,.wc_comment_not_updated,.wc_comment_not_edited{ background-color: #FCE8E8 !important; font-size:14px; text-align:center; color:#CE4A66; border:#F2D3D2 1px solid; padding:5px 10px; width:100%; box-sizing:border-box; margin:5px 0px; border-radius:3px; }.wc_held_for_moderate{ background-color: #FCE6BF; font-size:14px; text-align:center; color:#D3760C; border:#F9C975 1px solid; padding:5px 10px; width:100%; box-sizing:border-box; margin:5px 0px; border-radius:3px; }.wc-label a:focus{ outline:none; }.wpdiscuz-loading-bar{ position: fixed; text-align:center; right: 0; width: 50px; border:none; background:transparent; z-index:999999; display: none;}.wpdiscuz-loading-bar-auth{ top:32px; }.wpdiscuz-loading-bar-unauth{ top:0px; }.wpdiscuz-vote-sorting-desc,.wpdiscuz-vote-sorting-asc{ text-align:center; border:none; z-index:999999; cursor: pointer; display: inline-block;}.wpdiscuz-front-actions{ width:100%; box-sizing:border-box; padding:5px 10px; margin-bottom:10px;border-right: 1px solid #f1f1f1;border-left: 1px solid #f1f1f1; text-align: right;}.wpdiscuz-subscribe-bar{ width:100%; box-sizing:border-box; padding:10px; margin-bottom:10px;border-right: 1px solid #f1f1f1;border-left: 1px solid #f1f1f1;}.wpdiscuz_select { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAANCAYAAAC+ct6XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjBBRUQ1QTQ1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjBBRUQ1QTU1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMEFFRDVBMjVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMEFFRDVBMzVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pk5mU4QAAACUSURBVHjaYmRgYJD6////MwY6AyaGAQIspCieM2cOjKkIxCFA3A0TSElJoZ3FUCANxAeAWA6IOYG4iR5BjWwpCDQCcSnNgxoIVJCDFwnwA/FHWlp8EIpHSKoGgiggLkITewrEcbQO6mVAbAbE+VD+a3IsJTc7FQAxDxD7AbEzEF+jR1DDywtoCr9DbhwzDlRZDRBgACYqHJO9bkklAAAAAElFTkSuQmCC") no-repeat scroll right center!important; border-radius: 0; border: 1px solid lightgray!important; box-shadow:none!important; height:28px!important; padding: 3px 22px 3px 3px!important; font-size:13px!important; -moz-appearance:none!important; -webkit-appearance:none!important; outline: 0 none!important; text-indent: 0.01px; text-overflow: ""!important; width:100%!important; box-sizing:border-box !important; line-height:20px!important; clear:both; float:none!important; margin:0px!important; }.wc-secondary-form-wrapper{ margin-top:10px!important; }#wpcomm .wpdiscuz-subscribe-form-intro{ font-size:14px; float:left; display:block; padding:3px 10px 3px 1px; line-height:20px; box-sizing:border-box; white-space:nowrap; }#wpcomm .wpdiscuz-subscribe-form-option{ font-size:13px; float:left; display:block; padding-right:5px; box-sizing:border-box; }#wpcomm .wpdiscuz-subscribe-form-email{ font-size:14px; float:left; display:block; padding:0 5px 0 0; box-sizing:border-box; width:30%; }#wpcomm .wpdiscuz-subscribe-form-button{ font-size:14px; float:left; display:block;box-sizing:border-box; }#wpcomm .wpdiscuz-subscribe-form-email select{ width:100%!important; }#wpcomm .wpdiscuz-subscribe-form-email input[type="email"]{ font-size:13px!important; padding:3px!important; width:100%!important; height:auto!important; line-height:20px!important; box-sizing:border-box !important; clear: both; float: none; margin:0px; }#wpcomm .wpdiscuz-subscribe-form-button input[type="submit"]{ font-size:16px!important; min-height:29px!important; height:29px!important; padding:1px 3px 5px 3px!important; width:40px; line-height:14px!important; box-sizing:border-box !important; border: 1px solid #ddd; clear: both; float: none; margin:0px; }#wpcomm .wc-comment-link{ font-size:12px; float:right; text-align:right; line-height:20px; height:15px; padding:0px 0px 0px 10px; }#wpcomm .wc-comment-link .wc-comment-img-link{ cursor:pointer; height:10px; }#wpcomm .wpdiscuz_subscribe_status{ font-size:12px; padding-top:6px; }#wpcomm .wpdiscuz_subscribe_status a{ font-size:12px; }.tooltipster-content input[type="text"].wc-comment-link-input{ padding:2px; width:100%; font-size:13px; } #wpcomm .page-numbers{ padding:2px 7px; font-size:14px; margin:20px 1px; line-height: 33px; background:#FFFFFF; } #wpcomm span.current{ color:#FFFFFF; } @media screen and (max-width:1000px){#wpcomm .wc-field-captcha input[type="text"]{max-width:45%;min-width:90px}} @media screen and (max-width:850px){#wpcomm .wc-field-captcha input[type="text"]{max-width:35%;min-width:90px}} @media screen and (max-width:790px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}} @media screen and (max-width:690px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}} @media screen and (max-width:600px){#wpcomm .wpdiscuz-subscribe-form-option{ width:100%!important; padding:0px!important; } #wpcomm .wpdiscuz-subscribe-form-email{ width:100%!important; padding:0px!important; margin-top:5px; } #wpcomm .wpdiscuz-subscribe-form-button{ width:100%!important; padding:0px!important; } #wpcomm .wpdiscuz-subscribe-form-button input[type="submit"]{ width:100%!important; margin-top:5px;} #wpcomm .wc-field-comment .wc-field-avatararea{ width:25px; } #wpcomm .wc-field-comment .wc-field-avatararea .avatar{ width:25px; } #wpcomm .wc-field-comment .wc-field-textarea{ margin-left: 30px; } #wpcomm .wc-field-name{ width:100%; } #wpcomm .wc-field-email{ width:100%; } #wpcomm .wc-field-submit input[type="button"]{ width:100%; } #wpcomm .wc-field-captcha input[type="text"]{ max-width: 100%; width: 100%; } #wpcomm .wc-field-name input[type="text"]{ max-width: 100%; width: 100%; } #wpcomm .wc-captcha-label img{ padding:0px; margin-top:8px; } #wpcomm .wc-field-website{ padding-bottom: 8px; } #wpcomm .wc-reply{ margin-left:25px!important } #wpcomm .wc_comment_level-3{ margin-left:0px!important; } #wpcomm .wc_comment_level-4{ margin-left:0px!important; } #wpcomm .wc_comment_level-5{ margin-left:0px!important; } #wpcomm .wc-comment-text{ font-size:13px!important; } #wpcomm .wc-comment .wc-comment-left{ width: 40px!important; } #wpcomm .wc-comment .wc-comment-left .avatar{ width: 40px!important; } #wpcomm .wc-comment .wc-comment-right{ margin-left: 55px!important; } #wpcomm .wc-reply .wc-comment-right{ margin-left: 55px!important; } #wpcomm .wc-toggle{ font-size:11px; line-height:12px; padding-top:40px; padding-bottom:5px; } #wpcomm .share_buttons_box{ margin-top:9px;}} @media screen and (max-width:420px){ #wpcomm .wc-toggle{ font-size:11px; line-height:12px; padding-top:35px; padding-bottom:5px; } #wpcomm .wpdiscuz-sort-buttons, #wpcomm .wpdiscuz-sort-button{ font-size:11px!important; } #wpcomm .wc-captcha-label .wc_captcha_img{ width:70%;} #wpcomm .wc-share-link{ line-height:30px;} #wpcomm .wc-field-comment .wc-field-textarea{ margin-left: 0px; } #wpcomm .wc-field-comment .wc-field-avatararea .avatar{ width:0px; display: none;} #wpcomm .wc-comment .wc-comment-left{ float:none!important; margin-bottom:8px; width:100%!important; } #wpcomm .wc-comment .wc-comment-right, #wpcomm .wc-reply .wc-comment-right{ margin-left:0px!important; } #wpcomm .wc-comment .wc-comment-left .avatar{ width:25px!important; height:25px!important; margin:0px 5px 0px 0px!important; float:left!important; display:block!important; } #wpcomm .wc-comment .wc-comment-left .wc-comment-label{ font-size:13px; padding:6px 5px 5px 5px; line-height:14px; display:block-inline!important; margin-left:33px; } #wpcomm .wc-field-submit input[type="button"]{ width:99%; font-size:10px; padding:5px 2px; } .wpdiscuz_auth .wc-field-submit{width: 100%!important;} .wpdiscuz_auth .wc_notification_checkboxes{ text-align: left!important; }}
|
2 |
|
3 |
|
1 |
+
#wpcomm * { box-sizing:border-box; }#wpcomm span{ display:inline; }#wpcomm{ margin:15px 5px;padding:1px 0 10px 0;border-top:#ddd solid 1px }#wc-comment-header{ padding:20px 5px 1px 5px;display:block;float:none;clear:both;font-size:18px }#wpcomm form .wpdiscuz-item{ display:block; height:auto;}.wpdiscuz-item input{border-radius:0;height:auto;width:auto}#wpcomm form{ margin:0!important;padding:0!important;background:none;border:0;width:auto!important }#wpcomm form div{ margin:0 }#wc_show_hide_loggedin_username{padding:10px 5px 5px 5px;font-size:13px}#wpcomm .wc_new_comment_and_replies{margin:0;padding:0;width:100%;height:auto;background:transparent}#wpcomm .wc_new_comment_and_replies .wc_new_comment{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 3px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc_new_comment_and_replies .wc_new_reply{float:right;display:none;padding:3px 10px;font-size:12px;margin:1px 0 1px 1px;cursor:pointer;color:#fff;line-height:15px}#wpcomm .wc-comment-bar{width:100%;padding:0;display:block}#wpcomm .wc-comment-title{margin:0;line-height:18px;font-weight:bold;padding:10px;margin-bottom:10px;font-size:13px;text-align:right;border-bottom:#ccc dotted 1px;padding-bottom:10px}#wpcomm .wc-form-wrapper{padding:10px;margin-top:0px;border:1px solid #f1f1f1;clear:both;}#wpcomm .wc-author-data{margin-bottom:0px}#wpcomm .wc-field-name{width:49%;float:left}#wpcomm .wc-field-email{width:49%;float:right;text-align:right}#wpcomm .wc-field-comment{margin:5px auto 1px auto}#wpcomm .wc-field-comment .wc-field-avatararea{width:60px;float:left}#wpcomm .wc-field-comment .wc-field-textarea{margin-left:65px}#wpcomm .wc-field-captcha{width:49%;float:left;text-align:left;margin:0;height:auto!important}#wpcomm .wc-field-submit{width:49%;float:right;text-align:right;margin:0;padding:5px 0 13px 0;}#wpcomm .wc-field-website{width:100%;padding:0 0 10px 0;margin:0;display:block}#wpcomm .wc-field-name input[type="text"]{width:99%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-website input[type="url"],#wpcomm .wc-field-website input[type="text"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-email input[type="email"]{width:100%;max-width:100%;padding:3px 5px;font-size:14px;margin:0;height:29px}#wpcomm .wc-field-captcha input[type="text"]{max-width:45%;min-width:85px;padding:3px 5px;font-size:14px;margin:0 5px 2px 0;height:27px}#wpcomm .wc-field-submit input[type="button"]{margin:1px;border:#ddd 1px solid;font-size:13px;line-height:16px;padding:6px 15px;clear:both;float:none}#wpcomm .captcha_msg{color:#999;font-family:Lato,sans-serif;font-size:13px;line-height:18px;display:block;clear:both;padding:5px 0 0 0}#wpcomm .wc-field-comment textarea,#wpcomm .wc-comment .wc-comment-right textarea{width:100%;max-width:100%;height:48px;min-height:48px!important;padding:5px;box-sizing:border-box;border-radius:0}#wpcomm .wc-label{display:block;font-size:14px;padding:5px}#wpcomm .wc_manage_subscribtions{cursor:pointer;padding:0 0 5px 0;display:block;font-size:13px;line-height:16px;font-family:Lato,sans-serif}#wpcomm .wc_notification_checkboxes{padding:7px 0 7px 0;text-align:right;display:none;border-top:1px dotted #ddd;line-height:18px;font-size:13px}#wpcomm .wc_notification_checkboxes input[type="checkbox"],#wpcomm .wc_notification_checkboxes input[type="radio"]{overflow:none;width:inherit;font-size:13px;margin:0;padding:0;display:inline;clear:both;float:none;max-height:20px;margin:0 3px}#wpcomm .wc_notification_checkboxes label{clear:both;float:none;font-weight:normal}#wpcomm .wc-label-comment-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-reply-notify,#wpcomm .wc-notification-none{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-label-all-reply-notify{display:inline;font-size:13px;padding:0;margin:0;border:0;line-height:15px;text-decoration:none;color:#999;font-family:Lato,sans-serif;cursor:pointer}#wpcomm .wc-field-captcha .wc-label{font-size:14px;padding:5px;text-align:center;display:inline}#wpcomm input[type="text"],#wpcomm input[type="email"],#wpcomm input[type="url"],#wpcomm textarea{font-size:14px;color:#777;font-family:Lato,sans-serif;box-sizing:border-box;margin:0;clear:both;float:none;display:inline}#wpcomm .wc-copyright{margin:0 0 0 auto;text-align:right;display:block;padding-top:2px}#wpcomm .wc-copyright a{font-size:9px;color:#aaa;cursor:help;text-decoration:none;margin:0;padding:0;border:0}#wpcomm .wc-thread-wrapper{padding:10px 0;margin-bottom:10px}#wpcomm .wc-comment{margin-bottom:13px}#wpcomm .wc-comment .wc-field-submit{padding:5px 0 5px 0}#wpcomm .wc-comment .wc-form-wrapper{padding:10px 10px 7px 10px}#wpcomm .wc-comment .wc-comment-left{width:62px;float:left;text-align:center;font-family:Lato,sans-serif;line-height:16px}#wpcomm .wc-comment .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px; display:block; }#wpcomm .wc-reply .wc-comment-right{margin-left:70px;border:#f5f5f5 1px solid;padding:10px 10px 3px 10px}#wpcomm .wc-reply{margin-top:10px;margin-bottom:0;margin-left:40px}#wpcomm .wc-must-login{margin:0;font-size:14px;line-height:16px;padding:10px;text-align:center}#wpcomm hr{background-color:rgba(0,0,0,0.1);border:0 none;height:1px;margin:10px 0}#wpcomm .avatar{border:1px solid rgba(0,0,0,0.1);padding:2px;margin:0 auto;float:none;display:inline;width:48px;height:auto}#wpcomm .wc-form-wrapper .avatar{margin-top:3px}#wpcomm .wc-comment-text{text-align:left;padding-bottom:5px;line-height:20px;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}#wpcomm .wc-comment-text img{max-width:90%;height:auto}#wpcomm .wc-comment-header{margin-bottom:7px;font-family:Lato,sans-serif}#wpcomm .wc-comment-author{font-size:16px;width:40%;float:left;white-space:normal; text-align:left;}#wpcomm .wc-comment-author a{font-size:16px;white-space:normal;text-decoration:none; line-height:25px; }#wpcomm .wc-comment-label{color:#fff;padding:2px 5px;font-size:12px;margin:4px auto;text-align:center;display:table;line-height:16px}#wpcomm .wc-comment-date{font-size:12px;color:#999;float:right;text-align:right;white-space:nowrap;line-height:23px}#wpcomm .wc-comment-footer{font-size:12px;font-weight:normal;color:#999;margin-top:12px;min-height:28px;font-family:Lato,sans-serif; text-align:left;}#wpcomm .wc-comment-footer a,#wpcomm .wc-comment-footer span.wc_editable_comment,#wpcomm .wc-comment-footer span.wc_save_edited_comment,#wpcomm span.wc_cancel_edit{text-decoration:none;font-size:13px;font-weight:bold;cursor:pointer}#wpcomm .wc-comment-footer .share_buttons_box img{vertical-align:middle}#wpcomm .wc-comment-footer .wc-voted{color:#666;cursor:default}#wpcomm .wc-comment-footer .wc-vote-img-up{padding:0;margin:0 0 -2px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-img-down{padding:0;margin:0 0 -6px 0;vertical-align:baseline;display:inline;float:none;clear:both;border:0;background:transparent;width:16px;height:16px;border-radius:0;box-shadow:none;box-sizing:border-box}#wpcomm .wc-comment-footer .wc-vote-result{padding:2px 6px 2px 5px;color:#fff;font-size:12px;font-weight:bold;display:inline;margin-right:5px}#wpcomm .wc-toggle{float:right;text-align:right;padding-right:0;margin-right:0;color:#999;cursor:pointer;font-size:12px;white-space:nowrap; line-height:24px;}#wpcomm .wpdiscuz-item{background:0;border-radius:0;box-shadow:none}#wc_response_info img{margin:0 auto 0 auto;box-shadow:none}#wpcomm .share_buttons_box img{display:inline!important;width:16px;height:16px}#wpcomm .wc-captcha-label img{display:inline!important;border:0;padding:0 0 0 2px;margin:0;vertical-align:middle}#wpcomm .wc-reply-link,#wpcomm .wc-vote-link,#wpcomm .wc-share-link{cursor:pointer;font-size:13px;font-weight:bold}#wpcomm .wc-form-footer{display:none}#wpcomm .wc-field-captcha .wc-captcha-label{padding:0;display:inline-block}#wpcomm .wc_captcha_refresh_img{cursor:pointer;margin-left:3px}#wpcomm .share_buttons_box{display:none}#wpcomm .wc-comment.wc-no-left-margin{margin-left:0!important}div.wc_modal{background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}.wc-load-more-submit-wrap{width:100%;text-align:center;margin-bottom:20px;margin-top:25px}.wc-load-more-submit{width:auto!important;padding:10px 20px;text-align:center;background-color:#fafafa;border-radius:3px;color:#555;cursor:pointer}.wc-load-more-submit:hover{background-image:-moz-linear-gradient(center top,#f4f4f4,#e6e6e6);background-repeat:repeat-x;box-shadow:0 1px 2px rgba(64,64,64,0.1);color:#7c7c7c}#wc_openModalFormAction>div#wc_response_info{width:200px;background:none repeat scroll 0 0 #ededed;color:#444;font-size:18px;font-weight:normal;padding:45px 10px 50px 10px!important;text-align:center;line-height:25px}#wc_openModalFormAction>div#wc_response_info a.close{background-position-x:right;background-position-y:top}#wpcomm #bywpdiscuz{display:none}#wpcomm .by-wpdiscuz{text-align:right;border-top:#ddd solid 1px;padding:1px 1px 1px 1px}#wpcomm .by-wpdiscuz a{font-size:11px;font-weight:bold;text-align:right;color:#ccc;padding:1px;margin:0;line-height:12px;border:0;text-decoration:none}#wpcomm .wpdimg{border:0;padding:0;margin:0;height:12px;cursor:pointer;display:inline;clear:both}#wc_unsubscribe_message{margin:10px auto 1px auto;padding:10px;text-align:center;border:#0d0 1px dotted;background:#cfc}.wc_unsubscribe_message{font-size:14px;color:#444}#wpcomm .wc_comment_level-3{margin-left:40px!important}#wpcomm .wc_comment_level-4{margin-left:40px!important}#wpcomm .wc_comment_level-5{margin-left:40px!important}#wpcomm .wc_editable_div{-moz-appearance:textfield-multiline;-webkit-appearance:textarea;border:1px solid #ccc;border-radius:0;font:medium -moz-fixed;font:-webkit-small-control;overflow:auto;resize:both;box-sizing:border-box;height:46px;max-width:100%;min-height:46px!important;padding:5px;width:100%}#wpcomm .wc_cancel_edit{display:none}#wpcomm .wc-comment-text p{margin-bottom:10px}#wpcomm .wc-comment-right textarea.wc_edit_comment{height:80px;max-height:200px}#wpcomm .wc_social_plugin_wrapper{width:auto;}#wpcomm .wc_comm_form .wc_secondary_form{clear:both}#wpcomm .wc_comm_form .wc-field-comment{clear:both}#wpcomm .wp-social-login-widget{margin-bottom:15px; }#wpcomm .wc_social_plugin_wrapper .wp-social-login-connect-with{float:left;font-size:13px;padding:2px 7px 0 0;text-transform:uppercase}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list{padding:1px;text-align:left;margin-bottom:-10px}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list{padding:1px;text-align:right}#wpcomm .wc-secondary-forms-social-content .wp-social-login-provider-list img{width:20px;height:20px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .wp-social-login-provider-list img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .social_connect_ui{padding:0;clear:both;margin:0;margin-top:-20px;margin-bottom:-10px}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc_social_plugin_wrapper .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc_social_plugin_wrapper .social_connect_form{float:left;line-height:35px;text-align:left;vertical-align:middle}#wpcomm .wc_social_plugin_wrapper .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#social_connect_facebook_auth,#social_connect_twitter_auth,#social_connect_google_auth,#social_connect_google_plus_auth,#social_connect_yahoo_auth,#social_connect_wordpress_auth{clear:both;padding:0;margin:0}#wpcomm .wc-secondary-forms-social-content .social_connect_ui{padding:0;clear:both;margin:0;text-align:right}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect{display:inherit;padding:0;margin:0;float:left;line-height:35px;padding-right:10px}#wpcomm .wc-secondary-forms-social-content .social_connect_form img{width:24px;height:24px;float:none;display:inline;border:0}#wpcomm .wc-secondary-forms-social-content .social_connect_form{float:left;width:100%;text-align:right;padding:0 0 5px 0;line-height:20px;vertical-align:middle}#wpcomm .wc-secondary-forms-social-content .comment-form-social-connect label{display:inherit;padding:0;margin:0;font-style:normal;font-weight:normal;border:0;font-size:13px;text-transform:uppercase}#wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="password"], #wpcomm input[type="url"]{ line-height: inherit!important;}#wpcomm .wc-comment-text ol li, #wpcomm .wc-comment-text ul li{ margin-left:20px; }#wpcomm .wc-comment-text blockquote { font-size: inherit; line-height: inherit; margin-bottom: 1em; margin-left: 1em; padding-left: 1em; }.wpdiscuz-nofollow,.wpdiscuz-nofollow:hover{text-decoration: none!important;}#wpcomm .wc-field-comment textarea, #wpcomm .wc-comment .wc-comment-right textarea{ display: inline; }#wpcomm .input-text, #wpcomm input[type="text"], #wpcomm input[type="input"], #wpcomm input[type="password"], #wpcomm input[type="email"], #wpcomm input[type="number"], #wpcomm input[type="url"], #wpcomm input[type="tel"], #wpcomm input[type="search"], #wpcomm textarea, #wpcomm select{ margin:0px;}.wc_msg_required_fields,.wc_invalid_field,.wc_invalid_captcha, .wc_error_url_text,.wc_error_email_text,.wpdiscuz-sendmail-error, .wc_msg_comment_text_min_length,.wc_msg_comment_text_max_length, .wc_login_to_vote, .wc_deny_voting_from_same_ip, .wc_self_vote, .wc_vote_only_one_time, .wc_voting_error,.wc_comment_edit_not_possible,.wc_comment_not_updated,.wc_comment_not_edited{ background-color: #FCE8E8 !important; font-size:14px; text-align:center; color:#CE4A66; border:#F2D3D2 1px solid; padding:5px 10px; width:100%; box-sizing:border-box; margin:5px 0px; border-radius:3px; }.wc_held_for_moderate{ background-color: #FCE6BF; font-size:14px; text-align:center; color:#D3760C; border:#F9C975 1px solid; padding:5px 10px; width:100%; box-sizing:border-box; margin:5px 0px; border-radius:3px; }.wc-label a:focus{ outline:none; }.wpdiscuz-loading-bar{ position: fixed; text-align:center; right: 0; width: 50px; border:none; background:transparent; z-index:999999; display: none;}.wpdiscuz-loading-bar-auth{ top:32px; }.wpdiscuz-loading-bar-unauth{ top:0px; }.wpdiscuz-vote-sorting-desc,.wpdiscuz-vote-sorting-asc{ text-align:center; border:none; z-index:999999; cursor: pointer; display: inline-block;}.wpdiscuz-front-actions{ width:100%; box-sizing:border-box; padding:5px 10px; margin-bottom:10px;border-right: 1px solid #f1f1f1;border-left: 1px solid #f1f1f1; text-align: right;}.wpdiscuz-subscribe-bar{ width:100%; box-sizing:border-box; padding:10px; margin-bottom:10px;border-right: 1px solid #f1f1f1;border-left: 1px solid #f1f1f1;}.wpdiscuz_select { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAANCAYAAAC+ct6XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjBBRUQ1QTQ1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjBBRUQ1QTU1QzkxMTFFMDlDNDdEQzgyNUE1RjI4MTEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGMEFFRDVBMjVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGMEFFRDVBMzVDOTExMUUwOUM0N0RDODI1QTVGMjgxMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pk5mU4QAAACUSURBVHjaYmRgYJD6////MwY6AyaGAQIspCieM2cOjKkIxCFA3A0TSElJoZ3FUCANxAeAWA6IOYG4iR5BjWwpCDQCcSnNgxoIVJCDFwnwA/FHWlp8EIpHSKoGgiggLkITewrEcbQO6mVAbAbE+VD+a3IsJTc7FQAxDxD7AbEzEF+jR1DDywtoCr9DbhwzDlRZDRBgACYqHJO9bkklAAAAAElFTkSuQmCC") no-repeat scroll right center!important; border-radius: 0; border: 1px solid lightgray!important; box-shadow:none!important; height:28px!important; padding: 3px 22px 3px 3px!important; font-size:13px!important; -moz-appearance:none!important; -webkit-appearance:none!important; outline: 0 none!important; text-indent: 0.01px; text-overflow: ""!important; width:100%!important; box-sizing:border-box !important; line-height:20px!important; clear:both; float:none!important; margin:0px!important; }.wc-secondary-form-wrapper{ margin-top:10px!important; }#wpcomm .wpdiscuz-subscribe-form-intro{ font-size:14px; float:left; display:block; padding:3px 10px 3px 1px; line-height:20px; box-sizing:border-box; white-space:nowrap; }#wpcomm .wpdiscuz-subscribe-form-option{ font-size:13px; float:left; display:block; padding-right:5px; box-sizing:border-box; }#wpcomm .wpdiscuz-subscribe-form-email{ font-size:14px; float:left; display:block; padding:0 5px 0 0; box-sizing:border-box; width:30%; }#wpcomm .wpdiscuz-subscribe-form-button{ font-size:14px; float:left; display:block;box-sizing:border-box; }#wpcomm .wpdiscuz-subscribe-form-email select{ width:100%!important; }#wpcomm .wpdiscuz-subscribe-form-email input[type="email"]{ font-size:13px!important; padding:3px!important; width:100%!important; height:auto!important; line-height:20px!important; box-sizing:border-box !important; clear: both; float: none; margin:0px; }#wpcomm .wpdiscuz-subscribe-form-button input[type="submit"]{ font-size:16px!important; min-height:29px!important; height:29px!important; padding:1px 3px 5px 3px!important; width:40px; line-height:14px!important; box-sizing:border-box !important; border: 1px solid #ddd; clear: both; float: none; margin:0px; }#wpcomm .wc-comment-link{ font-size:12px; float:right; text-align:right; line-height:20px; height:15px; padding:0px 0px 0px 10px; }#wpcomm .wc-comment-link .wc-comment-img-link{ cursor:pointer; height:10px; }#wpcomm .wpdiscuz_subscribe_status{ font-size:12px; padding-top:6px; }#wpcomm .wpdiscuz_subscribe_status a{ font-size:12px; }.tooltipster-content input[type="text"].wc-comment-link-input{ padding:2px; width:100%; font-size:13px; color:#777777; } #wpcomm .page-numbers{ padding:2px 7px; font-size:14px; margin:20px 1px; line-height: 33px; background:#FFFFFF; } #wpcomm span.current{ color:#FFFFFF; } @media screen and (max-width:1000px){#wpcomm .wc-field-captcha input[type="text"]{max-width:45%;min-width:90px}} @media screen and (max-width:850px){#wpcomm .wc-field-captcha input[type="text"]{max-width:35%;min-width:90px}} @media screen and (max-width:790px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}} @media screen and (max-width:690px){#wpcomm .wc-field-captcha input[type="text"]{max-width:30%;min-width:80px}} @media screen and (max-width:600px){#wpcomm .wpdiscuz-subscribe-form-option{ width:100%!important; padding:0px!important; } #wpcomm .wpdiscuz-subscribe-form-email{ width:100%!important; padding:0px!important; margin-top:5px; } #wpcomm .wpdiscuz-subscribe-form-button{ width:100%!important; padding:0px!important; } #wpcomm .wpdiscuz-subscribe-form-button input[type="submit"]{ width:100%!important; margin-top:5px;} #wpcomm .wc-field-comment .wc-field-avatararea{ width:25px; } #wpcomm .wc-field-comment .wc-field-avatararea .avatar{ width:25px; } #wpcomm .wc-field-comment .wc-field-textarea{ margin-left: 30px; } #wpcomm .wc-field-name{ width:100%; } #wpcomm .wc-field-email{ width:100%; } #wpcomm .wc-field-submit input[type="button"]{ width:100%; } #wpcomm .wc-field-captcha input[type="text"]{ max-width: 100%; width: 100%; } #wpcomm .wc-field-name input[type="text"]{ max-width: 100%; width: 100%; } #wpcomm .wc-captcha-label img{ padding:0px; margin-top:8px; } #wpcomm .wc-field-website{ padding-bottom: 8px; } #wpcomm .wc-reply{ margin-left:25px!important } #wpcomm .wc_comment_level-3{ margin-left:0px!important; } #wpcomm .wc_comment_level-4{ margin-left:0px!important; } #wpcomm .wc_comment_level-5{ margin-left:0px!important; } #wpcomm .wc-comment-text{ font-size:13px!important; } #wpcomm .wc-comment .wc-comment-left{ width: 40px!important; } #wpcomm .wc-comment .wc-comment-left .avatar{ width: 40px!important; } #wpcomm .wc-comment .wc-comment-right{ margin-left: 55px!important; } #wpcomm .wc-reply .wc-comment-right{ margin-left: 55px!important; } #wpcomm .wc-toggle{ font-size:11px; line-height:12px; padding-top:40px; padding-bottom:5px; } #wpcomm .share_buttons_box{ margin-top:9px;}} @media screen and (max-width:420px){ #wpcomm .wc-toggle{ font-size:11px; line-height:12px; padding-top:35px; padding-bottom:5px; } #wpcomm .wpdiscuz-sort-buttons, #wpcomm .wpdiscuz-sort-button{ font-size:11px!important; } #wpcomm .wc-captcha-label .wc_captcha_img{ width:70%;} #wpcomm .wc-share-link{ line-height:30px;} #wpcomm .wc-field-comment .wc-field-textarea{ margin-left: 0px; } #wpcomm .wc-field-comment .wc-field-avatararea .avatar{ width:0px; display: none;} #wpcomm .wc-comment .wc-comment-left{ float:none!important; margin-bottom:8px; width:100%!important; } #wpcomm .wc-comment .wc-comment-right, #wpcomm .wc-reply .wc-comment-right{ margin-left:0px!important; } #wpcomm .wc-comment .wc-comment-left .avatar{ width:25px!important; height:25px!important; margin:0px 5px 0px 0px!important; float:left!important; display:block!important; } #wpcomm .wc-comment .wc-comment-left .wc-comment-label{ font-size:13px; padding:6px 5px 5px 5px; line-height:14px; display:block-inline!important; margin-left:33px; } #wpcomm .wc-field-submit input[type="button"]{ width:99%; font-size:10px; padding:5px 2px; } .wpdiscuz_auth .wc-field-submit{width: 100%!important;} .wpdiscuz_auth .wc_notification_checkboxes{ text-align: left!important; }}
|
2 |
|
3 |
|
assets/js/wpdiscuz-captcha.js
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
var mainWrapperUniqueId = getUniqueID($('.wc_main_comm_form'), 1);
|
3 |
-
|
4 |
-
$(document).delegate('.wc_captcha_refresh_img', 'click', function () {
|
5 |
-
changeCaptchaImage($(this));
|
6 |
-
});
|
7 |
-
|
8 |
-
$(document).delegate('.wc_field_captcha', 'focus', function () {
|
9 |
-
changeCaptchaImage($(this));//messig avelcnel cuyc tal
|
10 |
-
});
|
11 |
-
|
12 |
-
wpdiscuzTimeoutForCaptcha(mainWrapperUniqueId, 30 * 60 * 1000);
|
13 |
-
|
14 |
-
/*=======================FUNCTIONS===================================*/
|
15 |
-
function wpdiscuzTimeoutForCaptcha(uniqueId, time) {
|
16 |
-
wpdiscuzRemoveExpiredClass(uniqueId);
|
17 |
-
setTimeout(function () {
|
18 |
-
captchaExpiredTime(uniqueId);
|
19 |
-
wpdiscuzAddExpiredClass(uniqueId);
|
20 |
-
}, time);
|
21 |
-
}
|
22 |
-
|
23 |
-
function wpdiscuzAddExpiredClass(uniqueId) {
|
24 |
-
if ($('#wc-secondary-form-wrapper-' + uniqueId).hasClass('wc-secondary-forms')) {
|
25 |
-
$('#wc-secondary-form-wrapper-' + uniqueId + ' .wc_field_captcha').addClass('wpdiscuz-expired');
|
26 |
-
} else {
|
27 |
-
$('#wc-main-form-wrapper-' + uniqueId + ' .wc_field_captcha').addClass('wpdiscuz-expired');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function wpdiscuzRemoveExpiredClass(uniqueId) {
|
32 |
-
if ($('#wc-secondary-form-wrapper-' + uniqueId).hasClass('wc-secondary-forms')) {
|
33 |
-
$('#wc-secondary-form-wrapper-' + uniqueId + ' .wc_field_captcha').removeClass('wpdiscuz-expired');
|
34 |
-
} else {
|
35 |
-
$('#wc-main-form-wrapper-' + uniqueId + ' .wc_field_captcha').removeClass('wpdiscuz-expired');
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
function captchaExpiredTime(uniqueId) {
|
40 |
-
$.ajax({
|
41 |
-
type: 'POST',
|
42 |
-
url: wpdiscuz_ajax_obj.url,
|
43 |
-
data: {
|
44 |
-
wpdiscuz_uniqueId: uniqueId,
|
45 |
-
action: 'setCaptchaExpired'
|
46 |
-
}
|
47 |
-
});
|
48 |
-
}
|
49 |
-
|
50 |
-
function changeCaptchaImage(reloadImage) {
|
51 |
-
var captchaImg = $(reloadImage).prev().children('.wc_captcha_img');
|
52 |
-
var src = captchaImg.attr('src');
|
53 |
-
var new_src = src.substring(0, src.lastIndexOf('=')) + '=' + Math.random();
|
54 |
-
captchaImg.attr('src', new_src);
|
55 |
-
var isMain = reloadImage.parents('.wc-form-wrapper').hasClass('wc-secondary-forms') ? 0 : 1;
|
56 |
-
var uniqueId = getUniqueID(reloadImage, isMain);
|
57 |
-
var time = isMain ? 30 * 60 * 1000 : 15 * 60 * 1000;
|
58 |
-
wpdiscuzTimeoutForCaptcha(uniqueId, time);
|
59 |
-
}
|
60 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/wpdiscuz-captcha.min.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
jQuery(document).ready(function(f){var d=getUniqueID(f(".wc_main_comm_form"),1);f(document).delegate(".wc_captcha_refresh_img","click",function(){b(f(this))});f(document).delegate(".wc_field_captcha","focus",function(){b(f(this))});a(d,30*60*1000);function a(i,h){g(i);setTimeout(function(){e(i);c(i)},h)}function c(h){if(f("#wc-secondary-form-wrapper-"+h).hasClass("wc-secondary-forms")){f("#wc-secondary-form-wrapper-"+h+" .wc_field_captcha").addClass("wpdiscuz-expired")}else{f("#wc-main-form-wrapper-"+h+" .wc_field_captcha").addClass("wpdiscuz-expired")}}function g(h){if(f("#wc-secondary-form-wrapper-"+h).hasClass("wc-secondary-forms")){f("#wc-secondary-form-wrapper-"+h+" .wc_field_captcha").removeClass("wpdiscuz-expired")}else{f("#wc-main-form-wrapper-"+h+" .wc_field_captcha").removeClass("wpdiscuz-expired")}}function e(h){f.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuz_uniqueId:h,action:"setCaptchaExpired"}})}function b(m){var j=f(m).prev().children(".wc_captcha_img");var l=j.attr("src");var h=l.substring(0,l.lastIndexOf("="))+"="+Math.random();j.attr("src",h);var i=m.parents(".wc-form-wrapper").hasClass("wc-secondary-forms")?0:1;var n=getUniqueID(m,i);var k=i?30*60*1000:15*60*1000;a(n,k)}});
|
|
|
|
assets/js/wpdiscuz-synch-comments.js
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function ($) {
|
2 |
-
var offset;
|
3 |
-
var count;
|
4 |
-
if (admin_options_obj.lastCommentId) {
|
5 |
-
$('#wpdiscuz_synch_comments_count').keyup(function () {
|
6 |
-
if (isNaN(parseInt($(this).val()))) {
|
7 |
-
$('#wpdiscuz_synch_comments').attr('disabled', 'disabled');
|
8 |
-
} else {
|
9 |
-
$('#wpdiscuz_synch_comments').removeAttr('disabled');
|
10 |
-
count = Math.abs($(this).val());
|
11 |
-
}
|
12 |
-
});
|
13 |
-
}
|
14 |
-
|
15 |
-
$('#wpdiscuz_synch_comments').click(function () {
|
16 |
-
offset = 0;
|
17 |
-
$(this).attr('disabled', 'disabled');
|
18 |
-
window.onbeforeunload = confirmExit;
|
19 |
-
function confirmExit() {
|
20 |
-
return "";
|
21 |
-
}
|
22 |
-
var progressDiv = '<div id="wpdiscuz_progressbar" class="wpdiscuz_progressbar" style="width:1%;">1%</div>';
|
23 |
-
document.getElementById('wpdiscuz_progressbar_wrapper').innerHTML = progressDiv;
|
24 |
-
count = count > 100 ? 100 : count;
|
25 |
-
count = count < 10 ? 10 : count;
|
26 |
-
synchronizeComments(count, 0);
|
27 |
-
});
|
28 |
-
function synchronizeComments(count, synchronizedComments) {
|
29 |
-
$.ajax({
|
30 |
-
type: 'POST',
|
31 |
-
url: ajaxurl,
|
32 |
-
data: {
|
33 |
-
action: 'synchronizeComments',
|
34 |
-
commentsCountPerRequest: count,
|
35 |
-
synchronizedComments: synchronizedComments,
|
36 |
-
offset: offset
|
37 |
-
}
|
38 |
-
}).done(function (response) {
|
39 |
-
try {
|
40 |
-
offset++;
|
41 |
-
var width, text;
|
42 |
-
var obj = $.parseJSON(response);
|
43 |
-
var wpdiscuzProgress = obj.wpdiscuz_progress;
|
44 |
-
var synchronizedComments = obj.synchronizedComments;
|
45 |
-
if (isNaN(parseInt(wpdiscuzProgress))) {
|
46 |
-
width = 100;
|
47 |
-
text = wpdiscuzProgress;
|
48 |
-
} else {
|
49 |
-
width = wpdiscuzProgress;
|
50 |
-
text = wpdiscuzProgress + ' %';
|
51 |
-
}
|
52 |
-
var progressDiv = '<div id="wpdiscuz_progressbar" class="wpdiscuz_progressbar" style="width:' + width + '%;">' + text + '</div>';
|
53 |
-
document.getElementById('wpdiscuz_progressbar_wrapper').innerHTML = progressDiv;
|
54 |
-
|
55 |
-
if (parseInt(wpdiscuzProgress) < 100) {
|
56 |
-
synchronizeComments(count, synchronizedComments);
|
57 |
-
} else {
|
58 |
-
window.onbeforeunload = null;
|
59 |
-
}
|
60 |
-
} catch (e) {
|
61 |
-
console.log(e);
|
62 |
-
}
|
63 |
-
});
|
64 |
-
}
|
65 |
-
});
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/wpdiscuz-synch-comments.min.js
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
jQuery(document).ready(function(c){var d;var b;if(admin_options_obj.lastCommentId){c("#wpdiscuz_synch_comments_count").keyup(function(){if(isNaN(parseInt(c(this).val()))){c("#wpdiscuz_synch_comments").attr("disabled","disabled")}else{c("#wpdiscuz_synch_comments").removeAttr("disabled");b=Math.abs(c(this).val())}})}c("#wpdiscuz_synch_comments").click(function(){d=0;c(this).attr("disabled","disabled");window.onbeforeunload=f;function f(){return""}var e='<div id="wpdiscuz_progressbar" class="wpdiscuz_progressbar" style="width:1%;">1%</div>';document.getElementById("wpdiscuz_progressbar_wrapper").innerHTML=e;b=b>100?100:b;b=b<10?10:b;a(b,0)});function a(f,e){c.ajax({type:"POST",url:ajaxurl,data:{action:"synchronizeComments",commentsCountPerRequest:f,synchronizedComments:e,offset:d}}).done(function(h){try{d++;var j,n;var l=c.parseJSON(h);var m=l.wpdiscuz_progress;var i=l.synchronizedComments;if(isNaN(parseInt(m))){j=100;n=m}else{j=m;n=m+" %"}var g='<div id="wpdiscuz_progressbar" class="wpdiscuz_progressbar" style="width:'+j+'%;">'+n+"</div>";document.getElementById("wpdiscuz_progressbar_wrapper").innerHTML=g;if(parseInt(m)<100){a(f,i)}else{window.onbeforeunload=null}}catch(k){console.log(k)}})}});
|
|
|
|
assets/js/wpdiscuz.js
CHANGED
@@ -35,7 +35,6 @@ jQuery(document).ready(function ($) {
|
|
35 |
|
36 |
if ($('.wc_main_comm_form').length) {
|
37 |
var mainWrapperUniqueId = getUniqueID($('.wc_main_comm_form'), 1);
|
38 |
-
wpdiscuzTimeoutForCaptcha(mainWrapperUniqueId, mainFormTimeOut * 60 * 1000);
|
39 |
setCookieInForm();
|
40 |
}
|
41 |
$(document).delegate('.wc-reply-link', 'click', function () {
|
@@ -91,44 +90,6 @@ jQuery(document).ready(function ($) {
|
|
91 |
changeCaptchaImage($(this));
|
92 |
});
|
93 |
|
94 |
-
$(document).delegate('.wc_field_captcha', 'focus', function () {
|
95 |
-
if ($(this).hasClass('wpdiscuz-expired')) {
|
96 |
-
addCapthcaExpiredMessage($(this));
|
97 |
-
}
|
98 |
-
});
|
99 |
-
|
100 |
-
function wpdiscuzTimeoutForCaptcha(uniqueId, time) {
|
101 |
-
if ($('#wpcomm .wc-field-captcha').length) {
|
102 |
-
wpdiscuzRemoveExpiredClass(uniqueId);
|
103 |
-
removeCapthcaExpiredMessage(uniqueId);
|
104 |
-
setTimeout(function () {
|
105 |
-
captchaExpiredTime(uniqueId);
|
106 |
-
wpdiscuzAddExpiredClass(uniqueId);
|
107 |
-
}, time);
|
108 |
-
}
|
109 |
-
}
|
110 |
-
|
111 |
-
function wpdiscuzAddExpiredClass(uniqueId) {
|
112 |
-
if ($('#wc-secondary-form-wrapper-' + uniqueId).hasClass('wc-secondary-form-wrapper')) {
|
113 |
-
$('#wc-secondary-form-wrapper-' + uniqueId + ' .wc_field_captcha').addClass('wpdiscuz-expired');
|
114 |
-
} else {
|
115 |
-
$('#wc-main-form-wrapper-' + uniqueId + ' .wc_field_captcha').addClass('wpdiscuz-expired');
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
function wpdiscuzRemoveExpiredClass(uniqueId) {
|
120 |
-
if ($('#wc-secondary-form-wrapper-' + uniqueId).hasClass('wc-secondary-form-wrapper')) {
|
121 |
-
$('#wc-secondary-form-wrapper-' + uniqueId + ' .wc_field_captcha').removeClass('wpdiscuz-expired');
|
122 |
-
} else {
|
123 |
-
$('#wc-main-form-wrapper-' + uniqueId + ' .wc_field_captcha').removeClass('wpdiscuz-expired');
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
function captchaExpiredTime(uniqueId) {
|
128 |
-
getAjaxObject('setCaptchaExpired', uniqueId);
|
129 |
-
$('.wpdiscuz-loading-bar').hide();
|
130 |
-
}
|
131 |
-
|
132 |
function changeCaptchaImage(reloadImage) {
|
133 |
if (isShowCaptchaForGuests || isShowCaptchaForMembers) {
|
134 |
var captchaImg = $(reloadImage).prev().children('.wc_captcha_img');
|
@@ -137,22 +98,9 @@ jQuery(document).ready(function ($) {
|
|
137 |
captchaImg.attr('src', new_src);
|
138 |
var isMain = reloadImage.parents('.wc-form-wrapper').hasClass('wc-secondary-form-wrapper') ? 0 : 1;
|
139 |
var uniqueId = getUniqueID(reloadImage, isMain);
|
140 |
-
var time = isMain ? mainFormTimeOut * 60 * 1000 : secondaryFormTimeOut * 60 * 1000;
|
141 |
-
wpdiscuzTimeoutForCaptcha(uniqueId, time);
|
142 |
}
|
143 |
}
|
144 |
|
145 |
-
function addCapthcaExpiredMessage(field) {
|
146 |
-
field.parent().addClass('bad');
|
147 |
-
}
|
148 |
-
|
149 |
-
function removeCapthcaExpiredMessage(uniqueID) {
|
150 |
-
if ($('#wc-secondary-form-wrapper-' + uniqueID).hasClass('wc-secondary-form-wrapper')) {
|
151 |
-
$('#wc-secondary-form-wrapper-' + uniqueID + ' .wc-field-captcha').removeClass('bad');
|
152 |
-
} else {
|
153 |
-
$('#wc-main-form-wrapper-' + uniqueID + ' .wc-field-captcha').removeClass('bad');
|
154 |
-
}
|
155 |
-
}
|
156 |
//============================== CAPTCHA ============================== //
|
157 |
//============================== ADD COMMENT FUNCTION ============================== //
|
158 |
|
@@ -611,7 +559,6 @@ jQuery(document).ready(function ($) {
|
|
611 |
$('#wc-secondary-form-wrapper-' + uniqueId).slideToggle(700, function () {
|
612 |
field.addClass('wpdiscuz-clonned');
|
613 |
});
|
614 |
-
wpdiscuzTimeoutForCaptcha(uniqueId, secondaryFormTimeOut * 60 * 1000);
|
615 |
}
|
616 |
|
617 |
function replaceUniqueId(uniqueId) {
|
35 |
|
36 |
if ($('.wc_main_comm_form').length) {
|
37 |
var mainWrapperUniqueId = getUniqueID($('.wc_main_comm_form'), 1);
|
|
|
38 |
setCookieInForm();
|
39 |
}
|
40 |
$(document).delegate('.wc-reply-link', 'click', function () {
|
90 |
changeCaptchaImage($(this));
|
91 |
});
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
function changeCaptchaImage(reloadImage) {
|
94 |
if (isShowCaptchaForGuests || isShowCaptchaForMembers) {
|
95 |
var captchaImg = $(reloadImage).prev().children('.wc_captcha_img');
|
98 |
captchaImg.attr('src', new_src);
|
99 |
var isMain = reloadImage.parents('.wc-form-wrapper').hasClass('wc-secondary-form-wrapper') ? 0 : 1;
|
100 |
var uniqueId = getUniqueID(reloadImage, isMain);
|
|
|
|
|
101 |
}
|
102 |
}
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
//============================== CAPTCHA ============================== //
|
105 |
//============================== ADD COMMENT FUNCTION ============================== //
|
106 |
|
559 |
$('#wc-secondary-form-wrapper-' + uniqueId).slideToggle(700, function () {
|
560 |
field.addClass('wpdiscuz-clonned');
|
561 |
});
|
|
|
562 |
}
|
563 |
|
564 |
function replaceUniqueId(uniqueId) {
|
assets/js/wpdiscuz.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
-
jQuery(document).ready(function(E){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 S=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var r=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!S;var R=parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members)>0&&wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var x=wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;var m=wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;var b=wpdiscuz_ajax_obj.wpdiscuz_options.wc_load_all_comments;var p=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var k=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var j=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var H=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var T=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var c;var n="date";var L=[];var v=[];F();h();E(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active");E("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){E(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor"))});if(E(".wc_main_comm_form").length){var G=o(E(".wc_main_comm_form"),1);N(G,x*60*1000);g()}E(document).delegate(".wc-reply-link","click",function(){if(E(this).hasClass("wpdiscuz-clonned")){E("#wc-secondary-form-wrapper-"+o(E(this),0)).slideToggle(700)}else{i(E(this))}g()});E(document).delegate("textarea.wc_comment","focus",function(){E(this).autoGrow();var aa=E(this).parents(".wc-form-wrapper");E(".wc-form-footer",aa).slideDown(700)});E(document).delegate(".wc-share-link","click",function(){var aa=E(this).parents(".wc-comment-right");E(".share_buttons_box",aa).slideToggle(1000)});E(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(aa){aa.preventDefault()});E(document).delegate(".wc-toggle","click",function(){var ab=o(E(this),0);var aa=E(this);E("#wc-comm-"+ab+"> .wc-reply").slideToggle(700,function(){if(E(this).is(":hidden")){aa.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" ∨")}else{aa.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" ∧")}})});E(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(E(this).hasClass("wc-reply")){E(">.wc-comment-right",E(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{E(">.wc-comment-right",E(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});E(document).delegate(".wc_captcha_refresh_img","click",function(){Q(E(this))});E(document).delegate(".wc_field_captcha","focus",function(){if(E(this).hasClass("wpdiscuz-expired")){W(E(this))}});function N(ab,aa){if(E("#wpcomm .wc-field-captcha").length){f(ab);P(ab);setTimeout(function(){z(ab);V(ab)},aa)}}function V(aa){if(E("#wc-secondary-form-wrapper-"+aa).hasClass("wc-secondary-form-wrapper")){E("#wc-secondary-form-wrapper-"+aa+" .wc_field_captcha").addClass("wpdiscuz-expired")}else{E("#wc-main-form-wrapper-"+aa+" .wc_field_captcha").addClass("wpdiscuz-expired")}}function f(aa){if(E("#wc-secondary-form-wrapper-"+aa).hasClass("wc-secondary-form-wrapper")){E("#wc-secondary-form-wrapper-"+aa+" .wc_field_captcha").removeClass("wpdiscuz-expired")}else{E("#wc-main-form-wrapper-"+aa+" .wc_field_captcha").removeClass("wpdiscuz-expired")}}function z(aa){e("setCaptchaExpired",aa);E(".wpdiscuz-loading-bar").hide()}function Q(af){if(r||R){var ac=E(af).prev().children(".wc_captcha_img");var ae=ac.attr("src");var aa=ae.substring(0,ae.lastIndexOf("="))+"="+Math.random();ac.attr("src",aa);var ab=af.parents(".wc-form-wrapper").hasClass("wc-secondary-form-wrapper")?0:1;var ag=o(af,ab);var ad=ab?x*60*1000:m*60*1000;N(ag,ad)}}function W(aa){aa.parent().addClass("bad")}function P(aa){if(E("#wc-secondary-form-wrapper-"+aa).hasClass("wc-secondary-form-wrapper")){E("#wc-secondary-form-wrapper-"+aa+" .wc-field-captcha").removeClass("bad")}else{E("#wc-main-form-wrapper-"+aa+" .wc-field-captcha").removeClass("bad")}}E(document).delegate(".wc_comm_submit","click",function(){var ae=true;var af=1;var ad=E(this).parents("form");if(!ad.hasClass("wc_main_comm_form")){af=D(E(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&E(".wc_email",ad).val()){E(".wc_email",ad).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(E(".wc_email",ad).val())){E(".wc_email",ad).removeAttr("required");E(".wc_email",ad).next(".alert").html("")}if(!wpdiscuzValidator.checkAll(ad)){ae=false}else{var aa="";var ab="";var ac=ad.serialize()+"&wc_comment_depth="+af+"&comment_post_ID="+p;e("addComment",ac).done(function(ah){try{var aj=E.parseJSON(ah);aa=aj.code;if(parseInt(aa)>=0){var ag=aj.is_main;ab=aj.message;E(".wc_header_text_count").html(aj.wc_all_comments_count_new);if(ag){E(".wc-thread-wrapper").prepend(ab)}else{E("#wc-secondary-form-wrapper-"+aa).slideToggle(700);if(aj.is_in_same_container==1){E("#wc-secondary-form-wrapper-"+aa).after(ab)}else{E("#wc-secondary-form-wrapper-"+aa).after(ab.replace("wc-reply","wc-reply wc-no-left-margin"))}}q(aj);X(aj);u(ad,aj);ad.get(0).reset();g()}else{ab=wpdiscuz_ajax_obj.wpdiscuz_options[aa];t(ad,aa,ab,true)}}catch(ai){if(ah.indexOf("<")>=0&&ah.indexOf(">")>=0){ab=ai}else{ab=ah}t(ad,"wc_invalid_field",ab,true)}Q(E(".wc_captcha_refresh_img",ad));F();E(".wpdiscuz-loading-bar").hide()})}});function q(ac){if(!ac.held_moderate){var ab="post_id="+p+"&comment_id="+ac.new_comment_id+"&email="+ac.user_email+"&isParent="+ac.is_main;var aa=e("checkNotificationType",ab);aa.done(function(ad){try{ac=E.parseJSON(ad)}catch(ae){console.log(ae)}})}}function X(ac){if(ac.redirect>0&&ac.new_comment_id){var ab="commentId="+ac.new_comment_id;var aa=e("redirect",ab);aa.done(function(ad){ac=E.parseJSON(ad);if(ac.code==1){setTimeout(function(){window.location.href=ac.redirect_to},5000)}})}}function g(){if(E.cookie("wc_author_name")){E(".wc_comm_form .wc_name").val(E.cookie("wc_author_name"))}if(E.cookie("wc_author_email")){E(".wc_comm_form .wc_email").val(E.cookie("wc_author_email"))}if(E.cookie("wc_author_website")){E(".wc_comm_form .wc_website").val(E.cookie("wc_author_website"))}}function u(aa,ab){if(E(".wc_email",aa).val()){E.cookie("wc_author_email",E(".wc_email",aa).val())}else{E.cookie("wc_author_email",ab.user_email)}if(E(".wc_name",aa).val()){E.cookie("wc_author_name",E(".wc_name",aa).val())}else{E.cookie("wc_author_name",ab.user_name)}E.cookie("wc_author_website",E(".wc_website",aa).val())}var U;E(document).delegate(".wc_editable_comment","click",function(){var ad=o(E(this),0);var aa=Y(ad);var ac=E(this);var ab="commentId="+aa;e("editComment",ab).done(function(af){try{var aj=E.parseJSON(af);var ah="";var ag=aj.code;if(parseInt(ag)>=0){U=aj.message;var ae='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+ad+'" style="min-height: 2em;">'+aj.message+"</textarea>";E("#wc-comm-"+ad+" > .wc-comment-right .wc-comment-text").replaceWith(ae);document.getElementById("wc_edit_comment-"+ad).focus();E("#wc-comm-"+ad+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();ae="";E("#wc-comm-"+ad+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();E("#wc-comm-"+ad+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ah=wpdiscuz_ajax_obj.wpdiscuz_options[ag];t(ac,ag,ah,false)}}catch(ai){console.log(ai)}E(".wpdiscuz-loading-bar").hide()})});E(document).delegate(".wc_save_edited_comment","click",function(){var af=o(E(this));var ab=Y(af);var aa=E("#wc-comm-"+af+" textarea#wc_edit_comment-"+af);var ac=aa.val();var ae=E(this);if(E.trim(ac).length>0){var ad="commentId="+ab+"&commentContent="+ac;e("saveEditedComment",ad).done(function(ag){try{var ak=E.parseJSON(ag);var ah=ak.code;var ai="";if(parseInt(ah)>=0){I(af,ak.message)}else{ai=wpdiscuz_ajax_obj.wpdiscuz_options[ah];t(ae,ah,ai,false)}aa="";ac=""}catch(aj){console.log(aj)}E(".wpdiscuz-loading-bar").hide()})}});E(document).delegate(".wc_cancel_edit","click",function(){var aa=o(E(this));I(aa,U)});function I(ac,ab){E("#wc-comm-"+ac+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();E("#wc-comm-"+ac+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();E("#wc-comm-"+ac+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var aa='<div class="wc-comment-text">'+l(ab)+"</div>";E("#wc-comm-"+ac+" #wc_edit_comment-"+ac).replaceWith(aa)}function l(ad,ac){var ab=(ac||typeof ac==="undefined")?"<br/>":"<br>";var aa=(ad+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+ab+"$2");return aa.replace("<br><br>","<br/>")}E(document).delegate(".wc-load-more-submit","click",function(){var aa;if(n=="vote"){aa="offset="+c+"&orderBy="+n+"&order="+a;c++}else{aa="orderBy="+n+"&order="+a+"&lastParentId="+w()}aa+="&postId="+p+"&loadAllCommnts="+b;e("loadMoreComments",aa).done(function(ab){try{var ad=E.parseJSON(ab);E(".wpdiscuz-comment-pagination").before(ad.comment_list);s(ad);E(".wpdiscuz_single").remove()}catch(ac){console.log(ac)}F();E(".wpdiscuz-loading-bar").hide();E(".wc-load-more-submit").blur()})});function s(aa){if(aa.is_show_load_more!=false){O(aa.last_parent_id)}else{E(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}}E(document).delegate(".wc_vote","click",function(){var aa=E(this);var ad="";var ae="";var ab=E(this).parents(".wc-comment-right").attr("id");ab=ab.substring(ab.lastIndexOf("-")+1);var ac;if(E(this).hasClass("wc-up")){ac=1}else{ac=-1}var af="commentId="+ab+"&voteType="+ac;e("voteOnComment",af).done(function(ag){try{var ai=E.parseJSON(ag);ad=ai.code;if(parseInt(ad)>=0){var aj=E(".wc-comment-footer .wc-vote-result",E("#comment-"+ab));E(aj).text(parseInt(E(aj).text())+ac)}else{ae=wpdiscuz_ajax_obj.wpdiscuz_options[ad];t(aa,ad,ae,false)}}catch(ah){console.log(ah)}E(".wpdiscuz-loading-bar").hide()})});E(document).delegate(".wpdiscuz-sort-button","click",function(){if(!(E(this).hasClass("wpdiscuz-sort-button-active"))){var ad=E(this);if(E(this).hasClass("wpdiscuz-vote-sort-up")){n="vote";a="desc"}else{n="date";a=E(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var ac="postId="+p+"&orderBy="+n+"&order="+a;var aa="";var ab="";e("wpdiscuzSorting",ac).done(function(ae){try{var ag=E.parseJSON(ae);aa=ag.code;ab=ag.message;if(parseInt(aa)>0){E("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){E(this).remove()});E("#wpcomm .wc-thread-wrapper").prepend(ab);c=parseInt(ag.loadCount)}else{}K(ad);s(ag)}catch(af){console.log(af)}F();E(".wpdiscuz-loading-bar").hide()})}});function K(aa){E(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){E(this).removeClass("wpdiscuz-sort-button-active")});aa.addClass("wpdiscuz-sort-button-active")}function Z(){var ae=location.href;var ad=ae.match(/#comment\-(\d+)/);if(ad!==null){var ab=ad[1];if(!E("#comment-"+ab).length){var ac="commentId="+ab;var aa=e("getSingleComment",ac);aa.done(function(af){try{var ah=E.parseJSON(af);E(".wc-thread-wrapper").prepend(ah.message);E("html, body").animate({scrollTop:E(".wc-thread-wrapper").offset().top},1000)}catch(ag){console.log(ag)}F();E(".wpdiscuz-loading-bar").hide()})}}}Z();if(k>0&&T&&(S||(!S&&!H))){setInterval(M,parseInt(j)*1000)}function M(){var ad=C();var ab=(E.cookie("wc_author_email")!=undefined&&E.cookie("wc_author_email")!="")?E.cookie("wc_author_email"):"";var ac="postId="+p+"&loadLastCommentId="+T+"&visibleCommentIds="+ad+"&email="+ab;var aa=e("liveUpdate",ac);aa.done(function(af){try{var ak=E.parseJSON(af);if(ak.code==1){if(k==1){A(ak)}else{v=v.concat(ak.message.comments);L=L.concat(ak.message.author_replies);var ag=v.length;var ae=L.length;if(ag>0){var ai=ag+" ";ai+=ag>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;E(".wc_new_comment").html(ai).show()}else{E(".wc_new_comment").hide()}if(ae>0){var ah=ae+" ";ah+=ae>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;E(".wc_new_reply").html(ah).show()}else{E(".wc_new_reply").hide()}}E(".wc_header_text_count").html(ak.wc_all_comments_count_new);T=ak.loadLastCommentId}}catch(aj){console.log(aj)}F();E(".wpdiscuz-loading-bar").hide()})}function A(ad){if(ad.message!==undefined){var aa;var ac=ad.message;for(var ab=0;ab<ac.length;ab++){aa=ac[ab];y(aa.comment_parent,aa.comment_html)}}}E(document).delegate(".wc-update-on-click","click",function(){var aa;var ab=E(this);if(ab.hasClass("wc_new_comment")){aa=v.join()}else{aa=L.join()}e("updateOnClick",aa).done(function(ac){try{var ae=E.parseJSON(ac);A(ae);if(ab.hasClass("wc_new_comment")){v=[];E(".wc_new_comment").hide()}else{L=[];E(".wc_new_reply").hide()}}catch(ad){console.log(ad)}F();E(".wpdiscuz-loading-bar").hide()})});function t(ae,ab,ad,ac){var aa;var af;if(ac){af=ae.parents(".wc-form-wrapper")}else{af=ae.closest(".wc-comment")}aa=af.children(".wpdiscuz-comment-message");aa.addClass(ab);aa.html(ad);aa.show().delay(5000).fadeOut(1000,function(){aa.removeClass();aa.addClass("wpdiscuz-comment-message");aa.html("")})}function i(aa){var ab=o(aa,0);E("#wpdiscuz_form_anchor-"+ab).before(J(ab));E("#wc-secondary-form-wrapper-"+ab).slideToggle(700,function(){aa.addClass("wpdiscuz-clonned")});N(ab,m*60*1000)}function J(ab){var aa=E("#wpdiscuz_hidden_secondary_form").html();return aa.replace(/wpdiscuzuniqueid/g,ab)}function o(ac,ab){var aa="";if(ab){aa=ac.parents(".wc-main-form-wrapper").attr("id")}else{aa=ac.parents(".wc-comment").attr("id")}var ad=aa.substring(aa.lastIndexOf("-")+1);return ad}function Y(aa){return aa.substring(0,aa.indexOf("_"))}function B(ab){var aa=ab.substring(ab.indexOf("_")+1);return aa}function w(){var aa=E(".wc-load-more-link").attr("href");return aa.substring(aa.lastIndexOf("=")+1)}function O(aa){var ab=E(".wc-load-more-link").attr("href");E(".wc-load-more-link").attr("href",ab.replace(/[\d]+$/m,aa));E(".wpdiscuz-comment-pagination").show()}function D(ac){var ab=ac.attr("class");var aa=ab.split(" ");var ad="";E.each(aa,function(ae,af){if("wc_comment_level"===d(af,false)){ad=d(af,true)}});return parseInt(ad)+1}function d(aa,ab){var ac="";if(ab){ac=aa.substring(aa.indexOf("-")+1)}else{ac=aa.substring(0,aa.indexOf("-"))}return ac}function e(ab,aa){if(ab!=="liveUpdate"){E(".wpdiscuz-loading-bar").show()}return E.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:aa,action:ab}})}function y(ac,ab){if(ac==0){E(".wc-thread-wrapper").prepend(ab)}else{var aa=o(E("#comment-"+ac),0);E("#wpdiscuz_form_anchor-"+aa).after(ab)}}function C(){var ac;var aa;var ab="";E(".wc-comment-right").each(function(){ac=o(E(this),0);aa=Y(ac);ab+=aa+","});return ab}function F(){E(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});E(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function h(){if(E(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){E(".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(E(".wc_social_plugin_wrapper .the_champ_login_container").length){E(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(E(".wc_social_plugin_wrapper .social_connect_form").length){E(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(E(".wc_social_plugin_wrapper .oneall_social_login_providers").length){E(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}}}}}});
|
1 |
+
|
2 |
+
jQuery(document).ready(function(C){wpdiscuzValidator.message.invalid=wpdiscuz_ajax_obj.wpdiscuz_options.wc_invalid_field;wpdiscuzValidator.message.empty=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_empty_text;wpdiscuzValidator.message.email=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_email_text;wpdiscuzValidator.message.url=wpdiscuz_ajax_obj.wpdiscuz_options.wc_error_url_text;wpdiscuzValidator.message.min=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_min_length;wpdiscuzValidator.message.max=wpdiscuz_ajax_obj.wpdiscuz_options.wc_msg_comment_text_max_length;var O=wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var q=wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide==0&&!O;var N=parseInt(wpdiscuz_ajax_obj.wpdiscuz_options.wc_captcha_show_hide_for_members)>0&&wpdiscuz_ajax_obj.wpdiscuz_options.is_user_logged_in;var w=wpdiscuz_ajax_obj.wpdiscuz_options.main_form_time_out;var l=wpdiscuz_ajax_obj.wpdiscuz_options.secondary_form_time_out;var b=wpdiscuz_ajax_obj.wpdiscuz_options.wc_load_all_comments;var o=wpdiscuz_ajax_obj.wpdiscuz_options.wc_post_id;var j=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateType;var i=wpdiscuz_ajax_obj.wpdiscuz_options.commentListUpdateTimer;var F=wpdiscuz_ajax_obj.wpdiscuz_options.liveUpdateGuests;var P=wpdiscuz_ajax_obj.wpdiscuz_options.loadLastCommentId;var a=wpdiscuz_ajax_obj.wpdiscuz_options.wordpress_comment_order;var c;var m="date";var J=[];var u=[];D();g();C(".wpdiscuz-date-sort-"+a).addClass("wpdiscuz-sort-button-active");C("#wc_unsubscribe_message").delay(7000).fadeOut(1500,function(){C(this).remove();location.href=location.href.substring(0,location.href.indexOf("subscribeAnchor"))});if(C(".wc_main_comm_form").length){var E=n(C(".wc_main_comm_form"),1);f()}C(document).delegate(".wc-reply-link","click",function(){if(C(this).hasClass("wpdiscuz-clonned")){C("#wc-secondary-form-wrapper-"+n(C(this),0)).slideToggle(700)}else{h(C(this))}f()});C(document).delegate("textarea.wc_comment","focus",function(){C(this).autoGrow();var U=C(this).parents(".wc-form-wrapper");C(".wc-form-footer",U).slideDown(700)});C(document).delegate(".wc-share-link","click",function(){var U=C(this).parents(".wc-comment-right");C(".share_buttons_box",U).slideToggle(1000)});C(document).delegate(".wpdiscuz-nofollow,.wc_captcha_refresh_img,.wc-toggle,.wc-load-more-link","click",function(U){U.preventDefault()});C(document).delegate(".wc-toggle","click",function(){var V=n(C(this),0);var U=C(this);C("#wc-comm-"+V+"> .wc-reply").slideToggle(700,function(){if(C(this).is(":hidden")){U.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_show_replies_text+" ∨")}else{U.html(wpdiscuz_ajax_obj.wpdiscuz_options.wc_hide_replies_text+" ∧")}})});C(document).delegate(".wc-new-loaded-comment","mouseenter",function(){if(C(this).hasClass("wc-reply")){C(">.wc-comment-right",C(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_reply_bg_color},1500)}else{C(">.wc-comment-right",C(this)).animate({backgroundColor:wpdiscuz_ajax_obj.wpdiscuz_options.wc_comment_bg_color},1500)}});C(document).delegate(".wc_captcha_refresh_img","click",function(){M(C(this))});function M(Y){if(q||N){var W=C(Y).prev().children(".wc_captcha_img");var X=W.attr("src");var U=X.substring(0,X.lastIndexOf("="))+"="+Math.random();W.attr("src",U);var V=Y.parents(".wc-form-wrapper").hasClass("wc-secondary-form-wrapper")?0:1;var Z=n(Y,V)}}C(document).delegate(".wc_comm_submit","click",function(){var Y=true;var Z=1;var X=C(this).parents("form");if(!X.hasClass("wc_main_comm_form")){Z=B(C(this).parents(".wc-comment"))}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&C(".wc_email",X).val()){C(".wc_email",X).attr("required","required")}if(!wpdiscuz_ajax_obj.wpdiscuz_options.is_email_field_required&&!(C(".wc_email",X).val())){C(".wc_email",X).removeAttr("required");C(".wc_email",X).next(".alert").html("")}if(!wpdiscuzValidator.checkAll(X)){Y=false}else{var U="";var V="";var W=X.serialize()+"&wc_comment_depth="+Z+"&comment_post_ID="+o;e("addComment",W).done(function(ab){try{var ad=C.parseJSON(ab);U=ad.code;if(parseInt(U)>=0){var aa=ad.is_main;V=ad.message;C(".wc_header_text_count").html(ad.wc_all_comments_count_new);if(aa){C(".wc-thread-wrapper").prepend(V)}else{C("#wc-secondary-form-wrapper-"+U).slideToggle(700);if(ad.is_in_same_container==1){C("#wc-secondary-form-wrapper-"+U).after(V)}else{C("#wc-secondary-form-wrapper-"+U).after(V.replace("wc-reply","wc-reply wc-no-left-margin"))}}p(ad);R(ad);t(X,ad);X.get(0).reset();f()}else{V=wpdiscuz_ajax_obj.wpdiscuz_options[U];s(X,U,V,true)}}catch(ac){if(ab.indexOf("<")>=0&&ab.indexOf(">")>=0){V=ac}else{V=ab}s(X,"wc_invalid_field",V,true)}M(C(".wc_captcha_refresh_img",X));D();C(".wpdiscuz-loading-bar").hide()})}});function p(W){if(!W.held_moderate){var V="post_id="+o+"&comment_id="+W.new_comment_id+"&email="+W.user_email+"&isParent="+W.is_main;var U=e("checkNotificationType",V);U.done(function(X){try{W=C.parseJSON(X)}catch(Y){console.log(Y)}})}}function R(W){if(W.redirect>0&&W.new_comment_id){var V="commentId="+W.new_comment_id;var U=e("redirect",V);U.done(function(X){W=C.parseJSON(X);if(W.code==1){setTimeout(function(){window.location.href=W.redirect_to},5000)}})}}function f(){if(C.cookie("wc_author_name")){C(".wc_comm_form .wc_name").val(C.cookie("wc_author_name"))}if(C.cookie("wc_author_email")){C(".wc_comm_form .wc_email").val(C.cookie("wc_author_email"))}if(C.cookie("wc_author_website")){C(".wc_comm_form .wc_website").val(C.cookie("wc_author_website"))}}function t(U,V){if(C(".wc_email",U).val()){C.cookie("wc_author_email",C(".wc_email",U).val())}else{C.cookie("wc_author_email",V.user_email)}if(C(".wc_name",U).val()){C.cookie("wc_author_name",C(".wc_name",U).val())}else{C.cookie("wc_author_name",V.user_name)}C.cookie("wc_author_website",C(".wc_website",U).val())}var Q;C(document).delegate(".wc_editable_comment","click",function(){var X=n(C(this),0);var U=S(X);var W=C(this);var V="commentId="+U;e("editComment",V).done(function(Z){try{var ad=C.parseJSON(Z);var ab="";var aa=ad.code;if(parseInt(aa)>=0){Q=ad.message;var Y='<textarea required="required" name="wc_comment" class="wc_comment wc_field_input wc_edit_comment" id="wc_edit_comment-'+X+'" style="min-height: 2em;">'+ad.message+"</textarea>";C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-text").replaceWith(Y);document.getElementById("wc_edit_comment-"+X).focus();C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").show();Y="";C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").hide();C("#wc-comm-"+X+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").show()}else{ab=wpdiscuz_ajax_obj.wpdiscuz_options[aa];s(W,aa,ab,false)}}catch(ac){console.log(ac)}C(".wpdiscuz-loading-bar").hide()})});C(document).delegate(".wc_save_edited_comment","click",function(){var Z=n(C(this));var V=S(Z);var U=C("#wc-comm-"+Z+" textarea#wc_edit_comment-"+Z);var W=U.val();var Y=C(this);if(C.trim(W).length>0){var X="commentId="+V+"&commentContent="+W;e("saveEditedComment",X).done(function(aa){try{var ae=C.parseJSON(aa);var ab=ae.code;var ac="";if(parseInt(ab)>=0){G(Z,ae.message)}else{ac=wpdiscuz_ajax_obj.wpdiscuz_options[ab];s(Y,ab,ac,false)}U="";W=""}catch(ad){console.log(ad)}C(".wpdiscuz-loading-bar").hide()})}});C(document).delegate(".wc_cancel_edit","click",function(){var U=n(C(this));G(U,Q)});function G(W,V){C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_editable_comment").show();C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_cancel_edit").hide();C("#wc-comm-"+W+" > .wc-comment-right .wc-comment-footer .wc_save_edited_comment").hide();var U='<div class="wc-comment-text">'+k(V)+"</div>";C("#wc-comm-"+W+" #wc_edit_comment-"+W).replaceWith(U)}function k(X,W){var V=(W||typeof W==="undefined")?"<br/>":"<br>";var U=(X+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+V+"$2");return U.replace("<br><br>","<br/>")}C(document).delegate(".wc-load-more-submit","click",function(){var U;if(m=="vote"){U="offset="+c+"&orderBy="+m+"&order="+a;c++}else{U="orderBy="+m+"&order="+a+"&lastParentId="+v()}U+="&postId="+o+"&loadAllCommnts="+b;e("loadMoreComments",U).done(function(V){try{var X=C.parseJSON(V);C(".wpdiscuz-comment-pagination").before(X.comment_list);r(X);C(".wpdiscuz_single").remove()}catch(W){console.log(W)}D();C(".wpdiscuz-loading-bar").hide();C(".wc-load-more-submit").blur()})});function r(U){if(U.is_show_load_more!=false){L(U.last_parent_id)}else{C(".wc-load-more-submit").parents(".wpdiscuz-comment-pagination").hide()}}C(document).delegate(".wc_vote","click",function(){var U=C(this);var X="";var Y="";var V=C(this).parents(".wc-comment-right").attr("id");V=V.substring(V.lastIndexOf("-")+1);var W;if(C(this).hasClass("wc-up")){W=1}else{W=-1}var Z="commentId="+V+"&voteType="+W;e("voteOnComment",Z).done(function(aa){try{var ac=C.parseJSON(aa);X=ac.code;if(parseInt(X)>=0){var ad=C(".wc-comment-footer .wc-vote-result",C("#comment-"+V));C(ad).text(parseInt(C(ad).text())+W)}else{Y=wpdiscuz_ajax_obj.wpdiscuz_options[X];s(U,X,Y,false)}}catch(ab){console.log(ab)}C(".wpdiscuz-loading-bar").hide()})});C(document).delegate(".wpdiscuz-sort-button","click",function(){if(!(C(this).hasClass("wpdiscuz-sort-button-active"))){var X=C(this);if(C(this).hasClass("wpdiscuz-vote-sort-up")){m="vote";a="desc"}else{m="date";a=C(this).hasClass("wpdiscuz-date-sort-desc")?"desc":"asc"}var W="postId="+o+"&orderBy="+m+"&order="+a;var U="";var V="";e("wpdiscuzSorting",W).done(function(Y){try{var aa=C.parseJSON(Y);U=aa.code;V=aa.message;if(parseInt(U)>0){C("#wpcomm .wc-thread-wrapper .wc-comment").each(function(){C(this).remove()});C("#wpcomm .wc-thread-wrapper").prepend(V);c=parseInt(aa.loadCount)}else{}I(X);r(aa)}catch(Z){console.log(Z)}D();C(".wpdiscuz-loading-bar").hide()})}});function I(U){C(".wpdiscuz-sort-buttons .wpdiscuz-sort-button").each(function(){C(this).removeClass("wpdiscuz-sort-button-active")});U.addClass("wpdiscuz-sort-button-active")}function T(){var Y=location.href;var X=Y.match(/#comment\-(\d+)/);if(X!==null){var V=X[1];if(!C("#comment-"+V).length){var W="commentId="+V;var U=e("getSingleComment",W);U.done(function(Z){try{var ab=C.parseJSON(Z);C(".wc-thread-wrapper").prepend(ab.message);C("html, body").animate({scrollTop:C(".wc-thread-wrapper").offset().top},1000)}catch(aa){console.log(aa)}D();C(".wpdiscuz-loading-bar").hide()})}}}T();if(j>0&&P&&(O||(!O&&!F))){setInterval(K,parseInt(i)*1000)}function K(){var X=A();var V=(C.cookie("wc_author_email")!=undefined&&C.cookie("wc_author_email")!="")?C.cookie("wc_author_email"):"";var W="postId="+o+"&loadLastCommentId="+P+"&visibleCommentIds="+X+"&email="+V;var U=e("liveUpdate",W);U.done(function(Z){try{var ae=C.parseJSON(Z);if(ae.code==1){if(j==1){y(ae)}else{u=u.concat(ae.message.comments);J=J.concat(ae.message.author_replies);var aa=u.length;var Y=J.length;if(aa>0){var ac=aa+" ";ac+=aa>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comments_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_comment_button_text;C(".wc_new_comment").html(ac).show()}else{C(".wc_new_comment").hide()}if(Y>0){var ab=Y+" ";ab+=Y>1?wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_replies_button_text:wpdiscuz_ajax_obj.wpdiscuz_options.wc_new_reply_button_text;C(".wc_new_reply").html(ab).show()}else{C(".wc_new_reply").hide()}}C(".wc_header_text_count").html(ae.wc_all_comments_count_new);P=ae.loadLastCommentId}}catch(ad){console.log(ad)}D();C(".wpdiscuz-loading-bar").hide()})}function y(X){if(X.message!==undefined){var U;var W=X.message;for(var V=0;V<W.length;V++){U=W[V];x(U.comment_parent,U.comment_html)}}}C(document).delegate(".wc-update-on-click","click",function(){var U;var V=C(this);if(V.hasClass("wc_new_comment")){U=u.join()}else{U=J.join()}e("updateOnClick",U).done(function(W){try{var Y=C.parseJSON(W);y(Y);if(V.hasClass("wc_new_comment")){u=[];C(".wc_new_comment").hide()}else{J=[];C(".wc_new_reply").hide()}}catch(X){console.log(X)}D();C(".wpdiscuz-loading-bar").hide()})});function s(Y,V,X,W){var U;var Z;if(W){Z=Y.parents(".wc-form-wrapper")}else{Z=Y.closest(".wc-comment")}U=Z.children(".wpdiscuz-comment-message");U.addClass(V);U.html(X);U.show().delay(5000).fadeOut(1000,function(){U.removeClass();U.addClass("wpdiscuz-comment-message");U.html("")})}function h(U){var V=n(U,0);C("#wpdiscuz_form_anchor-"+V).before(H(V));C("#wc-secondary-form-wrapper-"+V).slideToggle(700,function(){U.addClass("wpdiscuz-clonned")})}function H(V){var U=C("#wpdiscuz_hidden_secondary_form").html();return U.replace(/wpdiscuzuniqueid/g,V)}function n(W,V){var U="";if(V){U=W.parents(".wc-main-form-wrapper").attr("id")}else{U=W.parents(".wc-comment").attr("id")}var X=U.substring(U.lastIndexOf("-")+1);return X}function S(U){return U.substring(0,U.indexOf("_"))}function z(V){var U=V.substring(V.indexOf("_")+1);return U}function v(){var U=C(".wc-load-more-link").attr("href");return U.substring(U.lastIndexOf("=")+1)}function L(U){var V=C(".wc-load-more-link").attr("href");C(".wc-load-more-link").attr("href",V.replace(/[\d]+$/m,U));C(".wpdiscuz-comment-pagination").show()}function B(W){var V=W.attr("class");var U=V.split(" ");var X="";C.each(U,function(Y,Z){if("wc_comment_level"===d(Z,false)){X=d(Z,true)}});return parseInt(X)+1}function d(U,V){var W="";if(V){W=U.substring(U.indexOf("-")+1)}else{W=U.substring(0,U.indexOf("-"))}return W}function e(V,U){if(V!=="liveUpdate"){C(".wpdiscuz-loading-bar").show()}return C.ajax({type:"POST",url:wpdiscuz_ajax_obj.url,data:{wpdiscuzAjaxData:U,action:V}})}function x(W,V){if(W==0){C(".wc-thread-wrapper").prepend(V)}else{var U=n(C("#comment-"+W),0);C("#wpdiscuz_form_anchor-"+U).after(V)}}function A(){var W;var U;var V="";C(".wc-comment-right").each(function(){W=n(C(this),0);U=S(W);V+=U+","});return V}function D(){C(".wc-comment-img-link").tooltipster({trigger:"click",contentAsHTML:true,interactive:true,multiple:true});C(".wc_tooltipster").tooltipster({offsetY:2,multiple:true})}function g(){if(C(".wc_social_plugin_wrapper .wp-social-login-provider-list").length){C(".wc_social_plugin_wrapper .wp-social-login-provider-list").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .the_champ_login_container").length){C(".wc_social_plugin_wrapper .the_champ_login_container").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .social_connect_form").length){C(".wc_social_plugin_wrapper .social_connect_form").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}else{if(C(".wc_social_plugin_wrapper .oneall_social_login_providers").length){C(".wc_social_plugin_wrapper .oneall_social_login .oneall_social_login_providers").clone().prependTo("#wpdiscuz_hidden_secondary_form > .wc-form-wrapper > .wc-secondary-forms-social-content")}}}}}});
|
class.WpdiscuzCore.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/*
|
4 |
* Plugin Name: wpDiscuz - Supercharged native comments
|
5 |
* Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
|
6 |
-
* Version: 3.0.
|
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/
|
@@ -46,7 +46,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
46 |
$this->optimizationHelper = new WpdiscuzOptimizationHelper($this->optionsSerialized, $this->dbManager, $this->emailHelper);
|
47 |
$this->css = new WpdiscuzCss($this->optionsSerialized);
|
48 |
$this->templateBuilder = new WpdiscuzTemplateBuilder($this->helper, $this->optimizationHelper, $this->dbManager, $this->options, $this->optionsSerialized);
|
49 |
-
add_action('admin_notices', array(&$this->optimizationHelper, 'wpdiscuzRequirements'));
|
50 |
add_action('wp_head', array(&$this, 'initCurrentPostType'));
|
51 |
add_action('wp_head', array(&$this->css, 'initCustomCss'));
|
52 |
add_action('plugins_loaded', array(&$this, 'wpdiscuzTextDomain'));
|
@@ -60,8 +59,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
60 |
}
|
61 |
add_action('wp_ajax_generateCaptcha', array(&$this->helper, 'generateCaptcha'));
|
62 |
add_action('wp_ajax_nopriv_generateCaptcha', array(&$this->helper, 'generateCaptcha'));
|
63 |
-
add_action('wp_ajax_setCaptchaExpiredd', array(&$this->helper, 'setCaptchaExpired'));
|
64 |
-
add_action('wp_ajax_nopriv_setCaptchaExpired', array(&$this->helper, 'setCaptchaExpired'));
|
65 |
add_action('wp_ajax_loadMoreComments', array(&$this, 'loadMoreComments'));
|
66 |
add_action('wp_ajax_nopriv_loadMoreComments', array(&$this, 'loadMoreComments'));
|
67 |
add_action('wp_ajax_voteOnComment', array(&$this, 'voteOnComment'));
|
@@ -78,7 +75,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
78 |
add_action('wp_ajax_nopriv_checkNotificationType', array(&$this->emailHelper, 'checkNotificationType'));
|
79 |
add_action('wp_ajax_redirect', array(&$this, 'redirect'));
|
80 |
add_action('wp_ajax_nopriv_redirect', array(&$this, 'redirect'));
|
81 |
-
add_action('
|
82 |
add_action('wp_insert_comment', array(&$this->optimizationHelper, 'addCommentToTree'), 2689, 2);
|
83 |
add_action('transition_comment_status', array(&$this->optimizationHelper, 'statusEventHandler'), 265, 3);
|
84 |
add_action('delete_comment', array(&$this->optimizationHelper, 'initSubComments'), 266);
|
@@ -135,7 +132,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
135 |
foreach ($newCommentIds as $newCommentId) {
|
136 |
$comment = get_comment($newCommentId);
|
137 |
if (($comment->comment_parent && (in_array($comment->comment_parent, $visibleCommentIds) || in_array($comment->comment_parent, $newCommentIds))) || !$comment->comment_parent) {
|
138 |
-
$comments = get_comments(array('comment__in' => $newCommentId
|
139 |
$commentHtml = wp_list_comments($commentListArgs, $comments);
|
140 |
$messageArray['message'][] = array('comment_parent' => $comment->comment_parent, 'comment_html' => $commentHtml);
|
141 |
}
|
@@ -161,7 +158,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
161 |
$commentListArgs['new_loaded_class'] = 'wc-new-loaded-comment';
|
162 |
foreach ($newCommentIds as $newCommentId) {
|
163 |
$comment = get_comment($newCommentId);
|
164 |
-
$comments = get_comments(array('comment__in' => $newCommentId
|
165 |
$commentHtml = wp_list_comments($commentListArgs, $comments);
|
166 |
$messageArray['message'][] = array('comment_parent' => $comment->comment_parent, 'comment_html' => $commentHtml);
|
167 |
}
|
@@ -382,7 +379,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
382 |
parse_str($commentData);
|
383 |
$commentId = intval(trim($commentId));
|
384 |
if ($commentId) {
|
385 |
-
$comments = get_comments(array('comment__in' => $commentId
|
386 |
$commentListArgs = $this->getCommentListArgs();
|
387 |
$commentListArgs['isSingle'] = true;
|
388 |
$commentListArgs['new_loaded_class'] = 'wc-new-loaded-comment';
|
@@ -416,12 +413,17 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
416 |
|
417 |
public function loadMoreComments() {
|
418 |
if (isset($_POST['wpdiscuzAjaxData'])) {
|
|
|
419 |
parse_str($_POST['wpdiscuzAjaxData']);
|
420 |
$postId = intval(trim($postId));
|
421 |
$limit = intval(trim($loadAllCommnts)) ? 0 : $this->optionsSerialized->wordpressCommentPerPage;
|
422 |
$args = array('limit' => $limit);
|
423 |
$orderBy = trim($orderBy);
|
424 |
if ($orderBy == 'vote') {
|
|
|
|
|
|
|
|
|
425 |
$args['orderby'] = 'meta_value_num';
|
426 |
$args['offset'] = intval($offset) * $limit;
|
427 |
} else {
|
@@ -522,7 +524,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
522 |
* get comments by comment type
|
523 |
*/
|
524 |
public function getWPComments($args = array()) {
|
525 |
-
global $post;
|
526 |
$this->optionsSerialized->initPhrasesOnLoad();
|
527 |
$defaults = array(
|
528 |
'last_parent_id' => 0,
|
@@ -532,10 +534,12 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
532 |
'order' => $this->optionsSerialized->wordpressCommentOrder,
|
533 |
'date_order' => $this->optionsSerialized->wordpressCommentOrder,
|
534 |
'limit' => $this->optionsSerialized->wordpressCommentPerPage,
|
535 |
-
'meta_key' => self::META_KEY_VOTES,
|
536 |
'is_threaded' => 1,
|
537 |
'status' => 'approve'
|
538 |
);
|
|
|
|
|
|
|
539 |
$parsedArgs = wp_parse_args($args, $defaults);
|
540 |
$commentData = array();
|
541 |
$commentListArgs = $this->getCommentListArgs();
|
@@ -571,10 +575,12 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
571 |
|
572 |
if ($args['comment__in']) {
|
573 |
$parentIds = $args['comment__in'];
|
574 |
-
if ($args['orderby'] == 'meta_value_num'
|
575 |
-
|
|
|
|
|
|
|
576 |
}
|
577 |
-
$rootComments = get_comments($args);
|
578 |
}
|
579 |
if ($args['is_threaded']) {
|
580 |
$commentmetaIds = $this->optimizationHelper->getCommentListByParentIds($parentIds);
|
@@ -597,11 +603,25 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
597 |
if ($this->optionsSerialized->wordpressCommentOrder == 'desc') {
|
598 |
$commentListArgs['reverse_top_level'] = false;
|
599 |
}
|
600 |
-
$commentList = get_comments(array('post_id' => $args['post_id'], 'status' => 'approve', 'order' => $this->optionsSerialized->wordpressCommentOrder
|
601 |
}
|
602 |
return $commentList;
|
603 |
}
|
604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
/**
|
606 |
* register options page for plugin
|
607 |
*/
|
@@ -637,8 +657,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
|
|
637 |
wp_localize_script('wpdiscuz-options-js', 'admin_options_obj', array('lastCommentId' => $realLastCommentId));
|
638 |
wp_enqueue_script('wpdiscuz-options-js');
|
639 |
wp_enqueue_script('thickbox');
|
640 |
-
wp_register_script('wpdiscuz-synchronize-comments', plugins_url(self::$PLUGIN_DIRECTORY . '/assets/js/wpdiscuz-synch-comments.min.js'), array('jquery'));
|
641 |
-
wp_enqueue_script('wpdiscuz-synchronize-comments');
|
642 |
wp_register_script('wpdiscuz-jquery-cookie', plugins_url(self::$PLUGIN_DIRECTORY . '/assets/js/jquery.cookie.min.js'), array('jquery'), '1.0.0', true);
|
643 |
wp_enqueue_script('wpdiscuz-jquery-cookie');
|
644 |
}
|
3 |
/*
|
4 |
* Plugin Name: wpDiscuz - Supercharged native comments
|
5 |
* Description: Better comment system. Wordpress post comments and discussion plugin. Allows your visitors discuss, vote for comments and share.
|
6 |
+
* Version: 3.0.3
|
7 |
* Author: gVectors Team (A. Chakhoyan, G. Zakaryan, H. Martirosyan)
|
8 |
* Author URI: http://www.gvectors.com/
|
9 |
* Plugin URI: http://www.gvectors.com/wpdiscuz/
|
46 |
$this->optimizationHelper = new WpdiscuzOptimizationHelper($this->optionsSerialized, $this->dbManager, $this->emailHelper);
|
47 |
$this->css = new WpdiscuzCss($this->optionsSerialized);
|
48 |
$this->templateBuilder = new WpdiscuzTemplateBuilder($this->helper, $this->optimizationHelper, $this->dbManager, $this->options, $this->optionsSerialized);
|
|
|
49 |
add_action('wp_head', array(&$this, 'initCurrentPostType'));
|
50 |
add_action('wp_head', array(&$this->css, 'initCustomCss'));
|
51 |
add_action('plugins_loaded', array(&$this, 'wpdiscuzTextDomain'));
|
59 |
}
|
60 |
add_action('wp_ajax_generateCaptcha', array(&$this->helper, 'generateCaptcha'));
|
61 |
add_action('wp_ajax_nopriv_generateCaptcha', array(&$this->helper, 'generateCaptcha'));
|
|
|
|
|
62 |
add_action('wp_ajax_loadMoreComments', array(&$this, 'loadMoreComments'));
|
63 |
add_action('wp_ajax_nopriv_loadMoreComments', array(&$this, 'loadMoreComments'));
|
64 |
add_action('wp_ajax_voteOnComment', array(&$this, 'voteOnComment'));
|
75 |
add_action('wp_ajax_nopriv_checkNotificationType', array(&$this->emailHelper, 'checkNotificationType'));
|
76 |
add_action('wp_ajax_redirect', array(&$this, 'redirect'));
|
77 |
add_action('wp_ajax_nopriv_redirect', array(&$this, 'redirect'));
|
78 |
+
add_action('admin_post_clearChildrenData', array(&$this->optimizationHelper, 'clearChildrenData'));
|
79 |
add_action('wp_insert_comment', array(&$this->optimizationHelper, 'addCommentToTree'), 2689, 2);
|
80 |
add_action('transition_comment_status', array(&$this->optimizationHelper, 'statusEventHandler'), 265, 3);
|
81 |
add_action('delete_comment', array(&$this->optimizationHelper, 'initSubComments'), 266);
|
132 |
foreach ($newCommentIds as $newCommentId) {
|
133 |
$comment = get_comment($newCommentId);
|
134 |
if (($comment->comment_parent && (in_array($comment->comment_parent, $visibleCommentIds) || in_array($comment->comment_parent, $newCommentIds))) || !$comment->comment_parent) {
|
135 |
+
$comments = get_comments(array('comment__in' => $newCommentId));
|
136 |
$commentHtml = wp_list_comments($commentListArgs, $comments);
|
137 |
$messageArray['message'][] = array('comment_parent' => $comment->comment_parent, 'comment_html' => $commentHtml);
|
138 |
}
|
158 |
$commentListArgs['new_loaded_class'] = 'wc-new-loaded-comment';
|
159 |
foreach ($newCommentIds as $newCommentId) {
|
160 |
$comment = get_comment($newCommentId);
|
161 |
+
$comments = get_comments(array('comment__in' => $newCommentId));
|
162 |
$commentHtml = wp_list_comments($commentListArgs, $comments);
|
163 |
$messageArray['message'][] = array('comment_parent' => $comment->comment_parent, 'comment_html' => $commentHtml);
|
164 |
}
|
379 |
parse_str($commentData);
|
380 |
$commentId = intval(trim($commentId));
|
381 |
if ($commentId) {
|
382 |
+
$comments = get_comments(array('comment__in' => $commentId));
|
383 |
$commentListArgs = $this->getCommentListArgs();
|
384 |
$commentListArgs['isSingle'] = true;
|
385 |
$commentListArgs['new_loaded_class'] = 'wc-new-loaded-comment';
|
413 |
|
414 |
public function loadMoreComments() {
|
415 |
if (isset($_POST['wpdiscuzAjaxData'])) {
|
416 |
+
global $wp_version;
|
417 |
parse_str($_POST['wpdiscuzAjaxData']);
|
418 |
$postId = intval(trim($postId));
|
419 |
$limit = intval(trim($loadAllCommnts)) ? 0 : $this->optionsSerialized->wordpressCommentPerPage;
|
420 |
$args = array('limit' => $limit);
|
421 |
$orderBy = trim($orderBy);
|
422 |
if ($orderBy == 'vote') {
|
423 |
+
if (version_compare($wp_version, '4.3.0', '>=')) {
|
424 |
+
$args['meta_key'] = self::META_KEY_VOTES;
|
425 |
+
}
|
426 |
+
$args['order'] = 'desc';
|
427 |
$args['orderby'] = 'meta_value_num';
|
428 |
$args['offset'] = intval($offset) * $limit;
|
429 |
} else {
|
524 |
* get comments by comment type
|
525 |
*/
|
526 |
public function getWPComments($args = array()) {
|
527 |
+
global $post, $wp_version;
|
528 |
$this->optionsSerialized->initPhrasesOnLoad();
|
529 |
$defaults = array(
|
530 |
'last_parent_id' => 0,
|
534 |
'order' => $this->optionsSerialized->wordpressCommentOrder,
|
535 |
'date_order' => $this->optionsSerialized->wordpressCommentOrder,
|
536 |
'limit' => $this->optionsSerialized->wordpressCommentPerPage,
|
|
|
537 |
'is_threaded' => 1,
|
538 |
'status' => 'approve'
|
539 |
);
|
540 |
+
if (version_compare($wp_version, '4.3.0', '>=')) {
|
541 |
+
$defaults['meta_key'] = WpdiscuzCore::META_KEY_VOTES;
|
542 |
+
}
|
543 |
$parsedArgs = wp_parse_args($args, $defaults);
|
544 |
$commentData = array();
|
545 |
$commentListArgs = $this->getCommentListArgs();
|
575 |
|
576 |
if ($args['comment__in']) {
|
577 |
$parentIds = $args['comment__in'];
|
578 |
+
if ($args['orderby'] == 'meta_value_num') {
|
579 |
+
$rootComments = $this->getTopVotedComments($args);
|
580 |
+
}
|
581 |
+
if (!$rootComments) {
|
582 |
+
$rootComments = get_comments($args);
|
583 |
}
|
|
|
584 |
}
|
585 |
if ($args['is_threaded']) {
|
586 |
$commentmetaIds = $this->optimizationHelper->getCommentListByParentIds($parentIds);
|
603 |
if ($this->optionsSerialized->wordpressCommentOrder == 'desc') {
|
604 |
$commentListArgs['reverse_top_level'] = false;
|
605 |
}
|
606 |
+
$commentList = get_comments(array('post_id' => $args['post_id'], 'status' => 'approve', 'order' => $this->optionsSerialized->wordpressCommentOrder));
|
607 |
}
|
608 |
return $commentList;
|
609 |
}
|
610 |
|
611 |
+
private function getTopVotedComments(&$args) {
|
612 |
+
global $wp_version;
|
613 |
+
$rootComments = array();
|
614 |
+
if (version_compare($wp_version, '4.3.0', '<')) {
|
615 |
+
foreach ($args['comment__in'] as $commentId) {
|
616 |
+
$rootComments[] = get_comment($commentId);
|
617 |
+
}
|
618 |
+
$args['order'] = 'desc';
|
619 |
+
} elseif ($this->optionsSerialized->wordpressCommentOrder == 'asc') {
|
620 |
+
add_filter('comments_clauses', array(&$this, 'filterVoteSortingOrderBY'));
|
621 |
+
}
|
622 |
+
return $rootComments;
|
623 |
+
}
|
624 |
+
|
625 |
/**
|
626 |
* register options page for plugin
|
627 |
*/
|
657 |
wp_localize_script('wpdiscuz-options-js', 'admin_options_obj', array('lastCommentId' => $realLastCommentId));
|
658 |
wp_enqueue_script('wpdiscuz-options-js');
|
659 |
wp_enqueue_script('thickbox');
|
|
|
|
|
660 |
wp_register_script('wpdiscuz-jquery-cookie', plugins_url(self::$PLUGIN_DIRECTORY . '/assets/js/jquery.cookie.min.js'), array('jquery'), '1.0.0', true);
|
661 |
wp_enqueue_script('wpdiscuz-jquery-cookie');
|
662 |
}
|
includes/class.WpdiscuzCss.php
CHANGED
@@ -15,7 +15,7 @@ class WpdiscuzCss {
|
|
15 |
global $post;
|
16 |
if ($post && in_array($post->post_type, $this->optionsSerialized->postTypes) && is_singular() && post_type_supports($post->post_type, 'comments')) {
|
17 |
?>
|
18 |
-
<style type="text/css">#wpcomm .wc_new_comment{ background:<?php echo $this->optionsSerialized->primaryColor; ?>;} #wpcomm .wc_new_reply{background:<?php echo $this->optionsSerialized->primaryColor; ?>;} #wpcomm .wc-form-wrapper{background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>;} #wpcomm select, #wpcomm textarea, #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="url"]{ border:<?php echo $this->optionsSerialized->inputBorderColor; ?> 1px solid;} #wpcomm .wc-comment .wc-comment-right{ background:<?php echo $this->optionsSerialized->commentBGColor; ?>;} #wpcomm .wc-reply .wc-comment-right{ background:<?php echo $this->optionsSerialized->replyBGColor; ?>; } #wpcomm .wc-comment-text{ font-size:<?php echo isset($this->optionsSerialized->commentTextSize) ? $this->optionsSerialized->commentTextSize : '14px'; ?>;color:<?php echo $this->optionsSerialized->commentTextColor; ?>;} <?php $blogRoles = $this->optionsSerialized->blogRoles; foreach ($blogRoles as $role => $color) { echo '#wpcomm .wc-blog-' . $role . ' > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-' . $role . ' > .wc-comment-right .wc-comment-author a{ color:' . $color . ';} '; echo '#wpcomm .wc-blog-' . $role . ' > .wc-comment-left .wc-comment-label{background:' . $color . ';}'; } ?> #wpcomm .wc-comment-footer a, #wpcomm .wc-comment-footer span.wc_editable_comment, #wpcomm .wc-comment-footer span.wc_save_edited_comment, #wpcomm span.wc_cancel_edit { color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; } #wpcomm .wc-comment-footer .wc-vote-result{ background:<?php echo $this->optionsSerialized->voteReplyColor; ?>;} #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link {color: <?php echo $this->optionsSerialized->voteReplyColor; ?>; }.wc-load-more-submit {border: 1px solid <?php echo $this->optionsSerialized->inputBorderColor; ?>;} #wc_openModalFormAction > div#wc_response_info a.close { background: url("<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/x.png'); ?>") no-repeat;}#wpcomm .wc-new-loaded-comment > .wc-comment-right {background: <?php echo $this->optionsSerialized->newLoadedCommentBGColor; ?>;} <?php echo stripslashes($this->optionsSerialized->customCss); ?> .wpdiscuz-front-actions{ background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>; } .wpdiscuz-subscribe-bar{ background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>; } .wpdiscuz-sort-buttons{ color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; } .wpdiscuz-sort-button{ color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; cursor:pointer; } .wpdiscuz-sort-button:hover{ color: <?php echo $this->optionsSerialized->primaryColor; ?>; cursor:pointer; } .wpdiscuz-sort-button-active{ color: <?php echo $this->optionsSerialized->primaryColor; ?>!important; cursor:default!important; }#wpcomm .page-numbers{ color:<?php echo $this->optionsSerialized->commentTextColor; ?>; border:<?php echo $this->optionsSerialized->commentTextColor; ?> 1px solid; } #wpcomm span.current{ background:<?php echo $this->optionsSerialized->commentTextColor; ?>; }</style>
|
19 |
<?php
|
20 |
}
|
21 |
}
|
15 |
global $post;
|
16 |
if ($post && in_array($post->post_type, $this->optionsSerialized->postTypes) && is_singular() && post_type_supports($post->post_type, 'comments')) {
|
17 |
?>
|
18 |
+
<style type="text/css">#wpcomm .wc_new_comment{ background:<?php echo $this->optionsSerialized->primaryColor; ?>;} #wpcomm .wc_new_reply{background:<?php echo $this->optionsSerialized->primaryColor; ?>;} #wpcomm .wc-form-wrapper{background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>;} #wpcomm select, #wpcomm textarea, #wpcomm input[type="text"], #wpcomm input[type="email"], #wpcomm input[type="url"]{ border:<?php echo $this->optionsSerialized->inputBorderColor; ?> 1px solid;} #wpcomm .wc-comment .wc-comment-right{ background:<?php echo $this->optionsSerialized->commentBGColor; ?>;} #wpcomm .wc-reply .wc-comment-right{ background:<?php echo $this->optionsSerialized->replyBGColor; ?>; } #wpcomm .wc-comment-text{ font-size:<?php echo isset($this->optionsSerialized->commentTextSize) ? $this->optionsSerialized->commentTextSize : '14px'; ?>;color:<?php echo $this->optionsSerialized->commentTextColor; ?>;} <?php $blogRoles = $this->optionsSerialized->blogRoles; if(!$blogRoles){echo '.wc-comment-author a{ color:#00B38F;} .wc-comment-label{background:#00B38F;}';}foreach ($blogRoles as $role => $color) { echo '#wpcomm .wc-blog-' . $role . ' > .wc-comment-right .wc-comment-author, #wpcomm .wc-blog-' . $role . ' > .wc-comment-right .wc-comment-author a{ color:' . $color . ';} '; echo '#wpcomm .wc-blog-' . $role . ' > .wc-comment-left .wc-comment-label{background:' . $color . ';}'; } ?> #wpcomm .wc-comment-footer a, #wpcomm .wc-comment-footer span.wc_editable_comment, #wpcomm .wc-comment-footer span.wc_save_edited_comment, #wpcomm span.wc_cancel_edit { color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; } #wpcomm .wc-comment-footer .wc-vote-result{ background:<?php echo $this->optionsSerialized->voteReplyColor; ?>;} #wpcomm .wc-reply-link, #wpcomm .wc-vote-link, #wpcomm .wc-share-link {color: <?php echo $this->optionsSerialized->voteReplyColor; ?>; }.wc-load-more-submit {border: 1px solid <?php echo $this->optionsSerialized->inputBorderColor; ?>;} #wc_openModalFormAction > div#wc_response_info a.close { background: url("<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/x.png'); ?>") no-repeat;}#wpcomm .wc-new-loaded-comment > .wc-comment-right {background: <?php echo $this->optionsSerialized->newLoadedCommentBGColor; ?>;} <?php echo stripslashes($this->optionsSerialized->customCss); ?> .wpdiscuz-front-actions{ background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>; } .wpdiscuz-subscribe-bar{ background:<?php echo isset($this->optionsSerialized->formBGColor) ? $this->optionsSerialized->formBGColor : '#f9f9f9'; ?>; } .wpdiscuz-sort-buttons{ color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; } .wpdiscuz-sort-button{ color:<?php echo $this->optionsSerialized->voteReplyColor; ?>; cursor:pointer; } .wpdiscuz-sort-button:hover{ color: <?php echo $this->optionsSerialized->primaryColor; ?>; cursor:pointer; } .wpdiscuz-sort-button-active{ color: <?php echo $this->optionsSerialized->primaryColor; ?>!important; cursor:default!important; }#wpcomm .page-numbers{ color:<?php echo $this->optionsSerialized->commentTextColor; ?>; border:<?php echo $this->optionsSerialized->commentTextColor; ?> 1px solid; } #wpcomm span.current{ background:<?php echo $this->optionsSerialized->commentTextColor; ?>; }</style>
|
19 |
<?php
|
20 |
}
|
21 |
}
|
manager/class.WpdiscuzDBManager.php
CHANGED
@@ -183,7 +183,7 @@ class WpdiscuzDBManager {
|
|
183 |
return $this->db->get_var("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` ORDER BY `comment_ID` DESC LIMIT 1;");
|
184 |
}
|
185 |
}
|
186 |
-
|
187 |
/**
|
188 |
* retrives new comment ids from database for current post
|
189 |
*/
|
@@ -192,8 +192,8 @@ class WpdiscuzDBManager {
|
|
192 |
$sqlCommentIds = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d AND `comment_ID` > %d AND `comment_author_email` != %s AND `comment_approved` = 1 $notInQuery ORDER BY `comment_date_gmt` $ordering;", $postId, $loadLastCommentId, $email);
|
193 |
return $this->matrixToArray($this->db->get_results($sqlCommentIds, ARRAY_N));
|
194 |
}
|
195 |
-
|
196 |
-
public function getAuthorNewReplies($visibleComments, $loadLastCommentId, $email){
|
197 |
$sqlCommentIds = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_parent` IN (SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_author_email` = %s AND `comment_ID` IN ($visibleComments)) AND `comment_approved` = 1 AND `comment_ID` > %d AND `comment_author_email` != %s ", $email, $loadLastCommentId, $email);
|
198 |
return $this->matrixToArray($this->db->get_results($sqlCommentIds, ARRAY_N));
|
199 |
}
|
@@ -249,10 +249,10 @@ class WpdiscuzDBManager {
|
|
249 |
public function getPostVotedCommentIds($args) {
|
250 |
$commentParent = $args['is_threaded'] ? 'AND `c`.`comment_parent` = 0' : '';
|
251 |
if ($args['limit']) {
|
252 |
-
$sqlPostVotedCommentIds = $this->db->prepare("SELECT `c`.`comment_ID` FROM `" . $this->dbprefix . "comments` AS `c` INNER JOIN `" . $this->dbprefix . "commentmeta` AS `cm` ON `c`.`comment_ID` = `cm`.`comment_id` WHERE `cm`.`meta_key` = 'wpdiscuz_votes' AND `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = 1 $commentParent ORDER BY (`cm`.`meta_value` + 0)
|
253 |
} else {
|
254 |
$allParentCounts = count($this->getAllParentCommentCount($args['post_id'], $args['is_threaded']));
|
255 |
-
$sqlPostVotedCommentIds = $this->db->prepare("SELECT `c`.`comment_ID` FROM `" . $this->dbprefix . "comments` AS `c` INNER JOIN `" . $this->dbprefix . "commentmeta` AS `cm` ON `c`.`comment_ID` = `cm`.`comment_id` WHERE `cm`.`meta_key` = 'wpdiscuz_votes' AND `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = 1 $commentParent ORDER BY (`cm`.`meta_value` + 0)
|
256 |
}
|
257 |
$postVotedCommentIds = $this->db->get_results($sqlPostVotedCommentIds, ARRAY_N);
|
258 |
return $this->matrixToArray($postVotedCommentIds);
|
@@ -283,7 +283,7 @@ class WpdiscuzDBManager {
|
|
283 |
} else {
|
284 |
$sql_comments = "SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE $commentParent";
|
285 |
}
|
286 |
-
$parentComments = $this->db->get_results($sql_comments, ARRAY_N);
|
287 |
return $this->matrixToArray($parentComments);
|
288 |
}
|
289 |
|
@@ -326,14 +326,35 @@ class WpdiscuzDBManager {
|
|
326 |
return $this->db->get_var($sql_comments);
|
327 |
}
|
328 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
public function addEmailNotification($id, $postID, $email, $subscriptionType, $confirm = 0) {
|
330 |
if ($subscriptionType != WpdiscuzCore::SUBSCRIPTION_COMMENT) {
|
331 |
$this->deleteCommentNotifications($id, $email);
|
332 |
}
|
333 |
$activationKey = md5($email . uniqid() . time());
|
334 |
-
$sql = $this->db->prepare("INSERT INTO `" . $this->emailNotification . "` (`email`, `subscribtion_id`, `post_id`, `subscribtion_type`, `activation_key`,`confirm`) VALUES(%s, %d, %d, %s, %s, %d);", $email, $id, $postID, $subscriptionType, $activationKey
|
335 |
$this->db->query($sql);
|
336 |
-
return $this->db->insert_id ? array('id'
|
337 |
}
|
338 |
|
339 |
public function getPostNewCommentNotification($post_id, $email) {
|
@@ -423,9 +444,9 @@ class WpdiscuzDBManager {
|
|
423 |
$sql_alter = "ALTER TABLE `" . $this->users_voted . "` MODIFY `user_id` VARCHAR(255) NOT NULL, ADD COLUMN `is_guest` TINYINT(1) DEFAULT 0, ADD INDEX `is_guest` (`is_guest`);";
|
424 |
$this->db->query($sql_alter);
|
425 |
}
|
426 |
-
|
427 |
public function alterNotificationTable() {
|
428 |
-
$sql_alter = "ALTER TABLE `"
|
429 |
$this->db->query($sql_alter);
|
430 |
}
|
431 |
|
@@ -437,4 +458,4 @@ class WpdiscuzDBManager {
|
|
437 |
return $ids;
|
438 |
}
|
439 |
|
440 |
-
}
|
183 |
return $this->db->get_var("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` ORDER BY `comment_ID` DESC LIMIT 1;");
|
184 |
}
|
185 |
}
|
186 |
+
|
187 |
/**
|
188 |
* retrives new comment ids from database for current post
|
189 |
*/
|
192 |
$sqlCommentIds = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_post_ID` = %d AND `comment_ID` > %d AND `comment_author_email` != %s AND `comment_approved` = 1 $notInQuery ORDER BY `comment_date_gmt` $ordering;", $postId, $loadLastCommentId, $email);
|
193 |
return $this->matrixToArray($this->db->get_results($sqlCommentIds, ARRAY_N));
|
194 |
}
|
195 |
+
|
196 |
+
public function getAuthorNewReplies($visibleComments, $loadLastCommentId, $email) {
|
197 |
$sqlCommentIds = $this->db->prepare("SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_parent` IN (SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE `comment_author_email` = %s AND `comment_ID` IN ($visibleComments)) AND `comment_approved` = 1 AND `comment_ID` > %d AND `comment_author_email` != %s ", $email, $loadLastCommentId, $email);
|
198 |
return $this->matrixToArray($this->db->get_results($sqlCommentIds, ARRAY_N));
|
199 |
}
|
249 |
public function getPostVotedCommentIds($args) {
|
250 |
$commentParent = $args['is_threaded'] ? 'AND `c`.`comment_parent` = 0' : '';
|
251 |
if ($args['limit']) {
|
252 |
+
$sqlPostVotedCommentIds = $this->db->prepare("SELECT `c`.`comment_ID` FROM `" . $this->dbprefix . "comments` AS `c` INNER JOIN `" . $this->dbprefix . "commentmeta` AS `cm` ON `c`.`comment_ID` = `cm`.`comment_id` WHERE `cm`.`meta_key` = 'wpdiscuz_votes' AND `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = 1 $commentParent ORDER BY (`cm`.`meta_value` + 0) desc, `c`.`comment_date_gmt` {$args['date_order']} LIMIT %d OFFSET %d", $args['post_id'], $args['limit'], $args['offset']);
|
253 |
} else {
|
254 |
$allParentCounts = count($this->getAllParentCommentCount($args['post_id'], $args['is_threaded']));
|
255 |
+
$sqlPostVotedCommentIds = $this->db->prepare("SELECT `c`.`comment_ID` FROM `" . $this->dbprefix . "comments` AS `c` INNER JOIN `" . $this->dbprefix . "commentmeta` AS `cm` ON `c`.`comment_ID` = `cm`.`comment_id` WHERE `cm`.`meta_key` = 'wpdiscuz_votes' AND `c`.`comment_post_ID` = %d AND `c`.`comment_approved` = 1 $commentParent ORDER BY (`cm`.`meta_value` + 0) desc, `c`.`comment_date_gmt` {$args['date_order']} LIMIT %d OFFSET %d", $args['post_id'], $allParentCounts, $args['viewed_comment_count']);
|
256 |
}
|
257 |
$postVotedCommentIds = $this->db->get_results($sqlPostVotedCommentIds, ARRAY_N);
|
258 |
return $this->matrixToArray($postVotedCommentIds);
|
283 |
} else {
|
284 |
$sql_comments = "SELECT `comment_ID` FROM `" . $this->dbprefix . "comments` WHERE $commentParent";
|
285 |
}
|
286 |
+
$parentComments = $this->db->get_results($sql_comments, ARRAY_N);
|
287 |
return $this->matrixToArray($parentComments);
|
288 |
}
|
289 |
|
326 |
return $this->db->get_var($sql_comments);
|
327 |
}
|
328 |
|
329 |
+
public function getCommentMeta($commentId, $metaKey) {
|
330 |
+
$sql_meta = $this->db->prepare("SELECT `comment_id`,`meta_value` FROM `" . $this->dbprefix . "commentmeta` WHERE `comment_id` = %d AND `meta_key` = %s", $commentId, $metaKey);
|
331 |
+
return $this->db->get_row($sql_meta);
|
332 |
+
}
|
333 |
+
|
334 |
+
public function checkVoteData($postId) {
|
335 |
+
$sql_query = $this->db->prepare("INSERT INTO `" . $this->dbprefix . "commentmeta` (`meta_id`,`comment_id`, `meta_key`, `meta_value`)(
|
336 |
+
SELECT cm.`meta_key` AS m_k , c.`comment_ID`, %s, IFNULL(cm.`meta_key`,'0')
|
337 |
+
FROM `" . $this->dbprefix . "comments` c
|
338 |
+
LEFT JOIN `" . $this->dbprefix . "commentmeta` cm ON cm.`comment_id` = c.`comment_ID` AND cm.`meta_key` = %s
|
339 |
+
WHERE c.`comment_post_ID` = %d
|
340 |
+
HAVING m_k IS NULL
|
341 |
+
);", WpdiscuzCore::META_KEY_VOTES, WpdiscuzCore::META_KEY_VOTES, $postId);
|
342 |
+
$this->db->query($sql_query);
|
343 |
+
}
|
344 |
+
|
345 |
+
public function clearChildrenDataFromMeta() {
|
346 |
+
$sql_query = $this->db->prepare("DELETE FROM `" . $this->dbprefix . "commentmeta` WHERE `meta_key` LIKE %s", WpdiscuzCore::META_KEY_CHILDREN);
|
347 |
+
$this->db->query($sql_query);
|
348 |
+
}
|
349 |
+
|
350 |
public function addEmailNotification($id, $postID, $email, $subscriptionType, $confirm = 0) {
|
351 |
if ($subscriptionType != WpdiscuzCore::SUBSCRIPTION_COMMENT) {
|
352 |
$this->deleteCommentNotifications($id, $email);
|
353 |
}
|
354 |
$activationKey = md5($email . uniqid() . time());
|
355 |
+
$sql = $this->db->prepare("INSERT INTO `" . $this->emailNotification . "` (`email`, `subscribtion_id`, `post_id`, `subscribtion_type`, `activation_key`,`confirm`) VALUES(%s, %d, %d, %s, %s, %d);", $email, $id, $postID, $subscriptionType, $activationKey, $confirm);
|
356 |
$this->db->query($sql);
|
357 |
+
return $this->db->insert_id ? array('id' => $this->db->insert_id, 'activation_key' => $activationKey) : false;
|
358 |
}
|
359 |
|
360 |
public function getPostNewCommentNotification($post_id, $email) {
|
444 |
$sql_alter = "ALTER TABLE `" . $this->users_voted . "` MODIFY `user_id` VARCHAR(255) NOT NULL, ADD COLUMN `is_guest` TINYINT(1) DEFAULT 0, ADD INDEX `is_guest` (`is_guest`);";
|
445 |
$this->db->query($sql_alter);
|
446 |
}
|
447 |
+
|
448 |
public function alterNotificationTable() {
|
449 |
+
$sql_alter = "ALTER TABLE `" . $this->emailNotification . "` ADD UNIQUE KEY `subscribe_unique_index` (`subscribtion_id`,`email`);";
|
450 |
$this->db->query($sql_alter);
|
451 |
}
|
452 |
|
458 |
return $ids;
|
459 |
}
|
460 |
|
461 |
+
}
|
options/class.WpdiscuzOptions.php
CHANGED
@@ -187,7 +187,6 @@ class WpdiscuzOptions {
|
|
187 |
<li><?php _e('Email Subscription', 'wpdiscuz'); ?> <?php if (class_exists('Prompt_Comment_Form_Handling')): ?> <?php _e('and Postmatic', 'wpdiscuz'); ?> <?php endif; ?></li>
|
188 |
<li><?php _e('Background and Colors', 'wpdiscuz'); ?></li>
|
189 |
<li><?php _e('Social Login', 'wpdiscuz'); ?></li>
|
190 |
-
<li><?php _e('Comments Optimization', 'wpdiscuz'); ?></li>
|
191 |
</ul>
|
192 |
<div class="resp-tabs-container options_tab_id">
|
193 |
<?php
|
@@ -197,7 +196,6 @@ class WpdiscuzOptions {
|
|
197 |
include 'options-layouts/settings-subscription.php';
|
198 |
include 'options-layouts/settings-style.php';
|
199 |
include 'options-layouts/settings-social.php';
|
200 |
-
include 'options-layouts/settings-synch-comments.php';
|
201 |
?>
|
202 |
</div>
|
203 |
</div>
|
@@ -238,15 +236,13 @@ class WpdiscuzOptions {
|
|
238 |
var activeTabIndex = $('.resp-tabs-list.options_tab_id li.resp-tab-active').index();
|
239 |
$.cookie('optionsActiveTabIndex', activeTabIndex, {expires: 30});
|
240 |
});
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
$('.resp-tabs-container.options_tab_id > div').eq(savedIndex).css('display', 'block');
|
249 |
-
}
|
250 |
});
|
251 |
</script>
|
252 |
<table class="form-table wc-form-table">
|
@@ -255,6 +251,8 @@ class WpdiscuzOptions {
|
|
255 |
<td colspan="4">
|
256 |
<p class="submit">
|
257 |
<a style="float: left;" class="button button-secondary" href="<?php echo admin_url(); ?>edit-comments.php?page=wpdiscuz_options_page&wpdiscuz_reset_options=1"><?php _e('Reset Options', 'wpdiscuz'); ?></a>
|
|
|
|
|
258 |
<input style="float: right;" type="submit" class="button button-primary" name="wc_submit_options" value="<?php _e('Save Changes', 'wpdiscuz'); ?>" />
|
259 |
</p>
|
260 |
</td>
|
187 |
<li><?php _e('Email Subscription', 'wpdiscuz'); ?> <?php if (class_exists('Prompt_Comment_Form_Handling')): ?> <?php _e('and Postmatic', 'wpdiscuz'); ?> <?php endif; ?></li>
|
188 |
<li><?php _e('Background and Colors', 'wpdiscuz'); ?></li>
|
189 |
<li><?php _e('Social Login', 'wpdiscuz'); ?></li>
|
|
|
190 |
</ul>
|
191 |
<div class="resp-tabs-container options_tab_id">
|
192 |
<?php
|
196 |
include 'options-layouts/settings-subscription.php';
|
197 |
include 'options-layouts/settings-style.php';
|
198 |
include 'options-layouts/settings-social.php';
|
|
|
199 |
?>
|
200 |
</div>
|
201 |
</div>
|
236 |
var activeTabIndex = $('.resp-tabs-list.options_tab_id li.resp-tab-active').index();
|
237 |
$.cookie('optionsActiveTabIndex', activeTabIndex, {expires: 30});
|
238 |
});
|
239 |
+
var savedIndex = $.cookie('optionsActiveTabIndex') >= 0 ? $.cookie('optionsActiveTabIndex') : 0;
|
240 |
+
$('.resp-tabs-list.options_tab_id li').removeClass('resp-tab-active');
|
241 |
+
$('.resp-tabs-container.options_tab_id > div').removeClass('resp-tab-content-active');
|
242 |
+
$('.resp-tabs-container.options_tab_id > div').css('display', 'none');
|
243 |
+
$('.resp-tabs-list.options_tab_id li').eq(savedIndex).addClass('resp-tab-active');
|
244 |
+
$('.resp-tabs-container.options_tab_id > div').eq(savedIndex).addClass('resp-tab-content-active');
|
245 |
+
$('.resp-tabs-container.options_tab_id > div').eq(savedIndex).css('display', 'block');
|
|
|
|
|
246 |
});
|
247 |
</script>
|
248 |
<table class="form-table wc-form-table">
|
251 |
<td colspan="4">
|
252 |
<p class="submit">
|
253 |
<a style="float: left;" class="button button-secondary" href="<?php echo admin_url(); ?>edit-comments.php?page=wpdiscuz_options_page&wpdiscuz_reset_options=1"><?php _e('Reset Options', 'wpdiscuz'); ?></a>
|
254 |
+
<?php $clearChildrenUrl = admin_url('admin-post.php/?action=clearChildrenData&clear=1'); ?>
|
255 |
+
<a href="<?php echo wp_nonce_url($clearChildrenUrl, 'clear_children_data'); ?>" class="button button-secondary" title="Use this button if wpDiscuz has been deactivated for a while." style="margin-left: 5px;" id="wpdiscuz_synch_comments"><?php _e('Refresh comment optimization', 'wpdiscuz'); ?></a>
|
256 |
<input style="float: right;" type="submit" class="button button-primary" name="wc_submit_options" value="<?php _e('Save Changes', 'wpdiscuz'); ?>" />
|
257 |
</p>
|
258 |
</td>
|
options/options-layouts/settings-synch-comments.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if (!defined('ABSPATH')) {
|
3 |
-
exit();
|
4 |
-
}
|
5 |
-
?>
|
6 |
-
<style>.wpdiscuz_progressbar{ background:url(<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/'); ?>assets/img/progressbar.gif) left no-repeat #FFFFFF; box-sizing:border-box; overflow:hidden; font-size:16px; color:#FFFFFF; padding:14px 0px 15px 0px; min-width:50px!important; white-space:nowrap; } </style>
|
7 |
-
<div>
|
8 |
-
<h2 style="padding:5px 10px 10px 10px; margin:0px;"><?php _e('Supercharge existing comments', 'wpdiscuz'); ?> </h2>
|
9 |
-
<p style="padding:10px; font-size:13px; font-family:Verdana, Arial, Helvetica, sans-serif;">
|
10 |
-
<?php _e("wpDiscuz 3.0 and all future 3.x versions have been named as Supercharged.
|
11 |
-
It's super fast and perfectly optimized. wpDiscuz 3 version is dozens of times faster than 1.x and 2.x versions.
|
12 |
-
The Supercharged version supports millions of comments per post, so the number of comments doesn't matter anymore.
|
13 |
-
You can use wpDiscuz for extremely large and active websites without any worry. <br />
|
14 |
-
To start using this crazy machine you should do one-time data optimization of existing comments.
|
15 |
-
All new comments will be automatically optimized. Just click on [Supercharge my comments] button and wait for 100% result.
|
16 |
-
<span style='color:#0091CD'>Please be patient. The duration of this process depends on number of your website comments. It may take minutes if you have more than 1000 comments.</span>
|
17 |
-
This process doesn't affect any data, it doesn't re-store comments in different tables, it just collects comments thread hierarchy and relationship information.<br />", 'wpdiscuz'); ?>
|
18 |
-
</p>
|
19 |
-
<div style="margin:20px 0px 30px 0px;">
|
20 |
-
<div style="max-width:400px; float:left; padding:10px; margin-right:20px;">
|
21 |
-
<?php
|
22 |
-
$realLastCommentId = $this->dbManager->getLastCommentId();
|
23 |
-
$disabled = $realLastCommentId ? '' : 'disabled="disabled"';
|
24 |
-
?>
|
25 |
-
<input id="wpdiscuz_synch_comments_count" value="25" style="width:80px;" type="number" placeholder="<?php _e('Default value is 25', 'wpdiscuz'); ?>" name="wpdiscuz_synch_comments_count"/>
|
26 |
-
<button <?php echo $disabled; ?> type="button" class="button button-primary" style="background:#4793C8;" id="wpdiscuz_synch_comments"><?php _e('Supercharge My Comments', 'wpdiscuz'); ?></button>
|
27 |
-
<br />
|
28 |
-
<span style="font-size:11px; color:#666666;"><?php _e("Number of comments per request", 'wpdiscuz'); ?></span>
|
29 |
-
</div>
|
30 |
-
<div style="min-width:354px; float:left; border-radius:4px; border:#CCCCCC 1px solid;">
|
31 |
-
<div id="wpdiscuz_progressbar_wrapper" class="wrap" style="max-width:354px; height:50px; width:100%; margin:0px;"></div>
|
32 |
-
</div>
|
33 |
-
<div style="clear:both;"></div>
|
34 |
-
<div style="font-size:13px; color:#666666; padding:10px;"><?php _e("Please note: If your comments are not optimized yet, those are hidden on front-end. All comments will be back once this process is completed.", 'wpdiscuz'); ?></div>
|
35 |
-
<div style=" padding:15px; margin:15px 0px; background:#EDFAFF; font-size:13px;">
|
36 |
-
<h3 style="margin-top:0px; padding-top:0px;">Some good tips</h3>
|
37 |
-
<p style="font-size:14px; font-weight:bold; margin-bottom:5px;"> If the [Supercharge my comments] button doesn't work:</p>
|
38 |
-
This problem comes just because you have some "Warning" errors getting outputted before the first header gets written ( or in-between ).
|
39 |
-
This is the 90% of all cases. This comes from different plugins. We can't check all those so we've created a stand-alone version of comment supercharger:
|
40 |
-
<ol>
|
41 |
-
<li style="margin-bottom:2px">Please download this file: <a href="http://wpdiscuz.com/300/wpdiscuz.zip" target="_blank">http://wpdiscuz.com/300/wpdiscuz.zip</a></li>
|
42 |
-
<li style="margin-bottom:2px">Unzip and upload wpdiscuz.php file to root directory of your WordPress site.</li>
|
43 |
-
<li style="margin-bottom:2px">Than call it like <span style="color:#FF6633">http://example.com/wpdiscuz.php</span></li>
|
44 |
-
<li style="margin-bottom:2px">This will show you a form with [Go] button. Just click on that and wait for "Done!" message.</li>
|
45 |
-
<li style="margin-bottom:2px">Remove wpdiscuz.php file from your root directory.</li>
|
46 |
-
</ol>
|
47 |
-
|
48 |
-
<p style="font-size:14px; font-weight:bold; margin-bottom:5px;">If "There are new comments for optimization [--button--]" message can't get away:</p>
|
49 |
-
Please try to post a new comment on front-end, it should fix this issue. Also don't forget to clean all caches after that.
|
50 |
-
</div>
|
51 |
-
</div>
|
52 |
-
<span style="font-size:12px; color:#666666;"> <?php _e("Note: after each deactivation of wpDiscuz, it may ask you to optimize existing comments again. It needs to make sure, that all comments, which have been added during deactivation period are also optimized.", 'wpdiscuz'); ?></span>
|
53 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: gVectors Team
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UC44WQM5XJFPA
|
4 |
Tags: wordpress comments, ajax comments, ajax, live update, live comments, realtime chat, chat, realtime commenting, mobile commenting, post comments, advanced comment, comments box, community, discussion, discuss, disqus, discuz, Disqus alternative, Livefyre alternative, Jatpack comments alternative, Facebook comments alternative, comment form, commenting, reply, comments, better comments, discussions, comment notifications, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter, email commenting, social login, boost comments, native comments
|
5 |
-
Requires at least: 4.
|
6 |
Tested up to: 4.3.1
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -92,8 +92,6 @@ IMPORTANT: If you have a Cache Plugin, please delete all caches after wpDiscuz u
|
|
92 |
1. Upload plugin folder to the '/wp-content/plugins/' directory,
|
93 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
94 |
|
95 |
-
If your're updating from wpDiscuz 1.x or from 2.x you should do one-time data optimization of existing comments. Go to Dashboard > Comments > wpDiscuz Settings > Comments Optimization Tab and click on [Supercharge my comments] button and wait for 100% result. All new comments will be automatically optimized. This process doesn't affect any data, it doesn't re-store comments in different tables, it just collects comments thread hierarchy and relationship information.
|
96 |
-
|
97 |
== Frequently Asked Questions ==
|
98 |
|
99 |
**IMPORTANT**
|
@@ -140,26 +138,33 @@ wpDiscuz Documentation: http://wpdiscuz.com/wpdiscuz-documentation/
|
|
140 |
|
141 |
== Changelog ==
|
142 |
|
|
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
wpDiscuz 3 requires at least WordPress 4.3 version.
|
147 |
-
We're currently working on core functions to make it compatible on lower versions (>3.1)
|
148 |
-
For now if your wordpress version is lower than 4.3 you can use wpDiscuz 2.1.10 . Download here: https://downloads.wordpress.org/plugin/wpdiscuz.2.2.10.zip
|
149 |
|
150 |
IMPORTANT: If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
|
151 |
|
152 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
|
155 |
-
= 3.0.1
|
156 |
|
157 |
* Tip: [Supercharge my comments] button doesn't work
|
158 |
* Tip: "There are new comments for optimization [--button--]" message can't get away
|
159 |
* Fixed Bug: CAPTCHA image doesn't work (on websites where post ajax php file is secured)
|
160 |
|
161 |
|
162 |
-
= 3.0.0
|
163 |
|
164 |
IMPORTANT: If your're updating from wpDiscuz 1.x or from 2.x you should do one-time data optimization of existing comments. Please go to Comments > wpDiscuz Settings > Comments Optimization Tab and click on [Supercharge my comments] button and wait for 100% result.
|
165 |
|
2 |
Contributors: gVectors Team
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UC44WQM5XJFPA
|
4 |
Tags: wordpress comments, ajax comments, ajax, live update, live comments, realtime chat, chat, realtime commenting, mobile commenting, post comments, advanced comment, comments box, community, discussion, discuss, disqus, discuz, Disqus alternative, Livefyre alternative, Jatpack comments alternative, Facebook comments alternative, comment form, commenting, reply, comments, better comments, discussions, comment notifications, comment template, activity, comment author, comment system, redirect, comment redirect, first commenter, email commenting, social login, boost comments, native comments
|
5 |
+
Requires at least: 4.1
|
6 |
Tested up to: 4.3.1
|
7 |
+
Stable tag: 3.0.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
92 |
1. Upload plugin folder to the '/wp-content/plugins/' directory,
|
93 |
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
94 |
|
|
|
|
|
95 |
== Frequently Asked Questions ==
|
96 |
|
97 |
**IMPORTANT**
|
138 |
|
139 |
== Changelog ==
|
140 |
|
141 |
+
= 3.0.3 =
|
142 |
|
143 |
+
wpDiscuz 3 requires at least WordPress 4.1 version.
|
144 |
+
We're currently working on core functions to make it compatible on lower versions (>3.8)
|
|
|
|
|
|
|
145 |
|
146 |
IMPORTANT: If you have a Cache Plugin and CDN, please delete all caches and purge CDN after wpDiscuz update.
|
147 |
|
148 |
+
* Added: Requires at least Wordpress 4.1
|
149 |
+
* Added: Comments auto-optimizer, you don't need to use [Supercharge My Comments] button anymore
|
150 |
+
* Optimized: Less ajax requests for CAPTCHA
|
151 |
+
* Fixed Bug: RTL issues
|
152 |
+
* Fixed Bug: Reversed subscription message on subscribe bar
|
153 |
+
* Fixed Bug: Label coloring issue
|
154 |
+
|
155 |
+
= 3.0.2 =
|
156 |
+
|
157 |
+
* Fixed Bug: Subscribe to comments bar doesn't work (redirects to admin-ajax.php)
|
158 |
|
159 |
|
160 |
+
= 3.0.1 =
|
161 |
|
162 |
* Tip: [Supercharge my comments] button doesn't work
|
163 |
* Tip: "There are new comments for optimization [--button--]" message can't get away
|
164 |
* Fixed Bug: CAPTCHA image doesn't work (on websites where post ajax php file is secured)
|
165 |
|
166 |
|
167 |
+
= 3.0.0 =
|
168 |
|
169 |
IMPORTANT: If your're updating from wpDiscuz 1.x or from 2.x you should do one-time data optimization of existing comments. Please go to Comments > wpDiscuz Settings > Comments Optimization Tab and click on [Supercharge my comments] button and wait for 100% result.
|
170 |
|
templates/comment/class.WpdiscuzTemplateBuilder.php
CHANGED
@@ -84,7 +84,7 @@ class WpdiscuzTemplateBuilder {
|
|
84 |
$commentWrapperClass .= ($comment->comment_parent && $this->optionsSerialized->wordpressThreadComments) && !$args['isSingle'] ? 'wc-comment wc-reply' : 'wc-comment';
|
85 |
$hideReplyHtml = '<span class="wc-toggle" style="display:block;">' . $this->optionsSerialized->phrases['wc_hide_replies_text'] . ' ∧' . '</span>';
|
86 |
}
|
87 |
-
$voteCount = isset($comment->meta_value) ? $comment->meta_value :
|
88 |
$unique_id = $comment->comment_ID . '_' . $comment->comment_parent;
|
89 |
|
90 |
$authorName = $this->getAuthorName($comment);
|
84 |
$commentWrapperClass .= ($comment->comment_parent && $this->optionsSerialized->wordpressThreadComments) && !$args['isSingle'] ? 'wc-comment wc-reply' : 'wc-comment';
|
85 |
$hideReplyHtml = '<span class="wc-toggle" style="display:block;">' . $this->optionsSerialized->phrases['wc_hide_replies_text'] . ' ∧' . '</span>';
|
86 |
}
|
87 |
+
$voteCount = isset($comment->meta_value) ? $comment->meta_value : get_comment_meta($comment->comment_ID, WpdiscuzCore::META_KEY_VOTES, true);
|
88 |
$unique_id = $comment->comment_ID . '_' . $comment->comment_parent;
|
89 |
|
90 |
$authorName = $this->getAuthorName($comment);
|
templates/comment/comment-form.php
CHANGED
@@ -4,9 +4,8 @@ if (!defined('ABSPATH')) {
|
|
4 |
}
|
5 |
global $wpdiscuz, $post, $current_user;
|
6 |
get_currentuserinfo();
|
7 |
-
$wpdiscuz->
|
8 |
$commentsCount = $wpdiscuz->dbManager->getCommentsCount($post->ID);
|
9 |
-
$savedLastCommentId = get_option(WpdiscuzCore::OPTION_SLUG_OPTIMIZED_LAST_COMMENT_ID);
|
10 |
$header_text = '<span class="wc_header_text_count">' . $commentsCount . '</span> ';
|
11 |
$header_text .= ($commentsCount > 1) ? $wpdiscuz->optionsSerialized->phrases['wc_header_text_plural'] : $wpdiscuz->optionsSerialized->phrases['wc_header_text'];
|
12 |
$header_text .= ' ' . $wpdiscuz->optionsSerialized->phrases['wc_header_on_text'];
|
@@ -97,7 +96,7 @@ if (comments_open($post->ID)) {
|
|
97 |
}
|
98 |
?>
|
99 |
<div id="wpcomm" class="<?php echo (is_user_logged_in()) ? 'wpdiscuz_auth' : 'wpdiscuz_unauth'; ?>">
|
100 |
-
<?php if (!$wpdiscuz->optionsSerialized->headerTextShowHide
|
101 |
<div class="wc-comment-bar">
|
102 |
<p class="wc-comment-title">
|
103 |
<?php echo ($commentsCount) ? $header_text : $wpdiscuz->optionsSerialized->phrases['wc_be_the_first_text']; ?>
|
@@ -116,7 +115,7 @@ if (comments_open($post->ID)) {
|
|
116 |
?>
|
117 |
</div>
|
118 |
<?php
|
119 |
-
if ($wpdiscuz->optionsSerialized->showSubscriptionBar
|
120 |
$subscriptionData = $wpdiscuz->dbManager->hasSubscription($post->ID, $current_user->user_email);
|
121 |
$isConfirmed = $subscriptionData['confirm'];
|
122 |
$subscriptionType = $subscriptionData['type'];
|
@@ -153,9 +152,9 @@ if (comments_open($post->ID)) {
|
|
153 |
if (isset($unsubscribeLink)) {
|
154 |
$subscribeMessage = $isConfirmed ? $wpdiscuz->optionsSerialized->phrases['wc_unsubscribe'] : $wpdiscuz->optionsSerialized->phrases['wc_ignore_subscription'];
|
155 |
if ($subscriptionType == 'all_comment')
|
156 |
-
$introText = $wpdiscuz->optionsSerialized->phrases['wc_subscribed_to'] . ' ' . $wpdiscuz->optionsSerialized->phrases['wc_notify_on_new_comment'];
|
157 |
-
elseif ($subscriptionType == 'post')
|
158 |
$introText = $wpdiscuz->optionsSerialized->phrases['wc_subscribed_to'] . ' ' . $wpdiscuz->optionsSerialized->phrases['wc_notify_on_all_new_reply'];
|
|
|
|
|
159 |
echo '<div class="wpdiscuz_subscribe_status">' . $introText . " | <a href='$unsubscribeLink'>" . $subscribeMessage . "</a></div>";
|
160 |
}
|
161 |
?>
|
@@ -181,25 +180,23 @@ if (comments_open($post->ID)) {
|
|
181 |
<div id="wpcomm" class="<?php echo (is_user_logged_in()) ? 'wpdiscuz_auth' : 'wpdiscuz_unauth'; ?>" style="border:none;">
|
182 |
<?php } ?>
|
183 |
|
184 |
-
<?php if ($
|
185 |
-
|
186 |
-
<div class="wpdiscuz-
|
187 |
-
<
|
188 |
-
|
189 |
-
|
190 |
-
<span class="wpdiscuz-sort-button wpdiscuz-vote-sort-up"><?php echo $wpdiscuz->optionsSerialized->phrases['wc_most_voted']; ?></span>
|
191 |
-
</div>
|
192 |
</div>
|
193 |
-
|
|
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
<div style="clear:both"></div>
|
200 |
-
</div>
|
201 |
<div style="clear:both"></div>
|
202 |
-
|
|
|
203 |
<?php } ?>
|
204 |
<div class="wc-thread-wrapper">
|
205 |
<?php
|
@@ -216,7 +213,7 @@ if (comments_open($post->ID)) {
|
|
216 |
?>
|
217 |
<div class="wpdiscuz-comment-pagination">
|
218 |
<?php
|
219 |
-
if (!$wpdiscuz->optionsSerialized->wordpressIsPaginate && $commentData['is_show_load_more']
|
220 |
$loadMoreButtonText = ($wpdiscuz->optionsSerialized->loadAllComments) ? $wpdiscuz->optionsSerialized->phrases['wc_load_rest_comments_submit_text'] : $wpdiscuz->optionsSerialized->phrases['wc_load_more_submit_text'];
|
221 |
?>
|
222 |
<div class="wc-load-more-submit-wrap">
|
@@ -238,7 +235,7 @@ if (comments_open($post->ID)) {
|
|
238 |
<?php if ($wpdiscuz->optionsSerialized->showPluginPoweredByLink) { ?>
|
239 |
<div class="by-wpdiscuz">
|
240 |
<span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
|
241 |
-
|
242 |
<img src="<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/>
|
243 |
</span>
|
244 |
<a href="http://wpdiscuz.com/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option(WpdiscuzCore::OPTION_SLUG_VERSION); ?> - Supercharged native comments">wpDiscuz</a>
|
4 |
}
|
5 |
global $wpdiscuz, $post, $current_user;
|
6 |
get_currentuserinfo();
|
7 |
+
$wpdiscuz->dbManager->checkVoteData($post->ID);
|
8 |
$commentsCount = $wpdiscuz->dbManager->getCommentsCount($post->ID);
|
|
|
9 |
$header_text = '<span class="wc_header_text_count">' . $commentsCount . '</span> ';
|
10 |
$header_text .= ($commentsCount > 1) ? $wpdiscuz->optionsSerialized->phrases['wc_header_text_plural'] : $wpdiscuz->optionsSerialized->phrases['wc_header_text'];
|
11 |
$header_text .= ' ' . $wpdiscuz->optionsSerialized->phrases['wc_header_on_text'];
|
96 |
}
|
97 |
?>
|
98 |
<div id="wpcomm" class="<?php echo (is_user_logged_in()) ? 'wpdiscuz_auth' : 'wpdiscuz_unauth'; ?>">
|
99 |
+
<?php if (!$wpdiscuz->optionsSerialized->headerTextShowHide) { ?>
|
100 |
<div class="wc-comment-bar">
|
101 |
<p class="wc-comment-title">
|
102 |
<?php echo ($commentsCount) ? $header_text : $wpdiscuz->optionsSerialized->phrases['wc_be_the_first_text']; ?>
|
115 |
?>
|
116 |
</div>
|
117 |
<?php
|
118 |
+
if ($wpdiscuz->optionsSerialized->showSubscriptionBar) {
|
119 |
$subscriptionData = $wpdiscuz->dbManager->hasSubscription($post->ID, $current_user->user_email);
|
120 |
$isConfirmed = $subscriptionData['confirm'];
|
121 |
$subscriptionType = $subscriptionData['type'];
|
152 |
if (isset($unsubscribeLink)) {
|
153 |
$subscribeMessage = $isConfirmed ? $wpdiscuz->optionsSerialized->phrases['wc_unsubscribe'] : $wpdiscuz->optionsSerialized->phrases['wc_ignore_subscription'];
|
154 |
if ($subscriptionType == 'all_comment')
|
|
|
|
|
155 |
$introText = $wpdiscuz->optionsSerialized->phrases['wc_subscribed_to'] . ' ' . $wpdiscuz->optionsSerialized->phrases['wc_notify_on_all_new_reply'];
|
156 |
+
elseif ($subscriptionType == 'post')
|
157 |
+
$introText = $wpdiscuz->optionsSerialized->phrases['wc_subscribed_to'] . ' ' . $wpdiscuz->optionsSerialized->phrases['wc_notify_on_new_comment'];
|
158 |
echo '<div class="wpdiscuz_subscribe_status">' . $introText . " | <a href='$unsubscribeLink'>" . $subscribeMessage . "</a></div>";
|
159 |
}
|
160 |
?>
|
180 |
<div id="wpcomm" class="<?php echo (is_user_logged_in()) ? 'wpdiscuz_auth' : 'wpdiscuz_unauth'; ?>" style="border:none;">
|
181 |
<?php } ?>
|
182 |
|
183 |
+
<?php if ($commentsCount > 0 && $wpdiscuz->optionsSerialized->showSortingButtons && !$wpdiscuz->optionsSerialized->wordpressIsPaginate) { ?>
|
184 |
+
<div class="wpdiscuz-front-actions">
|
185 |
+
<div class="wpdiscuz-sort-buttons" style="font-size:14px;"><?php echo $wpdiscuz->optionsSerialized->phrases['wc_sort_by']; ?>:
|
186 |
+
<span class="wpdiscuz-sort-button wpdiscuz-date-sort-desc"><?php echo $wpdiscuz->optionsSerialized->phrases['wc_newest']; ?></span> |
|
187 |
+
<span class="wpdiscuz-sort-button wpdiscuz-date-sort-asc"><?php echo $wpdiscuz->optionsSerialized->phrases['wc_oldest']; ?></span> |
|
188 |
+
<span class="wpdiscuz-sort-button wpdiscuz-vote-sort-up"><?php echo $wpdiscuz->optionsSerialized->phrases['wc_most_voted']; ?></span>
|
|
|
|
|
189 |
</div>
|
190 |
+
</div>
|
191 |
+
<?php } ?>
|
192 |
|
193 |
+
<?php if ($wpdiscuz->optionsSerialized->commentListUpdateType == 2) { ?>
|
194 |
+
<div class="wc_new_comment_and_replies">
|
195 |
+
<div class="wc_new_comment wc-update-on-click"></div>
|
196 |
+
<div class="wc_new_reply wc-update-on-click"></div>
|
|
|
|
|
197 |
<div style="clear:both"></div>
|
198 |
+
</div>
|
199 |
+
<div style="clear:both"></div>
|
200 |
<?php } ?>
|
201 |
<div class="wc-thread-wrapper">
|
202 |
<?php
|
213 |
?>
|
214 |
<div class="wpdiscuz-comment-pagination">
|
215 |
<?php
|
216 |
+
if (!$wpdiscuz->optionsSerialized->wordpressIsPaginate && $commentData['is_show_load_more']) {
|
217 |
$loadMoreButtonText = ($wpdiscuz->optionsSerialized->loadAllComments) ? $wpdiscuz->optionsSerialized->phrases['wc_load_rest_comments_submit_text'] : $wpdiscuz->optionsSerialized->phrases['wc_load_more_submit_text'];
|
218 |
?>
|
219 |
<div class="wc-load-more-submit-wrap">
|
235 |
<?php if ($wpdiscuz->optionsSerialized->showPluginPoweredByLink) { ?>
|
236 |
<div class="by-wpdiscuz">
|
237 |
<span id="awpdiscuz" onclick='javascript:document.getElementById("bywpdiscuz").style.display = "inline";
|
238 |
+
document.getElementById("awpdiscuz").style.display = "none";'>
|
239 |
<img src="<?php echo plugins_url(WpdiscuzCore::$PLUGIN_DIRECTORY . '/assets/img/plugin-icon/icon_info.png'); ?>" align="absmiddle" class="wpdimg"/>
|
240 |
</span>
|
241 |
<a href="http://wpdiscuz.com/" id="bywpdiscuz" title="wpDiscuz v<?php echo get_option(WpdiscuzCore::OPTION_SLUG_VERSION); ?> - Supercharged native comments">wpDiscuz</a>
|
utils/class.WpdiscuzOptimizationHelper.php
CHANGED
@@ -14,34 +14,6 @@ class WpdiscuzOptimizationHelper {
|
|
14 |
$this->emailHelper = $emailHelper;
|
15 |
}
|
16 |
|
17 |
-
public function synchronizeComments() {
|
18 |
-
if (isset($_POST['commentsCountPerRequest']) && $commentsCountPerRequest = abs(intval($_POST['commentsCountPerRequest']))) {
|
19 |
-
$commentsCountPerRequest = $commentsCountPerRequest > 100 ? 100 : $commentsCountPerRequest;
|
20 |
-
$commentsCountPerRequest = $commentsCountPerRequest < 10 ? 10 : $commentsCountPerRequest;
|
21 |
-
} else {
|
22 |
-
$commentsCountPerRequest = 25;
|
23 |
-
}
|
24 |
-
$synchronizedComments = isset($_POST['synchronizedComments']) ? intval(trim($_POST['synchronizedComments'])) : 0;
|
25 |
-
$offset = isset($_POST['offset']) ? intval(trim($_POST['offset'])) * $commentsCountPerRequest : 0;
|
26 |
-
$comment_ids = $this->dbManager->getAllComments($commentsCountPerRequest, $offset);
|
27 |
-
foreach ($comment_ids as $comment_id) {
|
28 |
-
$comment = get_comment($comment_id);
|
29 |
-
if (!$comment->comment_parent) {
|
30 |
-
$this->setSubComment($comment_id);
|
31 |
-
$synchronizedComments++;
|
32 |
-
}
|
33 |
-
update_comment_meta($comment_id, WpdiscuzCore::META_KEY_VOTES, intval(get_comment_meta($comment_id, WpdiscuzCore::META_KEY_VOTES, true)));
|
34 |
-
}
|
35 |
-
$all_comment_count = count($this->dbManager->getAllParentCommentCount());
|
36 |
-
$progress = intval($synchronizedComments * 100 / $all_comment_count);
|
37 |
-
if ($progress == 100) {
|
38 |
-
$progress = __('Complete', 'wpdiscuz');
|
39 |
-
update_option(WpdiscuzCore::OPTION_SLUG_OPTIMIZED_LAST_COMMENT_ID, $comment_id);
|
40 |
-
}
|
41 |
-
$messageArray = array('wpdiscuz_progress' => $progress, 'synchronizedComments' => $synchronizedComments);
|
42 |
-
wp_die(json_encode($messageArray));
|
43 |
-
}
|
44 |
-
|
45 |
public function setSubComment($commentId) {
|
46 |
$childCommentIds = array();
|
47 |
$this->getCommentsTree(array($commentId), $childCommentIds);
|
@@ -50,7 +22,7 @@ class WpdiscuzOptimizationHelper {
|
|
50 |
$childCommentIdsString .=',';
|
51 |
}
|
52 |
update_comment_meta($commentId, WpdiscuzCore::META_KEY_CHILDREN, $childCommentIdsString);
|
53 |
-
return $
|
54 |
}
|
55 |
|
56 |
/**
|
@@ -92,9 +64,12 @@ class WpdiscuzOptimizationHelper {
|
|
92 |
public function getCommentListByParentIds($comment_ids) {
|
93 |
$comments = array();
|
94 |
foreach ($comment_ids as $comment_id) {
|
95 |
-
$children =
|
96 |
-
if (
|
97 |
-
$children =
|
|
|
|
|
|
|
98 |
$comments = array_merge($comments, $children);
|
99 |
}
|
100 |
}
|
@@ -112,7 +87,9 @@ class WpdiscuzOptimizationHelper {
|
|
112 |
$this->updateCommentTree($comment);
|
113 |
}
|
114 |
update_comment_meta($id, WpdiscuzCore::META_KEY_VOTES, 0);
|
115 |
-
|
|
|
|
|
116 |
}
|
117 |
}
|
118 |
|
@@ -205,21 +182,6 @@ class WpdiscuzOptimizationHelper {
|
|
205 |
}
|
206 |
}
|
207 |
|
208 |
-
public function wpdiscuzRequirements() {
|
209 |
-
$realLastCommentId = $this->dbManager->getLastCommentId();
|
210 |
-
if ($realLastCommentId) {
|
211 |
-
$savedLastCommentId = intval(get_option(WpdiscuzCore::OPTION_SLUG_OPTIMIZED_LAST_COMMENT_ID));
|
212 |
-
$synchronizeTabLink = '<a class="button button-primary" style="margin: 10px 0;" href="' . admin_url() . 'edit-comments.php?page=wpdiscuz_options_page#optionsTab7">' . __('Go to comment optimization page', 'wpdiscuz') . '</a>';
|
213 |
-
if (!$savedLastCommentId) {
|
214 |
-
echo "<div class='error'><p style='font-size: 14px;line-height: 20px;'>" . __('To start using wpDiscuz 3 you should do one-time data optimization of existing comments. All new comments will be automatically optimized. Just click on [Supercharge my comments] button and wait for 100% result > ', 'wpdiscuz') . $synchronizeTabLink . "</p></div>";
|
215 |
-
} else {
|
216 |
-
if ($savedLastCommentId && $savedLastCommentId < $realLastCommentId) {
|
217 |
-
echo "<div class='error'><p style='font-size: 14px;line-height: 20px;'>" . __('There are new comments for optimization! ', 'wpdiscuz') . $synchronizeTabLink . "</p></div>";
|
218 |
-
}
|
219 |
-
}
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
private function notifyOnApprove($comment) {
|
224 |
$postId = $comment->comment_post_ID;
|
225 |
$commentId = $comment->comment_ID;
|
@@ -234,5 +196,12 @@ class WpdiscuzOptimizationHelper {
|
|
234 |
}
|
235 |
}
|
236 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
}
|
14 |
$this->emailHelper = $emailHelper;
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
public function setSubComment($commentId) {
|
18 |
$childCommentIds = array();
|
19 |
$this->getCommentsTree(array($commentId), $childCommentIds);
|
22 |
$childCommentIdsString .=',';
|
23 |
}
|
24 |
update_comment_meta($commentId, WpdiscuzCore::META_KEY_CHILDREN, $childCommentIdsString);
|
25 |
+
return $childCommentIds;
|
26 |
}
|
27 |
|
28 |
/**
|
64 |
public function getCommentListByParentIds($comment_ids) {
|
65 |
$comments = array();
|
66 |
foreach ($comment_ids as $comment_id) {
|
67 |
+
$children = $this->dbManager->getCommentMeta($comment_id, WpdiscuzCore::META_KEY_CHILDREN);
|
68 |
+
if (!$children) {
|
69 |
+
$children = $this->setSubComment($comment_id);
|
70 |
+
$comments = array_merge($comments, $children);
|
71 |
+
} elseif ($children && $children->meta_value) {
|
72 |
+
$children = array_filter(explode(',', $children->meta_value));
|
73 |
$comments = array_merge($comments, $children);
|
74 |
}
|
75 |
}
|
87 |
$this->updateCommentTree($comment);
|
88 |
}
|
89 |
update_comment_meta($id, WpdiscuzCore::META_KEY_VOTES, 0);
|
90 |
+
if (!$comment->comment_parent) {
|
91 |
+
update_comment_meta($id, WpdiscuzCore::META_KEY_CHILDREN, '');
|
92 |
+
}
|
93 |
}
|
94 |
}
|
95 |
|
182 |
}
|
183 |
}
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
private function notifyOnApprove($comment) {
|
186 |
$postId = $comment->comment_post_ID;
|
187 |
$commentId = $comment->comment_ID;
|
196 |
}
|
197 |
}
|
198 |
}
|
199 |
+
|
200 |
+
public function clearChildrenData(){
|
201 |
+
if (isset($_GET['_wpnonce']) && wp_verify_nonce($_GET['_wpnonce'], 'clear_children_data') && isset($_GET['clear']) && trim($_GET['clear']) && current_user_can('manage_options')) {
|
202 |
+
$this->dbManager->clearChildrenDataFromMeta();
|
203 |
+
}
|
204 |
+
wp_redirect(admin_url('edit-comments.php?page=wpdiscuz_options_page'));
|
205 |
+
}
|
206 |
|
207 |
}
|
utils/interface.WpDiscuzConstants.php
CHANGED
@@ -4,7 +4,6 @@ interface WpDiscuzConstants {
|
|
4 |
|
5 |
const OPTION_SLUG_OPTIONS = 'wc_options';
|
6 |
const OPTION_SLUG_VERSION = 'wc_plugin_version';
|
7 |
-
const OPTION_SLUG_OPTIMIZED_LAST_COMMENT_ID = 'wpdiscuz_optimized_last_comment_id';
|
8 |
const META_KEY_CHILDREN = 'wpdiscuz_child_ids';
|
9 |
const META_KEY_VOTES = 'wpdiscuz_votes';
|
10 |
const JS_MAIN_FORM_TIME_OUT = 30;
|
4 |
|
5 |
const OPTION_SLUG_OPTIONS = 'wc_options';
|
6 |
const OPTION_SLUG_VERSION = 'wc_plugin_version';
|
|
|
7 |
const META_KEY_CHILDREN = 'wpdiscuz_child_ids';
|
8 |
const META_KEY_VOTES = 'wpdiscuz_votes';
|
9 |
const JS_MAIN_FORM_TIME_OUT = 30;
|