Skip to:
Content

BuddyPress.org

Changeset 3257


Ignore:
Timestamp:
09/12/2010 02:29:29 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Fix remove from group functionality.

Location:
branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-groups.php

    r3241 r3257  
    869869
    870870            // Remove a user.
    871             if ( !groups_remove_member( $bp->groups->current_group->id, $user_id ) )
     871            if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) )
    872872                bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' );
    873873            else
     
    24052405    do_action( 'groups_remove_member', $group_id, $user_id );
    24062406
    2407     if ( !$member->remove( $user_id, $group_id ) )
    2408         return false;
     2407    return $member->remove();
    24092408}
    24102409
  • branches/1.2/bp-groups/bp-groups-classes.php

    r3229 r3257  
    777777
    778778    function accept_invite() {
    779         $this->inviter_id = 0;
    780         $this->is_confirmed = 1;
     779        $this->inviter_id    = 0;
     780        $this->is_confirmed  = 1;
    781781        $this->date_modified = bp_core_current_time();
     782
     783        update_user_meta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
    782784    }
    783785
     
    785787        $this->is_confirmed = 1;
    786788        $this->date_modified = bp_core_current_time();
    787     }
    788 
    789     function remove( $user_id, $group_id ) {
    790         global $wpdb, $bp;
    791 
    792         $sql = $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id );
     789
     790        update_user_meta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );
     791    }
     792
     793    function remove() {
     794        global $wpdb, $bp;
     795
     796        $sql = $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
    793797
    794798        if ( !$result = $wpdb->query( $sql ) )
Note: See TracChangeset for help on using the changeset viewer.