Changeset 4896 for trunk/includes/forums/functions.php
- Timestamp:
- 05/11/2013 06:10:20 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/forums/functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/functions.php
r4876 r4896 1363 1363 // Get topics of forum 1364 1364 if ( empty( $topic_count ) ) 1365 $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) );1365 $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . implode( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) ); 1366 1366 1367 1367 // Update the count … … 1410 1410 $topic_ids = bbp_forum_query_topic_ids( $forum_id ); 1411 1411 if ( !empty( $topic_ids ) ) { 1412 $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );1412 $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . implode( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ); 1413 1413 } else { 1414 1414 $reply_count = 0; … … 1806 1806 1807 1807 if ( !empty( $topic_ids ) ) { 1808 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );1808 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . implode( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ); 1809 1809 wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0 1810 1810 } else { … … 2022 2022 2023 2023 // Allowed post statuses to pre-trash 2024 $post_stati = join( ',', array(2024 $post_stati = implode( ',', array( 2025 2025 bbp_get_public_status_id(), 2026 2026 bbp_get_closed_status_id(),
Note: See TracChangeset
for help on using the changeset viewer.