Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: [Resolved] Group join date

@megainfo

Participant

date_modified field contain the data of the latest group join ( ie: if the member join and leave then he join again a group, this field contain this date).

check the code of function groups_join_group( $group_id, $user_id = 0 )

Here a small code that can help you to fetch the join date


global $bp;

$user_id = 2;  //user id
$group_id = 1; // your group id

$join_date_sql = $wpdb->prepare( "SELECT date_modified FROM {$bp->groups->table_name_members} WHERE is_confirmed = 1 AND is_banned = 0 AND user_id = %d AND group_id= %d", $user_id, $group_id );
$join_date = $wpdb->get_var( $join_date_sql );

Skip to toolbar