version 1.84, 2003/01/27 10:58:56
|
version 1.92, 2003/02/22 01:40:28
|
Line 8 use POSIX qw(locale_h);
|
Line 8 use POSIX qw(locale_h);
|
use locale; |
use locale; |
open STDERR, ">/var/tmp/errors1"; |
open STDERR, ">/var/tmp/errors1"; |
my $newsurl='http://news.chgk.info/'; |
my $newsurl='http://news.chgk.info/'; |
|
my $cashednumber=500; |
|
my ($proxyptext,$proxysstr); |
my $printqueries=0; |
my $printqueries=0; |
my %forbidden=(); |
my %forbidden=(); |
my $debug=0; #added by R7 |
my $debug=0; #added by R7 |
if (param('debug')) {$debug=1; $printqueries=1} |
if (param('debug')) {$debug=1; $printqueries=1} |
*STDERR=*STDOUT if $debug; |
*STDERR=*STDOUT if $debug; |
|
my $thislocale; |
|
if ($^O =~ /win/i) { |
|
$thislocale = "Russian_Russia.20866"; |
|
} else { |
|
$thislocale = "ru_RU.KOI8-R"; |
|
} |
|
POSIX::setlocale( &POSIX::LC_ALL, $thislocale ); |
|
|
|
if ((uc 'а') ne 'А') {print STDERR "Koi8-r locale not installed!\n"}; |
|
|
my %fieldname= (0,'Question', 1, 'Answer', 2, 'Comments', 3, 'Authors', 4, 'Sources'); |
my %fieldname= (0,'Question', 1, 'Answer', 2, 'Comments', 3, 'Authors', 4, 'Sources'); |
my %rusfieldname=('Question','Вопрос', 'Answer', 'Ответ', |
my %rusfieldname=('Question','Вопрос', 'Answer', 'Ответ', |
'Comments', 'Комментарии', 'Authors', 'Автор', |
'Comments', 'Комментарии', 'Authors', 'Автор', |
Line 30 my %metodchar=('rus',1,'old',2);
|
Line 42 my %metodchar=('rus',1,'old',2);
|
|
|
|
|
|
|
my $thislocale; |
|
|
|
$searchin{$_}=1 foreach param('searchin'); |
$searchin{$_}=1 foreach param('searchin'); |
my %TypeName=('children'=>'Д', 'game'=>'Я', 'igp'=>'И', |
my %TypeName=('children'=>'Д', 'game'=>'Я', 'igp'=>'И', |
Line 145 sub GetTours {
|
Line 156 sub GetTours {
|
sub count |
sub count |
{ |
{ |
my ($dbh,$word)=@_; |
my ($dbh,$word)=@_; |
print "timeb=".time.br if $debug; |
|
$word=$dbh->quote(uc $word); |
$word=$dbh->quote(uc $word); |
my $query="SELECT number from nests,nf where $word=w1 AND w2=nf.id"; |
my $query="SELECT number from nests,nf where $word=w1 AND w2=nf.id"; |
my $sth=$dbh->prepare($query); |
my $sth=$dbh->prepare($query); |
$sth->execute; |
$sth->execute; |
my @a=$sth->fetchrow; |
my @a=$sth->fetchrow; |
print "timee0=".time.br if $debug; |
|
$sth->finish; |
$sth->finish; |
$a[0]||0; |
$a[0]||0; |
} |
} |
Line 174 sub printform
|
Line 183 sub printform
|
@df=param('type'); |
@df=param('type'); |
@df=('chgk','brain','igp','game','ehruditka','beskrylka') unless @df; |
@df=('chgk','brain','igp','game','ehruditka','beskrylka') unless @df; |
$checked{lc $_}="checked" foreach @df; |
$checked{lc $_}="checked" foreach @df; |
$checked{'all'}=param('all')?"checked":""; |
my $all=param('all') && param('all') eq 'yes'; |
$checked{'any'}=param('all')?"":"checked"; |
|
|
$checked{'all'}=$all?"checked":""; |
|
$checked{'any'}=$all?"":"checked"; |
$checked{lc param('metod')}="checked"; |
$checked{lc param('metod')}="checked"; |
$checked{'russian'}=1 unless $checked{'russian'} || $checked{'old'}; |
$checked{'russian'}=1 unless $checked{'russian'} || $checked{'old'}; |
|
|
Line 184 return
|
Line 195 return
|
<<EOT |
<<EOT |
<form method="get" enctype="application/x-www-form-urlencoded" |
<form method="get" enctype="application/x-www-form-urlencoded" |
action="/znatoki/cgi-bin/db.cgi"> |
action="/znatoki/cgi-bin/db.cgi"> |
<h2>Поиск в базе данных</h2> |
<h2>Поиск в базе вопросов</h2> |
|
|
<input type="text" name="sstr" value=$sstr size="30" maxlength="50"> |
<input type="text" name="sstr" value="$sstr" size="30" maxlength="50"> |
<input type="submit" value="Поиск"> $qnumber |
<input type="submit" value="Поиск"> $qnumber |
<p> |
<p> |
|
|
Line 211 action="/znatoki/cgi-bin/db.cgi">
|
Line 222 action="/znatoki/cgi-bin/db.cgi">
|
<input type="checkbox" $checked{'beskrylka'} name="type" value="beskrylka"> "Бескрылка" |
<input type="checkbox" $checked{'beskrylka'} name="type" value="beskrylka"> "Бескрылка" |
</td> |
</td> |
</tr><tr> |
</tr><tr> |
<td colspan=5><input type="radio" $checked{'russian'} name="metod" value="rus"> Расширенный (с учетом грамматики, в вопросах всех типов) |
<td colspan=5><input type="radio" $checked{'rus'} name="metod" value="rus"> Расширенный (с учетом грамматики, в вопросах всех типов) |
</td> |
</td> |
</tr><tr> |
</tr><tr> |
<th align="left">Искать: |
<th align="left">Искать: |
Line 244 EOT
|
Line 255 EOT
|
} |
} |
|
|
sub proxy |
sub proxy |
{ |
{ |
#print "time0=".time.br if $debug; |
|
my ($dbh,$ptext,$allnf)=@_; |
my ($dbh,$ptext,$allnf)=@_; |
|
my $sstr=makeproxysstr($dbh,$ptext,$allnf); |
|
return russearch($dbh,$sstr,0,$allnf); |
|
} |
|
|
|
sub makeproxysstr { |
|
my ($dbh,$ptext)=@_; |
my $text=$$ptext; |
my $text=$$ptext; |
$text=~tr/ёЁ/еЕ/; |
$text=~tr/ёЁ/еЕ/; |
$text=~s/(${RLrl})p(${RLrl})/$1p$2/gom; |
$text=~s/(${RLrl})p(${RLrl})/$1p$2/gom; |
Line 272 sub proxy
|
Line 288 sub proxy
|
|
|
$good{$words[$_]}=0 foreach 16..$#words; |
$good{$words[$_]}=0 foreach 16..$#words; |
|
|
# foreach (@list) |
|
# { |
|
# if ($good{$_}) |
|
# { |
|
# $good{$_}=0; |
|
# $sstr.=" $_"; |
|
# } |
|
# } |
|
$sstr.=" $_" foreach grep {$good{$_}} @list; |
$sstr.=" $_" foreach grep {$good{$_}} @list; |
print "time05=".time.br if $debug; |
|
$$ptext=$sstr; |
$$ptext=$sstr; |
return russearch($dbh,$sstr,0,$allnf); |
return $sstr; |
} |
} |
|
|
|
|
Line 502 sub Search {
|
Line 509 sub Search {
|
my $sstr=$$s; |
my $sstr=$$s; |
my (@arr, @Questions, @fields); |
my (@arr, @Questions, @fields); |
my (@sar, $i, $sth,$where,$query); |
my (@sar, $i, $sth,$where,$query); |
# my $ip=$ENV{'REMOTE_ADDR'}; |
|
|
|
# $ip=$dbh->quote($ip); |
|
# $query= |
|
# "INSERT into queries (query,metod,searchin,ip) |
|
# values (". $dbh->quote($sstr).', '. |
|
# $dbh->quote($metod) . ', ' . |
|
# $dbh->quote(join ' ', grep $searchin{$_}, keys %searchin) . |
|
# ", $ip)"; |
|
#print $query if $printqueries; |
|
# $dbh -> do ($query); |
|
if ($metod eq 'rus') |
if ($metod eq 'rus') |
{ |
{ |
my @tasks=russearch($dbh,$sstr,$all,$allnf); |
my @tasks=russearch($dbh,$sstr,$all,$allnf); |
Line 520 sub Search {
|
Line 516 sub Search {
|
} |
} |
elsif ($metod eq 'proxy') |
elsif ($metod eq 'proxy') |
{ |
{ |
# $searchin{'question'}=1; |
|
# $searchin{'answer'}=1; |
|
my @task=proxy($dbh,$s,$allnf); |
my @task=proxy($dbh,$s,$allnf); |
# $$s=$sstr; |
|
return @task |
return @task |
} |
} |
|
|
Line 641 sub PrintList {
|
Line 634 sub PrintList {
|
my $sstr=param('sstr')||''; |
my $sstr=param('sstr')||''; |
$qs=~s/sstr=[^\&]+/sstr=$sstr/; |
$qs=~s/sstr=[^\&]+/sstr=$sstr/; |
$qs=~s/\&was=[^\&]+//; |
$qs=~s/\&was=[^\&]+//; |
$qs.="&was=$was"||''; |
$qs.="&was=$was" if $was; |
|
my $fkvo=param('fkvo')||$#$Questions; |
|
$qs.="&fkvo=$fkvo" if $was; |
if ($first>$kvo*3+1) |
if ($first>$kvo*3+1) |
{ |
{ |
$nav.= |
$nav.= |
Line 653 sub PrintList {
|
Line 648 sub PrintList {
|
else {$nav.=' 'x15;} |
else {$nav.=' 'x15;} |
|
|
my ($fprint,$lprint); |
my ($fprint,$lprint); |
my $llprint=$#$Questions- ($#$Questions+1)%$kvo+2; |
my $llprint=$fkvo- ($fkvo+1)%$kvo+2; |
if ($#$Questions+1<=$kvo*7) |
if ($fkvo+1<=$kvo*7) |
{ $fprint=1; |
{ $fprint=1; |
$lprint=$llprint; |
$lprint=$llprint; |
} |
} |
elsif ($first>$kvo*3 && $#$Questions+1-$first>$kvo*3) |
elsif ($first>$kvo*3 && $fkvo+1-$first>$kvo*3) |
{ |
{ |
$fprint=$first-$kvo*3; |
$fprint=$first-$kvo*3; |
$lprint=$first+$kvo*3; |
$lprint=$first+$kvo*3; |
Line 687 sub PrintList {
|
Line 682 sub PrintList {
|
{ |
{ |
# next if $first-$f>$kvo*3; |
# next if $first-$f>$kvo*3; |
$l=$f+$kvo-1; |
$l=$f+$kvo-1; |
$l=$#$Questions+1 if $l>$#$Questions+1; |
$l=$#$Questions+1 if $l>$fkvo+1; |
if ($f==$first) {$nav.="[$f-$l] ";} |
if ($f==$first) {$nav.="[$f-$l] ";} |
else { |
else { |
$nav.= "[".a({href=>(url."?".$qs."\&first=$f")},"$f-$l")."] ";} |
$nav.= "[".a({href=>(url."?".$qs."\&first=$f")},"$f-$l")."] ";} |
} |
} |
if ($lprint+$kvo<$#$Questions) |
if ($lprint+$kvo<$fkvo) |
{ |
{ |
$nav.= |
$nav.= |
(" "x4). |
(" "x4). |
Line 725 sub PrintSearch {
|
Line 720 sub PrintSearch {
|
print printform; |
print printform; |
my @allnf; |
my @allnf; |
my @Questions; |
my @Questions; |
if ($was) |
$was=0 if $metod eq 'proxy'; |
|
if ($was && ($metod ne 'proxy')) |
{ |
{ |
my $sth=$dbh->prepare ("select sstr,questions,allnf from lastqueries where id=".param('was')); |
my $sth=$dbh->prepare ("select sstr,questions,allnf from lastqueries where id=".param('was')); |
$sth->execute; |
$sth->execute; |
Line 734 sub PrintSearch {
|
Line 730 sub PrintSearch {
|
@Questions=unpack 'L*',$q; |
@Questions=unpack 'L*',$q; |
@allnf=unpack 'L*',$nf; |
@allnf=unpack 'L*',$nf; |
$sth->finish; |
$sth->finish; |
} else |
} |
|
if (!$was || ($metod eq 'proxy') || (param('first')+param('kvo')>$cashednumber)) |
{ |
{ |
@Questions=&Search($dbh, \$sstr,$metod,$all,\@allnf); |
@Questions=&Search($dbh, \$sstr,$metod,$all,\@allnf); |
my $tmp=$dbh->quote(pack("L*",@Questions)); |
my $tmp=$dbh->quote(pack("L*",@Questions[0..$cashednumber])); |
my $qsstr=$dbh->quote($sstr); |
my $qsstr=$dbh->quote($sstr); |
my $nf=$dbh->quote(pack("L*", @allnf)); |
my $nf=$dbh->quote(pack("L*", @allnf)); |
my $ss=200; |
my $ss=200; |
Line 780 print "$query" if $printqueries;
|
Line 777 print "$query" if $printqueries;
|
|
|
} |
} |
|
|
|
$hits=param("fkvo")||$hits; |
|
|
if ($hits =~ /1.$/ || $hits =~ /[5-90]$/) { |
if ($hits =~ /1.$/ || $hits =~ /[5-90]$/) { |
$suffix = 'й'; |
$suffix = 'й'; |
Line 1111 sub PrintQuestion {
|
Line 1108 sub PrintQuestion {
|
my (%Tour) = GetTournament($dbh, $Question{'ParentId'}); |
my (%Tour) = GetTournament($dbh, $Question{'ParentId'}); |
my (%Tournament) = GetTournament($dbh, $Tour{'ParentId'}); |
my (%Tournament) = GetTournament($dbh, $Tour{'ParentId'}); |
my $fname=$Tournament{'FileName'}; |
my $fname=$Tournament{'FileName'}; |
#return "" if $fname=~/mgp0203/; |
|
$fname=~s/\.txt//; |
$fname=~s/\.txt//; |
$titles .= |
$titles .= |
dd(img({src=>"/icons/folder.open.gif"}) . " " . |
dd(img({src=>"/icons/folder.open.gif"}) . " " . |
Line 1136 sub PrintQuestion {
|
Line 1132 sub PrintQuestion {
|
if ($Question{'Authors'} ) { |
if ($Question{'Authors'} ) { |
my $q=$Question{'Authors'}; |
my $q=$Question{'Authors'}; |
###АВТОРА!! |
###АВТОРА!! |
my $sth=$dbh->prepare("select Authors.Id,Name, Surname, Nicks from Authors, A2Q |
my $sth=$dbh->prepare("select Authors.CharId,Name, Surname, Nicks from Authors, A2Q |
where Authors.Id=Author And Question=$Id"); |
where Authors.Id=Author And Question=$Id"); |
$sth->execute; |
$sth->execute; |
my ($AuthorId,$Name, $Surname,$other,$Nicks); |
my ($AuthorId,$Name, $Surname,$other,$Nicks); |
if (!$text) { |
if (!$text) { |
while ((($AuthorId,$Name, $Surname,$Nicks)=$sth->fetchrow),$AuthorId) |
while ((($AuthorId,$Name, $Surname,$Nicks)=$sth->fetchrow),$AuthorId) |
{ |
{ |
my ($firstletter)=$Name=~m/^./g; |
my ($firstletter)=$Name=~m/^./g; |
$Name=~s/\./\\\./g; |
$Name=~s/\./\\\./g; |
my $sha="(?:$Name\\s+$Surname)|(?:$Surname\\s+$Name)|(?:$firstletter\\.\\s*$Surname)|(?:$Surname\\s+$firstletter\\.)|(?:$Surname)|(?:$Name)"; |
$Name=~s/ё/[её]/g; |
|
$Surname=~s/ё/[её]/g; |
|
my $sha="(?:$Name\\s+$Surname)|(?:$Surname\\s+$Name)|(?:$firstletter\\.\\s*$Surname)|(?:$Surname\\s+$firstletter\\.)|(?:$Surname)"; |
if ($Nicks) |
if ($Nicks) |
{ |
{ |
$Nicks=~s/^\|//; |
$Nicks=~s/^\|//; |
Line 1160 sub PrintQuestion {
|
Line 1158 sub PrintQuestion {
|
} |
} |
} |
} |
$q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; |
$q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; |
|
unless ($1) |
|
{ |
|
$q=~s/$Name/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; |
|
} |
} |
} |
} |
} |
$output .= &PrintField("Автор(ы)", $q, $text); |
$output .= &PrintField("Автор(ы)", $q, $text); |
Line 1208 $output.="</span>"
|
Line 1210 $output.="</span>"
|
|
|
} |
} |
$output=~s/\(pic: ([^\)]*)\)/<p><img src="\/znatoki\/images\/db\/$1"><p>/g unless $text; |
$output=~s/\(pic: ([^\)]*)\)/<p><img src="\/znatoki\/images\/db\/$1"><p>/g unless $text; |
$output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'Близкие вопросы').p |
my $qid=param('tour') ? (param('tour').".$Question{'Number'}" ): ''; |
if $answer>0 && !$text; |
|
|
$output.=br.a({href=> url."?metod=proxy& |
|
qid=$qid"}, 'Близкие вопросы').p |
|
if $answer>0 && !$text && $qid; |
return $output; |
return $output; |
} |
} |
|
|
Line 1373 sub PrintQOfAuthor
|
Line 1378 sub PrintQOfAuthor
|
{ |
{ |
|
|
my ($dbh, $id) = @_; |
my ($dbh, $id) = @_; |
$id=$dbh->quote($id); |
unless ($id=~/^\d+$/) { |
|
$id=$dbh->quote($id); |
|
my $sth = $dbh->prepare("SELECT Id FROM Authors WHERE CharId=$id"); |
|
$sth->execute; |
|
($id)=$sth->fetchrow; |
|
$sth->finish; |
|
} |
|
$id=$dbh->quote($id); |
|
|
my $sth = $dbh->prepare("SELECT Name, Surname FROM Authors WHERE Id=$id"); |
my $sth = $dbh->prepare("SELECT Name, Surname FROM Authors WHERE Id=$id"); |
$sth->execute; |
$sth->execute; |
my ($name,$surname)=$sth->fetchrow; |
my ($name,$surname)=$sth->fetchrow; |
Line 1395 sub PrintQOfAuthor
|
Line 1408 sub PrintQOfAuthor
|
} else { |
} else { |
$suffix = 'я'; |
$suffix = 'я'; |
} |
} |
print h2("Поиск в базе вопросов"); |
# print h2("Поиск в базе вопросов"); |
print printform; |
print printform; |
print p({align=>"center"}, "Автор ".strong("$name $surname. ") |
print p({align=>"center"}, "Автор ".strong("$name $surname. ") |
. " : $hits попадани$suffix."); |
. " : $hits попадани$suffix."); |
Line 1617 sub WriteFile {
|
Line 1630 sub WriteFile {
|
|
|
MAIN: |
MAIN: |
{ |
{ |
|
|
setlocale(LC_CTYPE,'russian'); |
setlocale(LC_CTYPE,'russian'); |
my($i, $tour); |
my($i, $tour); |
my($text) = (param('text')) ? 1 : 0; |
my($text) = (param('text')) ? 1 : 0; |
|
if ($text) { |
|
print header('text/plain'); |
|
} else {print header;} |
|
|
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") |
or do { |
or do { |
print h1("Временные проблемы") . "База данных временно не |
print h1("Временные проблемы") . "База вопросов временно не |
работает. Заходите попозже."; |
работает. Заходите попозже."; |
print &Include_virtual("../dimrub/db/reklama.html"); |
print &Include_virtual("../dimrub/db/reklama.html"); |
print end_html; |
print end_html; |
die "Can't connect to DB chgk\n"; |
die "Can't connect to DB chgk\n"; |
}; |
}; |
|
my $sstr=param('sstr'); |
|
if (param('qid')) { |
|
my $sth; |
|
my $qid=param('qid'); |
|
if ($qid !~ /^[0-9]*$/) { |
|
my ($fname,$t,$n)= split /\./ , $qid; |
|
$n=$t,$t='' unless $n; |
|
if ($n) |
|
{ |
|
$sth = $dbh->prepare( |
|
"SELECT t2.Id FROM Tournaments as t1, |
|
Tournaments as t2 |
|
WHERE t1.FileName = '$fname.txt' |
|
AND t1.Id=t2.ParentId AND t2.Number=$t"); |
|
} |
|
else |
|
{ |
|
$sth = $dbh->prepare("SELECT Id FROM Tournaments |
|
WHERE FileName = '$fname.txt'"); |
|
} |
|
$sth->execute; |
|
$tour = ($sth->fetchrow)[0]; |
|
$sth->finish; |
|
$sth = $dbh->prepare( |
|
"SELECT QuestionId FROM |
|
Questions |
|
WHERE ParentId=$tour AND |
|
Questions.Number=$n"); |
|
$sth->execute; |
|
$qid = ($sth->fetchrow)[0]; |
|
} |
|
my $query="SELECT Question, Answer from Questions where QuestionId=$qid"; |
|
$sth=$dbh->prepare($query); |
|
$sth->execute; |
|
$sstr= join ' ',$sth->fetchrow; |
|
$sth->finish; |
|
$searchin{'Question'}=1; |
|
$searchin{'Answer'}=1; |
|
$sstr=~tr/ёЁ/еЕ/; |
|
$sstr=~s/[^йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮa-zA-Z0-9]/ /gi; |
|
$proxysstr=$sstr; |
|
$proxysstr=makeproxysstr($dbh,\$proxysstr); |
|
} |
|
|
|
|
if (!param('comp') and !param('sqldump') and !$text) { |
if (!param('comp') and !param('sqldump') and !$text) { |
print header; |
my $title="Результаты поиска на \"". ($proxysstr||$sstr) .'"' |
print start_html(-"title"=>'Database of the questions', |
if ($proxysstr||$sstr); |
|
$title||="База вопросов"; |
|
|
|
print start_html(-"title"=>$title, |
-author=>'dimrub@icomverse.com', |
-author=>'dimrub@icomverse.com', |
-bgcolor=>'#fff0e0', |
-bgcolor=>'#fff0e0', |
-vlink=>'#800020'); |
-vlink=>'#800020'); |
print "<style> |
print "<style> |
td {font-size: 9pt; font-family : sans-serif} |
td {font-size: x-small; font-family : sans-serif} |
th {font-size: 9pt; font-family : sans-serif} |
th {font-size: x-small; font-family : sans-serif} |
</style>\n"; |
</style>\n"; |
|
|
print &Include_virtual("../dimrub/db/reklama.html"); |
print &Include_virtual("../dimrub/db/reklama.html"); |
} |
} |
|
|
|
|
if ($^O =~ /win/i) { |
|
$thislocale = "Russian_Russia.20866"; |
|
} else { |
|
$thislocale = "ru_RU.KOI8-R"; |
|
} |
|
POSIX::setlocale( &POSIX::LC_ALL, $thislocale ); |
|
|
|
if ((uc 'а') ne 'А') {print "Koi8-r locale not installed!\n"}; |
|
|
|
|
|
if ($text) { |
|
print header('text/plain'); |
|
} |
|
|
|
if (param('hideequal')) { |
if (param('hideequal')) { |
my ($sth)= $dbh -> prepare("select first, second FROM equalto"); |
my ($sth)= $dbh -> prepare("select first, second FROM equalto"); |
Line 1725 EOT
|
Line 1778 EOT
|
&PrintQOfAuthor($dbh,param('qofauthor')); |
&PrintQOfAuthor($dbh,param('qofauthor')); |
} |
} |
elsif (param('sstr')||param('was')) { |
elsif (param('sstr')||param('was')) { |
&PrintSearch($dbh, param('sstr'), param('metod'),param('was')); |
&PrintSearch($dbh, $sstr||' ', param('metod')||'',param('was')); |
$dbh->do("delete from lastqueries where |
$dbh->do("delete from lastqueries where |
(TO_DAYS(NOW()) - TO_DAYS(t) >= 2) OR |
(TO_DAYS(NOW()) - TO_DAYS(t) >= 2) OR |
(time_to_sec(now())-time_to_sec(t) >3600)") |
(time_to_sec(now())-time_to_sec(t) >3600)") |
} |
} |
elsif (param('qid')) { |
elsif (param('qid')) { |
my $qid=param('qid'); |
&PrintSearch($dbh, $sstr||'', 'proxy'); |
my $query="SELECT Question, Answer from Questions where QuestionId=$qid"; |
|
print $query if $printqueries; |
|
my $sth=$dbh->prepare($query); |
|
$sth->execute; |
|
my $sstr= join ' ',$sth->fetchrow; |
|
$sth->finish; |
|
$searchin{'Question'}=1; |
|
$searchin{'Answer'}=1; |
|
$sstr=~tr/ёЁ/еЕ/; |
|
$sstr=~s/[^йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮa-zA-Z0-9]/ /gi; |
|
# print &PrintQuestion($dbh,$qid, 1, '!'); |
|
&PrintSearch($dbh, $sstr, 'proxy'); |
|
} |
} |
elsif (param('getfile')){ |
elsif (param('getfile')){ |
print &writefile |
print &writefile |
Line 1802 $sstr=~s/[^йцукенгшщзхъфывапролджэячсмит
|
Line 1843 $sstr=~s/[^йцукенгшщзхъфывапролджэячсмит
|
} |
} |
if (!$text) { |
if (!$text) { |
print &Include_virtual("../dimrub/db/footer.html"); |
print &Include_virtual("../dimrub/db/footer.html"); |
|
print p."<center><font size=-2>Обновление: ".&Include_virtual("../dimrub/db/date")."</center></font>"; |
print <<EEE |
print <<EEE |
<SCRIPT LANGUAGE="JavaScript"> |
<SCRIPT LANGUAGE="JavaScript"> |
function toggle(e) { |
function toggle(e) { |
Line 1814 function toggle(e) {
|
Line 1856 function toggle(e) {
|
</SCRIPT> |
</SCRIPT> |
EEE |
EEE |
; |
; |
print end_html; |
# print end_html; |
} |
} |
$dbh->disconnect; |
$dbh->disconnect; |
} |
} |