Advertisement:

Author Topic: Search form adaptation—how to include search in this board/topic  (Read 451 times)

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,734
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
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.

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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,228
    • StoryBB/StoryBB on GitHub
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline spiros

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 1,734
  • Gender: Male
  • A different point of view
    • spiros.doikas on Facebook
    • doikas on LinkedIn
    • @greektranslator on Twitter
    • Greek Translation
Re: Search form adaptation—how to include search in this board/topic
« Reply #2 on: March 17, 2019, 01:12:47 PM »
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...