Skip to:
Content

BuddyPress.org

Ticket #3540: 3540.02.patch

File 3540.02.patch, 2.1 KB (added by johnjamesjacoby, 13 years ago)

Adds comments to 3540.01.diff, and changes forum-loop.php to use !bp_is_group_forum() instead

  • bp-themes/bp-default/_inc/ajax.php

     
    8383
    8484/* This function will simply load the template loop for the current object. On an AJAX request */
    8585function bp_dtheme_object_template_loader() {
     86
     87        /**
     88         * AJAX requests happen too early to be seen by bp_update_is_directory()
     89         * so we do it manually here to ensure templates load with the correct
     90         * context. Without this check, templates will load the 'single' version
     91         * of themselves rather than the directory version.
     92         */
     93        if ( !bp_current_action() )
     94                bp_update_is_directory( true, bp_current_component() );
     95
     96        // Sanitize the post object
    8697        $object = esc_attr( $_POST['object'] );
     98
     99        // Locate the object template
    87100        locate_template( array( "$object/$object-loop.php" ), true );
    88101}
    89102add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' );
    90 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );
    91 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );
    92 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );
     103add_action( 'wp_ajax_groups_filter',  'bp_dtheme_object_template_loader' );
     104add_action( 'wp_ajax_blogs_filter',   'bp_dtheme_object_template_loader' );
     105add_action( 'wp_ajax_forums_filter',  'bp_dtheme_object_template_loader' );
    93106
    94107// This function will load the activity loop template when activity is requested via AJAX
    95108function bp_dtheme_activity_template_loader() {
  • bp-themes/bp-default/forums/forums-loop.php

     
    6060                                        <p class="topic-meta">
    6161                                                <span class="topic-by"><?php /* translators: "started by [poster] in [forum]" */ printf( __( 'Started by %1$s', 'buddypress' ), bp_get_the_topic_poster_avatar( 'height=20&width=20') . bp_get_the_topic_poster_name() ); ?></span>
    6262
    63                                                 <?php if ( bp_is_directory() || bp_is_user_forums() ) : ?>
     63                                                <?php if ( !bp_is_group_forum() ) : ?>
    6464
    6565                                                        <span class="topic-in">
    6666