Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/09/2011 03:06:13 PM (14 years ago)
Author:
boonebgorges
Message:

Reworks the way that total topic counts are retrieved on user forum pages. See #3557

File:
1 edited

Legend:

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

    r5112 r5129  
    137137            $this->total_topic_count = 0;
    138138        } else {
     139            // Get a total topic count, for use in pagination. This value will differ
     140            // depending on scope
    139141            if ( !empty( $forum_id ) ) {
     142                // Group forums
    140143                $topic_count = bp_forums_get_forum( $forum_id );
    141144                $topic_count = (int)$topic_count->topics;
    142145            } else if ( !empty( $bp->groups->current_group ) ) {
    143146                $topic_count = (int)groups_total_public_forum_topic_count( $type );
    144             } else if ( bp_is_user_forums_started() ) {
    145                 $topic_count = bp_forums_total_topic_count_for_user( bp_displayed_user_id() );
     147            } else if ( bp_is_user_forums_started() || ( bp_is_directory() && $user_id ) ) {
     148                // This covers the case of Profile > Forums > Topics Started, as
     149                // well as Forum Directory > My Topics
     150                $topic_count = bp_forums_total_topic_count_for_user( bp_displayed_user_id(), $type );
    146151            } else if ( bp_is_user_forums_replied_to() ) {
    147                 $topic_count = bp_forums_total_replied_count_for_user( bp_displayed_user_id() );
     152                // Profile > Forums > Replied To
     153                $topic_count = bp_forums_total_replied_count_for_user( bp_displayed_user_id(), $type );
    148154            } else {
    149                 // For forum directories, get a true count
     155                // For forum directories (All Topics), get a true count
    150156                $status = is_super_admin() ? 'all' : 'public'; // todo: member-of
    151157                $topic_count = (int)groups_total_forum_topic_count( $status, $search_terms );
Note: See TracChangeset for help on using the changeset viewer.