Changeset 4896
- Timestamp:
- 05/11/2013 06:10:20 AM (13 years ago)
- Location:
- trunk/includes
- Files:
-
- 10 edited
-
admin/tools.php (modified) (8 diffs)
-
common/formatting.php (modified) (1 diff)
-
common/functions.php (modified) (4 diffs)
-
forums/functions.php (modified) (4 diffs)
-
forums/template-tags.php (modified) (1 diff)
-
replies/template-tags.php (modified) (3 diffs)
-
search/template-tags.php (modified) (1 diff)
-
topics/functions.php (modified) (1 diff)
-
topics/template-tags.php (modified) (3 diffs)
-
users/template-tags.php (modified) (1 diff)
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 ) ) ) { -
trunk/includes/common/formatting.php
r4866 r4896 171 171 172 172 // Return the joined content array 173 return join( '', $content );173 return implode( '', $content ); 174 174 } 175 175 -
trunk/includes/common/functions.php
r4848 r4896 1253 1253 1254 1254 // Join post statuses together 1255 $post_status = "'" . join( "', '", $post_status ) . "'";1255 $post_status = "'" . implode( "', '", $post_status ) . "'"; 1256 1256 1257 1257 // Check for cache and set if needed … … 1296 1296 1297 1297 // Join post statuses together 1298 $post_status = "'" . join( "', '", $post_status ) . "'";1298 $post_status = "'" . implode( "', '", $post_status ) . "'"; 1299 1299 1300 1300 // Check for cache and set if needed … … 1339 1339 1340 1340 // Join post statuses together 1341 $post_status = "'" . join( "', '", $post_status ) . "'";1341 $post_status = "'" . implode( "', '", $post_status ) . "'"; 1342 1342 1343 1343 // Check for cache and set if needed … … 1400 1400 1401 1401 // Join post statuses together 1402 $post_status = "'" . join( "', '", $post_status ) . "'";1402 $post_status = "'" . implode( "', '", $post_status ) . "'"; 1403 1403 1404 1404 // Check for cache and set if needed -
trunk/includes/forums/functions.php
r4876 r4896 1363 1363 // Get topics of forum 1364 1364 if ( empty( $topic_count ) ) 1365 $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) );1365 $topic_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . implode( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $forum_id, bbp_get_topic_post_type() ) ); 1366 1366 1367 1367 // Update the count … … 1410 1410 $topic_ids = bbp_forum_query_topic_ids( $forum_id ); 1411 1411 if ( !empty( $topic_ids ) ) { 1412 $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );1412 $reply_count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent IN ( " . implode( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s';", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ); 1413 1413 } else { 1414 1414 $reply_count = 0; … … 1806 1806 1807 1807 if ( !empty( $topic_ids ) ) { 1808 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) );1808 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . implode( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ); 1809 1809 wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0 1810 1810 } else { … … 2022 2022 2023 2023 // Allowed post statuses to pre-trash 2024 $post_stati = join( ',', array(2024 $post_stati = implode( ',', array( 2025 2025 bbp_get_public_status_id(), 2026 2026 bbp_get_closed_status_id(), -
trunk/includes/forums/template-tags.php
r4877 r4896 1778 1778 // Filter the results 1779 1779 $classes = apply_filters( 'bbp_get_forum_class', $classes, $forum_id ); 1780 $retval = 'class="' . join( ' ', $classes ) . '"';1780 $retval = 'class="' . implode( ' ', $classes ) . '"'; 1781 1781 1782 1782 return $retval; -
trunk/includes/replies/template-tags.php
r4866 r4896 101 101 102 102 // Join post statuses together 103 $default['post_status'] = join( ',', $post_statuses );103 $default['post_status'] = implode( ',', $post_statuses ); 104 104 105 105 // Lean on the 'perm' query var value of 'readable' to provide statuses … … 1112 1112 } 1113 1113 1114 $author_link = join( $r['sep'], $author_link );1114 $author_link = implode( $r['sep'], $author_link ); 1115 1115 1116 1116 // No links if anonymous 1117 1117 } else { 1118 $author_link = join( $r['sep'], $author_links );1118 $author_link = implode( $r['sep'], $author_links ); 1119 1119 } 1120 1120 … … 1972 1972 $classes = get_post_class( $classes, $reply_id ); 1973 1973 $classes = apply_filters( 'bbp_get_reply_class', $classes, $reply_id ); 1974 $retval = 'class="' . join( ' ', $classes ) . '"';1974 $retval = 'class="' . implode( ' ', $classes ) . '"'; 1975 1975 1976 1976 return $retval; -
trunk/includes/search/template-tags.php
r4733 r4896 52 52 53 53 $default_post_type = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ); 54 $default_post_status = join( ',', $post_statuses );54 $default_post_status = implode( ',', $post_statuses ); 55 55 56 56 // Default query args -
trunk/includes/topics/functions.php
r4876 r4896 2341 2341 // Get replies of topic 2342 2342 if ( empty( $reply_count ) ) { 2343 $reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . join( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) );2343 $reply_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( '" . implode( '\',\'', array( bbp_get_trash_status_id(), bbp_get_spam_status_id() ) ) . "') AND post_type = '%s';", $topic_id, bbp_get_reply_post_type() ) ); 2344 2344 } 2345 2345 -
trunk/includes/topics/template-tags.php
r4866 r4896 123 123 124 124 // Join post statuses together 125 $default['post_status'] = join( ',', $post_statuses );125 $default['post_status'] = implode( ',', $post_statuses ); 126 126 127 127 // Lean on the 'perm' query var value of 'readable' to provide statuses … … 1439 1439 } 1440 1440 1441 $author_link = join( $r['sep'], $author_link );1441 $author_link = implode( $r['sep'], $author_link ); 1442 1442 1443 1443 // No links if anonymous 1444 1444 } else { 1445 $author_link = join( $r['sep'], $author_links );1445 $author_link = implode( $r['sep'], $author_links ); 1446 1446 } 1447 1447 … … 2198 2198 $classes = get_post_class( $classes, $topic_id ); 2199 2199 $classes = apply_filters( 'bbp_get_topic_class', $classes, $topic_id ); 2200 $retval = 'class="' . join( ' ', $classes ) . '"';2200 $retval = 'class="' . implode( ' ', $classes ) . '"'; 2201 2201 2202 2202 return $retval; -
trunk/includes/users/template-tags.php
r4840 r4896 1440 1440 $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text ); 1441 1441 } 1442 $author_link = join( ' ', $author_link );1442 $author_link = implode( ' ', $author_link ); 1443 1443 1444 1444 // No links if anonymous 1445 1445 } else { 1446 $author_link = join( ' ', $author_links );1446 $author_link = implode( ' ', $author_links ); 1447 1447 } 1448 1448
Note: See TracChangeset
for help on using the changeset viewer.