Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP Block Member uber-beta


  • shanebp
    Moderator

    @shanebp

    Here’s the start of a 1.7 only plugin for blocking members.

    I did something similar awhile back in 1.5 for a client.
    It worked but was a real pile of spaghetti.

    This approach adjusts queries in an attempt to make a member invisible to anyone they block.

    https://github.com/shanebp/BP-Block-Member

    So testing, code, comments all welcome.

    I know everyone is busy with the 1.7 drop.
    Maybe down the road ?

    @mercime
    @modemlooper

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

  • bp-help
    Participant

    @bphelp

    @shanebp
    Hey I am testing this as it sounds very handy. I am using WP 3.5.1 and BP 1.7b2.
    So far it does block the member your trying to block but when that blocked member goes to the member page this ugly code appears where that member that blocked you would have appeared in the members loop.
    `
    members – where sql:
    WHERE u.meta_key = ‘last_activity’ AND u.user_id NOT IN (1)
    `
    Also after you press the block button the text “block” turns into “error!”
    Another thing is when you refresh the page then the “error!” text turns into “unblock” so far that is the only way to unblock a blocked member.
    I hope this helps you debug. I am looking forward to using this plugin. Thanks!


    bp-help
    Participant

    @bphelp

    @shanebp
    In the activity stream it does block that members activities as well but it shows this message at the top of the activity stream:

    activity – where_sql:
    WHERE a.is_spam = 0 AND a.hide_sitewide = 0 AND a.type != ‘activity_comment’ AND a.user_id NOT IN (1) AND a.secondary_item_id NOT IN (1)

    Also when you press the load more activity button it outputs the same message every time the load more button is pressed.
    Once you get these errors debugged this will be a great contribution. Thanks again!


    shanebp
    Moderator

    @shanebp

    @bphelp

    this ugly code appears

    Those are debug messages, viewing the custom sql – not errors.
    I could have made that clearer.

    Also after you press the block button the text “block” turns into “error!”

    Now, that is an error.
    I’d appreciate knowing the exact steps that lead to it.

    And whether you are invisible, in spite of the error, when the blocked member opens ‘Members’ or ‘Activity’.

    You should delete and reinstall the plugin first – to make sure the table is fresh.
    Also – your OS and browser(s) ?

    I’ve tested it on Win 7, in Chrome, IE 8 and FF 12.


    bp-help
    Participant

    @bphelp

    @shanebp
    Sorry I accidently forgot to deactivate one plugin and once I did the below error went away

    Also after you press the block button the text “block” turns into “error!”

    The plugin that caused the error was a modified version of the friends-only-activity-stream plugin so now its gone. Is there a way to turn those debug messages on and off?
    I’m using Windows 7, XAMPP PHP 5.4.7, FF 12, and Chrome.
    Hope this helps.


    bp-help
    Participant

    @bphelp

    @shanebp And yes you are invisible despite the debug message in the activity stream if you have been blocked.


    shanebp
    Moderator

    @shanebp

    > Is there a way to turn those debug messages on and off?
    Sure, just comment out or delete those ‘echo’ lines.

    > The plugin that caused the error …
    Thanks for the update.
    Possible conflicts with other plugins (not to mention BP itself) is something I expect since I’m messing with core queries.
    But it’s a good way to get familiar with all the good query changes that Boone, et al, made for 1.7.


    bp-help
    Participant

    @bphelp

    @shanebp Sorry I should have been a little more thorough with my testing but here is what I have found. If I am an admin and say I block user1 which is just a subscriber then user1 cannot see my activity. However if user1 blocks user2 in which they are both just subscribers user2 can still see user1’s activity in the activity stream. It also doesn’t block them on the members page. It seems so far that blocking only works for the admin.


    shanebp
    Moderator

    @shanebp

    I can’t duplicate what you state.
    I’m not checking roles (admin, etc) at all.

    I do know it’s easy to get confused while testing.
    And I forgot to _not show the block button when viewing your own profile.
    That’s been fixed and is in the git repo if you’d like to try again.

    One thing to try is to have everyone block user2.
    Then user2 should only see themselves in Members and Activity.


    bp-help
    Participant

    @bphelp

    @shanebp
    Just tried it with the change you made and I still have the same issue. it seems only the admin account is effective at blocking, while subscribers has no effect at all when blocking. If user1 blocks user2 then user2 still see’s user1’s activity and is still visible in the members page as well. The only plugins I have activated is your plugin, buddypress, and bbpress. Not sure what the issue is!


    shanebp
    Moderator

    @shanebp

    @bphelp this conversation should be taking place in the Issues area of the git repo.

    If a moderator could truncate our conversation on this thread, that would be great.


    bp-help
    Participant

    @bphelp

    @shanebp Okay that sounds good.


    modemlooper
    Moderator

    @modemlooper

    why all the spaghetti? This is a simple plugin to put together, just do a redirect if a user is blocked. Save array of user ids and when visiting a profile it all unless logged in user id finds a match in array


    shanebp
    Moderator

    @shanebp

    >why all the spaghetti?
    The client didn’t want it to be obvious to a blocked member that they had been blocked.
    So it required at lot of intercepting, etc.

    What you describe is quite simple and would probably be enough.
    But most requests for this kind of plugin ask for site-wide invisibility – another beast entirely.


    bp-help
    Participant

    @bphelp

    @shanebp

    But most requests for this kind of plugin ask for site-wide invisibility – another beast entirely.

    isn’t that what the plugin your working on supposed to do at least as far as the activity stream, and being visible in the members directory? I really hope you can get this plugin working cause it will be very useful. Thanks for the effort so far!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘BP Block Member uber-beta’ is closed to new replies.
Skip to toolbar