Changeset 4770 for trunk/bp-core/bp-core-classes.php
- Timestamp:
- 07/21/2011 10:27:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-classes.php
r4709 r4770 510 510 if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) { 511 511 $names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", bp_xprofile_fullname_field_name() ) ); 512 for ( $i = 0 ; $i < count( $paged_users ); $i++) {512 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 513 513 foreach ( (array)$names as $name ) { 514 514 if ( $name->id == $paged_users[$i]->id ) … … 521 521 if ( 'popular' != $type ) { 522 522 $friend_count = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as total_friend_count FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'total_friend_count' ) ) ); 523 for ( $i = 0 ; $i < count( $paged_users ); $i++) {523 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 524 524 foreach ( (array)$friend_count as $count ) { 525 525 if ( $count->id == $paged_users[$i]->id ) … … 532 532 if ( bp_is_active( 'friends' ) ) { 533 533 $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids} ) ) OR (initiator_user_id IN ( {$user_ids} ) AND friend_user_id = %d )", $bp->loggedin_user->id, $bp->loggedin_user->id ) ); 534 for ( $i = 0 ; $i < count( $paged_users ); $i++) {534 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 535 535 foreach ( (array)$friend_status as $status ) { 536 536 if ( $status->initiator_user_id == $paged_users[$i]->id || $status->friend_user_id == $paged_users[$i]->id ) … … 542 542 if ( 'active' != $type ) { 543 543 $user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) ); 544 for ( $i = 0 ; $i < count( $paged_users ); $i++) {544 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 545 545 foreach ( (array)$user_activity as $activity ) { 546 546 if ( $activity->id == $paged_users[$i]->id ) … … 553 553 if ( 'active' != $type ) { 554 554 $user_activity = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as last_activity FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'last_activity' ) ) ); 555 for ( $i = 0 ; $i < count( $paged_users ); $i++) {555 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 556 556 foreach ( (array)$user_activity as $activity ) { 557 557 if ( $activity->id == $paged_users[$i]->id ) … … 563 563 // Fetch the user's latest update 564 564 $user_update = $wpdb->get_results( $wpdb->prepare( "SELECT user_id as id, meta_value as latest_update FROM {$wpdb->usermeta} WHERE meta_key = %s AND user_id IN ( {$user_ids} )", bp_get_user_meta_key( 'bp_latest_update' ) ) ); 565 for ( $i = 0 ; $i < count( $paged_users ); $i++) {565 for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) { 566 566 foreach ( (array)$user_update as $update ) { 567 567 if ( $update->id == $paged_users[$i]->id )
Note: See TracChangeset
for help on using the changeset viewer.