Changeset 3541
- Timestamp:
- 12/19/2010 12:29:04 PM (14 years ago)
- Location:
- trunk/bp-groups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r3465 r3541 527 527 $user_status = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_confirmed = 1 AND is_banned = 0", $bp->loggedin_user->id ) ); 528 528 for ( $i = 0; $i < count( $paged_groups ); $i++ ) { 529 $paged_groups[$i]->is_member = false; 530 529 531 foreach ( (array)$user_status as $group_id ) { 530 532 if ( $group_id == $paged_groups[$i]->id ) … … 535 537 $user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", $bp->loggedin_user->id ) ); 536 538 for ( $i = 0; $i < count( $paged_groups ); $i++ ) { 539 $paged_groups[$i]->is_banned = false; 540 537 541 foreach ( (array)$user_banned as $group_id ) { 538 542 if ( $group_id == $paged_groups[$i]->id ) -
trunk/bp-groups/bp-groups-templatetags.php
r3540 r3541 1024 1024 * 1025 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 making1027 * another SQL query.1026 * check $groups_template->group->is_banned instead of making another SQL query. 1027 * However, if used in a single group's pages, we must use groups_is_user_banned(). 1028 1028 * 1029 1029 * @global object $bp BuddyPress global settings … … 1034 1034 * @since 1.3 1035 1035 */ 1036 function bp_group_is_user_banned( $group = false, $user_id = false) {1036 function bp_group_is_user_banned( $group = false, $user_id = 0 ) { 1037 1037 global $bp, $groups_template; 1038 1038 … … 1044 1044 $group =& $groups_template->group; 1045 1045 1046 if ( !$user_id && !empty( $group->is_banned ) )1047 return apply_filters( 'bp_group_is_ member_banned', true);1046 if ( !$user_id && isset( $group->is_banned ) ) 1047 return apply_filters( 'bp_group_is_user_banned', $group->is_banned ); 1048 1048 } 1049 1049
Note: See TracChangeset
for help on using the changeset viewer.