Skip to:
Content

BuddyPress.org

Changeset 1957 for trunk/bp-messages.php


Ignore:
Timestamp:
09/25/2009 10:15:42 PM (16 years ago)
Author:
apeatling
Message:

Moving autocomplete results function to deprecated file as it is now in the theme and was causing duplicate results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages.php

    r1952 r1957  
    556556}
    557557
    558 function messages_ajax_autocomplete_results() {
    559     global $bp;
    560    
    561     $friends = false;
    562 
    563     // Get the friend ids based on the search terms
    564     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 
    581558// List actions to clear super cached pages on, if super cache is installed
    582559add_action( 'messages_delete_thread', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.