Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Adjusting Privacy Settings


  • bkypes
    Participant

    @bkypes

    Hey guys,

    I have a quick question on how to adjust the Activity Stream settings. I’ve tried a few plugins but none of them seem to work. I’d like to restrict viewing the activity stream to only users that are logged in. Is this possible without restricting it for my blog as well?

    Thanks,
    Brandon

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

  • bp-help
    Participant

    @bphelp

    @bkypes
    Try adding the below code to bp-custom.php if a logged out visitor tries to go to the activity page then they are redirected to login. For more info on bp-custom.php please see:
    https://codex.buddypress.org/developer/customizing/bp-custom-php/

    
    /* Prevent logged out users from accessing bp activity page */
    function nonreg_visitor_redirect() {
    global $bp;
      if ( bp_is_activity_component() ) {
        if(!is_user_logged_in()) { //just a visitor and not logged in
            wp_redirect( get_option('siteurl') . '/wp-login.php' );
        }
      }
    }
    add_filter('get_header','nonreg_visitor_redirect',1);
    

    bkypes
    Participant

    @bkypes

    @bphelp that works perfectly! Thanks so much!


    bp-help
    Participant

    @bphelp

    @bkypes
    You are welcome, glad I could help!


    DesignAc
    Participant

    @designac

    That’s working great. What if I want to restrict viewing all the member info (profile, groups, friends,…) as well as activity stream to non logged in users. What should I do? I want to make my network closed to non logged in visitors…


    bp-help
    Participant

    @bphelp

    @designac
    I submitted a plugin today to the repository that will do that. It has dashboard settings to exclude pages from protection but it is optional. So stay tuned!


    Asynaptic
    Participant

    @synaptic

    @bphelp can you please link to the plugin? Thanks!


    bp-help
    Participant

    @bphelp

    @synaptic
    Still waiting for the plugin review before I move it over to the repo but until then you can get it here.
    https://github.com/bphelp/private_community_for_bp_lite


    bp-help
    Participant

    @bphelp

    @designac @synaptic
    Just wondering if you could supply some feedback. You may want to download and install it again from the same link. I made some minor changes but it really doesn’t add anything more then what I had but they are using me as a test monkey I suppose with the wp plugin review panel. It works great on 4 different installations I have and I would appreciate your feedback. Keep in mind I intentionally did not block wordpress pages, just the BP ones, but you also have the option to unblock activity for instance. I may however make some changes depending on the feedback given.
    Thanks!


    bkypes
    Participant

    @bkypes

    @bp-help, I just installed the plugin on my site and it works pretty well! I would have done it sooner but we completely rebuilt our site and BP wasn’t working with the theme we’ve been using. I have a quick question for you though. Is it possible to reverse the plugin to leave all pages open and then enter only the pages that I want to block? Our site is an ecommerce site so I want to leave everything open and accessible except for the BuddyPress pages.


    bkypes
    Participant

    @bkypes

    @bp-help

    I’ve been messing around with the first bit of code and changing the:

    if ( bp_is_activity_component() ) {

    to

    if ( bp_is_groups_component() ) {

    or

    if ( bp_is_members_component() ) {

    and each time I try it, it crashes my site. Since it worked with the activity, I feel like the code has to be pretty close to working, I’m just not quite sure what the issue would be.


    bkypes
    Participant

    @bkypes

    I did some more digging and found another one of your older solutions that works perfectly here: https://buddypress.org/support/topic/hiding-groups-activity-members-list-to-non-members/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Resolved] Adjusting Privacy Settings’ is closed to new replies.
Skip to toolbar