';
# set cookie values for hide, sort by, and dir
if ( $f_save ) {
$t_manage_string = $f_hide.':'.$f_sort.':'.$f_dir;
gpc_set_cookie( $t_cookie_name, $t_manage_string, true );
} else if ( !is_blank( gpc_get_cookie( $t_cookie_name, '' ) ) ) {
$t_manage_arr = explode( ':', gpc_get_cookie( $t_cookie_name ) );
$f_hide = $t_manage_arr[0];
if ( isset( $t_manage_arr[1] ) ) {
$f_sort = $t_manage_arr[1];
} else {
$f_sort = 'username';
}
if ( isset( $t_manage_arr[2] ) ) {
$f_dir = $t_manage_arr[2];
} else {
$f_dir = 'DESC';
}
}
# Clean up the form variables
$c_sort = addslashes($f_sort);
if ($f_dir == 'ASC') {
$c_dir = 'ASC';
} else {
$c_dir = 'DESC';
}
if ($f_hide == 0) { # a 0 will turn it off
$c_hide = 0;
} else { # anything else (including 'on') will turn it on
$c_hide = 1;
}
?>
';
foreach ( $t_prefix_array as $t_prefix ) {
if ( $t_prefix === 'ALL' ) {
$t_caption = lang_get( 'show_all_users' );
} else {
$t_caption = $t_prefix;
}
if ( $t_prefix == $f_prefix ) {
$t_link = "$t_caption";
} else {
$t_link = '' . $t_caption . '';
}
$t_index_links .= '| ' . $t_link . ' | ';
}
$t_index_links .= '
';
echo $t_index_links;
if ( $f_prefix === 'ALL' ) {
$t_where = '(1 = 1)';
} else {
$t_where = "(username like '$f_prefix%')";
}
# Get the user data in $c_sort order
if ( 0 == $c_hide ) {
$query = "SELECT *, UNIX_TIMESTAMP(date_created) as date_created,
UNIX_TIMESTAMP(last_visit) as last_visit
FROM $t_user_table
WHERE $t_where
ORDER BY '$c_sort' $c_dir";
} else {
$query = "SELECT *, UNIX_TIMESTAMP(date_created) as date_created,
UNIX_TIMESTAMP(last_visit) as last_visit
FROM $t_user_table
WHERE (TO_DAYS(NOW()) - TO_DAYS(last_visit) < '$days_old') AND $t_where
ORDER BY '$c_sort' $c_dir";
}
$result = db_query($query);
$user_count = db_num_rows( $result );
?>