Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/11/2013 06:10:20 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Use implode() instead of join() through-out project. See #2331.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/tools.php

    r4791 r4896  
    131131
    132132            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>';
    134134                break;
    135135        }
     
    286286        return array( 1, sprintf( $statement, $result ) );
    287287
    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`);";
    289289    if ( is_wp_error( $wpdb->query( $sql ) ) )
    290290        return array( 2, sprintf( $statement, $result ) );
     
    528528
    529529    foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
    530         $chunk = "\n" . join( ",\n", $chunk );
     530        $chunk = "\n" . implode( ",\n", $chunk );
    531531        $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
    532532
     
    573573
    574574    foreach ( array_chunk( $insert_values, 10000 ) as $chunk ) {
    575         $chunk = "\n" . join( ",\n", $chunk );
     575        $chunk = "\n" . implode( ",\n", $chunk );
    576576        $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
    577577
     
    619619            continue;
    620620
    621         $favorites_joined = join( ',', $favorites );
     621        $favorites_joined = implode( ',', $favorites );
    622622        $values[]         = "('{$user->user_id}', '{$key}, '{$favorites_joined}')";
    623623
     
    636636
    637637    foreach ( array_chunk( $values, 10000 ) as $chunk ) {
    638         $chunk = "\n" . join( ",\n", $chunk );
     638        $chunk = "\n" . implode( ",\n", $chunk );
    639639        $sql_insert = "INSERT INTO `$wpdb->usermeta` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
    640640        if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
     
    680680            continue;
    681681
    682         $subscriptions_joined = join( ',', $subscriptions );
     682        $subscriptions_joined = implode( ',', $subscriptions );
    683683        $values[]             = "('{$user->user_id}', '{$key}', '{$subscriptions_joined}')";
    684684
     
    697697
    698698    foreach ( array_chunk( $values, 10000 ) as $chunk ) {
    699         $chunk = "\n" . join( ",\n", $chunk );
     699        $chunk = "\n" . implode( ",\n", $chunk );
    700700        $sql_insert = "INSERT INTO `{$wpdb->usermeta}` (`user_id`, `meta_key`, `meta_value`) VALUES $chunk;";
    701701        if ( is_wp_error( $wpdb->query( $sql_insert ) ) ) {
Note: See TracChangeset for help on using the changeset viewer.