Search form adaptation—how to include search in this board/topic

Started by spiros, March 17, 2019, 12:50:58 PM

Previous topic - Next topic

spiros

I've had the search form modified so that specific groups of boards (dictionary-style entries in my case) are searched and can be selected via a dropdown (and options remembered via a cookie):
https://www.translatum.gr/forum/index.php

However, I don't know how to adapt it so that when one is in a specific board/topic, there is also an option in the dropdown to search in this board/topic.

<div id="search">
<form name="searchform" onsubmit="return doSearch();" accept-charset="', $context['character_set'], '">
<input class="search_input" type="text" name="search" value="" />
<input class="search_button" type="submit" name="submit" value="" />
<select class="search_select" name="sengines" onchange="return saveOption();">
<option value="?action=search2;search=" title="Full forum search">Forum</option>
<option value="?action=search2;brd[]=6;brd[]=105;search=" title="German Greek bidirectional search - 92,000 terms">DE⇄EL</option>
</select>';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
<script src="', $settings['theme_url'], '/scripts/user_search.js"></script>
</div>


spiros

Hi Arantor,

Yes, I know this mod.  The issue being I assigned this task to a coder and he did not know how to include the functionality mentioned above...

Advertisement: