Skip to:
Content

BuddyPress.org

Changeset 3540


Ignore:
Timestamp:
12/19/2010 11:10:20 AM (14 years ago)
Author:
djpaul
Message:

Revert part of r3537 to fix group admins/mods display. See #2661.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r3537 r3540  
    5252        /* This is a single group page. */
    5353        $bp->is_single_item = true;
    54         $bp->groups->current_group = groups_get_groups( array( 'type' => 'active', 'include' => $group_id ) );
    55         $bp->groups->current_group = $bp->groups->current_group['groups'][0];
     54        $bp->groups->current_group = new BP_Groups_Group( $group_id );
    5655
    5756        /* Using "item" not "group" for generic support in other components. */
  • trunk/bp-groups/bp-groups-templatetags.php

    r3538 r3540  
    3232            $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude );
    3333        } else if ( 'single-group' == $type ) {
    34             $this->groups = array( $bp->groups->current_group );
     34            $group           = new stdClass;
     35            $group->group_id = BP_Groups_Group::get_id_from_slug( $slug );
     36            $this->groups    = array( $group );
    3537        } else {
    3638            $this->groups = groups_get_groups( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'include' => $include, 'exclude' => $exclude, 'populate_extras' => $populate_extras ) );
     
    118120        $this->in_the_loop = true;
    119121        $this->group = $this->next_group();
     122
     123        if ( $this->single_group )
     124            $this->group = new BP_Groups_Group( $this->group->group_id );
    120125
    121126        if ( 0 == $this->current_group ) // loop has just started
     
    10181023 * Checks if a user is banned from a group.
    10191024 *
     1025 * If this function is invoked inside the groups template loop (e.g. the group directory), then
     1026 * $groups_template->group->is_banned is set if the user is banned, so use that instead of making
     1027 * another SQL query.
     1028 *
    10201029 * @global object $bp BuddyPress global settings
    10211030 * @global BP_Groups_Template $groups_template Group template loop object
     
    10351044        $group =& $groups_template->group;
    10361045
    1037         if ( !$user_id )
    1038             return apply_filters( 'bp_group_is_member_banned', !empty( $group->is_banned ) );
     1046        if ( !$user_id && !empty( $group->is_banned ) )
     1047            return apply_filters( 'bp_group_is_member_banned', true );
    10391048    }
    10401049
Note: See TracChangeset for help on using the changeset viewer.