Changeset 5677 for branches/1.5/bp-friends/bp-friends-classes.php
- Timestamp:
- 02/07/2012 12:40:24 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/bp-friends/bp-friends-classes.php
r4934 r5677 295 295 296 296 function get_invitable_friend_count( $user_id, $group_id ) { 297 global $wpdb, $bp; 298 299 $ friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );300 297 298 // Setup some data we'll use below 299 $is_group_admin = BP_Groups_Member::check_is_admin( $user_id, $group_id ); 300 $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ); 301 301 $invitable_count = 0; 302 302 303 for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { 303 304 304 if ( BP_Groups_Member::check_is_member( (int)$friend_ids[$i], $group_id ) ) 305 // If already a member, they cannot be invited again 306 if ( BP_Groups_Member::check_is_member( (int) $friend_ids[$i], $group_id ) ) 305 307 continue; 306 308 307 if ( BP_Groups_Member::check_has_invite( (int)$friend_ids[$i], $group_id ) ) 309 // If user already has invite, they cannot be added 310 if ( BP_Groups_Member::check_has_invite( (int) $friend_ids[$i], $group_id ) ) 311 continue; 312 313 // If user is not group admin and friend is banned, they cannot be invited 314 if ( ( false === $is_group_admin ) && BP_Groups_Member::check_is_banned( (int) $friend_ids[$i], $group_id ) ) 308 315 continue; 309 316
Note: See TracChangeset
for help on using the changeset viewer.