Skip to:
Content

BuddyPress.org


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

Fix remove from group functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.