Changeset 3659
- Timestamp:
- 01/04/2011 10:54:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums.php
r3657 r3659 369 369 370 370 function bp_forums_total_topic_count() { 371 do_action( 'bbpress_init' ); 372 373 $query = new BB_Query( 'topic', array( 'page' => 1, 'per_page' => -1, 'count' => true ) ); 374 $count = $query->count; 375 $query = null; 376 377 return $count; 371 global $bbdb; 372 373 do_action( 'bbpress_init' ); 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'" ) ) ); 376 return apply_filters( 'bp_forums_total_topic_count', count( (array)$count ) ); 378 377 } 379 378
Note: See TracChangeset
for help on using the changeset viewer.