Changeset 4770 for trunk/bp-forums/bp-forums-functions.php
- Timestamp:
- 07/21/2011 10:27:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 )
Note: See TracChangeset
for help on using the changeset viewer.