Changeset 3540
- Timestamp:
- 12/19/2010 11:10:20 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r3537 r3540 52 52 /* This is a single group page. */ 53 53 $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 ); 56 55 57 56 /* Using "item" not "group" for generic support in other components. */ -
trunk/bp-groups/bp-groups-templatetags.php
r3538 r3540 32 32 $this->groups = groups_get_invites_for_user( $user_id, $this->pag_num, $this->pag_page, $exclude ); 33 33 } 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 ); 35 37 } else { 36 38 $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 ) ); … … 118 120 $this->in_the_loop = true; 119 121 $this->group = $this->next_group(); 122 123 if ( $this->single_group ) 124 $this->group = new BP_Groups_Group( $this->group->group_id ); 120 125 121 126 if ( 0 == $this->current_group ) // loop has just started … … 1018 1023 * Checks if a user is banned from a group. 1019 1024 * 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 * 1020 1029 * @global object $bp BuddyPress global settings 1021 1030 * @global BP_Groups_Template $groups_template Group template loop object … … 1035 1044 $group =& $groups_template->group; 1036 1045 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 ); 1039 1048 } 1040 1049
Note: See TracChangeset
for help on using the changeset viewer.