Advertisement:

Author Topic: Adding AutoSuggest to Search for 'By user' field  (Read 305 times)

Offline GL700Wing

  • Full Member
  • ***
  • Posts: 426
  • Gender: Female
Adding AutoSuggest to Search for 'By user' field
« on: July 24, 2018, 03:29:21 AM »
To add  AutoSuggest to the 'By user' field for searches modify ./Themes/default/Search.template.php as follows:

Find:
Code: [Select]
<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:
Code: [Select]
<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>