Changeset 1957
- Timestamp:
- 09/25/2009 10:15:42 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-messages.php
r1952 r1957 556 556 } 557 557 558 function messages_ajax_autocomplete_results() {559 global $bp;560 561 $friends = false;562 563 // Get the friend ids based on the search terms564 if ( function_exists( 'friends_search_friends' ) )565 $friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 );566 567 $friends = apply_filters( 'bp_friends_autocomplete_list', $friends, $_GET['q'], $_GET['limit'] );568 569 if ( $friends['friends'] ) {570 foreach ( $friends['friends'] as $user_id ) {571 $ud = get_userdata($user_id);572 $username = $ud->user_login;573 echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')574 ';575 }576 }577 }578 add_action( 'wp_ajax_messages_autocomplete_results', 'messages_ajax_autocomplete_results' );579 580 581 558 // List actions to clear super cached pages on, if super cache is installed 582 559 add_action( 'messages_delete_thread', 'bp_core_clear_cache' ); -
trunk/bp-messages/deprecated/bp-messages-deprecated.php
r1905 r1957 162 162 add_action( 'wp_ajax_messages_close_notice', 'messages_ajax_close_notice' ); 163 163 164 function messages_ajax_autocomplete_results() { 165 global $bp; 166 167 /* If we are using a BuddyPress 1.1+ theme ignore this. */ 168 if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) ) 169 return false; 170 171 $friends = false; 172 173 // Get the friend ids based on the search terms 174 if ( function_exists( 'friends_search_friends' ) ) 175 $friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 ); 176 177 $friends = apply_filters( 'bp_friends_autocomplete_list', $friends, $_GET['q'], $_GET['limit'] ); 178 179 if ( $friends['friends'] ) { 180 foreach ( $friends['friends'] as $user_id ) { 181 $ud = get_userdata($user_id); 182 $username = $ud->user_login; 183 echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ') 184 '; 185 } 186 } 187 } 188 add_action( 'wp_ajax_messages_autocomplete_results', 'messages_ajax_autocomplete_results' ); 189 164 190 /* Deprecated -- use messages_new_message() */ 165 191 function messages_send_message( $recipients, $subject, $content, $thread_id, $from_ajax = false, $from_template = false, $is_reply = false ) {
Note: See TracChangeset
for help on using the changeset viewer.