How to use og_is_member() API? Possible Duplicate:
  OG groups: How to check if user is a member or not?  




I don't know how to use this: http://api.drupalize.me/api/drupal/function/calls/og_is_member/7

I want to check if user is a member of group or not.

Can someone help me?

Thank you!
I'm not sure what difficulty you're having using the function or what Drupal version you're on, but according to drupalize.me, in Drupal 7 og_is_member() takes parameters $gid (ID of group), $entity_type (defaults to 'user'), $entity (defaults to current user), and $states (optional, defaults to all), and returns TRUE if the entity (e.g. current user by default) belongs to the group.

For example, to find out if the current user is a member of group 4, I would use something like,

$current_user = global $user;
if (og_is_member(4, 'user', $current_user)) {
  // show the user some stuff from group 4
}


The above code is not tested but should get you started.