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.

About: prwashburn

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
BuddyPress with s2Member Pro

By:  Ruan Barbosa in: Community Forum

voices: 5
replies: 18

4 years, 8 months ago  prwashburn

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
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.

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: 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: 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: 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 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: 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: 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: 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

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

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.