Changeset 3167
- Timestamp:
- 05/16/2011 08:02:09 AM (14 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-shortcodes.php
r3160 r3167 94 94 95 95 // Reply form 96 'bbp-reply-form' => array( $this, 'display_reply_form' ) 96 'bbp-reply-form' => array( $this, 'display_reply_form' ), 97 98 /** Views *********************************************************/ 99 100 // Single view 101 'bbp-single-view' => array( $this, 'display_view' ) 102 97 103 ) ); 98 104 } … … 595 601 } else { 596 602 bbp_get_template_part( 'bbpress/no', 'topics' ); 603 } 604 605 // Return contents of output buffer 606 return $this->_ob_end(); 607 } 608 609 /** Views *****************************************************************/ 610 611 /** 612 * Display the contents of a specific view in an output buffer and return to 613 * ensure that post/page contents are displayed first. 614 * 615 * @since bbPress (r3031) 616 * 617 * @param array $attr 618 * @param string $content 619 * @uses bbp_has_topics() 620 * @uses current_theme_supports() 621 * @uses get_template_part() 622 * @uses bbp_single_forum_description() 623 * @return string 624 */ 625 function display_view( $attr, $content = '' ) { 626 global $bbp; 627 628 // Sanity check required info 629 if ( empty( $attr['id'] ) ) 630 return $content; 631 632 // Set passed attribute to $view_id for clarity 633 $view_id = $attr['id']; 634 635 // Start output buffer 636 $this->_ob_start(); 637 638 // Display breadcrumb if a subforum 639 bbp_get_template_part( 'bbpress/nav', 'breadcrumb' ); 640 641 // Password protected 642 if ( post_password_required() ) { 643 644 // Output the password form 645 bbp_get_template_part( 'bbpress/form', 'protected' ); 646 647 // Not password protected, or password is already approved 648 } else { 649 650 /** Topics ********************************************************/ 651 652 // Unset globals 653 $this->_unset_globals(); 654 655 // Load the topic index 656 if ( bbp_view_query( $view_id ) ) { 657 bbp_get_template_part( 'bbpress/pagination', 'topics' ); 658 bbp_get_template_part( 'bbpress/loop', 'topics' ); 659 bbp_get_template_part( 'bbpress/pagination', 'topics' ); 660 bbp_get_template_part( 'bbpress/form', 'topic' ); 661 662 // No topics 663 } else { 664 bbp_get_template_part( 'bbpress/no', 'topics' ); 665 bbp_get_template_part( 'bbpress/form', 'topic' ); 666 } 597 667 } 598 668 -
branches/plugin/bbp-includes/bbp-general-template.php
r3132 r3167 2061 2061 global $bbp; 2062 2062 2063 // Prevent debug notice 2064 $new_content = ''; 2065 2063 2066 // Remove the filter that was added in bbp_template_include() 2064 2067 remove_filter( 'the_content', 'bbp_replace_the_content', 99999 ); … … 2131 2134 2132 2135 } elseif ( bbp_is_view() ) { 2133 2136 $new_content = $bbp->shortcodes->display_view( array( 'id' => get_query_var( 'bbp_view' ) ) ); 2134 2137 2135 2138 /** Topic Tags ********************************************************/ … … 2163 2166 2164 2167 // Juggle the content around and try to prevent unsightly comments 2165 if ( $new_content != $content) {2168 if ( !empty( $new_content ) && ( $new_content != $content ) ) { 2166 2169 2167 2170 // Set the content to be the new content
Note: See TracChangeset
for help on using the changeset viewer.