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

git-svn-id: https://develop.svn.wordpress.org/trunk@15168 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-06-08 13:00:09 +00:00
parent e4b69457fb
commit c7be6ba80f
3 changed files with 17 additions and 78 deletions
-43
View File
@@ -158,49 +158,6 @@ function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
return false;
}
function get_most_active_blogs( $num = 10, $display = true ) {
$most_active = get_site_option( 'most_active' );
$update = false;
if ( is_array( $most_active ) ) {
if ( ( $most_active['time'] + 60 ) < time() ) { // cache for 60 seconds.
$update = true;
}
} else {
$update = true;
}
if ( $update == true ) {
unset( $most_active );
$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
if ( is_array( $blogs ) ) {
reset( $blogs );
foreach ( (array) $blogs as $key => $details ) {
$most_active[ $details['blog_id'] ] = $details['postcount'];
$blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!!
}
arsort( $most_active );
reset( $most_active );
foreach ( (array) $most_active as $key => $details )
$t[ $key ] = $blog_list[ $key ];
unset( $most_active );
$most_active = $t;
}
update_site_option( 'most_active', $most_active );
}
if ( $display == true ) {
if ( is_array( $most_active ) ) {
reset( $most_active );
foreach ( (array) $most_active as $key => $details ) {
$url = esc_url('http://' . $details['domain'] . $details['path']);
echo '<li>' . $details['postcount'] . " <a href='$url'>$url</a></li>";
}
}
}
return array_slice( $most_active, 0, $num );
}
function get_user_count() {
global $wpdb;