user_autocomplete
modules/user/user.module, строка 2491
- Версии
- 5 – 6
user_autocomplete($string = '')
Retrieve a pipe delimited string of autocomplete suggestions for existing users
Код
<?php
function user_autocomplete($string = '') {
$matches = array();
if ($string) {
$result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
while ($user = db_fetch_object($result)) {
$matches[$user->name] = check_plain($user->name);
}
}
print drupal_to_js($matches);
exit();
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии