<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%Links::Config::load_vars%>
<html>

<head>
  <title>Gossamer Links Setup: Search Options</title>
  <%include include_style.html%>
</head>

<body>

<form method="post" action="setup.cgi">
<input type="hidden" name="do" value="setup_search" />

<%set header_title = 'Search Options'%>
<%set header_details = 'These options control how your search engine behaves.'%>
<%include include_header.html%>

<table border="0" cellpadding="2" cellspacing="3" width="100%">
  <tr>
    <th class="heading" colspan="2">Search Options:</th>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Default search behaviour. When your search.cgi script is called, these
      are the defaults it will use unless you specifically provide other
      parameters.
    </td>
  </tr>
  <tr>
    <td class="option">search_maxhits</td>
    <td class="value"><input type="text" name="search_maxhits" value="<%cfg_search_maxhits%>" size="5" /></td>
  </tr>
  <tr>
    <td class="option">search_bool</td>
    <td class="value">
      <input type="radio" value="AND" name="search_bool" id="sband" <%if cfg_search_bool eq 'AND'%>checked="checked" <%endif%>/><label for="sband">AND</label>
      <input type="radio" value="OR" name="search_bool" id="sbor" <%if cfg_search_bool eq 'OR'%>checked="checked" <%endif%>/><label for="dbor">OR</label>
    </td>
  </tr>
  <tr>
    <td class="option">search_substring</td>
    <td class="value">
      <input type="radio" value="1" name="search_substring" id="ss1" <%if cfg_search_substring%>checked="checked" <%endif%>/><label for="ss1">On</label>
      <input type="radio" value="0" name="search_substring" id="ss0" <%ifnot cfg_search_substring%>checked="checked" <%endif%>/><label for="ss0">Off</label>
    </td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Enable/Disable the search highlighting of search results.
    </td>
  </tr>
  <tr>
    <td class="option">search_highlighting</td>
    <td class="value">
      <input type="radio" value="1" name="search_highlighting" id="sh1" <%if cfg_search_highlighting%>checked="checked" <%endif%>/><label for="sh1">Yes</label>
      <input type="radio" value="0" name="search_highlighting" id="sh0" <%ifnot cfg_search_highlighting%>checked="checked" <%endif%>/><label for="sh0">No</label>
    </td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      This sets the number of colours that have been defined in the template
      css file.  These colours will be used to highlight the search terms of
      search results.  If there are more search terms used than colours, then
      it will reuse the colours.  The format for the css class name is:
      searchhl-<i>&lt;number between 1 and # of colours&gt;</i>
    </td>
  </tr>
  <tr>
    <td class="option">search_highlight_colors</td>
    <td class="value"><input type="text" name="search_highlight_colors" value="<%cfg_search_highlight_colors%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Enable/Disable the logging of queries that visitors perform.
    </td>
  </tr>
  <tr>
    <td class="option">search_logging</td>
    <td class="value">
      <input type="radio" value="1" name="search_logging" id="sl1" <%if cfg_search_logging%>checked="checked" <%endif%>/><label for="sl1">Yes</label>
      <input type="radio" value="0" name="search_logging" id="sl0" <%ifnot cfg_search_logging%>checked="checked" <%endif%>/><label for="sl0">No</label>
    </td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      The default sort orders for search results. These must relate to columns
      in your Links or Category tables. Use 'score' by itself to return the
      best matches first.
    </td>
  </tr>
  <tr>
    <td class="option">build_sort_order_search</td>
    <td class="value"><input type="text" name="build_sort_order_search" value="<%cfg_build_sort_order_search%>" size="40" /></td>
  </tr>
  <tr>
    <td class="option">build_sort_order_search_cat</td>
    <td class="value"><input type="text" name="build_sort_order_search_cat" value="<%cfg_build_sort_order_search_cat%>" size="40" /></td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      Determines whether to display and group your search results by
      category.
    </td>
  </tr>
  <tr>
    <td class="option">build_search_gb</td>
    <td class="value">
      <input type="radio" value="1" name="build_search_gb" id="bsgb1" <%if cfg_build_search_gb%>checked="checked" <%endif%>><label for="bsgb1">Yes</label>
      <input type="radio" value="0" name="build_search_gb" id="bsgb0" <%ifnot cfg_build_search_gb%>checked="checked" <%endif%>><label for="bsgb0">No</label>
    </td>
  </tr>
  <tr>
    <td class="description" colspan="2">
      By default, users can search on any field in your Links table by going to
      search.cgi?FIELDNAME=SEARCHTERM. If you have fields you don't want users
      to search on, you can list them here (comma separated list), and the
      search.cgi will ignore them.
    </td>
  </tr>
  <tr>
    <td class="option">search_blocked</td>
    <td class="value"><input type="text" name="search_blocked" value="<%cfg_search_blocked%>" size="30" /></td>
  </tr>
</table>

<div class="submit">
  <input type="submit" value="Submit Changes" />
  <input type="submit" name="reset_defaults" value="Restore System Defaults" />
</div>

</form>
</body>
</html>
