Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Trying to stop spam email


r-a-y
Keymaster

@r-a-y

I liked this idea, so I implemented it on my BP install.

I decided to do step #2.

Here’s what I added to my /wp-content/plugins/bp-custom.php:

function bp_send_message_to_friend_button() {
global $bp;

if ( bp_is_home() || !is_user_logged_in() || !friends_check_friendship($bp->loggedin_user->id,$bp->displayed_user->id) )
return false;

$ud = get_userdata( $bp->displayed_user->id );
?>
<div class="generic-button">
<a class="send-message" title="<?php _e( 'Send Message', 'buddypress' ) ?>" href="<?php echo $bp->loggedin_user->domain . $bp->messages->slug ?>/compose/?r=<?php echo $ud->user_login ?>"><?php _e( 'Send Message', 'buddypress' ) ?></a>
</div>
<?php
}

Then I edited the template files mentioned above with the new function call – bp_send_message_to_friend_button().

Now, the “Send Message” button only shows up if you are a friend of said user.

I’ve added a trac ticket about this issue as an enhancement, so maybe the above change will be built into the bp_send_message_button() function in the next BP release instead of having to add your own function.

There’s still the autocomplete feature in the “My Messages > Compose” area, as well as the wire and group wire to worry about though… one step at a time!

Skip to toolbar