]> ruin.nu Git - ndwebbie.git/blob - root/src/forum/search.tt2
Converted forum to catalyst.
[ndwebbie.git] / root / src / forum / search.tt2
1 [% META title = 'Forum search' %]
2
3 <form action="[% c.uri_for('search') %]" method="post">
4
5 <fieldset class="forum-post"> <legend>Topic</legend>
6         Find posts with these words in the thread's topic<br>
7         <input style="width:98%" type="text" name="topic" value=""><br>
8         Require all words: <input type="checkbox" name="alltopic" value="1"><br>
9 </fieldset>
10
11 <fieldset class="forum-post"> <legend>Body</legend>
12         Find posts with these words in the body<br>
13         <input style="width:98%" type="text" name="body" value=""><br>
14         Require all words: <input type="checkbox" name="allbody" value="1"><br>
15 </fieldset>
16
17 <fieldset class="forum-post"> <legend>Usernames</legend>
18         Find posts written by one these users<br>
19         <input style="width:98%" type="text" name="author" value=""><br>
20 </fieldset>
21
22 <fieldset class="forum-post"> <legend>Custom search</legend>
23         Use | (OR) or &amp; (AND) to separate words. Word:A searches for Word in
24         topic and Word:B searches for Word as author. 'Two words' to search for a
25         longer string. Word:D limits the search to just the message body.
26         <p><input style="width:98%" type="text" name="search" value=""></p>
27 </fieldset>
28 <p><input type="submit" name="cmd" value="Search"></p>
29 </form>
30
31 [% IF searcherror %]
32 <p> Could not search, because of: </p>
33 <p> [% searcherror | html %] </p>
34 [% END %]
35
36 [% IF searchresults %]
37 <table>
38 <tr>
39         <th>Thread</th>
40         <th>Author</th>
41         <th>Message</th>
42         <th>Rank</th>
43 </tr>
44         [% FOR post IN searchresults %]
45         <tr align="left" class="[% IF loop.count % 2 == 0 %]even[% ELSE %]odd[% END %]">
46                 <td><a href="[% c.uri_for('thread',post.ftid) %]">&nbsp;[% post.subject %]&nbsp;</a></td>
47                 <td>[% post.username %]</td>
48                 <td align="center">[% post.headline %]</td>
49                 <td>[% post.rank %]</td>
50         </tr>
51         [% END %]
52 </table>
53 [% END %]