• Resolved shirleyl

    (@shirleyl)


    Here’s the behavior I need:
    1. Block access to all BuddyPress and bbPress pages for users who aren’t logged in and redirect to wp-login.php page.

    –This plugin accomplishes this where most others I’ve tried have failed. Thanks!

    2. Display pages specified as static Front page and Posts page under WordPress Dashboard/Settings/Reading to users who aren’t logged in

    — I accomplished this by modifying line 27 in private-community-for-bp.php to add !is_front_page() && !is_home()

    3. Display all individual blog posts with visibility = Public to users who aren’t logged in.

    –I accomplished this by removing the array from the !is_single() parameter on line 27

    4. Display all blog archive pages (author, date, tag, category) to users who aren’t logged in

    — I accomplished this by adding !is_archive() to line 27

    Thus, my line 27 now reads:
    if ( !is_user_logged_in() && !is_front_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() && !is_single() && !is_archive() && !is_page ( array ( ...

    I need to do a bit more testing, but it looks like this plugin with my minor modifications will meet my needs. So, thank you so much for creating this plugin. I hope that you and others find this feedback helpful in future development and use.

    Shirley

    https://www.ads-software.com/plugins/private-community-for-bp-lite/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author bp-help

    (@bphelp)

    Hi @shirleyl
    I am working on adding more options for the next update. I am glad you found a workaround to suit your individual needs. I am sure others will find your workaround useful as well. Thanks for sharing and for the feedback.

    Thread Starter shirleyl

    (@shirleyl)

    Further testing reveals that my bbPress Forums page is not blocked with my modified line 27+:

    if ( !is_user_logged_in() && !is_front_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() && !is_single() && !is_archive() && !is_page
    				( array(
    				 $bphelp_my_unblocked_page_1,
    				 $bphelp_my_unblocked_page_2,
    				 $bphelp_my_unblocked_page_3,
    				 $bphelp_my_unblocked_page_4,
    				 $bphelp_my_unblocked_page_5,
    				 $bphelp_my_unblocked_page_6,
    				 $bphelp_my_unblocked_page_7,
    				 $bphelp_my_unblocked_page_8,
    				 $bphelp_my_unblocked_page_9,
    				 $bphelp_my_unblocked_page_10
    				 ) ) )

    The bbPress Forums page is blocked with the unmodified version 3.6 plugin. Any hints about how my modification broke blocking of the bbPress Forums page would be appreciated. I have double-checked and the Forums page is not included among my 10 unblocked pages.

    Thanks,

    Shirley

    Thread Starter shirleyl

    (@shirleyl)

    Ok, think I found the problem. The bbPress Forums page seems to be covered under !is_archive(), so that’s too broad for me to allow. I changed my parameters to detect specific types of WordPress archives pages:

    if ( !is_user_logged_in() && !is_front_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() && !is_single() && !is_date() && !is_tag() && !is_category() && !is_author() && !is_page
    				( array(
    				 $bphelp_my_unblocked_page_1,
    				 $bphelp_my_unblocked_page_2,
    				 $bphelp_my_unblocked_page_3,
    				 $bphelp_my_unblocked_page_4,
    				 $bphelp_my_unblocked_page_5,
    				 $bphelp_my_unblocked_page_6,
    				 $bphelp_my_unblocked_page_7,
    				 $bphelp_my_unblocked_page_8,
    				 $bphelp_my_unblocked_page_9,
    				 $bphelp_my_unblocked_page_10
    				 ) ) )

    Now, my bbPress Forums page is blocked. ?? Happy dance!

    Shirley

    Plugin Author bp-help

    (@bphelp)

    Thanks again @shirleyl for the workarounds!

    I’ve tried this solution but can’t get to work for pages. Blog seems to work and the homepage as well, but pages are still being redirected.

    Plugin Author bp-help

    (@bphelp)

    @scotm
    Did you enter the correct slug in the plugins unblock fields? It works on all 20 of my installs. Note: it has not been tested with multisite. Also note that its not intended to work on pages a generate a unique id like profile for instance. It works with members, activity, groups (not including sub pages of groups), forum (not including sub pages of forums), and other static pages you may have created. If your having trouble unblocking the types of pages I mentioned then I suggest doing some basic troubleshooting by deactivating all plugins other than BP, bbPress, and Private Community. Also try switching theme to Twenty Twelve, or bp-default. You may also want to check your bp-custom.php in case you have put some custom functions in there that may conflict.

    Thread Starter shirleyl

    (@shirleyl)

    My workaround doesn’t apply to pages. To unblock pages on my site, I rely on the core functionality in the original plugin: I enter the “slug” for the pages I want unblocked in one of the ten slots provided on the Dashboard/Settings/Private Community for BP Settings page.

    If you want to try modifying the code to unblock all pages, I suggest that you consult the conditional tags documentation in the WP Codex https://codex.www.ads-software.com/Conditional_Tags#A_PAGE_Page I’m not certain this is a good approach, however, as it might unblock your buddypress and bbPress pages as well, defeating the entire purpose of using this plugin.

    I hope that makes sense.

    Shirley

    Yes I meant all pages. Most sites have more than 10 pages, so listing 10 pages works fine until you get into a larger site.

    Plugin Author bp-help

    (@bphelp)

    @scotm
    That is the limitation of the free version but if you understand php code and html you could always add additional unblock fields yourself. Just pay attention to the code patterns in private-community-for-bp.php

    Yes I considered doing a mod of the plugin. Might go that route…

    Plugin Author bp-help

    (@bphelp)

    @scotm
    It is licensed under GPL so feel free to do so! Good luck!

    Thanks @shirleyl for this workaround, I too needed to have logged out blog access and this worked nicely.

    Thanks also @scotm for a great plugin!

    Thanks @shirleyl, this was a HUGE help.
    For anyone else trying to do this, the line to modify is now 37, for the updated versions of the plugin.

    Plugin Author bp-help

    (@bphelp)

    @delmorpheus
    Last time I checked Scotm is not a plugin author but if he forked my plugin it would be helpful to share a link so others can benefit.
    @takinglife2themax
    I’m glad @shirleyl ‘s work around helped you out.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘WordPress pages unblocked, BP & bbPress blocked’ is closed to new replies.