In form of a Network Dashboard Widget:
That <h2>
for the widget title is a bit overkill, but was just testing some styling :)
add_action( 'wp_network_dashboard_setup', 'wpse_66963_network_dashboard_setup' );
function wpse_66963_network_dashboard_setup()
{
wp_add_dashboard_widget(
'wpse_66963_posts_count_widget',
'<div id="icon-edit" class="icon32"></div><h2>Network Posts Count</h2>',
'wpse_66963_posts_count' );
}
function wpse_66963_posts_count()
{
global $wpdb;
$blogs = $wpdb->get_results( $wpdb->prepare(
"SELECT * FROM {$wpdb->blogs} WHERE spam = '0'
AND deleted = '0' AND archived = '0'
ORDER BY registered DESC, 5", ARRAY_A ) );
if ( empty( $blogs ) )
{
echo '<p>No blogs!</p>';
break;
}
?>
<table class="widefat">
<thead>
<tr>
<th>Site</th>
<th>Total posts</th>
<th>Draft posts</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Site</th>
<th>Total posts</th>
<th>Draft posts</th>
</tr>
</tfoot>
<tbody>
<?php
$args = array(
'numberposts' => -1,
'post_type' => 'post',
'post_status' => 'publish' );
$total_network = $draft_network = 0;
foreach ($blogs as $blog)
{
switch_to_blog( $blog->blog_id );
$args['post_status'] = 'publish';
$total_posts = count( get_posts( $args ) );
$total_network += $total_posts;
$args['post_status'] = 'draft';
$draft_posts = count( get_posts( $args ) );
$draft_network += $draft_posts;
?>
<tr>
<td><?php echo $blog->domain; ?></td>
<td><?php echo $total_posts; ?></td>
<td><?php echo $draft_posts; ?></td>
</tr>
<?php
}
?>
<tr>
<td><b>Total count</b></td>
<td><?php echo $total_network; ?></td>
<td><?php echo $draft_network; ?></td>
</tr>
</tbody>
</table>
<?php
restore_current_blog();
}