Changeset 4896 for trunk/includes/admin/tools.php
- Timestamp:
- 05/11/2013 06:10:20 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/admin/tools.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/tools.php
r4791 r4896 131 131 132 132 default: 133 $message = '<ul>' . "\n\t" . '<li>' . join( '</li>' . "\n\t" . '<li>', $errors ) . '</li>' . "\n" . '</ul>';133 $message = '<ul>' . "\n\t" . '<li>' . implode( '</li>' . "\n\t" . '<li>', $errors ) . '</li>' . "\n" . '</ul>'; 134 134 break; 135 135 } … … 286 286 return array( 1, sprintf( $statement, $result ) ); 287 287 288 $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . join( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);";288 $sql = "INSERT INTO `{$wpdb->postmeta}` (`post_id`, `meta_key`, `meta_value`) (SELECT `post_parent`, '_bbp_reply_count_hidden', COUNT(`post_status`) as `meta_value` FROM `{$wpdb->posts}` WHERE `post_type` = '" . bbp_get_reply_post_type() . "' AND `post_status` IN ( '" . implode( "','", array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') GROUP BY `post_parent`);"; 289 289 if ( is_wp_error( $wpdb->query( $sql ) ) ) 290 290 return array( 2, sprintf( $statement, $result ) ); … … 528 528 529 529 foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) { 530 $chunk = "\n" . join( ",\n", $chunk );530 $chunk = "\n" . implode( ",\n", $chunk ); 531 531 $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;"; 532 532 … … 573 573 574 574 foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) { 575 $chunk = "\n" . join( ",\n", $chunk );575 $chunk = "\n" . implode( ",\n", $chunk ); 576 576 $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;"; 577 577 … … 619 619 continue; 620 620 621 $favorites_joined = join( ',', $favorites );621 $favorites_joined = implode( ',', $favorites ); 622 622 $values[] = "('{$user->user_id}', '{$key}, '{$favorites_joined}')"; 623 623 … … 636 636 637 637 foreach ( array_chunk( $values, 10000 ) as $chunk ) { 638 $chunk = "\n" . join( ",\n", $chunk );638 $chunk = "\n" . implode( ",\n", $chunk ); 639 639 $sql_insert = "INSERT INTO `$wpdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;"; 640 640 if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) { … … 680 680 continue; 681 681 682 $subscriptions_joined = join( ',', $subscriptions );682 $subscriptions_joined = implode( ',', $subscriptions ); 683 683 $values[] = "('{$user->user_id}', '{$key}', '{$subscriptions_joined}')"; 684 684 … … 697 697 698 698 foreach ( array_chunk( $values, 10000 ) as $chunk ) { 699 $chunk = "\n" . join( ",\n", $chunk );699 $chunk = "\n" . implode( ",\n", $chunk ); 700 700 $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;"; 701 701 if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
Note: See TracChangeset
for help on using the changeset viewer.