I'm trying to display a table format of the top authors listed by the most recent posts. It should display the author, its avatar, the date, and the title of the post (with a link).
I have it listing the top authors along with the avatar. But it won't display the title of the post or the correct date.
Here's what I have so far:
$uc=array();
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$userpost = get_posts('showposts=1&author='.$bloguser->user_id);
$uc[$bloguser->user_id] = '';
if ($userpost) {
$uc[$bloguser->user_id]=$userpost[0]->post_date;
}
}
arsort($uc);
$i = 0;
foreach ($uc as $key => $value) {
$user = get_userdata($key);
$post_id= $user->postID;
$post_title= $user->post_title;
$post_date= $user->post_date;
$post_count = get_usernumposts($user->ID);
if ($post_count && $i < 10) {
$author_posts_url = get_author_posts_url($key);
?>
<table width="280" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="15%"> <img src="<?php bloginfo ('template_directory'); ?>/images/authors/<?php print $user->user_login; ?>.jpg" onerror= "this.src='<?php bloginfo ('template_directory'); ?>/images/authors/default.jpg'" width="45" height="50"></td>
<td width="85%" align="left">
<div class="sidebar_post"><?php printf ("<a href=\"index.php?p=%s\">%s</a></li>", $post_id,$post_title)?><br></div>
<div class="sidebar_author">By <?php print $user->display_name;?><br></div>
<div class="sidebar_postdate">Posted <?php the_time(get_option('date_format'));?></div>
</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
</table>
<?php }
$i++;
}
}