Ticket #655: autocomplete-message.diff
File autocomplete-message.diff, 1.4 KB (added by , 15 years ago) |
---|
-
autocomplete/bp-messages-autocomplete.php
1 1 <?php 2 2 3 /* Load the WP environment */ 3 4 require_once( preg_replace('%(.*)[/\\\\]wp-content[/\\\\].*%', '\1', dirname( __FILE__ ) ) . '/wp-load.php' ); 4 require_once( WP_CONTENT_DIR . '/mu-plugins/bp-core.php' );5 require_once( WP_CONTENT_DIR . '/mu-plugins/bp-friends.php' );6 5 6 /* Load the BP environment */ 7 require_once( BP_PLUGIN_DIR . '/mu-plugins/bp-core.php' ); 8 require_once( BP_PLUGIN_DIR . '/bp-friends.php' ); 9 7 10 // Setup the $bp global array as it's not auto set outside of the normal WP enviro. 8 11 bp_core_setup_globals(); 9 12 friends_setup_globals(); … … 12 15 $friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 ); 13 16 14 17 if ( $friends['friends'] ) { 18 15 19 foreach ( $friends['friends'] as $key => $friend ) { 20 16 21 $ud = get_userdata($friend['user_id']); 17 22 $username = $ud->user_login; 18 echo bp_core_get_avatar( $friend['user_id'], 1, 15, 15 ) . ' ' . bp_fetch_user_fullname( $friend['user_id'], false ) . ' (' . $username . ') 19 '; 20 } 23 echo bp_core_get_avatar( $friend['user_id'], 1, 15, 15 ) . ' ' . bp_fetch_user_fullname( $friend['user_id'], false ) . ' (' . $username . ')'; 24 25 } 26 21 27 } 22 28 ?> 29 No newline at end of file