sbrajesh

Brajesh Singh

Jul 23rd, 2010
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2. /*$user_id= User whose blog this is*/
  3. ?>
  4. <div id="item-buttons">
  5.             <?php if ( function_exists( 'bp_add_friend_button' ) ) : ?>
  6.                 <?php bp_add_friend_button($user_id) ?>
  7.             <?php endif; ?>
  8.  
  9.             <?php if ( is_user_logged_in()  && function_exists( 'bp_get_send_private_message_link_on_blog' ) ) : ?>
  10.                 <div class="generic-button" id="post-mention">
  11.                     <a href="<?php echo bp_get_send_public_message_link_on_blog($user_id); ?>" title="<?php _e( 'Mention this user in a new public message, this will send the user a notification to get their attention.', 'buddypress' ) ?>"><?php _e( 'Mention this User', 'buddypress' ) ?></a>
  12.                 </div>
  13.             <?php endif; ?>
  14.  
  15.             <?php if ( is_user_logged_in() && function_exists( 'bp_get_send_public_message_link_on_blog' ) ) : ?>
  16.                 <div class="generic-button" id="send-private-message">
  17.                     <a href="<?php echo bp_get_send_private_message_link_on_blog($user_id); ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a>
  18.                 </div>
  19.             <?php endif; ?>
  20. </div><!-- #item-buttons -->
  21.  
  22. <?php
  23. //custom function for public message link, please put the below code in your functions.php
  24. function bp_get_send_public_message_link_on_blog($user_id) {
  25.         global $bp;
  26.         return apply_filters( 'bp_get_send_public_message_link_on_blog', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $user_id) );
  27.     }
  28.     //custom function for private message link
  29.     function bp_get_send_private_message_link_on_blog($user_id) {
  30.         global $bp;
  31.  
  32.         return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $user_id ) );
  33.     }
  34.     ?>
Add Comment
Please, Sign In to add comment