WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/08/2010 01:00:09 PM (11 years ago)
Author:
ryan
Message:

Deprecate get_most_active_blogs() and get_blog_list(). Props ocean90. fixes #13773

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r15050 r15168  
    159159}
    160160
    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 
    204161function get_user_count() {
    205162    global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.