View Single Post
  #16  
Old 12th October 2009, 20:14
Nightcrawler's Avatar
Nightcrawler Nightcrawler is offline
Senior Member
 
Join Date: Oct 2009
P2P
Posts: 97
Default
Quote:
Originally Posted by DrNet View Post
(No user found!)
theres nothing wrong with it you need to add a normal user for it to show it doesn't count staff.

this is the code....

Code:
  if (isset ($_GET['searchby'])) 
  { 
    if ($_GET['searchby'] == 'banned') 
    { 
      $query = '(u.enabled = \'no\' OR u.usergroup=' . UC_BANNED . ')'; 
    } 
    else 
    { 
      if ($_GET['searchby'] == 'warned') 
      { 
        $query = '(u.warned = \'yes\' OR u.leechwarn = \'yes\')'; 
      } 
      else 
      { 
        if ($_GET['searchby'] == 'donor') 
        { 
          $query = 'u.donor = \'yes\''; 
        } 
        else 
        { 
          if ($_GET['searchby'] == 'vip') 
          { 
            $query = 'u.usergroup = \'' . UC_VIP . '\''; 
          } 
          else 
          { 
            if ($_GET['searchby'] == 'poweruser') 
            { 
              $query = 'u.usergroup = \'' . UC_POWER_USER . '\''; 
            } 
            else 
            { 
              $query = 'u.usergroup = \'' . UC_USER . '\''; 
            } 
          } 
        } 
      } 
    } 
  } 
  else 
  { 
    $query = 'u.usergroup = \'' . UC_USER . '\''; 
  } 
 
  (($res = sql_query ('SELECT COUNT(*) FROM users WHERE ' . str_replace ('u.', '', $query)) OR sqlerr (__FILE__, 110)) OR sqlerr (__FILE__, 110)); 
  $row = mysql_fetch_array ($res); 
  $count = $row[0]; 
  $perpage = $ts_perpage; 
  list ($pagertop, $pagerbottom, $limit) = pager ($perpage, $count, $_this_script_ . '&' . ($_GET['searchby'] ? 'searchby=' . htmlspecialchars ($_GET['searchby'] . '&') : '')); 
  stdhead ('UsersList'); 
  if (mysql_num_rows ($res) == 0) 
  { 
    begin_main_frame (); 
  } 
 
  $users = number_format (tsrowcount ('id', 'users', 'usergroup=\'' . UC_USER . '\'')); 
  begin_frame ('' . 'Users List (' . $users . ')', true); 
  begin_table (true); 
  echo '<tr><td colspan=7>Search: <a href='; 
  echo $_this_script_; 
  echo '&searchby=all>Show ALL</a> | <a href='; 
  echo $_this_script_; 
  echo '&searchby=banned>banned</a>| <a href='; 
  echo $_this_script_; 
  echo '&searchby=warned>warned</a> | <a href='; 
  echo $_this_script_; 
  echo '&searchby=donor>donor</a> | <a href='; 
  echo $_this_script_; 
  echo '&searchby=vip>vip</a> | <a href='; 
  echo $_this_script_; 
  echo '&searchby=poweruser>poweruser</td></tr> 
 
<tr> 
<td class="colhead">ID</td> 
<td class="colhead" align="left">Username</td> 
<td class="colhead" align="left">e-mail</td> 
<td class="colhead" align="left">Joined</td> 
<td class="colhead" align="center">DELETE</td> 
<td class="colhead" align="center">BAN</td> 
<td class="colhead" align="center">UNBAN</td> 
</tr> 
'; 
  ($res = sql_query ('' . 'SELECT u.*, p.canupload, p.candownload, p.cancomment, p.canmessage, p.canshout, g.namestyle FROM users u LEFT JOIN ts_u_perm p ON (u.id=p.userid) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE ' . $query . ' ORDER BY u.id DESC '.$limit) OR sqlerr (__FILE__, 137)); 
  if (1 <= mysql_num_rows ($res)) 
  { 
    while ($arr = @mysql_fetch_array ($res)) 
    { 
      $pic = get_user_icons ($arr); 
      $cn = get_user_class_name ($arr['usergroup']); 
      echo '<tr> 
<td>' . $arr[id] . '</td> 
<td align="left"><b><a href=' . $BASEURL . '/userdetails.php?id=' . $arr[id] . '>' . get_user_color ($arr['username'], $arr['namestyle']) . ' ' . $pic . ' (' . $cn . ')</b> ' . (($arr['enabled'] == 'no' ? '<font color=red>(banned)</font>' : $arr['usergroup'] == 9) ? '<font color=red>(banned)</font>' : '') . (($arr['warned'] == 'yes' ? '<font color=red>(warned)</font>' : $arr['leechwarn'] == 'yes') ? '<font color=red>(leechwarned)</font>' : '') . '</a><br />' . htmlspecialchars_uni ($arr['ip']) . '</td> 
<td align="left"><a href=mailto:' . $arr[email] . '>' . $arr[email] . '</a></td> 
<td align="left">' . $arr[added] . '</td> 
<td align="center"> 
<form method=post action=' . $_this_script_ . ('' . '> 
<input type=hidden name=action value=deleteuser> 
<input type="hidden" name="delusr" value="' . $arr['id'] . '" /> 
<input class=button type="submit" value="DELETE"> 
</form></td> 
<td align="center"> 
<form method=post action=') . $_this_script_ . '> 
<input type=hidden name=action value=banuser> 
<input type="hidden" name="banusr" value="' . $arr[id] . '" /> 
<input class=button type="submit" value="BAN"> 
</form></td> 
<td align="center"> 
<form method=post action=' . $_this_script_ . '> 
<input type=hidden name=action value=unbanuser> 
<input type="hidden" name="unbanusr" value="' . $arr[id] . '" /> 
<input class=button type="submit" value="UNBAN"> 
</form></td></tr>'; 
    } 
 
    echo '</form> 
'; 
    echo '<tr><td colspan=7 align=center>' . $pagerbottom . '</td></tr>'; 
  } 
  else 
  { 
    echo '<td><td colspan=7><div class=error>No user found!</div></td></tr>'; 
  }
Reply With Quote
The Following User Says Thank You to Nightcrawler For This Useful Post:
dontmind (7th April 2013)