[buddypress-dev] [BuddyPress] How to detect if an user has never logged in

Stas Sușcov stas at nerd.ro
Mon Jun 27 11:03:29 UTC 2011


În data de Lu, 27-06-2011 la 09:17 +0200, Pasquale Puzio a scris:
> Hi friends,
> 
> I'm developing a particular social network where the users are
> pre-registered and only after that they receive an invitation to join
> the social network. If they accept they can log in and become members.
> In order to do so, I need to display only the users that have logged
> in at least one time and hide the others.
> 
> My question is very simple: how can I detect if a registered user
> never logged in? It would be very useful to insert this filter in the
> members loop.
> 
> Thanks
> 

When a user logs in, his BuddyPress profile is generated. Once a user
profile was generated, it's entry will be listed in
`bp_core_get_users()` results. So basically, querying
`bp_core_get_users()` you will get all the BuddyPress users.

If you want to make it even better, you can also check the User object
attributes `user_registered` and `last_activity`.
http://chopapp.com/#c8jvi473



More information about the buddypress-dev mailing list