Changeset 6191 for trunk/src/includes/topics/functions.php
- Timestamp:
- 12/28/2016 04:24:52 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/topics/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6146 r6191 2795 2795 $post_status = "'" . implode( "','", $statuses ) . "'"; 2796 2796 $bbp_db = bbp_db(); 2797 $query = $bbp_db->prepare( "SELECT COUNT(ID) FROM {$bbp_db->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() );2797 $query = $bbp_db->prepare( "SELECT COUNT(ID) FROM {$bbp_db->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = %s", $topic_id, bbp_get_reply_post_type() ); 2798 2798 $reply_count = $bbp_db->get_var( $query ); 2799 2799 } … … 2970 2970 // Query the DB to get voices in this topic 2971 2971 $bbp_db = bbp_db(); 2972 $query = $bbp_db->prepare( "SELECT COUNT( DISTINCT post_author ) FROM {$bbp_db->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' ) OR ( ID = %d AND post_type = '%s' );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() );2972 $query = $bbp_db->prepare( "SELECT COUNT( DISTINCT post_author ) FROM {$bbp_db->posts} WHERE ( post_parent = %d AND post_status = %s AND post_type = %s ) OR ( ID = %d AND post_type = %s )", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ); 2973 2973 $voices = (int) $bbp_db->get_var( $query ); 2974 2974 … … 3011 3011 // Query the DB to get anonymous replies in this topic 3012 3012 $bbp_db = bbp_db(); 3013 $query = $bbp_db->prepare( "SELECT COUNT( ID ) FROM {$bbp_db->posts} WHERE ( post_parent = %d AND post_status = '%s' AND post_type = '%s' AND post_author = 0 ) OR ( ID = %d AND post_type = '%s' AND post_author = 0 );", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() );3013 $query = $bbp_db->prepare( "SELECT COUNT( ID ) FROM {$bbp_db->posts} WHERE ( post_parent = %d AND post_status = %s AND post_type = %s AND post_author = 0 ) OR ( ID = %d AND post_type = %s AND post_author = 0 )", $topic_id, bbp_get_public_status_id(), bbp_get_reply_post_type(), $topic_id, bbp_get_topic_post_type() ); 3014 3014 $replies = (int) $bbp_db->get_var( $query ); 3015 3015
Note: See TracChangeset
for help on using the changeset viewer.