Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('WP_USE_THEMES', false);
- require('/home/fomana/webapps/vncblog/wp-load.php');
- //Get users and count of posts put into array $uc, sort array by post count ascending, loop through array and echo user info, get latest post for each user and display time and title
- $uc = array();
- $blogusers = get_users_of_blog();
- if ($blogusers) {
- foreach ($blogusers as $bloguser) {
- $post_count = get_usernumposts($bloguser->user_id);
- $uc[$bloguser->user_id]=$post_count;
- }
- arsort($uc); //use asort($uc) if ascending by post count is desired
- $maxauthor = 10; // max authors to display
- $count = 0;
- foreach ($uc as $key => $value) {
- $count++;
- if ($count <= $maxauthor) {
- $user = get_userdata($key);
- $author_posts_url = get_author_posts_url($key);
- $post_count = $value;
- // Output the user info
- ?>
- <div class="block">
- <img class="fruit" src="<?php echo show_fruit(get_the_time('U'))?>" />
- <h3><?php echo $user->user_firstname . ' ' . $user->user_lastname ?></h3>
- <a href="<?php echo $author_posts_url ?>">View Posts</a>
- <?php
- $args=array(
- 'showposts' => 1,
- 'author' => $user->ID,
- 'caller_get_posts' => 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement