By armanjava on
Upon registering, my users choose from certain taxonomy tags to assign to their profile. For example, if they choose the taxonomy term 'Los Angeles', I would want them auto-subscribed to the 'Los Angeles' group which was also assigned to that same taxonomy term when the group was created.
Does anyone know how this can be done or if some module out there might be able to achieve this solution in some way?
I would also be willing to cover the cost if anyone wanted to develop a snippet or something similar for this...
Thanks in advance for anyone that can provide help with this.
Comments
A starting point
The following code should be place in a file called og_auto_subscribe.module in a directory called og_auto_subscribe (under the modules directory).
It needs to be modified to loop through the approriate term tids in the users profile (see og_auto_subscribe_user) and if you are using something other that og_basic for the group type you will need to modify og_auto_subscribe_get_group() with the correcty node type for your groups.
Note this only auto subscribes to groups, it does not un subscribe them if they unselect a term.
What if i'm using usernodes?
First, thank you so much for putting this together, I have no doubt it will not only help me but others that probably have the same problem.
I'm using the usernode module which allows the user to select a unique content type to create after they register on the site. They have a choice of 1 out of 10 different content types. After they select this content type, they are directed to it's creation form page where they then create the content type. These content types are all 'child nodes' of the usernode and are tied together using the nodefamily module. So in essence, each user ends up with one usernode and one of these 10 content types which is then embedded in their usernode when they view it. This replaces the traditional 'profile' item that comes with drupal core. The taxonomy term I want to initiate creation of the organic group is chosen when they first create this content type.(the one they select out of the 10 types they are offerred) The term's container and vocabulary is the same for all of these content types, it's just that I want you to know they are not on the user profile if that has anything to do with this coding.
I'm also using the category module as a replacement to the taxonomy module if that makes any difference. I don't think it does though as it works the same way in regards to terms and tids, i believe.
Also, i'm sorry about my ignorance on PHP and Drupal, but where do I find the term tids for the vocabulary terms in the category I want to use for this? And can you please give me an example on how to include that in the code?
Thank you so much again for all your help, it's greatly appreciated.
That changes things
The code outlined lined assumes Drupal's taxonomy module. Though the category module provides similiar functionality it uses it's own tables. I am not familiar enough with the category module to provide a solution "off the top of my head" (that is, it would take some research)
While I am using the user node module, I am not familiar the ability to "allow the user to select a unique content type to create after they register on the site" so I am unclear how that works. In the context of profile nodes since you have ten types how do you map the category to the type?
UserNode/NodeFamily/NodeProfile Modules were used.
I had a problem: how can I get each of my 10 different types of users a completely different profile input page with different taxonomy selections and fields? My solution: after they register, re-direct them to a page that gives them the option to create 1 of 10 different content types. Using the nodefamily module, I then made the usernode the parent and made all 10 of these content types the children. I then modified the usernode code per the instructions provided in the nodefamily readme to allow for all usernode children nodes to appear when someone goes to view the usernode. That way, that content type that they chose to create out of the 10 types I gave them to choose from, appears as their usernode and thus is their profile.
Under admin-->category, I just exposed that category to all of the 10 content types and so now the user can select this category when they are creating that 1 out of 10 content type.
In regards to the category tables, do you think you can help me with this Nevets? Is there anything I can do to help out with the research and maybe post for you? Please let me know if I can help in anyway. Eventhough i'm not a coder, I'm good at research.