Changeset 2051011
- Timestamp:
- 03/15/2019 04:51:05 AM (7 years ago)
- Location:
- dw-question-answer
- Files:
-
- 182 added
- 1 deleted
- 6 edited
-
tags/1.5.6 (added)
-
tags/1.5.6/assets (added)
-
tags/1.5.6/assets/banner-772x250.jpg (added)
-
tags/1.5.6/assets/css (added)
-
tags/1.5.6/assets/css/admin-style.css (added)
-
tags/1.5.6/assets/css/dwqa-akismet-button-report-spam.css (added)
-
tags/1.5.6/assets/css/email-template-editor.css (added)
-
tags/1.5.6/assets/css/prettify.css (added)
-
tags/1.5.6/assets/css/style.css (added)
-
tags/1.5.6/assets/css/tinymce.css (added)
-
tags/1.5.6/assets/img (added)
-
tags/1.5.6/assets/img/dw-captcha.png (added)
-
tags/1.5.6/assets/img/dw-embedquestion.png (added)
-
tags/1.5.6/assets/img/dw-leaderboard.png (added)
-
tags/1.5.6/assets/img/dw-markdown.png (added)
-
tags/1.5.6/assets/img/dw-widgets.png (added)
-
tags/1.5.6/assets/img/dwqa-140-1.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-2.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-3.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-4.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-5.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-6.gif (added)
-
tags/1.5.6/assets/img/dwqa-140-7.gif (added)
-
tags/1.5.6/assets/js (added)
-
tags/1.5.6/assets/js/admin-pointer-helper.js (added)
-
tags/1.5.6/assets/js/admin-settings-page.js (added)
-
tags/1.5.6/assets/js/code-edit-button.js (added)
-
tags/1.5.6/assets/js/dwqa-akismet-button-report-spam.js (added)
-
tags/1.5.6/assets/js/prettify.js (added)
-
tags/1.5.6/assets/less (added)
-
tags/1.5.6/assets/less/mixins.less (added)
-
tags/1.5.6/assets/less/variables.less (added)
-
tags/1.5.6/dw-question-answer.php (added)
-
tags/1.5.6/dwqa-dummy-data.xml (added)
-
tags/1.5.6/inc (added)
-
tags/1.5.6/inc/Admin (added)
-
tags/1.5.6/inc/Admin/Extensions.php (added)
-
tags/1.5.6/inc/Admin/Welcome.php (added)
-
tags/1.5.6/inc/Ajax.php (added)
-
tags/1.5.6/inc/Akismet.php (added)
-
tags/1.5.6/inc/Answer_List_Table.php (added)
-
tags/1.5.6/inc/Autoclosure.php (added)
-
tags/1.5.6/inc/Editor.php (added)
-
tags/1.5.6/inc/Filter.php (added)
-
tags/1.5.6/inc/Handle.php (added)
-
tags/1.5.6/inc/Helptab.php (added)
-
tags/1.5.6/inc/Metaboxes.php (added)
-
tags/1.5.6/inc/Notifications.php (added)
-
tags/1.5.6/inc/Permission.php (added)
-
tags/1.5.6/inc/PointerHelper.php (added)
-
tags/1.5.6/inc/Posts (added)
-
tags/1.5.6/inc/Posts/Answer.php (added)
-
tags/1.5.6/inc/Posts/Base.php (added)
-
tags/1.5.6/inc/Posts/Comment.php (added)
-
tags/1.5.6/inc/Posts/Question.php (added)
-
tags/1.5.6/inc/Rewrite.php (added)
-
tags/1.5.6/inc/Session.php (added)
-
tags/1.5.6/inc/Settings.php (added)
-
tags/1.5.6/inc/Shortcode.php (added)
-
tags/1.5.6/inc/Status.php (added)
-
tags/1.5.6/inc/Template.php (added)
-
tags/1.5.6/inc/Updater.php (added)
-
tags/1.5.6/inc/User.php (added)
-
tags/1.5.6/inc/Walker (added)
-
tags/1.5.6/inc/Walker/Category.php (added)
-
tags/1.5.6/inc/Walker/Tag.php (added)
-
tags/1.5.6/inc/autoload.php (added)
-
tags/1.5.6/inc/deprecated.php (added)
-
tags/1.5.6/inc/extend (added)
-
tags/1.5.6/inc/extend/buddypress (added)
-
tags/1.5.6/inc/extend/buddypress/functions.php (added)
-
tags/1.5.6/inc/extend/buddypress/index.php (added)
-
tags/1.5.6/inc/extend/buddypress/loader.php (added)
-
tags/1.5.6/inc/extend/buddypress/notifications.php (added)
-
tags/1.5.6/inc/helper (added)
-
tags/1.5.6/inc/helper/functions.php (added)
-
tags/1.5.6/inc/helper/plugin-compatibility.php (added)
-
tags/1.5.6/inc/helper/theme-compatibility.php (added)
-
tags/1.5.6/inc/widgets (added)
-
tags/1.5.6/inc/widgets/Closed_Question.php (added)
-
tags/1.5.6/inc/widgets/Latest_Question.php (added)
-
tags/1.5.6/inc/widgets/Popular_Question.php (added)
-
tags/1.5.6/inc/widgets/Related_Question.php (added)
-
tags/1.5.6/languages (added)
-
tags/1.5.6/languages/dw-question-answer-ar.mo (added)
-
tags/1.5.6/languages/dw-question-answer-ar.po (added)
-
tags/1.5.6/languages/dw-question-answer-ca.mo (added)
-
tags/1.5.6/languages/dw-question-answer-ca.po (added)
-
tags/1.5.6/languages/dw-question-answer-cs_CZ.mo (added)
-
tags/1.5.6/languages/dw-question-answer-cs_CZ.po (added)
-
tags/1.5.6/languages/dw-question-answer-de_DE.mo (added)
-
tags/1.5.6/languages/dw-question-answer-de_DE.po (added)
-
tags/1.5.6/languages/dw-question-answer-es_ES.mo (added)
-
tags/1.5.6/languages/dw-question-answer-es_ES.po (added)
-
tags/1.5.6/languages/dw-question-answer-fa_IR.mo (added)
-
tags/1.5.6/languages/dw-question-answer-fa_IR.po (added)
-
tags/1.5.6/languages/dw-question-answer-fr_FR.mo (added)
-
tags/1.5.6/languages/dw-question-answer-fr_FR.po (added)
-
tags/1.5.6/languages/dw-question-answer-he_IL.mo (added)
-
tags/1.5.6/languages/dw-question-answer-he_IL.po (added)
-
tags/1.5.6/languages/dw-question-answer-hi_IN.mo (added)
-
tags/1.5.6/languages/dw-question-answer-hi_IN.po (added)
-
tags/1.5.6/languages/dw-question-answer-hr.mo (added)
-
tags/1.5.6/languages/dw-question-answer-hr.po (added)
-
tags/1.5.6/languages/dw-question-answer-id_ID.mo (added)
-
tags/1.5.6/languages/dw-question-answer-id_ID.po (added)
-
tags/1.5.6/languages/dw-question-answer-it_IT.mo (added)
-
tags/1.5.6/languages/dw-question-answer-it_IT.po (added)
-
tags/1.5.6/languages/dw-question-answer-ko_KR.mo (added)
-
tags/1.5.6/languages/dw-question-answer-ko_KR.po (added)
-
tags/1.5.6/languages/dw-question-answer-nb_NO.mo (added)
-
tags/1.5.6/languages/dw-question-answer-nb_NO.po (added)
-
tags/1.5.6/languages/dw-question-answer-nl_NL.mo (added)
-
tags/1.5.6/languages/dw-question-answer-nl_NL.po (added)
-
tags/1.5.6/languages/dw-question-answer-pl_PL.mo (added)
-
tags/1.5.6/languages/dw-question-answer-pl_PL.po (added)
-
tags/1.5.6/languages/dw-question-answer-pt_BR.mo (added)
-
tags/1.5.6/languages/dw-question-answer-pt_BR.po (added)
-
tags/1.5.6/languages/dw-question-answer-ro_RO.mo (added)
-
tags/1.5.6/languages/dw-question-answer-ro_RO.po (added)
-
tags/1.5.6/languages/dw-question-answer-ru_RU.mo (added)
-
tags/1.5.6/languages/dw-question-answer-ru_RU.po (added)
-
tags/1.5.6/languages/dw-question-answer-sk_SK.mo (added)
-
tags/1.5.6/languages/dw-question-answer-sk_SK.po (added)
-
tags/1.5.6/languages/dw-question-answer-sv_SE.mo (added)
-
tags/1.5.6/languages/dw-question-answer-sv_SE.po (added)
-
tags/1.5.6/languages/dw-question-answer-th.mo (added)
-
tags/1.5.6/languages/dw-question-answer-th.po (added)
-
tags/1.5.6/languages/dw-question-answer-th_TH.mo (added)
-
tags/1.5.6/languages/dw-question-answer-th_TH.po (added)
-
tags/1.5.6/languages/dw-question-answer-tr_TR.mo (added)
-
tags/1.5.6/languages/dw-question-answer-tr_TR.po (added)
-
tags/1.5.6/languages/dw-question-answer-vi.mo (added)
-
tags/1.5.6/languages/dw-question-answer-vi.po (added)
-
tags/1.5.6/languages/dw-question-answer-zh_CN.mo (added)
-
tags/1.5.6/languages/dw-question-answer-zh_CN.po (added)
-
tags/1.5.6/languages/dw-question-answer-zh_TW.mo (added)
-
tags/1.5.6/languages/dw-question-answer-zh_TW.po (added)
-
tags/1.5.6/languages/dw-question-answer.pot (added)
-
tags/1.5.6/lib (added)
-
tags/1.5.6/lib/easy-digital-downloads (added)
-
tags/1.5.6/lib/easy-digital-downloads/EDD_SL_Plugin_Updater.php (added)
-
tags/1.5.6/readme.md (added)
-
tags/1.5.6/readme.txt (added)
-
tags/1.5.6/templates (added)
-
tags/1.5.6/templates/answer-submit-form.php (added)
-
tags/1.5.6/templates/answers.php (added)
-
tags/1.5.6/templates/archive-question-filter.php (added)
-
tags/1.5.6/templates/archive-question.php (added)
-
tags/1.5.6/templates/assets (added)
-
tags/1.5.6/templates/assets/css (added)
-
tags/1.5.6/templates/assets/css/editor-style.css (added)
-
tags/1.5.6/templates/assets/css/rtl.css (added)
-
tags/1.5.6/templates/assets/css/style.css (added)
-
tags/1.5.6/templates/assets/img (added)
-
tags/1.5.6/templates/assets/img/icon-loading.gif (added)
-
tags/1.5.6/templates/assets/img/icon-search.png (added)
-
tags/1.5.6/templates/assets/js (added)
-
tags/1.5.6/templates/assets/js/dwqa-questions-list.js (added)
-
tags/1.5.6/templates/assets/js/dwqa-single-question.js (added)
-
tags/1.5.6/templates/assets/js/dwqa-submit-question.js (added)
-
tags/1.5.6/templates/bp-archive-question.php (added)
-
tags/1.5.6/templates/captcha-form.php (added)
-
tags/1.5.6/templates/comments.php (added)
-
tags/1.5.6/templates/content-comment.php (added)
-
tags/1.5.6/templates/content-edit.php (added)
-
tags/1.5.6/templates/content-none.php (added)
-
tags/1.5.6/templates/content-question.php (added)
-
tags/1.5.6/templates/content-single-answer.php (added)
-
tags/1.5.6/templates/content-single-question.php (added)
-
tags/1.5.6/templates/email (added)
-
tags/1.5.6/templates/email/new-answer-followers.html (added)
-
tags/1.5.6/templates/email/new-answer.html (added)
-
tags/1.5.6/templates/email/new-comment-answer-followers.html (added)
-
tags/1.5.6/templates/email/new-comment-answer.html (added)
-
tags/1.5.6/templates/email/new-comment-question-followers.html (added)
-
tags/1.5.6/templates/email/new-comment-question.html (added)
-
tags/1.5.6/templates/email/new-question.html (added)
-
tags/1.5.6/templates/question-submit-form.php (added)
-
tags/1.5.6/templates/single-question.php (added)
-
tags/1.5.6/upgrades (added)
-
tags/1.5.6/upgrades/upgrades.php (added)
-
trunk/dw-question-answer.php (modified) (2 diffs)
-
trunk/inc/Notifications.php (modified) (4 diffs)
-
trunk/inc/Template.php (modified) (1 diff)
-
trunk/inc/User.php (modified) (1 diff)
-
trunk/inc/extend/buddypress/functions.php (modified) (2 diffs)
-
trunk/lib/recaptcha-php (deleted)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dw-question-answer/trunk/dw-question-answer.php
r1966975 r2051011 5 5 * Author: DesignWall 6 6 * Author URI: http://www.designwall.com 7 * Version: 1.5. 57 * Version: 1.5.6 8 8 * Text Domain: dw-question-answer 9 9 * @since 1.4.0 … … 26 26 $this->stylesheet_uri = DWQA_STYLESHEET_URL; 27 27 28 $this->version = '1.5. 5';28 $this->version = '1.5.6'; 29 29 30 30 // load posttype -
dw-question-answer/trunk/inc/Notifications.php
r1966975 r2051011 187 187 $subject = get_option( 'dwqa_subscrible_new_answer_followers_email_subject', __( '[{site_name}] You have a new answer for your followed question', 'dw-question-answer' ) ); 188 188 $subject = str_replace( '{site_name}', esc_html( $site_name ), $subject ); 189 $subject = str_replace( '{question_title}', sanitize_title( $question_title ), $subject );189 $subject = str_replace( '{question_title}', $question_title, $subject ); 190 190 $subject = str_replace( '{answer_author}', esc_html( $user_answer_display_name ), $subject ); 191 191 … … 201 201 $message = str_replace( '{question_link}', esc_url( $question_link ), $message ); 202 202 $message = str_replace( '{answer_link}', esc_url( $answer_link ), $message ); 203 $message = str_replace( '{question_title}', sanitize_title( $question_title ), $message );203 $message = str_replace( '{question_title}', $question_title, $message ); 204 204 $message = str_replace( '{answer_content}', wp_kses_post( $answer_content ), $message ); 205 205 $message = str_replace( '{answer_avatar}', $user_answer_avatar, $message ); … … 239 239 $subject = get_option( 'dwqa_subscrible_new_answer_email_subject', __( '[{site_name}] A new answer for "{question_title}" was posted on {site_name}', 'dw-question-answer' ) ); 240 240 $subject = str_replace( '{site_name}', esc_html( $site_name ), $subject ); 241 $subject = str_replace( '{question_title}', sanitize_title( $question_title ), $subject );241 $subject = str_replace( '{question_title}', $question_title, $subject ); 242 242 $subject = str_replace( '{question_id}', absint( $question_id ), $subject ); 243 243 $subject = str_replace( '{username}', esc_html( $user_question_display_name ), $subject ); … … 255 255 $message = str_replace( '{question_author}', esc_html( $user_question_display_name ), $message ); 256 256 $message = str_replace( '{answer_link}', esc_url( $answer_link ), $message ); 257 $message = str_replace( '{question_title}', sanitize_title( $question_title ), $message );257 $message = str_replace( '{question_title}', $question_title, $message ); 258 258 $message = str_replace( '{answer_content}', wp_kses_post( $answer_content ), $message ); 259 259 $message = str_replace( '{site_logo}', $site_logo, $message ); -
dw-question-answer/trunk/inc/Template.php
r1942382 r2051011 143 143 $paginate = str_replace( 'page-number', 'dwqa-page-number', $paginate ); 144 144 $paginate = str_replace( 'current', 'dwqa-current', $paginate ); 145 $paginate = str_replace( 'next', 'dwqa-next', $paginate );146 $paginate = str_replace( 'prev ', 'dwqa-prev ', $paginate );147 $paginate = str_replace( 'dots', 'dwqa-dots', $paginate );145 // $paginate = str_replace( 'next', 'dwqa-next', $paginate ); 146 // $paginate = str_replace( 'prev ', 'dwqa-prev ', $paginate ); 147 // $paginate = str_replace( 'dots', 'dwqa-dots', $paginate ); 148 148 149 149 if ( $wp_query->dwqa_questions->max_num_pages > 1 ) { -
dw-question-answer/trunk/inc/User.php
r1942382 r2051011 61 61 } 62 62 63 function dwqa_user_comment_count( $user_id ) {64 global $wpdb;65 66 $query = "SELECT `{$wpdb->prefix}comments`.user_id, count(*) as number_comment FROM `{$wpdb->prefix}comments` JOIN `{$wpdb->prefix}posts` ON `{$wpdb->prefix}comments`.comment_post_ID = `{$wpdb->prefix}posts`.ID WHERE 1 = 1 AND ( `{$wpdb->prefix}posts`.post_type = 'dwqa-question' OR `{$wpdb->prefix}posts`.post_type = 'dwqa-answer' ) AND `{$wpdb->prefix}comments`.comment_approved = 1 GROUP BY `{$wpdb->prefix}comments`.user_id";67 68 $results = wp_cache_get( 'dwqa-user-comment-count' );69 if ( false == $results ) {70 $results = $wpdb->get_results( $query, ARRAY_A );71 wp_cache_set( 'dwqa-user-comment-count', $results );72 }73 74 $users_comment_count = array_filter( $results, create_function( '$a', 'return $a["user_id"] == '.$user_id.';' ) );75 if ( ! empty( $users_comment_count ) ) {76 $user_comment_count = array_shift( $users_comment_count );77 return $user_comment_count['number_comment'];78 }79 return false;80 }81 63 82 64 function dwqa_user_most_answer( $number = 10, $from = false, $to = false ) { -
dw-question-answer/trunk/inc/extend/buddypress/functions.php
r1742022 r2051011 23 23 //question 24 24 function bp_dwqa_question_content() { 25 add_filter('dwqa_prepare_archive_posts', ' dp_dwqa_question_filter_query',12);25 add_filter('dwqa_prepare_archive_posts', 'bp_dwqa_question_filter_query',12); 26 26 remove_action( 'dwqa_before_questions_archive', 'dwqa_archive_question_filter_layout', 12 ); 27 27 include(DWQA_DIR .'templates/bp-archive-question.php'); 28 28 } 29 function dp_dwqa_question_filter_query($query){30 $ current_user_id = get_current_user_id();31 $query['author'] = $ current_user_id;29 function bp_dwqa_question_filter_query($query){ 30 $bp_displayed_user_id = bp_displayed_user_id(); 31 $query['author'] = $bp_displayed_user_id; 32 32 return $query; 33 33 } … … 35 35 //answer 36 36 function bp_dwqa_answer_content() { 37 add_filter('dwqa_prepare_archive_posts', ' dp_dwqa_answer_filter_query',12);37 add_filter('dwqa_prepare_archive_posts', 'bp_dwqa_answer_filter_query',12); 38 38 remove_action( 'dwqa_before_questions_archive', 'dwqa_archive_question_filter_layout', 12 ); 39 39 include(DWQA_DIR .'templates/bp-archive-question.php'); 40 40 } 41 function dp_dwqa_answer_filter_query($query){ 42 $current_user_id = get_current_user_id(); 43 $query['author'] = $current_user_id; 41 function bp_dwqa_answer_filter_query($query){ 42 $bp_displayed_user_id = bp_displayed_user_id(); 43 $post__in = array(); 44 45 $array = $query; 46 $array['post_type'] = 'dwqa-answer'; 47 $array['author'] = $bp_displayed_user_id; 48 49 // add_filter( 'posts_groupby', 'bp_dwqa_answers_groupby' ); 50 // use this function to fill per page 51 while(count($post__in) < $query['posts_per_page']){ 52 $array['post__not_in '] = $post__in; 53 $results = new WP_Query( $array ); 54 55 if($results->post_count > 0){ 56 foreach($results->posts as $result){ 57 $post__in[] = $result->post_parent; 58 } 59 }else{ 60 break; 61 } 62 } 63 if(empty($post__in)){ 64 $post__in = array(0); 65 } 66 $query['post__in'] = $post__in; 67 $query['orderby'] = 'post__in'; 68 44 69 return $query; 45 70 } -
dw-question-answer/trunk/readme.txt
r1968703 r2051011 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.9.7 6 Stable tag: 1.5. 56 Stable tag: 1.5.6 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 85 85 86 86 == Changelog == 87 88 = 1.5.6 = 89 * Fix: Question filter on buddypress tab 90 * Fix: Remove sanitize_title in Notification 91 * Fix: Remove old function & compatible php 7.2 87 92 88 93 = 1.5.5 =
Note: See TracChangeset
for help on using the changeset viewer.