latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

BuddyPress with s2Member Pro

Home Forums Community Forum BuddyPress with s2Member Pro

This topic contains 18 replies, has 5 voices. Last updated by  prwashburn 4 years, 8 months ago.

Topic Author Topic
Posted: Thursday Apr 12th, 2012 at 10:30 am #10659
Ruan Barbosa
Username: barbosa

Hello,

Some questions about the BuddyPress with s2Member Pro:

  • You can create a level to access only a single group in BuddyPress?
  • BuddyPress groups forums work with S2Member Pro?
  • It is compatible with the plugin Affiliate Royale?
  • Thanks

    List Of Topic Replies

    Viewing 18 replies - 1 through 18 (of 18 total)
    Author Replies
    Author Replies
    Posted: Friday Apr 13th, 2012 at 10:49 am #10725
    Raam Dev
    Username: Raam
    Staff Member

    Hi Ruan,

    s2Member BuddyPress integration works by protecting URI fragments (URLs) that point to various aspects of BuddyPress. Please see the note at Dashboard -› s2Member® -› Restriction Options -› URI Access Restrictions:

    URI Restrictions work great with plugins like BuddyPress that add new areas to your site ( where those new areas are NOT necessarily a Post/Page/Tag/Category ). In other words, anytime you’d like to protect a specific feature offered by BuddyPress ( or other plugins ), you’ll need to nail down specific word fragments found in the URIs associated with those areas.

    With this, you could, for example, restrict the /groups/ URL to only those with Level 2 access.

    Regarding Affiliate Royale: s2Member currently supports iDevAffiliate and ShareASale. Other affiliate plugin integrations may be possible (see Dashboard -› s2Member® -› API / Tracking -› Other Tracking Methods), but you would need to handle such custom integration.

    Posted: Monday Apr 23rd, 2012 at 1:20 pm #11613

    Raam,

    In continuation to the question above is it possible to do a specific URI restriction for /groups/ like what is available to specific pages/posts that is not contingent on membership level?

    I want to limit a group not to just one of the levels of membership but rather make it available only by invitation.

    Thanks.
    Phil

    Posted: Monday Apr 23rd, 2012 at 1:55 pm #11624
    Raam Dev
    Username: Raam
    Staff Member

    Hi Philip,

    I’m not sure I understand your question. Do you want to offer one-time access to specific pages inside /groups/ using the URI restriction? If so, then no that is not currently possible with s2Member. Only WordPress Posts/Pages can be offered through the s2Member Specific Post/Page function.

    Posted: Monday Apr 23rd, 2012 at 4:30 pm #11634

    I am not looking for one-time access. I was wanting to replicate the Specific Post/Page Access Restriction to a group through the URI feature, so that a person could pay to join only one specific group. So you are saying there is no way to limit a URI except through membership levels?

    Posted: Tuesday Apr 24th, 2012 at 2:46 pm #11724
    Raam Dev
    Username: Raam
    Staff Member

    Hi Philip,

    The Specific Post/Page feature of s2Member doesn’t work with subscriptions; it’s designed for Buy Now transactions where you “sell” a specific WordPress Post/Page.

    The only way to currently offer a URI restriction is through a membership that uses one of the s2Member Levels.

    You could “sell” a membership using a specific Level that has a URI restriction and then use a different level for each URI restriction. s2Member Pro comes with support for unlimited levels, so that would be an option if you require this specific functionality.

    Posted: Tuesday Apr 24th, 2012 at 2:56 pm #11729

    Ok. Thanks.

    I was looking around and found this older forum which discusses exactly what I need to do. http://www.primothemes.com/forums/viewtopic.php?t=1405&p=48569
    It is older. Can you tell me if this would still work? If it does where do I locate the code? In which function.php file? The buddypress theme or the main wp function.php file?

    Thanks.

    Phil

    Posted: Tuesday Apr 24th, 2012 at 8:40 pm #11787
    Ruan Barbosa
    Username: barbosa

    Philip,

    http://i48.tinypic.com/35bdpjr.jpg

    What you want to know?

    Posted: Wednesday Apr 25th, 2012 at 11:00 am #11838

    Thanks Ruan.

    I have looked at that approach but I am wanting to not link them to the actual member levels. I watched Jason Caldwell’s video tutorial on Custom Capabilities and he advocates using them to limit multiple levels, instead of the actual member levels. That would work more efficiently for my setup since I am going to have multiple products available and I want to reserve the member levels for people who want long term access to the products.

    Posted: Wednesday Apr 25th, 2012 at 11:04 am #11839

    Raam,

    So I have found through research Jason Caldwell advocates using Custom Capabilities to limit the URI’s. This post discusses the idea: http://www.primothemes.com/forums/viewtopic.php?t=684&p=3141.

    So I copied his Request URI code into my Buddpress default theme functions.php file. I edited to my group name and ccap field. But it doesn’t do anything. When I check the functionality it still allows anyone to access the group. Any thoughts on why it doesn’t work anymore. Or am I missing something altogether. I can post my exact code and specs if it would be helpful.

    Thanks guys. This is the one last sticking point to my site achieving the full functionality I desire.

    Phil

    Posted: Wednesday Apr 25th, 2012 at 10:28 pm #11886
    Raam Dev
    Username: Raam
    Staff Member

    Hi Phil,

    Please do post your exact code and specs. I will send Jason an email to see if he can offer any insight here. Thank you for your patience.

    Posted: Thursday Apr 26th, 2012 at 9:53 am #11937

    Thanks Raam. You guys are great.

    I am running a WP 3.3.2 site with Buddypress 1.5.5 and s2member 120309. I am using the buddypress default theme.

    I am wanting to fully limit access to each specific group based on a Custom Capabilities restriction. I have applied two different sets of code I have found through the forums and neither have worked. I have used them in both my theme function.php file and a bp-custom.php file. The group name is Masterpiece and the ccap is masterpiece.

    Here are the two codes.

    add_action ("template_redirect", "my_custom_capabilities", 1);
    function my_custom_capabilities ()
        {
            if ( bp_is_groups_component() && 'masterpiece' == bp_current_item() && !current_user_can ("access_s2member_ccap_masterpiece"))
                {
                    header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                    exit ();
                }
        } 

    The second way I tried is

    <?php
    add_action ("template_redirect", "my_custom_capabilities", 1);
    function my_custom_capabilities ()
        {
            if (fnmatch ("/masterpiece*", $_SERVER["REQUEST_URI"]) && !current_user_can ("access_s2member_ccap_masterpiece"))
                {
                    header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                    exit ();
                }
        }
    ?>

    Neither seems to redirect to the membership options page. Both allow the person to go through to the actual group. Any help would be greatly appreciated.

    Thanks in advance.
    Phil

    Posted: Thursday Apr 26th, 2012 at 10:38 am #11944
    Ruan Barbosa
    Username: barbosa

    It would help me a lot too.

    Posted: Saturday Apr 28th, 2012 at 5:21 am #12140
    Staff Member

    Thanks for the heads up on this thread.

    The latest versions of BuddyPress/s2Member use the “wp” action Hook, so the “template_redirect” Hook is too late. Try changing references to “template_redirect” in your previous code samples, to “wp“, with the same hook priority of “1”, and you should get the results you’d expect.

    Please let us know if problems persist.

    Sorry for any confusion on this. I know some of my past video tutorials use template_redirect, and those need to be updated as soon as possible, so they continue to work for folks running the latest versions. BuddyPress in particular, requires everything to run on the “wp” action hook now.

    Posted: Saturday Apr 28th, 2012 at 8:25 am #12148

    That was it. Problem solved. You guys rock!!!

    Thanks so much for the help. I am a big fan of s2member.

    Phil

    Posted: Saturday May 5th, 2012 at 9:03 pm #12738

    That’s exactly what I have been looking for. prwashburn, is it possible to post your code with the correction? Also did you add it to your functions.php or bp_functions.php file?

    Posted: Saturday May 5th, 2012 at 10:08 pm #12741

    No problem Mohamed.

    I placed the code in my bp-custom.php file which is in the plugins directory.

    <?php
    add_action ("wp", "my_custom_capabilities", 1);
    function my_custom_capabilities ()
        {
            if ( bp_is_groups_component() && 'group-name' == bp_current_item() && !current_user_can ("access_s2member_ccap_custom-name"))
                {
                    header ("Location: " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                    exit ();
                   }
         }
    ?>

    group-name is the name of the group obviously and custom-name is whatever you have used for the custom capability designation in s2member. You can put multiple functions in using elseif for each custom capability.

    Hope that helps.
    Phil

    Posted: Sunday May 6th, 2012 at 1:59 am #12745

    Thanks for the quick reply Phil.

    That code broke my theme and not sure why. Had to revert to the original bp-custom.php. I’ll try restricting URIs and sell the group links instead.
    Are your groups private or public?

    Posted: Monday May 7th, 2012 at 11:05 am #12796

    Sorry it broke your theme. I am running buddypress default with just a few minor modifications. Works like a charm in that theme.

    I have a mix of public, private and hidden groups. Currently I am adding people to groups manually as the site is still in the beta stage so our traffic is pretty low and I can keep up with it. I will have to program something to automatically assign people to groups soon.

    Viewing 18 replies - 1 through 18 (of 18 total)

    This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

    Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

    Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.