diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 8fceb4ac5b..1c786c0a1a 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -40,7 +40,7 @@ if ($mode == 'leaders') } // Check our mode... -if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'team'))) +if (!in_array($mode, array('', 'group', 'viewprofile', 'email', 'contact', 'searchuser', 'team', 'livesearch'))) { trigger_error('NO_MODE'); } @@ -980,7 +980,44 @@ switch ($mode) ); break; - + + case 'livesearch': + $q=request_var('q',''); + $hint=""; + // Get us some users :D + $sql = "SELECT u.user_id + FROM " . USERS_TABLE . " u + WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")"; + + $result = $db->sql_query($sql); + $user_list = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_list[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $user_list); + $result = $db->sql_query($sql); + $i=1; + while ($row = $db->sql_fetchrow($result)) + { $j=($i%2)+1; + if(stripos($row['username'],$q)===0) + { + $hint.="" . + $row['username'] . ""; + $i++; + } + else + $hint.=""; + } + echo $hint; + exit(); + break; + case 'group': default: // The basic memberlist @@ -1456,7 +1493,8 @@ switch ($mode) 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, 'S_ACTIVE_TIME_OPTIONS' => $s_find_active_time, 'S_GROUP_SELECT' => $s_group_select, - 'S_USER_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=$form&field=$field")) + 'S_USER_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=$form&field=$field"), + 'S_LIVE_SEARCH_ACTION' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=livesearch", $is_amp = false)) ); } diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index ee89b103b5..c46b94f102 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -1,3 +1,38 @@ + +

{L_FIND_USERNAME}

@@ -9,7 +44,7 @@
-
+
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 3d5a0a433d..c8eb5da9a6 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -940,6 +940,17 @@ li.pagination ul { z-index: 51; } +/* Live search box */ +#livesearch { + width: 30%; + margin: 0px; + position: absolute; + background-color: #12A3EB; + box-shadow: 1px 2px 5px rgb(175,167,167); + z-index: 999; + overflow: auto; +} + /* Miscellaneous styles ---------------------------------------- */ #forum-permissions { diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index aa6b61fe22..af320d4bd8 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -64,6 +64,41 @@ + + @@ -75,7 +110,7 @@ - + diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 0bffc33f37..ef18e22ccb 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -703,6 +703,14 @@ pre { font-weight: bold; } +#livesearch { + width: 35%; + margin: 0px; + position: absolute; + box-shadow: 1px 2px 5px rgb(175,167,167); + z-index: 999; + overflow: auto; +} /* Former imageset */ span.imageset {
{L_USERNAME}{L_COLON}
{L_EMAIL}{L_COLON}