Skip to:
Content
Pages
Categories
Search
Top
Bottom

Block user (free alternative?)

  • @kakilo

    Participant

    Hi guys,

    I was wondering how can I give the functionality to a user block another user from sending this user messages/seeing its profile or its photos (using bp-album as well). I have searched a lot and I couldn’t find anything that is up to me. The functionality I’ve found most capable of doing what I need is a feature of a premium plugin that I cannot afford now, and I’m needing it urgently :'{

    I need the functionality of blocking at least the user of sending messages.
    I know a bit of PHP and WP also, I can modify and adaptate codes to attend my needs, but I am really getting stucked at this.

    I really appreciate any help.

    If there is anyway for anyone help me here I would be very grateful.

    Thanks in advance,
    Cheers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @modemlooper

    Moderator

    if you look through my code starting at line 89 you can see where I’ve removed message button and filtered out non friends from sending messages.

    https://github.com/modemlooper/BuddySuite/blob/master/includes/buddysuite-user-settings.php

    @kakilo

    Participant

    Hey man!

    Thanks for all the support. It is the second time you’ve helped me a lot.

    So, I took a look at your code and I figured out what’s happening. But where the code ends without making it doesn’t work anymore?

    It goes to functions.php, right?

    Thanks a lot.

    @modemlooper

    Moderator

    you should put any code that is not theme related into bp-custom.php https://codex.buddypress.org/plugindev/bp-custom-php/

    It was basically line 106-141 but it won’t work if you cut and paste. You will need php knowledge to make it work.

    That function will just block a message from getting sent for non friends. You would need to edit it for only certain users.

    It would make a great plugin to allow users to block specific users from getting messaged.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Block user (free alternative?)’ is closed to new replies.
Skip to toolbar