The problem is, that the username is converted into an user_id
search.php (104-129 of 3.0.3-RC1)
- Code: Select all
else if ($author)
{
if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
{
trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
}
$sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
WHERE $sql_where
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query_limit($sql, 100);
while ($row = $db->sql_fetchrow($result))
{
$author_id_ary[] = (int) $row['user_id'];
}
$db->sql_freeresult($result);
if (!sizeof($author_id_ary))
{
trigger_error('NO_SEARCH_RESULTS');
}
}
but there are no entries for deleted users and guests, where the username is like you are searching for. so i think you should check for guest posts, with the username aswell.