Ticket #2566: jeffsayre_2566_repatch.patch
File jeffsayre_2566_repatch.patch, 8.9 KB (added by , 14 years ago) |
---|
-
buddypress/bp-themes/bp-default/members/single/member-header.php
21 21 <?php endif; ?> 22 22 23 23 <div id="item-buttons"> 24 <?php if ( function_exists( 'bp_add_friend_button' ) ) : ?> 25 <?php bp_add_friend_button() ?> 26 <?php endif; ?> 24 <?php if ( function_exists( 'bp_add_friend_button' ) ) : 25 list( $button, $potential_friend_id, $friend_status ) = bp_add_friend_button(); 26 27 if ( $button != false ) { ?> 28 <div class="generic-button friendship-button <?php echo $friend_status ?>" id="friendship-button-<?php echo $potential_friend_id ?>"> 29 <?php echo $button ?> 30 </div> 31 <?php }; 32 endif; ?> 27 33 28 <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_public_message_link' ) ) : ?> 29 <div class="generic-button" id="post-mention"> 30 <a href="<?php bp_send_public_message_link() ?>" 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> 31 </div> 32 <?php endif; ?> 33 34 <?php if ( is_user_logged_in() && !bp_is_my_profile() && function_exists( 'bp_send_private_message_link' ) ) : ?> 35 <div class="generic-button" id="send-private-message"> 36 <a href="<?php bp_send_private_message_link() ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a> 37 </div> 38 <?php endif; ?> 34 <?php if ( function_exists( 'bp_send_public_message_link' ) ) : 35 $button = bp_send_public_message_link(); 36 37 if ( $button != false ) { ?> 38 <div class="generic-button" id="post-mention"> 39 <a href="<?php echo $button ?>" 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> 40 </div> 41 <?php }; 42 endif; ?> 43 44 <?php if ( function_exists( 'bp_send_private_message_link' ) ) : 45 $button = bp_send_private_message_link(); 46 47 if ( $button != false ) { ?> 48 <div class="generic-button" id="send-private-message"> 49 <a href="<?php echo $button ?>" title="<?php _e( 'Send a private message to this user.', 'buddypress' ) ?>"><?php _e( 'Send Private Message', 'buddypress' ) ?></a> 50 </div> 51 <?php }; 52 endif; ?> 39 53 </div><!-- #item-buttons --> 40 54 41 55 <?php -
buddypress/bp-friends/bp-friends-templatetags.php
115 115 } 116 116 117 117 function bp_add_friend_button( $potential_friend_id = false, $friend_status = false ) { 118 echo bp_get_add_friend_button( $potential_friend_id, $friend_status ); 119 } 120 function bp_get_add_friend_button( $potential_friend_id = false, $friend_status = false ) { 121 global $bp, $friends_template; 118 global $bp, $friends_template; 122 119 123 124 120 if ( !is_user_logged_in() ) 121 return false; 125 122 126 127 128 129 123 if ( !$potential_friend_id && $friends_template->friendship->friend ) 124 $potential_friend_id = $friends_template->friendship->friend->id; 125 else if ( !$potential_friend_id && !$friends_template->friendship->friend ) 126 $potential_friend_id = $bp->displayed_user->id; 130 127 131 132 128 if ( $bp->loggedin_user->id == $potential_friend_id ) 129 return false; 133 130 134 135 131 if ( empty( $friend_status ) ) 132 $friend_status = friends_check_friendship_status( $bp->loggedin_user->id, $potential_friend_id ); 136 133 137 $button = '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">'; 138 139 if ( 'pending' == $friend_status ) 140 $button .= '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 141 else if ( 'is_friend' == $friend_status ) 142 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 143 else 144 $button .= '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 145 146 $button .= '</div>'; 147 148 return apply_filters( 'bp_get_add_friend_button', $button, $potential_friend_id, $friend_status ); 134 if ( 'pending' == $friend_status ) { 135 $button = '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '/">' . __( 'Friendship Requested', 'buddypress' ) . '</a>'; 136 } else if ( 'is_friend' == $friend_status ) { 137 $button = '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/remove-friend/' . $potential_friend_id . '/', 'friends_remove_friend' ) . '" title="' . __('Cancel Friendship', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="remove" class="remove">' . __('Cancel Friendship', 'buddypress') . '</a>'; 138 } else { 139 $button = '<a href="' . wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ) . '" title="' . __('Add Friend', 'buddypress') . '" id="friend-' . $potential_friend_id . '" rel="add" class="add">' . __('Add Friend', 'buddypress') . '</a>'; 149 140 } 141 142 return apply_filters( 'bp_get_add_friend_button', array( $button, $potential_friend_id, $friend_status ) ); 150 143 144 } 145 151 146 function bp_get_friend_ids( $user_id = false ) { 152 147 global $bp; 153 148 -
buddypress/bp-activity/bp-activity-templatetags.php
911 911 } 912 912 913 913 function bp_send_public_message_link() { 914 echo bp_get_send_public_message_link(); 915 } 916 function bp_get_send_public_message_link() { 917 global $bp; 914 global $bp; 915 916 if ( is_user_logged_in() && !bp_is_my_profile() ) { 918 917 919 return apply_filters( 'bp_get_send_public_message_link', $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ); 918 $button = wp_nonce_url( $bp->loggedin_user->domain . $bp->activity->slug . '/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ); 919 920 return apply_filters( 'bp_get_send_public_message_link', $button ); 920 921 } 922 return; 923 } 921 924 922 925 function bp_activity_post_form_action() { 923 926 echo bp_get_activity_post_form_action(); -
buddypress/bp-messages/bp-messages-templatetags.php
492 492 } 493 493 494 494 function bp_send_private_message_link() { 495 echo bp_get_send_private_message_link(); 496 } 497 function bp_get_send_private_message_link() { 498 global $bp; 495 global $bp; 496 497 if ( is_user_logged_in() && !bp_is_my_profile() ) { 498 499 $button = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ); 499 500 500 return apply_filters( 'bp_get_send_private_message_link', $b p->loggedin_user->domain . $bp->messages->slug . '/compose/?r=' . bp_core_get_username( $bp->displayed_user->user_id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ));501 return apply_filters( 'bp_get_send_private_message_link', $button ); 501 502 } 503 return; 504 } 502 505 503 506 function bp_send_message_button() { 504 507 echo bp_get_send_message_button();