Skip to:
Content
Pages
Categories
Search
Top
Bottom

More Privacy Options, private blogs, and activity streams


  • Boone Gorges
    Keymaster

    @boonebgorges

    I’m using More Privacy Options to allow users to fine-tune the privacy settings on their blogs. It works by creating three new privacy settings and assigning them to values -1, -2, -3 in wp_blogs ‘public’. BuddyPress only puts a new blog post in the activity streams if the privacy value is an integer, which works fine if you’re only dealing with WPMU’s default values of 1 for public and 0 for private, but having the additional values from More Privacy Options screws things up.

    I changed a line in /bp-blogs/bp-blogs-classes.php to keep this from happening. In the function is_hidden(), replace

    $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) )

    with

    if ( $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) < 1 )

    In other words, instead of ignoring blog entries with a non-integer privacy value, ignore all blog entries whose privacy value is less than 1.

    Because this problem arises from a plugin conflict, I’m not sure if it qualifies as patch-worthy in BP trunk. But I hope it will be useful to someone out there.

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

  • jugoretz
    Participant

    @jugoretz

    This does look useful to me, at least! But I want to confirm before I make the change.

    My line 267 in bp-blogs-classes.php currently reads

    if ( !(int)$wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) )

    So you’re saying I should just replace

    $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT public FROM {$wpdb->base_prefix}blogs WHERE blog_id = %d", $blog_id ) ) )

    within that line? Or the whole line?


    Boone Gorges
    Keymaster

    @boonebgorges

    You’ve got to replace the whole line. (Or just back out !(int) at the beginning of the if statement and replace it with 1 >, which amounts to the same thing.) Let me know how it works.


    arghagain
    Participant

    @arghagain

    Has anyone confirm that this work yet?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘More Privacy Options, private blogs, and activity streams’ is closed to new replies.
Skip to toolbar