<html>

<head>
  <title>Gossamer Links - Tools - Keyword Searches</title>
  <%include include_style.html%>
  <base target="_self">
</head>

<body>

<%set header_title = 'Search Query Logs'%>
<%set header_details = 'This screen shows you a list of search queries people have performed.'%>
<%unless config.search_logging%><%set header_details .= "<br><br>Note: Search Logs are currently <b>disabled</b>.  You can enable Search Logs from the Setup => Search Options page."%><%endif%>
<%include include_header.html%>

<%Links::Tools::search_log%>
<br>

<%if toolbar%>
<div class="box">Pages: <%toolbar%></div>
<%endif%>

<table>
  <tr>
    <th width="45%" class="heading"><a href="admin.cgi?do=page;page=tools_search_logs.html;sb=slog_query;so=<%if not so or sb ne 'slog_query' or so eq 'DESC'%>ASC<%else%>DESC<%endif%>;nh=<%nh%>;mh=<%mh%>">Query</a></th>
    <th width="9%" class="heading"><a href="admin.cgi?do=page;page=tools_search_logs.html;sb=slog_count;so=<%if not so or sb ne 'slog_count' or so eq 'ASC'%>DESC<%else%>ASC<%endif%>;nh=<%nh%>;mh=<%mh%>">Count</a></th>
    <th width="22%" class="heading"><a href="admin.cgi?do=page;page=tools_search_logs.html;sb=slog_last;so=<%if not so or sb ne 'slog_last' or so eq 'ASC'%>DESC<%else%>ASC<%endif%>;nh=<%nh%>;mh=<%mh%>">Last Searched</a></th>
    <th width="10%" class="heading"><a href="admin.cgi?do=page;page=tools_search_logs.html;sb=slog_hits;so=<%if not so or sb ne 'slog_hits' or so eq 'ASC'%>DESC<%else%>ASC<%endif%>;nh=<%nh%>;mh=<%mh%>">Results</a></th>
    <th width="14%" class="heading"><a href="admin.cgi?do=page;page=tools_search_logs.html;sb=slog_time;so=<%if not so or sb ne 'slog_time' or so eq 'ASC'%>DESC<%else%>ASC<%endif%>;nh=<%nh%>;mh=<%mh%>">Avg.&nbsp;Time Elapsed</a></th>
  </tr>

<%loop log_loop%>
  <tr>
    <td><a href="<%cgi_url%>/search.cgi?query=<%escape_url slog_query%>" target="_linksearch"><%escape_html slog_query%></a></td>
    <td><%slog_count%></td>
    <td><nobr><%GT::Date::date_get($slog_last, '%yyyy%-%mm%-%dd% %h%:%MM% %tt%')%></nobr></td>
    <td><%slog_hits%></td>
    <td><%if slog_time%><%slog_time_formatted%><%else%><i>Unknown</i><%endif%></td>
  </tr>
<%endloop%>
</table>

<%if toolbar%>
<div class="box">Pages: <%toolbar%></div>
<%endif%>

<form action="admin.cgi" method="post">
<div class="submit">
  Purge listings older than <input name="days" size="2" style="font-weight: normal; font-size: 9pt"> days old.
  <input type="submit" value="Purge">
  <input type="hidden" name="do" value="page">
  <input type="hidden" name="page" value="tools_search_logs.html">
</div>
</form>

</body>
</html>
