To add AutoSuggest to the 'By user' field for searches modify ./Themes/default/Search.template.php as follows:
Find:
<dd><input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" /></dd>
Replace With:
<dd><input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" />
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var oAdduserspec = new smc_AutoSuggest({
sSelf: \'oAdduserspec\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'userspec\',
sControlId: \'userspec\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
// ]]></script>
</dd>
Nice idea, GL700Wing!
Nice, I think I could use this in some mods that I do.
Just added it to my forum, works great 8).
(https://s20.postimg.cc/euqhj28n1/SHOT8683.png)
There is just one small bug. It doesn't check whether you're a guest or not and suggests a nick in either case (logged in or not). I have disabled the Memberlist for guests on my forum, so this is kind of small "leak".
It's not that big of a deal, I'd still keep running it ;). It's not that guests can't check active members on the forum, read their nick and search by it in the Advanced Search box ;).
Quote from: GigaWatt on August 30, 2018, 02:45:31 PMThere is just one small bug. It doesn't check whether you're a guest or not and suggests a nick in either case (logged in or not). I have disabled the Memberlist for guests on my forum, so this is kind of small "leak".
I also don't allow guests to view the memberlist (or to view a member's profile summary) so I don't really consider it an issue. However, it is easy to change the behaviour ...
To add AutoSuggest to the
'By user' field for searches
only where viewing of the memberlist or viewing of member profile summaries is allowed modify ./Themes/default/Search.template.php as follows:
Find:<dd><input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" /></dd>
Replace With:<dd><input id="userspec" type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" class="input_text" />';
if (allowedTo('view_mlist') || allowedTo('profile_view_any'))
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?fin20"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var oAdduserspec = new smc_AutoSuggest({
sSelf: \'oAdduserspec\',
sSessionId: \'', $context['session_id'], '\',
sSessionVar: \'', $context['session_var'], '\',
sSuggestId: \'userspec\',
sControlId: \'userspec\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
// ]]></script>';
echo '
</dd>
Yep, that solved it ;).
Thanks :) Working nicely.