group for logged in user
-
Hoping someone can help as ive tried Sooooo.. many things for this I’m running out of ideas.
I’m using Buddy press groups to categorize my users (office based, sales etc….)
I’m also using a plugin called ‘Login Log’ which records logins by all users.The login log plugin logs many details at time of login but dosnt currently log which buddy press group a user is in. I need this infor for reporting purposes.
No i have modified the login log plugin to record and extra field into the DB, but I am having great trouble returning the group(s) for a particular user at login time.
The code (from the login log plugin) which retrieves the user data then stores is is below.
you will see that i have defined a variable called ‘group’ and i need the relevant code to retrieve the buddypress group(s) to which this user belongs to so i can store it.
Anyone shed any light on this as i have tried MANY options to no avail..
any help greatly appreciated.
$group = ???????; $values = array( 'uid' => $uid, 'user_login' => $user_login, 'user_role' => $user_role, 'user_email' => $user_email, 'time' => current_time('mysql'), 'ip' => isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? esc_attr($_SERVER['HTTP_X_FORWARDED_FOR']) : esc_attr($_SERVER['REMOTE_ADDR']), 'country' => $guest_country, 'city' => $guest_city, 'login_result' => $this->login_success, 'data' => $serialized_data, 'name' => $USErname, 'group' => $group ); $format = array('%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s'); $this->save_data($values, $format);
- The topic ‘group for logged in user’ is closed to new replies.