Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/22/2011 04:13:30 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Fix situation where topic count would return 1 when there are no topics yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-functions.php

    r3806 r3842  
    323323    do_action( 'bbpress_init' );
    324324
    325     if ( isset( $bbdb ) )
     325    if ( isset( $bbdb ) ) {
    326326        $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" ) ) );
    327     else
     327        $count = count( (array)$count );
     328    } else {
    328329        $count = 0;
    329 
    330     return apply_filters( 'bp_forums_total_topic_count', count( (array)$count ) );
     330    }
     331
     332    return apply_filters( 'bp_forums_total_topic_count', $count );
    331333}
    332334
Note: See TracChangeset for help on using the changeset viewer.