Changeset 3911 for branches/plugin/bbp-admin/bbp-tools.php
- Timestamp:
- 05/22/2012 08:00:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-tools.php
r3890 r3911 385 385 return array( 1, sprintf( $statement, $result ) ); 386 386 387 $key = $wpdb->prefix . '_bbp_topic_count'; 387 388 $insert_values = array(); 388 389 foreach ( $insert_rows as $insert_row ) 389 $insert_values[] = "('{$insert_row->post_author}', ' _bbp_topic_count', '{$insert_row->_count}')";390 $insert_values[] = "('{$insert_row->post_author}', '{$key}', '{$insert_row->_count}')"; 390 391 391 392 if ( !count( $insert_values ) ) 392 393 return array( 2, sprintf( $statement, $result ) ); 393 394 394 $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` = ' _bbp_topic_count';";395 $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';"; 395 396 if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) 396 397 return array( 3, sprintf( $statement, $result ) ); … … 431 432 return array( 1, sprintf( $statement, $result ) ); 432 433 434 $key = $wpdb->prefix . '_bbp_reply_count'; 433 435 $insert_values = array(); 434 436 foreach ( $insert_rows as $insert_row ) 435 $insert_values[] = "('{$insert_row->post_author}', ' _bbp_reply_count', '{$insert_row->_count}')";437 $insert_values[] = "('{$insert_row->post_author}', '{$key}', '{$insert_row->_count}')"; 436 438 437 439 if ( !count( $insert_values ) ) 438 440 return array( 2, sprintf( $statement, $result ) ); 439 441 440 $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` = ' _bbp_reply_count';";442 $sql_delete = "DELETE FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';"; 441 443 if ( is_wp_error( $wpdb->query( $sql_delete ) ) ) 442 444 return array( 3, sprintf( $statement, $result ) ); … … 471 473 $statement = __( 'Removing trashed topics from user favorites… %s', 'bbpress' ); 472 474 $result = __( 'Failed!', 'bbpress' ); 473 $key = bbp_get_favorites_key();475 $key = $wpdb->prefix . '_bbp_favorites'; 474 476 $users = $wpdb->get_results( "SELECT `user_id`, `meta_value` AS `favorites` FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';" ); 475 477 … … 531 533 $statement = __( 'Removing trashed topics from user subscriptions… %s', 'bbpress' ); 532 534 $result = __( 'Failed!', 'bbpress' ); 533 $key = bbp_get_subscriptions_key();535 $key = $wpdb->prefix . '_bbp_subscriptions'; 534 536 $users = $wpdb->get_results( "SELECT `user_id`, `meta_value` AS `subscriptions` FROM `{$wpdb->usermeta}` WHERE `meta_key` = '{$key}';" ); 535 537
Note: See TracChangeset
for help on using the changeset viewer.