Support Forum
I'm full of questions today
Okay, so I know you can set up a private forum, and you can bypass group permissions by manually adding a user to the private forum access list (via Forum > User Groups > Manage User Groups and adding a member to a user group's "Selected" list) - but the key word is "manually". You have to go in and add each person to the list yourself.
I'm wanting to write a function that hooks into this, so when a particular action is taken (i.e. someone purchases access to the forum), I can update the database table for the user group and add the user to it.
Is there already a hook I can tie into (or code somewhere that someone's already done this with, or something similar) that will allow me to update that table? (I *think* it's _sfmembers.user_id = _sfmemberships.user_id AND _sfmemberships.usergroup_id = _sfpermissions.usergroup_id AND _sfpermissions.forum_id = _sfforums.forum_id that maps the user to the forum through a group). I could use a WP custom select query to update the _sfmemberships table and add the member there (and I think that would be the only spot I'd need to add a row?) but if there's already a hook or something in place for this, that would be great to know about
sorry, missing what you want to do...
add a new user? add a new membership? add user to usergroup?
sorry, been a long, long week...
Visit Cruise Talk Central and Mr Papa's World
so just call:
sp_add_membership($ug_id, $user_id);
of course, pass the proper ids...
keep in mind that this will obey the single membership option setting you have set for your forum...
we are concentrating on the api in the codex for the display template functions first... then will get to this portion of the API and get them documented too..
Visit Cruise Talk Central and Mr Papa's World
np. glad to help. of course, there is a corresponding
sp_remove_membership($ug_id, $user_id)
sp_check_membership($ug_id, $user_id)
sp_reset_memberships($user_id)
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)