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: a guest on May 23rd, 2011  |  syntax: PHP  |  size: 3.17 KB  |  views: 54  |  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. if ((!isset($_GET['sort'])) || ($_GET['sort'] == 'date_new')) {
  3.         $sort = "user_registered DESC";
  4. } elseif ($_GET['sort'] == 'name') {
  5.         $sort = "user_firstname ASC, user_lastname ASC";
  6. } elseif ($_GET['sort'] == 'date_old') {
  7.         $sort = "user_registered ASC";
  8. } elseif ($_GET['sort'] == 'ort') {
  9.         $sort = "location ASC, user_firstname ASC, user_lastname ASC";
  10. } elseif ($_GET['sort'] == 'land') {
  11.         $sort = "country ASC, user_firstname ASC, user_lastname ASC";
  12. } elseif ($_GET['sort'] == 'comment') {
  13.         $sort = "user_firstname ASC, user_lastname ASC";
  14.         $ifcom = "AND your_thoughts_about_dubbing != ''";
  15. } else {
  16.         $sort = "user_registered DESC";
  17. }
  18.  
  19. $list_number = "50";
  20. if (!isset($_GET['p'])) {
  21.         $p = 1;
  22.         $_GET['p'] = 1;
  23. } else {
  24.         $p = $_GET['p'];
  25. }
  26. $from = (($p * $list_number) - $list_number);
  27.  
  28.  
  29.         echo 'Sortieren nach
  30.         <a href="/de/liste?p='.$_GET['p'].'&sort=name">Name</a>,
  31.         <a href="/de/liste?p='.$_GET['p'].'&sort=date_new">Datum</a>,
  32.         <a href="/de/liste?p='.$_GET['p'].'&sort=ort">Ort</a>,
  33.         oder
  34.         <a href="/de/liste?p='.$_GET['p'].'&sort=land">Land</a>.
  35.         ';
  36.  
  37. $listed_count = mysql_num_rows(mysql_query("SELECT ID FROM wp_users"));
  38.  
  39.         echo $listed_count." Unterschriften.";
  40.         echo '<br /><br /><ul class="liste">';
  41.  
  42.  
  43. $listed_sql = "SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' ORDER BY ".$sort."
  44.                                                                 LIMIT ".$from.", ".$list_number;
  45.  
  46. $authors = $wpdb->get_results($listed_sql);
  47.  
  48. foreach ($authors as $author) {
  49.        
  50. $user_url = get_the_author_meta('user_url', $author->ID);
  51. $user_firstname = get_the_author_meta('user_firstname', $author->ID);
  52. $user_lastname = get_the_author_meta('user_lastname', $author->ID);
  53. $user_lastname = substr($user_lastname,0,1);
  54. $user_lastname = $user_lastname.".";
  55. $country = get_the_author_meta('country', $author->ID);
  56. $location = get_the_author_meta('location', $author->ID);
  57. $your_thoughts_about_dubbing = get_the_author_meta('your_thoughts_about_dubbing', $author->ID);
  58.  
  59.     echo "<li>
  60.                         <div class='user'>";
  61.                         #echo get_avatar($author->ID);
  62.                         if (!empty($user_url)) {
  63.                                 echo '<a href="'.$user_url.'" target="_blank">';
  64.                         }
  65.                         echo $user_firstname.' '.$user_lastname;
  66.                         if (!empty($user_url)) {
  67.                                 echo "</a>";
  68.                         }
  69.                         echo '</div>';
  70.                         echo '<div class="from"><img src="/wp-content/themes/against-dubbing/img/flags/'.$country.'.gif" class="flag" title="'.$country.'" alt="'.$country.'" /> '.$location.'</div>';
  71.                         echo '<div class="clear"></div>';
  72.  
  73.                         if (!empty($your_thoughts_about_dubbing)) {
  74.                                 echo "<div class='usercomment'>";
  75.                                 echo $your_thoughts_about_dubbing;
  76.                                 echo "</div>";
  77.                         }
  78.     echo "</li>";
  79.  
  80. }
  81.  
  82.  
  83. echo '</ul>';
  84. echo '<br />';
  85.  
  86.         if ($p > 1) {
  87.                 $prev = ($p - 1);
  88.                         echo "<div class='newer'><a href='/de/liste/".$prev."/".$_GET['sort']."'>&laquo; Zur&uuml;ck | </a></div>";
  89.         }
  90.        
  91.        
  92.        
  93.         echo "Seiten ";
  94.         for($i = 1; $i <= $pagecount; $i++){
  95.                 if(($p) == $i){
  96.                 echo " <strong>".$i."</strong> ";
  97.                 } else {
  98.                                 echo " <a href='/de/liste/".$i."/".$_GET['sort']."'>".$i."</a> ";
  99.                 }
  100.         }
  101.         if ($p < $pagecount) {
  102.                 $next = ($p + 1);
  103.                                 echo "<div class='older'><a href='/de/liste/".$next."/".$_GET['sort']."'> | Vor &raquo;</a></div>";      
  104.         }
  105. ?>