Changeset 4770
- Timestamp:
- 07/21/2011 10:27:09 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r4619 r4770 446 446 $activities = bp_activity_get_sitewide( array( 'max' => $limit ) ); 447 447 448 for ( $i = 0 ; $i < count($activities); $i++) {448 for ( $i = 0, $count = count( $activities ); $i < $count; ++$i ) { 449 449 $title = explode( '<span', $activities[$i]['content'] ); 450 450 -
trunk/bp-blogs/bp-blogs-classes.php
r4398 r4770 251 251 return $paged_blogs; 252 252 253 for ( $i = 0 ; $i < count( $paged_blogs ); $i++) {253 for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) { 254 254 $blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id ); 255 255 $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT post_title, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" ); … … 259 259 $blog_descs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" ) ); 260 260 261 for ( $i = 0 ; $i < count( $paged_blogs ); $i++) {261 for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) { 262 262 foreach ( (array)$blog_descs as $desc ) { 263 263 if ( $desc->blog_id == $paged_blogs[$i]->blog_id ) -
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 ) -
trunk/bp-core/bp-core-functions.php
r4727 r4770 643 643 644 644 // Step one: the first chunk 645 for ( $i = 0, $j = count( $chunks); $i < $j; $i++) {645 for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) { 646 646 $seconds = $chunks[$i][0]; 647 647 -
trunk/bp-forums/bp-forums-functions.php
r4764 r4770 321 321 // Fetch the topic's last poster details 322 322 $poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" ) ); 323 for ( $i = 0 ; $i < count( $topics ); $i++) {323 for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { 324 324 foreach ( (array)$poster_details as $poster ) { 325 325 if ( $poster->topic_id == $topics[$i]->topic_id ) { … … 335 335 if ( bp_is_active( 'xprofile' ) ) { 336 336 $poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" ) ); 337 for ( $i = 0 ; $i < count( $topics ); $i++) {337 for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { 338 338 foreach ( (array)$poster_names as $name ) { 339 339 if ( $name->topic_id == $topics[$i]->topic_id ) … … 439 439 $poster_details = $wpdb->get_results( $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ) ); 440 440 441 for ( $i = 0 ; $i < count( $posts ); $i++) {441 for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) { 442 442 foreach ( (array)$poster_details as $poster ) { 443 443 if ( $poster->user_id == $posts[$i]->poster_id ) { … … 453 453 if ( bp_is_active( 'xprofile' ) ) { 454 454 $poster_names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" ) ); 455 for ( $i = 0 ; $i < count( $posts ); $i++) {455 for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) { 456 456 foreach ( (array)$poster_names as $name ) { 457 457 if ( isset( $topics[$i] ) && $name->user_id == $topics[$i]->user_id ) -
trunk/bp-friends/bp-friends-classes.php
r4634 r4770 99 99 $fids = array(); 100 100 101 for ( $i = 0 ; $i < count($friends); $i++) {101 for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) { 102 102 if ( $assoc_arr ) 103 103 $fids[] = array( 'user_id' => ( $friends[$i]->friend_user_id == $user_id ) ? $friends[$i]->initiator_user_id : $friends[$i]->friend_user_id ); … … 281 281 $results = $wpdb->get_results($sql); 282 282 283 for ( $i = 0 ; $i < count($results); $i++) {283 for ( $i = 0, $count = count( $results ); $i < $count; ++$i ) { 284 284 $fids[] = ( $results[$i]->friend_user_id == $user_id ) ? $results[$i]->initiator_user_id : $results[$i]->friend_user_id; 285 285 } 286 286 287 287 // remove duplicates 288 if ( count( $fids) > 0 )288 if ( count( $fids ) > 0 ) 289 289 return array_flip(array_flip($fids)); 290 290 else … … 298 298 299 299 $invitable_count = 0; 300 for ( $i = 0 ; $i < count($friend_ids); $i++) {300 for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { 301 301 302 302 if ( BP_Groups_Member::check_is_member( (int)$friend_ids[$i], $group_id ) ) -
trunk/bp-friends/bp-friends-functions.php
r4605 r4770 245 245 return false; 246 246 247 for ( $i = 0 ; $i < count( $user_ids ); $i++)248 $users[] = new BP_Core_User( $user_ids[$i]);247 for ( $i = 0, $count = count( $user_ids ); $i < $count; ++$i ) 248 $users[] = new BP_Core_User( $user_ids[$i] ); 249 249 250 250 return array( 'users' => $users, 'count' => BP_Friends_Friendship::search_users_count( $search_terms ) ); -
trunk/bp-friends/bp-friends-template.php
r4675 r4770 93 93 <ul class="horiz-gallery"> 94 94 95 <?php for ( $i = 0 ; $i < count( $friend_ids ); $i++) { ?>95 <?php for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { ?> 96 96 97 97 <li> … … 139 139 <ul class="item-list" id="random-members-list"> 140 140 141 <?php for ( $i = 0 ; $i < count( $user_ids['users'] ); $i++) { ?>141 <?php for ( $i = 0, $count = count( $user_ids['users'] ); $i < $count; ++$i ) { ?> 142 142 143 143 <li> -
trunk/bp-groups/bp-groups-classes.php
r4764 r4770 542 542 /* Fetch the logged in users status within each group */ 543 543 $user_status = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_confirmed = 1 AND is_banned = 0", $bp->loggedin_user->id ) ); 544 for ( $i = 0 ; $i < count( $paged_groups ); $i++) {544 for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) { 545 545 $paged_groups[$i]->is_member = false; 546 546 … … 552 552 553 553 $user_banned = $wpdb->get_col( $wpdb->prepare( "SELECT group_id FROM {$bp->groups->table_name_members} WHERE is_banned = 1 AND user_id = %d AND group_id IN ( {$group_ids} )", $bp->loggedin_user->id ) ); 554 for ( $i = 0 ; $i < count( $paged_groups ); $i++) {554 for ( $i = 0, $count = count( $paged_groups ); $i < $count; ++$i ) { 555 555 $paged_groups[$i]->is_banned = false; 556 556 … … 1106 1106 if ( bp_is_active( 'friends' ) ) { 1107 1107 $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 ) ); 1108 for ( $i = 0 ; $i < count( $members ); $i++) {1108 for ( $i = 0, $count = count( $members ); $i < $count; ++$i ) { 1109 1109 foreach ( (array)$friend_status as $status ) { 1110 1110 if ( $status->initiator_user_id == $members[$i]->user_id || $status->friend_user_id == $members[$i]->user_id ) -
trunk/bp-groups/bp-groups-functions.php
r4729 r4770 645 645 $group = new BP_Groups_Group( $group_id ); 646 646 647 for ( $i = 0 ; $i < count( $invited_users ); $i++) {647 for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) { 648 648 $member = new BP_Groups_Member( $invited_users[$i], $group_id ); 649 649 … … 779 779 780 780 // Saved okay, now send the email notification 781 for ( $i = 0 ; $i < count( $admins ); $i++)781 for ( $i = 0, $count = count( $admins ); $i < $count; ++$i ) 782 782 groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id ); 783 783 -
trunk/bp-groups/bp-groups-template.php
r4729 r4770 2200 2200 $invites = groups_get_invites_for_group( $bp->loggedin_user->id, $group_id ); 2201 2201 2202 for ( $i = 0 ; $i < count( $friends ); $i++) {2202 for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) { 2203 2203 $checked = ''; 2204 2204 -
trunk/bp-members/bp-members-buddybar.php
r4761 r4770 21 21 if ( $notifications ) { 22 22 $counter = 0; 23 for ( $i = 0 ; $i < count($notifications); $i++) {23 for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { 24 24 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?> 25 25 -
trunk/bp-members/bp-members-notifications.php
r4624 r4770 50 50 51 51 // Group notifications by component and component_action and provide totals 52 for ( $i = 0 ; $i < count($notifications); $i++) {52 for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { 53 53 $notification = $notifications[$i]; 54 54 $grouped_notifications[$notification->component_name][$notification->component_action][] = $notification; -
trunk/bp-messages/bp-messages-classes.php
r4736 r4770 176 176 177 177 $count = 0; 178 for ( $i = 0 ; $i < count( $unread_counts ); $i++) {178 for ( $i = 0, $count = count( $unread_counts ); $i < $count; ++$i ) { 179 179 $count += $unread_counts[$i]->unread_count; 180 180 } … … 342 342 343 343 if ( is_array( $recipient_usernames ) ) { 344 for ( $i = 0 ; $i < count($recipient_usernames); $i++) {344 for ( $i = 0, $count = count( $recipient_usernames ); $i < $count; ++$i ) { 345 345 if ( $rid = bp_core_get_userid( trim($recipient_usernames[$i]) ) ) 346 346 $recipient_ids[] = $rid; -
trunk/bp-messages/bp-messages-functions.php
r4628 r4770 136 136 if ( is_array( $thread_ids ) ) { 137 137 $error = 0; 138 for ( $i = 0 ; $i < count( $thread_ids ); $i++) {138 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 139 139 if ( !$status = BP_Messages_Thread::delete( $thread_ids[$i]) ) 140 140 $error = 1; -
trunk/bp-themes/bp-default/_inc/ajax.php
r4710 r4770 559 559 $thread_ids = explode( ',', $_POST['thread_ids'] ); 560 560 561 for ( $i = 0 ; $i < count($thread_ids); $i++) {561 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 562 562 BP_Messages_Thread::mark_as_unread($thread_ids[$i]); 563 563 } … … 575 575 $thread_ids = explode( ',', $_POST['thread_ids'] ); 576 576 577 for ( $i = 0 ; $i < count($thread_ids); $i++) {577 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { 578 578 BP_Messages_Thread::mark_as_read($thread_ids[$i]); 579 579 } … … 591 591 $thread_ids = explode( ',', $_POST['thread_ids'] ); 592 592 593 for ( $i = 0 ; $i < count($thread_ids); $i++)593 for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) 594 594 BP_Messages_Thread::delete($thread_ids[$i]); 595 595 596 _e( 'Messages deleted.', 'buddypress');596 _e( 'Messages deleted.', 'buddypress' ); 597 597 } 598 598 } -
trunk/bp-xprofile/bp-xprofile-classes.php
r4634 r4770 73 73 if ( BP_XProfile_Field::delete_for_group( $this->id ) ) { 74 74 /* Remove profile data for the groups fields */ 75 for ( $i = 0 ; $i < count( $this->fields ); $i++) {75 for ( $i = 0, $count = count( $this->fields ); $i < $count; ++$i ) { 76 76 BP_XProfile_ProfileData::delete_for_field( $this->fields[$i]->id ); 77 77 } … … 587 587 ); 588 588 589 $i++;589 ++$i; 590 590 } 591 591 } 592 592 593 593 if ( !empty( $options ) ) { 594 for ( $i = 0 ; $i < count( $options ); $i++) {594 for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) { 595 595 $j = $i + 1; 596 596 … … 911 911 912 912 if ( is_array( $fields ) ) { 913 for ( $i = 0 ; $i < count( $fields ); $i++) {913 for ( $i = 0, $count = count( $fields ); $i < $count; ++$i ) { 914 914 if ( $i == 0 ) 915 915 $field_sql .= $wpdb->prepare( "AND ( f.name = %s ", $fields[$i] ); … … 931 931 932 932 if ( is_array( $fields ) ) { 933 for ( $i = 0 ; $i < count( $values ); $i++) {933 for ( $i = 0, $count = count( $values ); $i < $count; ++$i ) { 934 934 for ( $j = 0; $j < count( $fields ); $j++ ) { 935 935 if ( $values[$i]->name == $fields[$j] ) -
trunk/bp-xprofile/bp-xprofile-template.php
r4678 r4770 103 103 $has_data = false; 104 104 105 for ( $i = 0 ; $i < count( $this->group->fields ); $i++) {105 for ( $i = 0, $count = count( $this->group->fields ); $i < $count; ++$i ) { 106 106 $field = &$this->group->fields[$i]; 107 107 … … 548 548 $html .= '<option value=""' . selected( $day, '', false ) . '>--</option>'; 549 549 550 for ( $i = 1; $i < 32; $i++) {550 for ( $i = 1; $i < 32; ++$i ) { 551 551 $html .= '<option value="' . $i .'"' . selected( $day, $i, false ) . '>' . $i . '</option>'; 552 552 } … … 564 564 $html .= '<option value=""' . selected( $month, '', false ) . '>------</option>'; 565 565 566 for ( $i = 0; $i < 12; $i++) {566 for ( $i = 0; $i < 12; ++$i ) { 567 567 $html .= '<option value="' . $eng_months[$i] . '"' . selected( $month, $eng_months[$i], false ) . '>' . $months[$i] . '</option>'; 568 568 } … … 634 634 635 635 $tabs = array(); 636 for ( $i = 0, $count = count( $groups ); $i < $count; $i++) {636 for ( $i = 0, $count = count( $groups ); $i < $count; ++$i ) { 637 637 if ( $group_name == $groups[$i]->name ) 638 638 $selected = ' class="current"';
Note: See TracChangeset
for help on using the changeset viewer.