version 1.41, 2001/12/04 01:17:12
|
version 1.46, 2001/12/08 23:00:44
|
Line 2
|
Line 2
|
|
|
use DBI; |
use DBI; |
use CGI ':all'; |
use CGI ':all'; |
use Text::Query; |
#use Text::Query; |
use strict; |
use strict; |
use Time::Local; |
use Time::Local; |
use POSIX qw(locale_h); |
use POSIX qw(locale_h); |
Line 152 sub printform
|
Line 152 sub printform
|
my $inputstring=textfield(-name=>'sstr', |
my $inputstring=textfield(-name=>'sstr', |
-default=>param('sstr')||'', |
-default=>param('sstr')||'', |
-size=>50); |
-size=>50); |
my $fields=checkbox_group('searchin',['Question','Answer','Comments','Authors','Sources'], [grep $searchin{$_}, keys %searchin], |
my @df=keys %searchin; |
|
@df=('Question', 'Answer') unless @df; |
|
my $fields=checkbox_group('searchin',['Question','Answer','Comments','Authors','Sources'], [@df], |
'false',\%rusfieldname); |
'false',\%rusfieldname); |
|
|
my $metod=radio_group(-name=>'metod',-values=>['old','rus'], |
my $metod=radio_group(-name=>'metod',-values=>['old','rus'], |
-default=>param('metod')||'rus', |
-default=>(param('metod')||'rus'), |
-labels=>\%rusfieldname); |
-labels=>\%rusfieldname); |
my $all=radio_group(-name=>'all',-values=>['yes','no'], |
my $all=radio_group(-name=>'all',-values=>['yes','no'], |
-default=>param('all')||'no', |
-default=>(param('all')||'no'), |
-labels=>{'yes'=>'÷ÓÅ','no'=>'ìÀÂÏÅ'}); |
-labels=>{'yes'=>'÷ÓÅ','no'=>'ìÀÂÏÅ'}); |
|
|
################################################# |
################################################# |
Line 193 sub proxy
|
Line 195 sub proxy
|
$text=~s/p(${RLrl})/Ò$1/gom; |
$text=~s/p(${RLrl})/Ò$1/gom; |
$text=~s/(${RLrl})p/$1Ò/gom; |
$text=~s/(${RLrl})p/$1Ò/gom; |
$text=~s/\s+/ /gmo; |
$text=~s/\s+/ /gmo; |
$text=~s/[^ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀêãõëåîçûýúèÿæù÷áðòïìäöüñþóíéôøâàQWERTYUIOPASDFGHJKLZXCVBNM]/ /g; |
$text=~s/[^ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀêãõëåîçûýúèÿæù÷áðòïìäöüñþóíéôøâàQWERTYUIOPASDFGHJKLZXCVBNM0-9]/ /g; |
$text=uc $text; |
$text=uc $text; |
my @list= $text=~m/(?:(?:${RLrl})+)|(?:[A-Za-z0-9]+)/gom; |
my @list= $text=~m/(?:(?:${RLrl})+)|(?:[A-Za-z0-9]+)/gom; |
my (%c, %good,$sstr); |
my (%c, %good,$sstr); |
Line 210 sub proxy
|
Line 212 sub proxy
|
$good{$_}=1 if $c{$_}<200; |
$good{$_}=1 if $c{$_}<200; |
} |
} |
|
|
$good{$words[$_]}=0 foreach 11..$#words; |
$good{$words[$_]}=0 foreach 16..$#words; |
|
|
# foreach (@list) |
# foreach (@list) |
# { |
# { |
Line 439 sub Search {
|
Line 441 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'}; |
# my $ip=$ENV{'REMOTE_ADDR'}; |
|
|
$ip=$dbh->quote($ip); |
# $ip=$dbh->quote($ip); |
$query= |
# $query= |
"INSERT into queries (query,metod,searchin,ip) |
# "INSERT into queries (query,metod,searchin,ip) |
values (". $dbh->quote($sstr).', '. |
# values (". $dbh->quote($sstr).', '. |
$dbh->quote($metod) . ', ' . |
# $dbh->quote($metod) . ', ' . |
$dbh->quote(join ' ', grep $searchin{$_}, keys %searchin) . |
# $dbh->quote(join ' ', grep $searchin{$_}, keys %searchin) . |
", $ip)"; |
# ", $ip)"; |
print $query if $printqueries; |
#print $query if $printqueries; |
$dbh -> do ($query); |
# $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 995 sub PrintQuestion {
|
Line 997 sub PrintQuestion {
|
$output .= &PrintField("ëÏÍÍÅÎÔÁÒÉÉ", $Question{'Comments'}, $text); |
$output .= &PrintField("ëÏÍÍÅÎÔÁÒÉÉ", $Question{'Comments'}, $text); |
} |
} |
} |
} |
$output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'âÌÉÚËÉÅ ×ÏÐÒÏÓÙ').p |
# $output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'âÌÉÚËÉÅ ×ÏÐÒÏÓÙ').p |
if $answer; |
# if $answer; |
return $output; |
return $output; |
} |
} |
|
|