I'm new to Drupal, so please forgive me if this is a stupid set of questions. I'm still trying to learn how to use the existing drupal API, modules and forms. Our development site is using Drupal 6.9 with a LAMP server environment up and working. We own and run the host ourselves. We have Organic Groups installed and working since we are building an invitation only social networking site. The problem we don't know how to solve is:
Problem:
We would like to be able to allow registered users to invite outside people such as their friends and family to join the site and their group. These invitees would not necessarily be registered users (although they could be). When they register with our site they need to be automatically registered with organic groups as a member of the group they were invited to join.
I know we will need to create a new "invite your friend" form that will allow the inviting user to enter information, then we need to process the information, and I assume store it in a new database table. In specific we need the invited person's name and email and the inviting persons name, uid, and the organic group name and id they want their friend to join. When the invited user does register to join our site we want to automatically sign them up for the group they were invited to join, but also allow the new user the option of creating another group.
Question One:
We are worried about and don't know how to go about changing the user functions in the organic group module to call a modified, or expanded, or even a new form to allow a user to invite a non registered outside the site friend to join their group, which will include emailing them an invitation. How do we do that?
Question Two: Is it possible to add our new form and form building function (which it looks like would be the form id as well?) to the existing user registration module and if so how? I assume we need to create a new table to store the information, but is that true? Can we add fields to an existing table? It looks like the user.module registration code is in function user_external_login_register($name, $module) along with other form building functions to set up the registration page and form, but I'm not sure we should change that code...is there some way to modify the existing form to add the new fields and processing we need?
Question Three:
How do we sign the user automatically into the organic group they were invited to join? We know how to use the database API to pull information out of the drupal database, but how do I automatically/programatically add the newly registered user to the correct organic group using the organic group's existing software rather than figuring out what to stuff in which tables and reaching out and doing that? Should I create a function that fills out the organic group's signup form and call the execute_form API? If so which form? All our site's groups are invite only, but it's not clear there is a specific form to use, is there?
Question four:
If the user wants to create their own new group while registering, we need to automatically send that information to the organic group module to create the new group and sign the new user up as it's administrator. How can we do that automatically, since all we want the new user to do is enter the name of their new group. Our site would then automatically pass that to the organic groups module along with the user's new UID (which I know means the user must be registered at that point). In the existing registration form ogganic groups will add a checkbox form to allow a user to join a group but this should only appear for that specific user when they sign in and no other. Is there a way to do that?
I know it's a long set of questions, and they may be stupid ones, but it people could point me to some php code or let me know what forms (and their id/function calls) to use it would be a big help. I am familiar with PHP, PERL and SQL so PHP snips as well as some pointers would be really helpful.
Thanks in advance
Comments
Ditto. I too would like to understand how this is done.
Thanks for the great question. I would appreciate any insight you get. And I will keep poking around.
subscribin'
subscribin'
OG Reg Code
Hi, I am interested in similar functionality. Have you seen the module:
http://drupal.org/project/og_reg_codes
I thinks it does some of what you are looking for.
Has anyone gotten this to work?
I am also interested in this functionality. Has anyone found a good solution?
Me too. Looks like the best
Me too. Looks like the best solution right now is a "two step" where the user has to be invited to Drupal, then they can join the group.
The good news: you can list your group on the registration form so when someone signs up, it's just one extra click to add themselves to the group.
There's userplus or Invite, which lets you invite multiple people at once, and add multiple people to your group. But it's still two steps. http://drupal.org/project/userplus or http://drupal.org/project/invite
There's also Mandatory Groups, but it still doesn't quite get us the capability we want.
We're looking to do basically
We're looking to do basically the same thing. I just started a thread here about it:
http://drupal.org/node/993680
Haven't found a good solution yet.