-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
60 lines (60 loc) · 2.41 KB
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php require_once ('head.php');
if ($username) {
//get a list of the usernames and ids
$res_users = mysql_query ("SELECT `userid`, `username` FROM `users`") or die ("Error getting usernames: " . mysql_error() . "<br />");
while ($row=mysql_fetch_array($res_users)) {
$key = $row["userid"];
$userlist[$key] = $row["username"];
}
}
$refine = !empty($_REQUEST['refine']) ? htmlentities($_REQUEST['refine']) : "";
?>
<h1>Search</h1>
<form name="search" method="GET" action="conversationsearch.php">
<table border=0 cellpadding=0 cellspacing=0 class="medium">
<tr>
<td style="padding:5px" class="large">Find comments with... </td>
<td style="padding:5px"></td></tr>
<tr>
<td style="padding:5px">these words: </td>
<td style="padding:5px"><input class="copy" type="text" size=20 name="q" value="<?php echo $refine;?>"></td></tr>
<tr>
<td style="padding:5px">by this author: </td>
<td style="padding:5px">
<select class="copy" name="q_author" style="width:44%">
<option value = "" selected></option>
<?php
foreach ($userlist as $value) {
echo "<option value = \"" . $value . "\">" . $value . "</option><br />";
} ?>
</select></td></tr>
<tr>
<td style="padding:5px">within the last: </td>
<td style="padding:5px">
<select class="copy" name="q_timeframe" style="width:44%">
<option value = "" selected></option>
<option value = 7>week</option>
<option value = 30>month</option>
<option value = 365>year</option>
</select></td></tr>
<tr>
<td style="padding:5px; vertical-align:top">where thread title contains: </td>
<td style="padding:5px"><input class="copy" type="text" size=20 name="q_title"><BR>
<input type="checkbox" name="q_matchAllComments" value="matchall" onclick="document.forms.search.q.disabled=document.forms.search.q_matchAllComments.checked;"> Retrieve every comment in these threads </td>
</td></tr>
<tr>
<td style="padding:5px" ><input type="submit" value="Search"></td>
<td style="padding:5px"><input type="checkbox" name="q_oldestfirst" value="oldestfirst"> Show older posts first <br>
</tr>
</table>
</form>
<script language='javascript' type='text/javascript'>
function SetFocus() {
var txtMyTextBox = document.forms.search.q;
txtMyTextBox.focus();
}
SetFocus();
</script>
</td></tr></table>
</body>
</html>