-
Notifications
You must be signed in to change notification settings - Fork 0
/
getquote.php
executable file
·102 lines (56 loc) · 2.84 KB
/
getquote.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<table cellspacing="2" cellpadding="0" align="center" border="0" width="99%">
<tr>
<td>
<?
switch($qsarr[0]) {
case "latest":
$title = "Latest quotes";
$res = getlatest();
break;
case "top":
$title = "Top quotes";
$res = getgroupquote($so, qlim);
break;
case "bottom":
$title = "The dregs!";
$res = getgroupquote($so, qlim);
break;
case "search":
$title = "Search 'em";
// do a quick clean up of formdata
$srchstr = addslashes($searchstr);
if (is_numeric($_REQUEST['lim'])) {
$limit = $_REQUEST['lim'];
} else {
$limit = qlim;
}
$sortby = $_REQUEST['sb'];
$res = getsearchquote($srchstr, $limit, $sortby);
break;
case "random":
$title = "Random quotage";
$res = getrandquote();
break;
} // end switch()
// print "<br><pre>New: " . $newswvar . "</pre><br>";
?>
<h1><?=$title ?></h1>
<?
if(is_array($res)) {
for($i=0; $i < count($res); $i++) {
?>
<p class="quote"><a class="quote" href="/?<?=$res[$i][col_qid] ?>">#<?=$res[$i][col_qid] ?></a> <a class="nlquote" href="/?markdn&q=<?=$res[$i][col_qid] ?>">-</a> (<?=$res[$i][col_score] ?>) <a class="nlquote" href="/?markup&q=<?=$res[$i][col_qid] ?>">+</a> [<a class="quote" href="/?markbd&q=<?=$res[$i][col_qid] ?>">sucks</a>]<br />
<br/>
<?=formatentry($res[$i][col_qtext]) ?>
</p>
<?
}
} else {
?>
<p>No quotes to be found! :/</p>
<?
}
?>
</td>
</tr>
</table>