Skip to:
Content

BuddyPress.org

Changeset 3044


Ignore:
Timestamp:
06/11/2010 01:01:46 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2411, #2341

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-friends/bp-friends-classes.php

    r2976 r3044  
    316316        global $wpdb, $bp;
    317317
     318        // Get friends of $user_id
     319        $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
     320
    318321        // Delete all friendships related to $user_id
    319322        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->friends->table_name} WHERE friend_user_id = %d OR initiator_user_id = %d", $user_id, $user_id ) );
     
    322325        $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE component_name = 'friends' AND ( component_action = 'friendship_request' OR component_action = 'friendship_accepted' ) AND item_id = %d", $user_id ) );
    323326
    324         // Get friends of $user_id and update their respective friend counts
    325         $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id );
    326         foreach ( (array)$friend_ids as $friend_id )
     327        // Loop through friend_ids and update their counts
     328        foreach ( (array)$friend_ids as $friend_id ) {
    327329            BP_Friends_Friendship::total_friend_count( $friend_id );
    328 
     330        }
    329331    }
    330332}
Note: See TracChangeset for help on using the changeset viewer.