BuddyDev

Search

[Resolved] Activity as Wire for friends only

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4209

    Hi,

    With the help of your own FB-Like User Activity plug-in and the essential but buggy BuddyPress Activity Privacy plug-in (I resorted to using an older version and modifying it), I am finally close to achieving my dream of having proper social networking on my site. The only thing I need now is Activity as Wire, BUT I want it to be restricted to the poster’s friends only, rather than all logged-in users. How can I achieve this? I’m not afraid to hack the plug-in itself if necessary (please note that I need it to be BP1.8 compatible).

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #4211

    Hi Lee,
    Thank you for asking. It is good to know you are finally nearing the completion.

    Please change this line

    https://github.com/sbrajesh/bp-activity-as-wire/blob/master/bp-activity-as-wire.php#L44

    to

    
    
    if ( is_user_logged_in() && friends_check_friendship( bp_displayed_user_id(), bp_loggedin_user_id() ) && bp_is_user() && ! bp_is_my_profile() && ( ! bp_current_action() || bp_is_current_action( 'just-me' ) || bp_is_current_action( 'mentions' ) ) ) {
    	bp_locate_template( array( 'activity/post-form.php' ), true );
    }
    

    Please do let me know if that works for you or not?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 66
    ljmac on #4213

    Yes! It works! I’ll have to remember that friends_check_friendship( bp_displayed_user_id(), bp_loggedin_user_id() ) function – could come in handy for a lot of things.

    BTW, the function you posted late last year to allow friends AND followers in the FB-Like User Activity Stream works as well (this was another holy grail for me). I’ve finally got the social networking on my site working the way I want!

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #4218

    Thank you.
    I am happy it helped.
    All the best 🙂

You must be logged in to reply to this topic.

This topic is: resolved