OG groups: How to check if user is a member or not? What code can I use to check if a user is a member of a group?
For the 7.x-2.x branch of Organic Groups you need to use the following code.

og_is_member('node', $gid, 'user', $user)


'node' is the entity type. The function og_is_member requires 4 parameters to return the correct value.