escape(str_replace(array('*', '_',), array('%', '\\_'), $username)).'\''; if ($show_group > -1) $where_sql[] = 'u.group_id='.$show_group; // Fetch user count $result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'users AS u WHERE u.id>1 AND u.group_id!='.PUN_UNVERIFIED.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '')) or error('Unable to fetch user list count', __FILE__, __LINE__, $db->error()); $num_users = $db->result($result); // Determine the user offset (based on $_GET['p']) $num_pages = ceil($num_users / 50); $p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']); $start_from = 50 * ($p - 1); $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_common['User list']); if ($pun_user['g_search_users'] == '1') $focus_element = array('userlist', 'username'); // Generate paging links $paging_links = ''.$lang_common['Pages'].' '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&show_group='.$show_group.'&sort_by='.$sort_by.'&sort_dir='.$sort_dir); define('PUN_ALLOW_INDEX', 1); define('PUN_ACTIVE_PAGE', 'userlist'); require PUN_ROOT.'header.php'; ?>

query('SELECT u.id FROM '.$db->prefix.'users AS u WHERE u.id>1 AND u.group_id!='.PUN_UNVERIFIED.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.', u.id ASC LIMIT '.$start_from.', 50') or error('Unable to fetch user IDs', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { $user_ids = array(); for ($i = 0;$cur_user_id = $db->result($result, $i);$i++) $user_ids[] = $cur_user_id; // Grab the users $result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id IN('.implode(',', $user_ids).') ORDER BY '.$sort_by.' '.$sort_dir.', u.id ASC') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error()); while ($user_data = $db->fetch_assoc($result)) { $user_title_field = get_title($user_data); ?> '."\n\t\t\t\t\t".''."\n"; ?>
'.pun_htmlspecialchars($user_data['username']).'' ?>
'.$lang_search['No hits'].'