|
|
|
|
|
query('SELECT COUNT(id)-1 FROM '.$db->prefix.'users') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
else if ($id == 'other')
{
switch ($db_type)
{
case 'mysql':
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users WHERE id>1 AND username NOT REGEXP \'^[a-zA-Z]\'') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
break;
case 'pgsql';
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users WHERE id>1 AND username !~ \'^[a-zA-Z]\'') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
break;
}
}
else
$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users WHERE id>1 AND username LIKE \''.$id.'%\'') or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error());
$num_users = $db->result($result, 0);
// The number of pages required to display all users
$num_pages = ceil($num_users / 50);
if (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages)
{
$p = 1;
$start_from = 0;
}
else
{
$p = $_GET['p'];
$start_from = 50 * ($p - 1);
}
if ($id == 'all')
$result = $db->query('SELECT id, username, email, title, hide_email, num_posts, status, registered FROM '.$db->prefix.'users WHERE id>1 ORDER BY username LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
else if ($id == 'other')
{
switch ($db_type)
{
case 'mysql':
$result = $db->query('SELECT id, username, email, title, hide_email, num_posts, status, registered FROM '.$db->prefix.'users WHERE id>1 AND username NOT REGEXP \'^[a-zA-Z]\' ORDER BY username LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
break;
case 'pgsql';
$result = $db->query('SELECT id, username, email, title, hide_email, num_posts, status, registered FROM '.$db->prefix.'users WHERE id>1 AND username !~ \'^[a-zA-Z]\' ORDER BY username LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
break;
}
}
else
$result = $db->query('SELECT id, username, email, title, hide_email, num_posts, status, registered FROM '.$db->prefix.'users WHERE id>1 AND username LIKE \''.$id.'%\' ORDER BY username LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
$num_users_page = $db->num_rows($result);
if ($num_users_page)
{
while ($num_users_page--)
{
$user_data = $db->fetch_assoc($result);
$user_title = get_title($user_data);
?>
'.htmlspecialchars($user_data['username']).'' ?> |
0) ? ''.$user_data['email'].'' : $lang_ul['Not displayed']; ?> |
|
|
0): ?> |
'.$lang_ul['No users'].' "'.$id.'". | '."\n";
?>