[support] How can I tell if a user if a user is a member of an OG group?

Earnie Boyd earnie at users.sourceforge.net
Mon May 26 15:22:57 UTC 2008


Quoting "Neil: esl-lounge.com" <neil at esl-lounge.com>:

> I would like to show a link on a group node if a user is a member and 
> another link if they are not. I looked through og.module and found 
> the $subscription variable. I tried both the following without any 
> success:
>
> <?php if($subscription == 'active') : ?>
> already a member!
> <?php else: ?>
> Join Today!
> <?php endif; ?>
>
> <?php if($subscription) : ?>
> already a member!
> <?php else: ?>
> Join Today!
> <?php endif; ?>
>
> But I'm getting "Join Today" showing whether the user is a member or 
> not. I imagine this means the $subscription variable isn't available 
> in this context.
>
> does anyone know how to find out if a user is a member of an OG group?
>

I'm guessing you need a global $subscription; added to the code.

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the support mailing list