Changes in trunk/wp-includes/ms-functions.php [14928:15186]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r14928 r15186 159 159 } 160 160 161 function get_most_active_blogs( $num = 10, $display = true ) {162 $most_active = get_site_option( 'most_active' );163 $update = false;164 if ( is_array( $most_active ) ) {165 if ( ( $most_active['time'] + 60 ) < time() ) { // cache for 60 seconds.166 $update = true;167 }168 } else {169 $update = true;170 }171 172 if ( $update == true ) {173 unset( $most_active );174 $blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details175 if ( is_array( $blogs ) ) {176 reset( $blogs );177 foreach ( (array) $blogs as $key => $details ) {178 $most_active[ $details['blog_id'] ] = $details['postcount'];179 $blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!!180 }181 arsort( $most_active );182 reset( $most_active );183 foreach ( (array) $most_active as $key => $details )184 $t[ $key ] = $blog_list[ $key ];185 186 unset( $most_active );187 $most_active = $t;188 }189 update_site_option( 'most_active', $most_active );190 }191 192 if ( $display == true ) {193 if ( is_array( $most_active ) ) {194 reset( $most_active );195 foreach ( (array) $most_active as $key => $details ) {196 $url = esc_url('http://' . $details['domain'] . $details['path']);197 echo '<li>' . $details['postcount'] . " <a href='$url'>$url</a></li>";198 }199 }200 }201 return array_slice( $most_active, 0, $num );202 }203 204 161 function get_user_count() { 205 162 global $wpdb; … … 598 555 // Check if the domain/path has been used already. 599 556 if ( is_subdomain_install() ) { 600 $mydomain = "$blogname.$domain";557 $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain ); 601 558 $path = $base; 602 559 } else { … … 732 689 $user_login = $wpdb->escape($signup->user_login); 733 690 $user_email = $wpdb->escape($signup->user_email); 734 wpmu_validate_user_signup($user_login, $user_email);735 691 $password = wp_generate_password(); 736 692 … … 766 722 } 767 723 768 wpmu_validate_blog_signup($signup->domain, $signup->title);769 724 $blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, $wpdb->siteid ); 770 725 … … 1239 1194 $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) ); 1240 1195 $global_id = $wpdb->insert_id; 1196 if ( empty( $global_id ) ) 1197 return $term_id; 1241 1198 } else { 1242 1199 $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
Note: See TracChangeset
for help on using the changeset viewer.