Changeset 7860 for trunk/bp-friends/bp-friends-classes.php
- Timestamp:
- 02/12/2014 09:27:20 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-friends/bp-friends-classes.php
r7556 r7860 365 365 global $wpdb; 366 366 367 $user_ids = implode( ',', wp_parse_id_list( $user_ids ) ); 368 369 return $wpdb->get_results( $wpdb->prepare( "SELECT meta_value as last_activity, user_id FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} ) ORDER BY meta_value DESC", bp_get_user_meta_key( 'last_activity' ) ) ); 367 $last_activities = BP_Core_User::get_last_activity( $user_ids ); 368 369 // Sort and structure as expected in legacy function 370 usort( $last_activities, create_function( '$a, $b', ' 371 if ( $a["date_recorded"] == $b["date_recorded"] ) { 372 return 0; 373 } 374 375 return ( strtotime( $a["date_recorded"] ) < strtotime( $b["date_recorded"] ) ) ? 1 : -1; 376 ' ) ); 377 378 $retval = array(); 379 foreach ( $last_activities as $last_activity ) { 380 $u = new stdClass; 381 $u->last_activity = $last_activity['date_recorded']; 382 $u->user_id = $last_activity['user_id']; 383 384 $retval[] = $u; 385 } 386 387 return $retval; 370 388 } 371 389
Note: See TracChangeset
for help on using the changeset viewer.