1) stderr( _("Error"), "Invalid input"); if ($letter == "" || strpos("abcdefghijklmnopqrstuvwxyz", $letter) === false) $letter = "a"; $query = "username LIKE '$letter%' AND status='confirmed'"; $q = "letter=$letter"; } if ($class) { $query .= " AND class=$class"; $q .= ($q ? "&" : "") . "class=$class"; } stdhead("Users"); print("

Users

\n"); print("
\n"); print("Search: \n"); print("\n"); print("\n"); print("
\n"); print("

\n"); for ($i = 97; $i < 123; ++$i) { $l = chr($i); $L = chr($i - 32); if ($l == $letter) print("$L\n"); else print("$L\n"); } print("

\n"); $page = (int) $_GET['page']; $perpage = 100; $offset = ($page * $perpage) - $perpage; if($offset < 0) $offset = 0; $country_sql = "concat('\"',')"; $sql = sprintf('SELECT SQL_CALC_FOUND_ROWS users.id as id, users.username as username, users.class as class, IF ( users.country >0, %s, \'---\' ) as country, IF ( users.added = "0000-00-00 00:00:00", "-", users.added ) as added, IF ( users.last_access = "0000-00-00 00:00:00", "-", users.last_access ) as last_access FROM users USE INDEX( username_status) LEFT JOIN countries ON users.country = countries.id WHERE %s ORDER BY username LIMIT %u,%u', $country_sql, $query, $offset, $perpage); $res = do_mysql_query($sql) or sqlerr(); $count = mysql_result( do_mysql_query('SELECT FOUND_ROWS()'), 0); $pages = floor($count / $perpage); if ($pages * $perpage < $arr[0]) ++$pages; if ($page < 1) $page = 1; if ($page > $pages) $page = $pages; for ($i = 1; $i <= $pages; ++$i) if ($i == $page) $pagemenu .= "$i\n"; else $pagemenu .= "$i\n"; if ($page == 1) $browsemenu .= "<< Prev"; else $browsemenu .= "<< Prev"; $browsemenu .= "      "; if ($page == $pages) $browsemenu .= "Next >>"; else $browsemenu .= "Next >>"; print("

$browsemenu
$pagemenu

"); $num = mysql_num_rows($res); print("\n"); print("\n"); while($arr = mysql_fetch_assoc($res)) { echo '" . ''; } echo '
User nameRegisteredLast accessClassCountry
'.$arr['username'].''.($arr['donated'] > 0 ? "Donor" : "")."'.$arr['added'].''.$arr['last_access'].''. get_user_class_name($arr['class']) . ''.$arr['country'].'

'.$pagemenu.'
'.$browsemenu.'

'; stdfoot(); ?>