Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restricting Topics with S2Member plugin


  • Killerrabbit2
    Participant

    @killerrabbit2

    WP V. 3.9.1
    bbPress v 2.5.4

    I’ve been banging my head against the wall on this one.

    Here is what I need to do:

    I have users who need to register for different forums. Each specific forum has restrictions. I am using the S2Member plugin. I can with their shortcodes restrict content within a page. I then can restrict a forum listing when I use a bbPress short code within a page.

    The problem is that bbPress dynamically creates topic pages, thus I can not put any shortcode logic in to restrict who sees the topics.

    S2Member has some code that works to restrict content with a function. However, using bbPress conditional tags don’t work. I can use the native conditional tags which do.

    Below is my code that I can’t seem to get working:

    add_action ("wp", "my_custom_capabilities");
    
    function my_custom_capabilities ()
    	{
    	if(bbp_is_topic_tag('Global'))
    		{
    		header ("Location: ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
    		exit();
    		}
    	}

    Ideas?!

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

  • Robin W
    Moderator

    @robin-w

    There are all sorts of backdoors that a ‘page/post’ restricting plugin doesn’t cover for bbpress

    For instance :

    search is usually forum wide
    http://www.mysite.com/topics
    http://www.mysite.com/replies
    looking at topics/replies created in a user profile
    recent topics widget
    recent replies widget

    all usually just bypass a plugin written for pages.

    which is why I wrote the private groups plugin

    https://wordpress.org/plugins/bbp-private-groups/

    There is no reason why it shouldn’t work alongside your members with members protecting your pages & posts, and private groups protecting your forums.

    BUT you do have to set users up to see restricted forums, and this is manual. It is quick to do (just a setting within the user settings), but if you have an automated joining process, then you would need to add a manual step (or write some code!)


    Killerrabbit2
    Participant

    @killerrabbit2

    Robin you are the woman. Awesome. This is just what I needed.

    With S2Member I was able to find a way to protect topics made in the backend but if a participant creates a topic on the front end I can’t protect it.

    A much deserved donation is coming your way.


    Robin W
    Moderator

    @robin-w

    Hey thanks, glad its working for you !

    Name is gender neutral I know, but I’m the male version 🙂


    Killerrabbit2
    Participant

    @killerrabbit2

    Whoops, I thought I might have made that mistake. 🙂

    Thanks again.


    Robin W
    Moderator

    @robin-w

    No problem, glad to help !


    Killerrabbit2
    Participant

    @killerrabbit2

    Enjoy your donation. 🙂


    Robin W
    Moderator

    @robin-w

    Thankyou !!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar