Debian Codegraph @

data/0.12-dev/impl/index.phtml

raw
1 <html>
2 <head>
3 <title>Aiksaurus 0.12 BETA demo</title>
4 <style>
5 <!--
6 body {
7 margin-left: 0px;
8 margin-right: 0px;
9 margin-top: 0px;
10 }
11
12 td {
13 padding-left: .2in;
14 }
15 -->
16 </style>
17
18 </head>
19
20 <body bgcolor="#ffffff" background="web_bg.png" text="#000000" onLoad="document.forms[0].elements[0].focus()">
21
22 <form name="searchform" method="post" action="index.phtml">
23 <table border="0" height="45" width="100%" bgcolor="#fffff0" cellspacing="0" cellpadding="5">
24 <tr>
25 <td><big>Synonyms for <font color="#ff0000"><? print ucwords(strtolower($searchfor)); ?></font></big></td>
26 <td align="right">
27 Look up:
28 <input type="text" name="searchfor" size="15" value="" />
29 &nbsp; <input type="submit" value="Go">
30 </td>
31 </tr>
32 </form>
33 </table>
34
35 <?
36
37 function makeLink($word)
38 {
39 print "<a href=\"index.phtml?searchfor=" . rawurlencode($word) . "\">$word</a>";
40 }
41
42 function printResults($res, $title)
43 {
44 if (count($res) == 0)
45 return;
46
47 switch(count($res) % 4)
48 {
49 case 0:
50 case 3:
51 $stop1 = count($res) / 4;
52 $stop2 = 2 * $stop1;
53 $stop3 = 3 * $stop1;
54 $stop4 = count($res);
55 break;
56
57 case 1:
58 $stop1 = (count($res) / 4);
59 $stop2 = $stop1 + count($res) / 4;
60 $stop3 = $stop2 + count($res) / 4;
61 $stop4 = count($res);
62 break;
63
64 case 2:
65 $stop1 = count($res) / 4;
66 $stop2 = 1 + $stop1 + count($res) / 4;
67 $stop3 = $stop2 + count($res) / 4;
68 $stop4 = count($res);
69 break;
70 }
71
72 print "<table border=\"0\" width=\"100%\" cellpadding=\"5\" cellspacing=\"0\">";
73
74 print "<tr>";
75 print "<th align=\"left\" width=\"100%\" colspan=\"4\" bgcolor=\"#f0f0f0\">";
76 print "<big>$title - (" . count($res) . " Synonyms)</big>";
77 print "</th></tr>";
78
79 print "<tr><td width=\"25%\" valign=\"top\">";
80 for($i = 0;$i < $stop1;++$i)
81 {
82 print makeLink($res[$i]) . "<br>";
83 }
84
85 print "</td><td width=\"25%\" valign=\"top\">";
86
87 for(; $i < $stop2; ++$i)
88 {
89 print makeLink($res[$i]) . "<br>";
90 }
91
92 print "</td><td width=\"25%\" valign=\"top\">";
93
94 for(; $i < $stop3; ++$i)
95 {
96 print makeLink($res[$i]) . "<br>";
97 }
98
99 print "</td><td width=\"25%\" valign=\"top\">";
100
101 for(; $i < $stop4; ++$i)
102 {
103 print makeLink($res[$i]) . "<br>";
104 }
105
106 print "</td></tr></table><br>";
107 }
108
109
110
111
112 if (!empty($searchfor))
113 {
114 $ret = exec("./Aiksaurus.t \"$searchfor\"", $out);
115
116 if ($ret == "*** No synonyms known. ***")
117 {
118 print "No Synonyms Found";
119 }
120
121 else
122 {
123 for($i = 0;$i < count($out);++$i)
124 {
125 if (ereg("^# Meaning", $out[$i]))
126 {
127 continue;
128 }
129
130 if ($out[$i] == "")
131 continue;
132
133
134 $words = explode(", ", $out[$i]);
135
136 printResults($words, "Meaning " . ++$meaning);
137 }
138 }
139 }
140 ?>
141
142 </body>
143 </html>