2) ? -1 : intval($_GET['show_group']); $sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by']; $sort_dir = (!isset($_GET['sort_dir']) || $_GET['sort_dir'] != 'ASC' && $_GET['sort_dir'] != 'DESC') ? 'ASC' : strtoupper($_GET['sort_dir']); $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['User list']; if ($pun_user['g_search_users'] == '1') $focus_element = array('userlist', 'username'); define('PUN_ALLOW_INDEX', 1); require PUN_ROOT.'header.php'; ?>

escape(str_replace('*', '%', $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'.(!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']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p']; $start_from = 50 * ($p - 1); // 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='.strtoupper($sort_dir)); ?>

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>1'.(!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 list', __FILE__, __LINE__, $db->error()); if ($db->num_rows($result)) { 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'].'