Skip to:
Content

BuddyPress.org

Changeset 5095


Ignore:
Timestamp:
09/02/2011 10:45:02 AM (13 years ago)
Author:
boonebgorges
Message:

Adds a manual check for bp->is_directory at the beginning of bp_dtheme_object_template_loader(). Switches logic of group metadata display in forum directories. Fixes #3540. Props boonebgorges, johnjamesjacoby

Location:
trunk/bp-themes/bp-default
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r4937 r5095  
    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
  • trunk/bp-themes/bp-default/forums/forums-loop.php

    r4771 r5095  
    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">
Note: See TracChangeset for help on using the changeset viewer.