Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: jurgemaister on Jan 29th, 2013  |  syntax: PHP  |  size: 0.60 KB  |  views: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>
clone this paste RAW Paste Data