version 1.46, 2001/12/08 23:00:44
|
version 1.48, 2001/12/10 21:28:33
|
Line 7 use strict;
|
Line 7 use strict;
|
use Time::Local; |
use Time::Local; |
use POSIX qw(locale_h); |
use POSIX qw(locale_h); |
use locale; |
use locale; |
#open STDERR, ">errors1"; |
open STDERR, ">errors1"; |
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} |
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 151 sub printform
|
Line 152 sub printform
|
my $submit=submit(-value=>'ðÏÉÓË'); |
my $submit=submit(-value=>'ðÏÉÓË'); |
my $inputstring=textfield(-name=>'sstr', |
my $inputstring=textfield(-name=>'sstr', |
-default=>param('sstr')||'', |
-default=>param('sstr')||'', |
-size=>50); |
-size=>30, |
|
-maxlength=>30); |
my @df=keys %searchin; |
my @df=keys %searchin; |
@df=('Question', 'Answer') unless @df; |
@df=('Question', 'Answer') unless @df; |
my $fields=checkbox_group('searchin',['Question','Answer','Comments','Authors','Sources'], [@df], |
my $fields=checkbox_group('searchin',['Question','Answer','Comments','Authors','Sources'], [@df], |
Line 537 print "@Questions" if $printqueries;
|
Line 539 print "@Questions" if $printqueries;
|
Ðð Òò Óó Ôô Õõ Ææ Èè Ãã Þþ Ûû Ýý Øø Ùù Üü Àà Ññ/; |
Ðð Òò Óó Ôô Õõ Ææ Èè Ãã Þþ Ûû Ýý Øø Ùù Üü Àà Ññ/; |
|
|
sub NoCase { |
sub NoCase { |
my ($sstr) = shift; |
my ($sstr) = shift; |
my ($res); |
my ($res); |
|
|
if (($res) = grep(/$sstr/, @letters)) { |
if (($res) = grep(/$sstr/, @letters)) { |
Line 958 sub PrintQuestion {
|
Line 960 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.Id,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); |
|
|
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)"; |
# my $sha="(?:$Name\\s+$Surname)|(?:$Surname\\s+$Name)|(?:$firstletter\\.\\s*$Surname)|(?:$Surname\\s+$firstletter\\.)|(?:$Surname)|(?:$Name)"; |
if ($Nicks) |
# if ($Nicks) |
{ |
# { |
$Nicks=~s/^\|//; |
# $Nicks=~s/^\|//; |
foreach (split /\|/, $Nicks) |
# foreach (split /\|/, $Nicks) |
{ |
# { |
s/\s+/ /g; |
# s/\s+/ /g; |
s/\s+$//; |
# s/\s+$//; |
s/ /\\s+/g; |
# s/ /\\s+/g; |
s/\./\\\./g; |
# s/\./\\\./g; |
if (s/>$//) {$sha="$sha|(?:$_)"} |
# if (s/>$//) {$sha="$sha|(?:$_)"} |
else {$sha="(?:$_)|$sha"} |
# else {$sha="(?:$_)|$sha"} |
} |
# } |
} |
# } |
$q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; |
# $q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; |
} |
# } |
|
|
$output .= &PrintField("á×ÔÏÒ(Ù)", $q, $text); |
$output .= &PrintField("á×ÔÏÒ(Ù)", $q, $text); |
|
|