Codex

WPMU Functions/get most active blogs

Contents

Description

Returns and/or outputs information relating to the most active blogs hosted on this WPMU install based on number of blog posts.

Parameters

$num
(integer) (optional) The number of blogs to return.
Default: 10
$display
(boolean) (optional) Flag indicating if function should output a list inner (set of li tags) containing the most active blogs (see examples).
Default: true

Return Values

Returns an array of arrays each representing a blog hosted on this WPMU install ordered by activity level. Details are represented in the following format:

blog_id 
(integer) ID of blog detailed.
domain 
(string) Domain used to access this blog.
path 
(string) Path used to access this blog.
postcount 
(integer) The number of posts in this blog.

Usage

<?php get_most_active_blogs( ); ?>

Examples

<?php
echo '<ol>';
get_most_active_blogs();
echo 
'</ol>';
?>
<?php
$most_active 
get_most_active_blogs10false );
foreach (
$most_active AS $active) {
    echo 
$active['domain'].$active['path'].' ('.$active['postcount'].' posts)<br />';
}
?>

Notes

(Devportals) I think it would be good to have another argument to ignore certain blogs, for example my client don't want to display main blog stats here :(