Support Forum
On our system, we have a need to automatically subscribe users to certain forums when the users are activated via WP-Members. Currently we're doing this manually through the database, but I'd like to be able to do it from the admin panel. Which of the following would be the best way to add this code into our system?
- Add subscription options on the user management screen in WP-Members
- Add to the User section of the SP admin area
- Create a whole separate SP plugin to manage subscriptions - tie in with existing subscriptions plugin code to call existing functions for adding/deleting subscriptions
- Do something else entirely
I'm looking for the option that would be least intrusive to existing code and one that would cause the least amount of hassle when we need to install updates to existing plugins.
we wouldnt do the first option... we generally try to stay away from functionality limited to single other plugin (yes, we have a couple now)...
on the second option, you didnt really offer a suggestion on the UI... how would you like to subscribe them to topics? have to know the topic id? if we had a select list of topics, that could take minutes or longer to populate on busy sites... same for list of topics and then select of users - for large user db (some of our users have over a million users in their forum) would take minutes or longer to popuplate too...
and not sure how the UI would automatically subscribe them as you state...
and actually, you can probably do that now... As long as this WP Members plugin has a simple API, like firing a hook when it creates a user, you could hook into the user creation and subscribe them automatically... assuming its using the wp api according to standards, you could just hook into the wp user creation action and subscribe them instead... something like:
add_action('user_register', 'my_member_create'); function my_member_create($userid) { # now add your forum subscription include_once(SLIBDIR.'sp-subscriptions-database.php'); sp_subscriptions_save_forum_subscription($userid, $forumid, false); }
just replace $forumid with the id of the forum you want to subscribe to (calculate however you need to)... that action is fired when wp creates a new user (whether through registration, admin panel or plugin using the api)... I havent actually test that but should do the trick...
using actions/filters/problem-with-post-edit-buttonooks are much more powerful than a lot of options that wont be used by most folks and allow you to customize it exactly the way you want...
Visit Cruise Talk Central and Mr Papa's World
If you haven't found it already then this - http://codex.wordpress.org/Fun....._Reference - is a good place to start. SP actions and filters behave in exactly the same way built and using the same API. Ours are not all documented yet - well neither is the WP core come to that! - but we will always help identify whatever you might need.
YELLOW
SWORDFISH
|
1 Guest(s)