Page 1 of 1

Pre sales question: Forum integration

PostPosted: June 17th, 2011, 1:48 am
by blogjunkie
I've spent some time looking through your website and documentation but I would like to be sure before I decide to buy the plugin. I am launching a membership site that requires the following capabilities:

Product 1
- Access to pages 1-10
- Access to forum A

Product 2
- Access to pages 11-20
- Access to forum B

And so on. I am aware that S2Member can be integrated with bbPress, but can it achieve the above?

Finally, I'd like to know if I would be able to do upsells and 1 time offers, e.g. User is purchasing Product 1 but the site offers Product 2 at a discount.

Thanks!

Re: Pre sales question: Forum integration

PostPosted: June 18th, 2011, 12:16 am
by Cristián Lávaque
Yes, you could protect the pages using custom capabilities, and the custom capability would be added to the account when you sell the product. http://www.s2member.com/custom-capabilities-video/

So posts 1-10 would require the user to have custom capability product1, and posts 11-20 the product2 custom capability, for example.

There's a bridge to integrate with bbPress. I suggest you read the documentation for it. You can use the custom capabilities to restrict access to the forums. WP Admin -> s2Member -> Other Integrations -> bbPress Plugin Integration

I hope that helps!

Re: Pre sales question: Forum integration

PostPosted: June 18th, 2011, 1:36 am
by blogjunkie
Thank you Christian. But is it possible to restrict product1 custom capabilities to only access Forum A? I watched the video but I haven't installed S2Member to try it out myself. I'm not very technical and I don't want to have to hire a developer to test it just to find out. Thanks

Re: Pre sales question: Forum integration

PostPosted: June 18th, 2011, 12:16 pm
by Cristián Lávaque
From the bbPress Plugin Integration documentation:

Note, it is currently NOT possible to protect a Forum, and have all Topics inside that Forum protected automatically. In order to accomplish that, you'll need to use s2Member's URI Access Restrictions. We're working to improve this functionality in the mean time.


WP Admin -> s2Member -> Restriction Options -> URI Restrictions


Re-reading that, I realize that it would not be possible to protect the forum with a custom capability as I had thought, since URI Restriction works with levels only.

You could protect the posts with levels as well, but this needs a special way of protecting them. Since levels give incremental access (level 2 would have access to itself and lower ones like level 1), to prevent that you'd need to protect the post's content with a conditional that checks the specific level the person is in instead of just protecting the whole page at the level. WP Admin -> s2Member -> API / Scripting -> Using Simple Conditionals -> Example #3

This is why I wasn't suggesting levels and preferred custom capabilities, but then you can't protect a whole forum with it.

Re: Pre sales question: Forum integration

PostPosted: June 20th, 2011, 4:16 am
by Jason Caldwell
What version of bbPress are you integrating please?
Is it the latest version that works as a plugin for WordPress, or the older version that is stand-alone?

This is possible either way, but the instructions are a bit different, depending on which version you're integrating.

Re: Pre sales question: Forum integration

PostPosted: June 20th, 2011, 4:34 am
by blogjunkie
Hi Jason. It's a new site that I will be developing so I haven't decided on all the elements. If I use the bbPress plugin will I be able to restrict forums based on custom capabilities?

Re: Pre sales question: Forum integration

PostPosted: June 20th, 2011, 5:12 am
by Jason Caldwell
Thanks for the follow-up.

Yes, but you will need to use Custom Conditionals along with your Custom Capabilities to get this working properly in the current release. I'm attaching a code sample that should do the job for you. You'll just need to find the numeric ID of each of your bbPress Forums. If you need help finding the numeric IDs, please install this plugin: http://wordpress.org/extend/plugins/wp-show-ids/

Now, just create this directory and file:
/wp-content/mu-plugins/s2-bbpress-ccaps.php
( re-configure the sections below as needed )
Code: Select all
<?php
add_action 
("template_redirect", "my_function");
function my_function ()
    {
        $forumA_id = 123; /* Configure this please. */
        $forumB_id = 456; /* Configure this please. */
        
        if 
(bbp_get_forum_id () === $forumA_id && current_user_cannot ("access_s2member_ccap_forumA"))
            {
                wp_redirect (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                exit;
            }
        else if (bbp_get_forum_id () === $forumB_id && current_user_cannot ("access_s2member_ccap_forumB"))
            {
                wp_redirect (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                exit;
            }
    }
?>

Re: Pre sales question: Forum integration

PostPosted: June 20th, 2011, 4:39 pm
by Cristián Lávaque
Thanks Jason, I didn't know how to help him with that one.

Re: Pre sales question: Forum integration

PostPosted: June 21st, 2011, 3:53 am
by blogjunkie
Thanks Jason and Cristian, I just wanted to say that I really appreciate you guys answering my questions to the extent of writing up the necessary code for what I need to do.