This is the code i got so far. i just dont know how to outbut it!
also i want it to be able to create like a monthly report function so i can output pictures uploaded to the server the last month. but that is not the most important. the output is now...
can anybody help me?
<?php
/*
Plugin Name: Sitewide Picture Count
Plugin URI: http://www.udyr.com
Description: Counts number of uploads by users. use: <b>sitewide_picture_count($pictures)</b> inside of php tags
Author: Patrick
Version: 0.1
Author URI: http://www.udyr.com
*/
function sitewide_picture_count() {
global $wpdb, $blog_id;
$and = wp_post_mime_type_where( $mime_type );
$count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' $and GROUP BY post_mime_type", ARRAY_A );
$pictures = array( );
foreach( (array) $count as $row ) {
$pictures[$row['post_mime_type']] = $row['num_posts'];
}
return (object) $pictures;
}
add_action('sitewide_picture_count', 'sitewide_picture_count');
?>