Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="widget">
- <h4>Top Contributers to Entries</h4>
- <?php
- function top_authors_list($number = 10) {
- $u = array();
- $authors = get_users_of_blog();
- if ($authors) {
- foreach ($authors as $author) {
- $post_count = get_usernumposts($author->user_id);
- $u[$author->user_id] = $post_count;
- }
- arsort($u);
- $i = 0;
- echo '<div class="bg">';
- echo '<ul class="column" style="float:left;margin-right: 56px;">' . "\n";
- foreach ($u as $key => $value) {
- $i++;
- if ($i <= $number) {
- $user = get_userdata($key);
- $author_posts_url = get_author_posts_url($key);
- $post_count = $value;
- if ($post_count > 0) {
- echo '<li><a href="' . $author_posts_url .'"><span class="category-list-item">' . $user->display_name . '</span> <span class="menu-count">' . $post_count . '</span></a></li>' . "\n";
- }
- }
- }
- echo '</ul></div>';
- }
- }
- ?>
- <?php if (function_exists('top_authors_list')) top_authors_list(10); ?>
- <script type="text/javascript">
- jQuery('document').ready(function($) {
- var i = 0;
- var $newUL;
- var $theColumn = $('.column');
- var length = $theColumn.children('li').length;
- while(length > 3) { /* when enough members merits it, change this and others to 15 */
- $newUL = $('<ul class="' + $theColumn.attr('class') + '" style="float:left;"></ul>');
- while(i < 3) {
- $theColumn.children('li').eq(3).appendTo($newUL)
- i++;
- length--;
- }
- $('.bg').append($newUL);
- i = 0;
- }
- });
- </script>
- </div><!--/top contributors-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement