equal
deleted
inserted
replaced
861 { |
861 { |
862 case 'username': |
862 case 'username': |
863 if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 ) |
863 if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 ) |
864 { |
864 { |
865 $search = '%' . escape_string_like($_GET['userinput']) . '%'; |
865 $search = '%' . escape_string_like($_GET['userinput']) . '%'; |
866 $q = $db->sql_query('SELECT username FROM ' . table_prefix . "users WHERE " . ENANO_SQLFUNC_LOWERCASE . "(username) LIKE '$search' AND user_id > 1"); |
866 $min_id = ( isset($_GET['allow_anon']) && $_GET['allow_anon'] == '1' ) ? '1' : '2'; |
|
867 $q = $db->sql_query('SELECT username FROM ' . table_prefix . "users WHERE " . ENANO_SQLFUNC_LOWERCASE . "(username) LIKE '$search' AND user_id >= $min_id"); |
867 if ( !$q ) |
868 if ( !$q ) |
868 $db->die_json(); |
869 $db->die_json(); |
869 |
870 |
870 while ( $row = $db->fetchrow() ) |
871 while ( $row = $db->fetchrow() ) |
871 { |
872 { |
896 $db->die_json(); |
897 $db->die_json(); |
897 |
898 |
898 while ( $row = $db->fetchrow() ) |
899 while ( $row = $db->fetchrow() ) |
899 { |
900 { |
900 $pathskey = ( isset($paths->nslist[$row['namespace']]) ? $paths->nslist[$row['namespace']] : $row['namespace'] . substr($paths->nslist['Special'], -1) ) . $row['urlname']; |
901 $pathskey = ( isset($paths->nslist[$row['namespace']]) ? $paths->nslist[$row['namespace']] : $row['namespace'] . substr($paths->nslist['Special'], -1) ) . $row['urlname']; |
|
902 |
901 $key = array( |
903 $key = array( |
902 0 => $pathskey, |
904 0 => $pathskey, |
903 'pid_highlight' => highlight_term($_GET['userinput'], dirtify_page_id($pathskey), '<b>', '</b>'), |
905 'pid_highlight' => highlight_term($_GET['userinput'], dirtify_page_id($pathskey), '<b>', '</b>'), |
904 'name_highlight' => highlight_term($_GET['userinput'], $row['name'], '<b>', '</b>') |
906 'name_highlight' => highlight_term($_GET['userinput'], $row['name'], '<b>', '</b>') |
905 ); |
907 ); |