Changeset 7939
- Timestamp:
- 02/20/2014 03:16:52 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r7934 r7939 1223 1223 1224 1224 // Fetch the logged-in user's status within each group 1225 $user_status_results = $wpdb->get_results( $wpdb->prepare( "SELECT group_id, is_confirmed, invite_sent FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_banned = 0", bp_loggedin_user_id() ) ); 1225 if ( is_user_logged_in() ) { 1226 $user_status_results = $wpdb->get_results( $wpdb->prepare( "SELECT group_id, is_confirmed, invite_sent FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_banned = 0", bp_loggedin_user_id() ) ); 1227 } else { 1228 $user_status_results = array(); 1229 } 1226 1230 1227 1231 // Reindex … … 1256 1260 } 1257 1261 1258 $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() ) ); 1262 if ( is_user_logged_in() ) { 1263 $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() ) ); 1264 } else { 1265 $user_banned = array(); 1266 } 1267 1259 1268 for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) { 1260 1269 $paged_groups[$i]->is_banned = false;
Note: See TracChangeset
for help on using the changeset viewer.