Содержимое файла | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
185 | diffor | 1 | <script type="text/javascript"> |
2 | function processLink(s) |
||
3 | { |
||
4 | s = s.replace(/\s+/g," "); |
||
5 | location.href=self.name + "?query=" + escape(s); |
||
6 | } |
||
7 | </script> |
||
8 | <div align=center> |
||
9 | <img src=logo.png alt=""> |
||
10 | <br><br> |
||
11 | <form name="form1" action=""> |
||
12 | <input value="<?php |
||
13 | $query = $_REQUEST['query']; |
||
14 | # clean up passed value |
||
15 | $query = preg_replace("/^\s+/","",$query); |
||
16 | $query = preg_replace("/\s+$/","",$query); |
||
17 | $query = preg_replace("/\s+/"," ",$query); |
||
18 | $query = ereg_replace("--","––",$query); |
||
19 | # $query = ereg_replace("-","–",$query); |
||
20 | $value = preg_replace("/\"/",""",$query); |
||
21 | echo "$value" |
||
22 | ?>" type="text" name="query" onChange="submit()"> |
||
23 | <input type="submit" id="edit-submit" value="Поиск" class="form-submit"> |
||
24 | <p> |
||
25 | </form></div> |
||
26 | <?php |
||
27 | if($query != "") { |
||
28 | exec("/usr/bin/dict -h localhost $query 2>&1",$output,$error); |
||
29 | $output = implode("\n",$output); |
||
30 | $output = ereg_replace ("definition found","совпадение найдено",$output); |
||
31 | $output = ereg_replace ("No definitions found for","Ничего не найдено для запроса",$output); |
||
32 | $output = ereg_replace ("definitions found","совпадений найдено",$output); |
||
33 | $output = ereg_replace ("perhaps you mean","возможно вы искали",$output); |
||
34 | $output = ereg_replace("1000pbio:","<b><b>1000+ биографий</b>:",$output); |
||
35 | $output = ereg_replace("abr1w:","<b>Словарь синонимов Н.Абрамова</b>:" ,$output); |
||
36 | $output = ereg_replace("biology:","<b>Русско-английский биологический словарь</b>:", $output); |
||
37 | $output = ereg_replace("bokarjoveoru:","<b>Эсперанто-русский</b>:", $output); |
||
38 | $output = ereg_replace("bokarjovrueo:","<b>Русский-эсперанто</b>:", $output); |
||
39 | $output = ereg_replace("church:","<b>Словарь церковных терминов</b>:", $output); |
||
40 | $output = ereg_replace("dalf:","<b>Толковый словарь живого великорусского языка Даля</b>:", $output); |
||
41 | $output = ereg_replace("estonian_et-ru:","<b>Эстонско-русский</b>:", $output); |
||
42 | $output = ereg_replace("findict:","<b>Словарь финансовых терминов</b>:", $output); |
||
43 | $output = ereg_replace("L9_DE_RU_Universal:","<b>Немецко-русский</b>:", $output); |
||
44 | $output = ereg_replace("L9_EN_RU_Computer:","<b>Англо-русский (компьютерный)</b>:", $output); |
||
45 | $output = ereg_replace("L9_EN_RU_Universal:","<b>Англо-русский</b>:", $output); |
||
46 | $output = ereg_replace("L9_ES_RU_Universal:","<b>Испанско-русский</b>:", $output); |
||
47 | $output = ereg_replace("L9_FR_RU_Law:","<b>Французско-русский (юридический)</b>:", $output); |
||
48 | $output = ereg_replace("L9_FR_RU_Technical:","<b>Французско-русский (технический)</b>:", $output); |
||
49 | $output = ereg_replace("L9_FR_RU_Universal:","<b>Французско-русский</b>:", $output); |
||
50 | $output = ereg_replace("L9_IT_RU_Universal:","<b>Итальяно-русский</b>:", $output); |
||
51 | $output = ereg_replace("L9_RU_DE_Universal:","<b>Русско-немецкий</b>:", $output); |
||
52 | $output = ereg_replace("L9_RU_EN_Computer:","<b>Русско-английский (компьютерный)</b>:", $output); |
||
53 | $output = ereg_replace("L9_RU_EN_Universal:","<b>Русско-английский</b>:", $output); |
||
54 | $output = ereg_replace("L9_RU_ES_Universal:","<b>Русско-испанский</b>:", $output); |
||
55 | $output = ereg_replace("L9_RU_FR_Law:","<b>Русско-французский (юридический)</b>:", $output); |
||
56 | $output = ereg_replace("L9_RU_FR_Technical:","<b>Русско-французский (технический)</b>:", $output); |
||
57 | $output = ereg_replace("L9_RU_FR_Universal:","<b>Русско-французский</b>:", $output); |
||
58 | $output = ereg_replace("L9_RU_IT_Universal:","<b>Русско-итальянский</b>:", $output); |
||
59 | $output = ereg_replace("latrus:","<b>Латынь-русский</b>:", $output); |
||
60 | $output = ereg_replace("meddict:","<b>Медицинский словарь</b>:", $output); |
||
61 | $output = ereg_replace("ozhegov:","<b>Толковый словарь Ожегова</b>:", $output); |
||
62 | $output = ereg_replace("slovnyk_be-ru:","<b>Белорусско-русский</b>:", $output); |
||
63 | $output = ereg_replace("slovnyk_pl-ru:","<b>Польско-русский</b>:", $output); |
||
64 | $output = ereg_replace("slovnyk_ru-be:","<b>Русско-белорусский</b>:", $output); |
||
65 | $output = ereg_replace("slovnyk_ru-pl:","<b>Русско-польский</b>:", $output); |
||
66 | $output = ereg_replace("smiley:","<b>Словарь смайликов</b>:", $output); |
||
67 | $output = ereg_replace("swedish_ru-sv:","<b>Русско-шведский</b>:", $output); |
||
68 | $output = ereg_replace("swedish_sv-ru:","<b>Шведско-русский</b>:", $output); |
||
69 | $output = ereg_replace("beslov:","<b>Большой Энциклопедический Словарь</b>:", $output); |
||
70 | $output = ereg_replace("brok_and_efr:","<b>Энциклопедический словарь Брокгауза и Ефрона</b>:", $output); |
||
71 | $output = ereg_replace("sdict_fi-ru:","<b>Финско-русский</b>:", $output); |
||
72 | $output = ereg_replace("ses:","<b>Современный энциклопедический словарь</b>:", $output); |
||
73 | $output = ereg_replace("slovnyk_ru-uk:","<b>Русско-украинский</b>:", $output); |
||
74 | $output = ereg_replace("slovnyk_uk-ru:","<b>Украинско-русский</b>:", $output); |
||
75 | $output = ereg_replace("ushakov:","<b>Толковый словарь Ушакова</b>:", $output); |
||
76 | $output = ereg_replace("\[([^\[]+)\]","", $output); |
||
77 | |||
78 | |||
79 | if($error) { |
||
80 | echo "<pre><b>Ошибка</b>: $output</pre>"; |
||
81 | } |
||
82 | else {# bold first line |
||
83 | $output = preg_replace("/^(.*)/","<b>\\1</b>",$output); |
||
84 | # wrap first line of each reference in table to control background color |
||
85 | $output = preg_replace("/(\n\nFrom )(.*)\n/","\n\n<table width=100% cellpadding=4 |
||
86 | bgcolor=\"#7FA95D\"><tr><td><b>\\2</b></td></tr></table>",$output); |
||
87 | # find and process document internal links |
||
88 | $output = preg_replace("/\{+(.*?)\}+/s", |
||
89 | "<a href=\"javascript:processLink('\\1');\">\\1</a>",$output); |
||
90 | echo "<div align=left><pre>$output</pre></div>"; |
||
91 | } |
||
92 | } |
||
93 | ?> |
||
94 | <script type="text/javascript"> |
||
95 | document.form1.query.focus(); |
||
96 | </script> |