Ticket #2985: 2985.002.patch
File 2985.002.patch, 23.4 KB (added by , 13 years ago) |
---|
-
bp-activity/bp-activity-classes.php
Class BP_Activity_Activity { 445 445 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 451 451 $activity_feed[$i]['title'] = trim( strip_tags( $title[0] ) ); -
bp-blogs/bp-blogs-classes.php
Class BP_Blogs_Blog { 250 250 if ( empty( $blog_ids ) ) 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" ); 256 256 } … … Class BP_Blogs_Blog { 258 258 /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */ 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 ) 264 264 $paged_blogs[$i]->description = $desc->description; -
bp-core/bp-core-classes.php
class BP_Core_User { 509 509 // Fetch the user's full name 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 ) 515 515 $paged_users[$i]->fullname = $name->fullname; … … class BP_Core_User { 520 520 // Fetch the user's total friend count 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 ) 526 526 $paged_users[$i]->total_friend_count = (int)$count->total_friend_count; … … class BP_Core_User { 531 531 // Fetch whether or not the user is a friend 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 ) 537 537 $paged_users[$i]->is_friend = $status->is_confirmed; … … class BP_Core_User { 541 541 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 ) 547 547 $paged_users[$i]->last_activity = $activity->last_activity; … … class BP_Core_User { 552 552 // Fetch the user's last_activity 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 ) 558 558 $paged_users[$i]->last_activity = $activity->last_activity; … … class BP_Core_User { 562 562 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 ) 568 568 $paged_users[$i]->latest_update = $update->latest_update; -
bp-core/bp-core-functions.php
function bp_core_time_since( $older_date, $newer_date = false ) { 642 642 } else { 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 648 648 // Finding the biggest chunk (if the chunk fits, break) -
bp-forums/bp-forums-functions.php
function bp_forums_get_topic_extras( $topics ) { 320 320 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 ) { 326 326 $topics[$i]->topic_last_poster_email = $poster->user_email; … … function bp_forums_get_topic_extras( $topics ) { 334 334 // Fetch fullname for the topic's last poster 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 ) 340 340 $topics[$i]->topic_last_poster_displayname = $name->value; … … function bp_forums_get_post_extras( $posts ) { 438 438 // Fetch the poster's user_email, user_nicename and user_login 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 ) { 444 444 $posts[$i]->poster_email = $poster->user_email; … … function bp_forums_get_post_extras( $posts ) { 452 452 // Fetch fullname for each poster. 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 ) 458 458 $posts[$i]->poster_name = $poster->value; -
bp-friends/bp-friends-classes.php
class BP_Friends_Friendship { 98 98 $friends = $wpdb->get_results( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ) ); 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 ); 104 104 else … … class BP_Friends_Friendship { 280 280 $sql = $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} WHERE (friend_user_id = %d || initiator_user_id = %d) && is_confirmed = 1 ORDER BY rand() LIMIT %d", $user_id, $user_id, $total_friends ); 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 291 291 return false; … … class BP_Friends_Friendship { 297 297 $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ); 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 ) ) 303 303 continue; -
bp-friends/bp-friends-functions.php
function friends_search_users( $search_terms, $user_id, $pag_num = 0, $pag_page 244 244 if ( !$user_ids ) 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 ) ); 251 251 } -
bp-friends/bp-friends-template.php
function bp_friends_random_friends() { 92 92 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> 98 98 <a href="<?php echo bp_core_get_user_domain( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i], 'type' => 'thumb' ) ) ?></a> … … function bp_friends_random_members( $total_members = 5 ) { 138 138 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> 144 144 <a href="<?php echo bp_core_get_user_domain( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id, 'type' => 'thumb' ) ) ?></a> -
bp-groups/bp-groups-classes.php
Class BP_Groups_Group { 541 541 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 547 547 foreach ( (array)$user_status as $group_id ) { … … Class BP_Groups_Group { 551 551 } 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 557 557 foreach ( (array)$user_banned as $group_id ) { … … Class BP_Groups_Member { 1105 1105 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 ) 1111 1111 $members[$i]->is_friend = $status->is_confirmed; -
bp-groups/bp-groups-functions.php
function groups_send_invites( $user_id, $group_id ) { 644 644 $invited_users = groups_get_invites_for_group( $user_id, $group_id ); 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 650 650 // Send the actual invite … … function groups_send_membership_request( $requesting_user_id, $group_id ) { 778 778 require_once ( BP_PLUGIN_DIR . '/bp-groups/bp-groups-notifications.php' ); 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 784 784 do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id ); -
bp-groups/bp-groups-template.php
function bp_new_group_invite_friend_list() { 2199 2199 if ( $friends = friends_get_friends_invite_list( $bp->loggedin_user->id, $group_id ) ) { 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 2205 2205 if ( !empty( $invites ) ) { -
bp-members/bp-members-buddybar.php
function bp_adminbar_notifications_menu() { 20 20 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 26 26 <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li> -
bp-members/bp-members-notifications.php
function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) { 49 49 $notifications = BP_Core_Notification::get_all_for_user( $user_id ); 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; 55 55 } -
bp-messages/bp-messages-classes.php
Class BP_Messages_Thread { 175 175 return false; 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 } 181 181 … … Class BP_Messages_Message { 341 341 return false; 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; 347 347 } -
bp-messages/bp-messages-functions.php
function messages_delete_thread( $thread_ids ) { 135 135 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; 141 141 } -
bp-themes/bp-default/_inc/ajax.php
function bp_dtheme_ajax_message_markunread() { 558 558 } else { 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 } 564 564 } … … function bp_dtheme_ajax_message_markread() { 574 574 } else { 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 } 580 580 } … … function bp_dtheme_ajax_messages_delete() { 590 590 } else { 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 } 599 599 add_action( 'wp_ajax_messages_delete', 'bp_dtheme_ajax_messages_delete' ); -
bp-xprofile/bp-xprofile-classes.php
Class BP_XProfile_Group { 72 72 /* Remove the group's fields. */ 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 } 78 78 } … … Class BP_XProfile_Field { 586 586 $_POST["isDefault_{$type}_option"][$i] 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 597 597 if ( 'multiselectbox' == $type || 'checkbox' == $type ) … … Class BP_XProfile_ProfileData { 910 910 $field_sql = ''; 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] ); 916 916 else … … Class BP_XProfile_ProfileData { 930 930 $new_values = array(); 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] ) 936 936 $new_values[$fields[$j]] = $values[$i]->value; -
bp-xprofile/bp-xprofile-template.php
Class BP_XProfile_Data_Template { 102 102 function has_fields() { 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 108 108 if ( !empty( $field->data ) && $field->data->value != null ) { … … function bp_the_profile_field_options( $args = '' ) { 547 547 case 'day': 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 } 553 553 break; … … function bp_the_profile_field_options( $args = '' ) { 563 563 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 } 569 569 break; … … function bp_profile_group_tabs() { 633 633 $group_name = bp_profile_group_name(false); 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"'; 639 639 else