Advertisement
jurgemaister

Untitled

Jan 29th, 2013
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Echo Filtered List
  4.  */
  5. function filtered_list() {
  6.     $authors = get_users('orderby=nicename');
  7.     $all_authors = array();
  8.     foreach($authors as $author)
  9.         if(count_user_posts($author->id) > 0) {
  10.             array_push($all_authors, $author)
  11.         }
  12.     }
  13.     return $all_authors;
  14. }
  15.  
  16. function contributors() {
  17.     $authors = filtered_list();
  18.     for($i = 0; $i < count($authors); $i++) {
  19.         if ($i == count($authors) - 1) {
  20.             echo "<li class='author-last clearfix'>";
  21.         } else {
  22.             echo "<li class='author clearfix'>";
  23.         }
  24.     }
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement