1

Our website has three types of groups: area groups, support groups and member organized groups.

While a member can join several or none of the support groups and member-organized groups, we do want each member to be a part of one (and only one) area group.

I'd like to find a way to use rules to check to see if a member is a member of an area group and if not, display a warning/help message to them to encourage them to join an area group. Ideally, I would like to do this several times shortly after they join and then occasionally after the first couple weeks (some people who are in the process of moving to the area may not want to join a group right away and I don't want the messages to get overwhelming for that small minority).

I've been playing around in the rules module to see what I can do, but I'm not sure exactly how to check to see if they are a member of any group of the area group type -- can anyone help me with determining what conditions I have to apply to get it to check this for me? Also can I put a limit (as suggested above) on the amount of times the message shows?

Or in lieu of that, is there an easier way to accomplish this goal of ensuring that all of our members make it into one area group?

Thanks Heather

1

I don't think Rules alone will do what you want. You'll want something like

// This hook fires whenever a user account is saved. 
// If you want to do it at other times, you'll want another hook.
function mymodule_user_presave(&$edit, $account, $category) {
    // This is an organic groups API function for finding out what group a user is in.
    $user_groups = og_get_groups_by_user($account, 'my_group_type');
    if ( [check for group membership] ) { ... }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.