Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/26/2011 03:28:35 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Introduce Forums tab to user account area, to show topics the user has started, topics the user has replied to, and favorite forum topics. This includes additional template files in bp-default to support new functionality, and edits to the forum_sql filter functions.

File:
1 edited

Legend:

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

    r3911 r3933  
    102102            $this->total_topic_count = 0;
    103103        } else {
    104             if ( $forum_id ) {
     104            if ( !empty( $forum_id ) ) {
    105105                $topic_count = bp_forums_get_forum( $forum_id );
    106106                $topic_count = (int)$topic_count->topics;
    107             } else if ( function_exists( 'groups_total_public_forum_topic_count' ) ) {
     107            } else if ( !empty( $bp->groups->current_group ) ) {
    108108                $topic_count = (int)groups_total_public_forum_topic_count( $type );
    109109            } else {
     
    217217     * pass their parameters directly to the loop.
    218218     */
    219     $type = 'newest';
    220     $user_id = 0;
    221     $forum_id = false;
     219    $type         = 'newest';
     220    $user_id      = 0;
     221    $forum_id     = false;
    222222    $search_terms = false;
    223     $no_stickies = 'all';
     223    $no_stickies  = 'all';
    224224
    225225    // User filtering
     
    732732        global $bp, $forum_template;
    733733
    734         $start_num = intval( ( $forum_template->pag_page - 1 ) * $forum_template->pag_num ) + 1;
    735         $from_num = bp_core_number_format( $start_num );
    736         $to_num = bp_core_number_format( ( $start_num + ( $forum_template->pag_num - 1  ) > $forum_template->total_topic_count ) ? $forum_template->total_topic_count : $start_num + ( $forum_template->pag_num - 1 ) );
    737         $total = bp_core_number_format( $forum_template->total_topic_count );
    738 
     734        $start_num  = intval( ( $forum_template->pag_page - 1 ) * $forum_template->pag_num ) + 1;
     735        $from_num   = bp_core_number_format( $start_num );
     736        $to_num     = bp_core_number_format( ( $start_num + ( $forum_template->pag_num - 1  ) > $forum_template->total_topic_count ) ? $forum_template->total_topic_count : $start_num + ( $forum_template->pag_num - 1 ) );
     737        $total      = bp_core_number_format( $forum_template->total_topic_count );
    739738        $pag_filter = false;
     739
    740740        if ( 'tags' == $forum_template->type && !empty( $forum_template->search_terms ) )
    741741            $pag_filter = sprintf( __( ' matching tag "%s"', 'buddypress' ), $forum_template->search_terms );
Note: See TracChangeset for help on using the changeset viewer.