Changeset 3660
- Timestamp:
- 01/05/2011 10:03:41 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums.php
r3659 r3660 373 373 do_action( 'bbpress_init' ); 374 374 375 $count = $bbdb->get_results( $bbdb->prepare( "SELECT t.topic_id FROM {$bbdb->topics} AS t". groups_add_forum_tables_sql( '' ) . " WHERE " . groups_add_forum_where_sql( "t.topic_status = '0'" ) ) );375 $count = $bbdb->get_results( $bbdb->prepare( "SELECT t.topic_id FROM {$bbdb->topics} AS t". groups_add_forum_tables_sql( '' ) . " WHERE " . groups_add_forum_where_sql( "t.topic_status = 0" ) ) ); 376 376 return apply_filters( 'bp_forums_total_topic_count', count( (array)$count ) ); 377 377 } … … 547 547 } 548 548 549 550 549 function bp_forums_get_forum_topicpost_count( $forum_id ) { 551 550 global $wpdb, $bbdb; … … 556 555 return $wpdb->get_results( $wpdb->prepare( "SELECT topics, posts from {$bbdb->forums} WHERE forum_id = %d", $forum_id ) ); 557 556 } 558 559 557 560 558 function bp_forums_filter_caps( $allcaps ) { … … 589 587 add_action( 'bp_forums_new_topic', 'bp_core_clear_cache' ); 590 588 add_action( 'bp_forums_new_post', 'bp_core_clear_cache' ); 591 592 589 ?> -
trunk/bp-forums/bp-forums-filters.php
r3592 r3660 132 132 add_filter( 'bp_get_the_topic_post_edit_text', 'bp_forums_strip_mentions_on_post_edit' ); 133 133 add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' ); 134 135 134 ?> -
trunk/bp-groups/bp-groups-filters.php
r3369 r3660 106 106 add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 ); 107 107 108 /** 109 * Amends the forum directory's "last active" bbPress SQL query to stop it fetching 110 * information we aren't going to use. This speeds up the query. 111 * 112 * @see BB_Query::_filter_sql() 113 * @since 1.3 114 */ 115 function groups_filter_forums_root_page_sql( $sql ) { 116 return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' ); 117 } 118 add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' ); 108 119 ?>
Note: See TracChangeset
for help on using the changeset viewer.