Changes in trunk/wp-includes/ms-functions.php [15186:14928]
- File:
-
- 1 edited
-
trunk/wp-includes/ms-functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r15186 r14928 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 -> $details 175 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 161 204 function get_user_count() { 162 205 global $wpdb; … … 555 598 // Check if the domain/path has been used already. 556 599 if ( is_subdomain_install() ) { 557 $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain );600 $mydomain = "$blogname.$domain"; 558 601 $path = $base; 559 602 } else { … … 689 732 $user_login = $wpdb->escape($signup->user_login); 690 733 $user_email = $wpdb->escape($signup->user_email); 734 wpmu_validate_user_signup($user_login, $user_email); 691 735 $password = wp_generate_password(); 692 736 … … 722 766 } 723 767 768 wpmu_validate_blog_signup($signup->domain, $signup->title); 724 769 $blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, $wpdb->siteid ); 725 770 … … 1194 1239 $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) ); 1195 1240 $global_id = $wpdb->insert_id; 1196 if ( empty( $global_id ) )1197 return $term_id;1198 1241 } else { 1199 1242 $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
Note: See TracChangeset
for help on using the changeset viewer.