Changeset 3166
- Timestamp:
- 05/16/2011 07:45:01 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r3164 r3166 586 586 587 587 // Define used variables 588 $output = $sub_forums = $topic_count = $reply_count = '';588 $output = $sub_forums = $topic_count = $reply_count = $counts = ''; 589 589 $i = 0; 590 $count = array(); 590 591 591 592 // Defaults and arguments … … 608 609 // Loop through forums and create a list 609 610 if ( $sub_forums = bbp_forum_get_subforums( $forum_id ) ) { 611 610 612 // Total count (for separator) 611 613 $total_subs = count( $sub_forums ); 612 foreach ( $sub_forums as $sub_forum ) {614 foreach ( $sub_forums as $sub_forum ) { 613 615 $i++; // Separator count 614 616 615 617 // Get forum details 618 $count = array(); 616 619 $show_sep = $total_subs > $i ? $separator : ''; 617 620 $permalink = bbp_get_forum_permalink( $sub_forum->ID ); 618 621 $title = bbp_get_forum_title( $sub_forum->ID ); 619 622 620 // Show topic and reply counts623 // Show topic count 621 624 if ( !empty( $show_topic_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) 622 625 $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID ); 623 626 627 // Show reply count 624 628 if ( !empty( $show_reply_count ) && !bbp_is_forum_category( $sub_forum->ID ) ) 625 629 $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID ); 626 630 627 $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $count_before . implode( $count_sep, $count ) . $count_after . '</a>' . $show_sep . $link_after; 631 // Counts to show 632 if ( !empty( $count ) ) 633 $counts = $count_before . implode( $count_sep, $count ) . $count_after; 634 635 // Build this sub forums link 636 $output .= $link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $link_after; 628 637 } 629 638
Note: See TracChangeset
for help on using the changeset viewer.