--- db/prgsrc/db.cgi 2001/10/18 19:53:17 1.24 +++ db/prgsrc/db.cgi 2001/11/26 10:31:49 1.37 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w use DBI; use CGI ':all'; @@ -7,9 +7,11 @@ use strict; use Time::Local; use POSIX qw(locale_h); use locale; -open STDERR, ">errors"; +#open STDERR, ">errors"; my $printqueries=0; -my %fieldname= (0,'Question', 1, 'Answer', 2, 'Comments'); +my %forbidden=(); +my $debug=0; #added by R7 +my %fieldname= (0,'Question', 1, 'Answer', 2, 'Comments', 3, 'Authors', 4, 'Sources'); my %searchin; @@ -20,7 +22,8 @@ my $thislocale; $searchin{'question'}=param('Question'); $searchin{'answer'}=param('Answer'); $searchin{'comment'}=param('Comment'); -$printqueries||=param('debug'); +$searchin{'authors'}=param('Authors'); +$searchin{'sources'}=param('Sources'); my $all=param('all'); $all=0 if lc $all eq 'no'; my ($PWD) = `pwd`; @@ -30,12 +33,12 @@ my ($ZIP) = "/home/piataev/bin/zip"; my $DUMPFILE = "/tmp/chgkdump"; my ($SENDMAIL) = "/usr/sbin/sendmail"; my ($TMSECS) = 30*24*60*60; -my (%RevMonths) = +my (%RevMonths) = ('Jan', '0', 'Feb', '1', 'Mar', '2', 'Apr', '3', 'May', '4', 'Jun', '5', 'Jul', '6', 'Aug', '7', 'Sep', '8', 'Oct', '9', 'Nov', '10', 'Dec', '11', 'Янв', '0', 'Фев', 1, 'Мар', 2, 'Апр', 3, 'Май', '4', - 'Июн', '5', 'Июл', 6, 'Авг', '7', 'Сен', '8', + 'Июн', '5', 'Июл', 6, 'Авг', '7', 'Сен', '8', 'Окт', '9', 'Ноя', '19', 'Дек', '11'); # Determine whether the given time is within 2 months from now. @@ -90,7 +93,7 @@ sub GetTourQuestions { my ($dbh, $ParentId) = @_; my (@arr, @Questions); - my ($sth) = $dbh->prepare("SELECT QuestionId FROM Questions + my ($sth) = $dbh->prepare("SELECT QuestionId FROM Questions WHERE ParentId=$ParentId ORDER BY QuestionId"); $sth->execute; @@ -143,7 +146,7 @@ $sstr=~tr/йцукенгшщзхъфывапролджэячсмить foreach $i (0..$#w) # заполняем массив @nf начальных форм # $nf[$i] -- ссылка на массив возможных # начальных форм словоформы $i - { + { $qw= $dbh->quote (uc $w[$i]); $query=" select distinct w2 from nests where w1=$qw"; @@ -157,6 +160,7 @@ print "$query",br if $printqueries; } } + my @bad=grep {!$nf[$_]} 0..$#w; # @bad -- номера словоформ, # которых нет в словаре @@ -173,8 +177,10 @@ print "$query",br if $printqueries; } return () if ($all && @verybad); + my $kvo=0; push @$allnf, @{$_} foreach @nf; + print "nf=@$allnf" if $printqueries; foreach $i (0..$#w) #запросы в базу... { @@ -187,25 +193,6 @@ print "$query",br if $printqueries; $_= " word2question.word=".$_. ' ' foreach @arr; $_= " nf.id=".$_. ' ' foreach @arr1; -# $_= " nests.w2=".$_. ' ' foreach @arr2; -# $query="select w1 from nests where". (join ' OR ', @arr2); -#print $query if $printqueries; -# $sth=$dbh -> prepare($query); -# $sth->execute; -# while (@ar=$sth->fetchrow) -# { -# $ar[0]=~s/(.)/&nocase($1)/ge; -# push(@sf,'(?:'.$ar[0].')'); -# } -# $selectshablon=join '|',@sf; - -#print $selectshablon,br if $printqueries; - -# $selectshablon=qr/$selectshablon/i; - - - - $query="select questions from word2question where". (join ' OR ', @arr); print "$query\n",br if $printqueries; @@ -229,7 +216,6 @@ print "$query\n",br if $printqueries; - if (@blob < 4) { $tasksof{$i}=undef; @@ -245,13 +231,12 @@ print "$query\n",br if $printqueries; # виде хэша, ключи которого -- номера вопросов, # а значения -- списки номеров вхождений. Вот. { - ($field,$hi,$lo,$wordnumber)=@blob[$ii..($ii+3)]; + ($field,$lo,$hi,$wordnumber)=@blob[$ii..($ii+3)]; $ii+=4; $number=$lo+$hi*256; $field=$fieldname{$field}; if ($searchin{lc $field}) { - push @{$tasksof{$i}{$number}}, $wordnumber; # дополнили в хэше, висящем на # словоформе $i в %tasksof список @@ -267,9 +252,9 @@ print "$query\n",br if $printqueries; } } #foreach $i -print "keys tasksof", keys %tasksof if $printqueries; +#print "keys tasksof", join ' ', keys %{$tasksof{0}}; #Ищем пересечение или объединение списков вопросов (значений %tasksof) - foreach $sf (keys %tasksof) + foreach $sf (keys %tasksof) { $count{$_}++ foreach keys %{$tasksof{$sf}}; } @@ -277,7 +262,7 @@ print "keys tasksof", keys %tasksof if $ keys %count) ; -#print "\n\$#tasks=",$#tasks,br; +print "\n\$#tasks=",$#tasks,br if $printqueries; ############ Сортировка найденных вопросов foreach (keys %wordsof) @@ -290,7 +275,7 @@ foreach (keys %wordsof) ############ -print "tasks=@tasks" if $printqueries;; +print "tasks=@tasks" if $printqueries; #print "$_ $relevance{$_} | " foreach @tasks; #print br; @@ -359,19 +344,18 @@ sub Search { ###Simple and advanced query processing. Added by R7 - if ($metod eq 'simple' || $metod eq 'advanced') + if ($metod eq 'simple' || $metod eq 'advanced') { - foreach (qw/Question Answer Sources Authors Comments/) { + foreach (qw/Question Answer Sources Authors Comments/) { if (param($_)) { - push @fields, $_; + push @fields, $_; } - } - + } @fields=(qw/Question Answer Sources Authors Comments/) unless scalar @fields; my $fields=join ",", @fields; my $q=new Text::Query($sstr, - -parse => 'Text::Query::'. + -parse => 'Text::Query::'. (($metod eq 'simple') ? 'ParseSimple':'ParseAdvanced'), -solve => 'Text::Query::SolveSQL', -build => 'Text::Query::BuildSQLMySQL', @@ -380,20 +364,18 @@ sub Search { $where= $$q{'matchexp'}; my $query= "SELECT Questionid FROM Questions WHERE $where"; - print br."Query is: $query".br if $printqueries; + print br."Query is: $query".br if $debug; $sth = $dbh->prepare($query); } else -###### +###### { - foreach (qw/Question Answer Sources Authors Comments/) { if (param($_)) { push @fields, "IFNULL($_, '')"; } } - @sar = split " ", $sstr; for $i (0 .. $#sar) { $sar[$i] = $dbh->quote("%${sar[$i]}%"); @@ -406,8 +388,11 @@ sub Search { $sstr = join " OR $f LIKE ", @sar; } -my $query="SELECT QuestionId FROM Questions + my $query; + $query="SELECT QuestionId FROM Questions WHERE $f LIKE $sstr ORDER BY QuestionId"; + + print $query if $printqueries; $sth = $dbh->prepare($query) @@ -415,16 +400,16 @@ print $query if $printqueries; $sth->execute; while (@arr = $sth->fetchrow) { - push @Questions, $arr[0]; + push @Questions, $arr[0] unless $forbidden{$arr[0]}; } - + return @Questions; } # Substitute every letter by a pair (for case insensitive search). - my (@letters) = qw/аА бБ вВ гГ дД еЕ жЖ зЗ иИ йЙ кК лЛ мМ нН оО + my (@letters) = qw/аА бБ вВ гГ дД еЕ жЖ зЗ иИ йЙ кК лЛ мМ нН оО пП рР сС тТ уУ фФ хХ цЦ чЧ шШ щЩ ьЬ ыЫ эЭ юЮ яЯ/; - + sub NoCase { my ($sstr) = shift; my ($res); @@ -444,7 +429,6 @@ sub PrintSearch { my $shablon; - if ($metod eq 'rus') { my $where='0'; @@ -459,7 +443,7 @@ print "$query" if $printqueries; { push @shablon,"(?:$arr[0])"; } - $shablon= join "|", @shablon; + $shablon= join "|", @shablon; $shablon=~s/[её]/\[ЕЁ\]/gi; # $shablon=~s/([йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ])/&NoCase($1)/ge; $shablon=qr/$shablon/i; @@ -473,9 +457,9 @@ print "$query" if $printqueries; } elsif ($hits =~ /1$/) { $suffix = 'е'; } else { - $suffix = 'я'; + $suffix = 'я'; } - + print p({align=>"center"}, "Результаты поиска на " . strong($sstr) . " : $hits попадани$suffix."); @@ -489,7 +473,7 @@ print "$query" if $printqueries; for ($i = 0; $i <= $#Questions; $i++) { $output = &PrintQuestion($dbh, $Questions[$i], 1, $i + 1, 1); if (param('metod') eq 'rus') - { + { $output=~s/\b($shablon)\b/\$1\<\/strong\>/gi; } else { foreach (@sar) { @@ -514,10 +498,10 @@ sub PrintRandom { for ($i = 0; $i <= $#Questions; $i++) { # Passing DB handler, question ID, print answer, question # number, print title, print text/html - $output .= + $output .= &PrintQuestion($dbh, $Questions[$i], 1, $i + 1, 0, $text); } - return $output; + return $output; } sub PrintTournament { @@ -527,7 +511,7 @@ sub PrintTournament { my ($output) = ''; %Tournament = &GetTournament($dbh, $Id) if ($Id); - + my ($URL) = $Tournament{'URL'}; my ($Info) = $Tournament{'Info'}; my ($Copyright) = $Tournament{'Copyright'}; @@ -537,7 +521,7 @@ sub PrintTournament { if ($Id) { for ($Tournament{'Type'}) { /Г/ && do { - $output .= h2({align=>"center"}, + $output .= h2({align=>"center"}, "Группа: $Tournament{'Title'} ", "$Tournament{'PlayedAt'}") . p . "\n"; last; @@ -545,13 +529,13 @@ sub PrintTournament { /Ч/ && do { return &PrintTour($dbh, $Tours[0], $answer) if ($#Tours == 0); - + my $title="Пакет: $Tournament{'Title'}"; if ($Tournament{'PlayedAt'}) { $title .= " $Tournament{'PlayedAt'}"; } - $output .= h2({align=>"center"}, + $output .= h2({align=>"center"}, "$title") . p . "\n"; last; }; @@ -564,9 +548,9 @@ sub PrintTournament { $output .= h2("Банк Вопросов: $qnum вопросов") . p . "\n"; } - for ($i = 0; $i <= $#Tours; $i++) { + for ($i = 0; $i <= $#Tours; $i++) { %Tournament = &GetTournament($dbh, $Tours[$i]); - + if ($Tournament{'Type'} =~ /Ч/) { $SingleTour = 0; my (@Tours) = &GetTours($dbh, $Tournament{'Id'}); @@ -590,7 +574,7 @@ sub PrintTournament { if ($SingleTour or $Tournament{'Type'} =~ /Т/) { $list .= dd(img({src=>$imgsrc, alt=>$alt}) . " " . $Tournament{'Title'} . " " . - $Tournament{'PlayedAt'} . $qnum) . + $Tournament{'PlayedAt'} . $qnum) . dl( dd("[" . a({href=>url . "?tour=$Tournament{'Id'}&answer=0"}, @@ -599,11 +583,11 @@ sub PrintTournament { "вопросы + ответы") . "]") ); } else { - $list .= dd(a({href=>url . "?tour=$Tournament{'Id'}&comp=1"}, + $list .= dd(a({href=>url . "?tour=$Tournament{'Id'}&comp=1"}, img({src=>'/icons/compressed.gif', alt=>'[ZIP]', border=>1})) - . " " . img({src=>$imgsrc, alt=>$alt}) - . " " . a({href=>url . "?tour=$Tournament{'Id'}&answer=0"}, - $Tournament{'Title'}. " ". + . " " . img({src=>$imgsrc, alt=>$alt}) + . " " . a({href=>url . "?tour=$Tournament{'Id'}&answer=0"}, + $Tournament{'Title'}. " ". $Tournament{'PlayedAt'}) . $qnum); } } @@ -611,7 +595,7 @@ sub PrintTournament { if ($URL) { $output .= - p("Дополнительная информация об этом турнире - по адресу " . + p("Дополнительная информация об этом турнире - по адресу " . a({-'href'=>$URL}, $URL)); } @@ -622,7 +606,7 @@ sub PrintTournament { if ($Info) { $output .= p($Info); } - + return $output; } @@ -636,7 +620,7 @@ sub Suffix { sub IsTour { my ($dbh, $Id) = @_; - my ($sth) = $dbh->prepare("SELECT Type FROM Tournaments + my ($sth) = $dbh->prepare("SELECT Type FROM Tournaments WHERE Id=$Id"); $sth->execute; return ($sth->fetchrow)[0] =~ /Т/; @@ -656,23 +640,23 @@ sub PrintTour { if ($Tour{'Type'} !~ /Т/); my ($qnum) = $Tour{'QuestionsNum'}; - my ($suffix) = &Suffix($qnum); - - $output .= h2({align=>"center"}, $Tournament{"Title"}, + my ($suffix) = &Suffix($qnum); + + $output .= h2({align=>"center"}, $Tournament{"Title"}, $Tournament{'PlayedAt'}, - "
", $Tour{"Title"} . + "
", $Tour{"Title"} . " ($qnum вопрос$suffix)\n") . p; my (@Questions) = &GetTourQuestions($dbh, $Id); for ($q = 0; $q <= $#Questions; $q++) { $output .= &PrintQuestion($dbh, $Questions[$q], $answer, 0); - } + } $output .= hr({-'align'=>'center', -'width'=>'80%'}); if ($Tournament{'URL'}) { $output .= - p("Дополнительная информация об этом турнире - по адресу " . + p("Дополнительная информация об этом турнире - по адресу " . a({-'href'=>$Tournament{'URL'}}, $Tournament{'URL'})); } @@ -683,26 +667,26 @@ sub PrintTour { if ($Tournament{'Info'}) { $output .= p($Tournament{'Info'}); } - + if ($answer == 0) { - $bottom .= + $bottom .= "[" . a({href=>url . "?tour=$Id&answer=1"}, "ответы") . "] " . br; } if (&IsTour($dbh, $Id - 1)) { - $bottom .= - "[" . a({href=>url . "?tour=" . ($Id - 1) . "&answer=0"}, + $bottom .= + "[" . a({href=>url . "?tour=" . ($Id - 1) . "&answer=0"}, "предыдущий тур") . "] "; - $bottom .= - "[" . a({href=>url . "?tour=" . ($Id - 1) . "&answer=1"}, + $bottom .= + "[" . a({href=>url . "?tour=" . ($Id - 1) . "&answer=1"}, "предыдущий тур с ответами") . "] " . br; } if (&IsTour($dbh, $Id + 1)) { - $bottom .= - "[" . a({href=>url . "?tour=" . ($Id + 1) . "&answer=0"}, + $bottom .= + "[" . a({href=>url . "?tour=" . ($Id + 1) . "&answer=0"}, "следующий тур") . "] "; - $bottom .= - "[" . a({href=>url . "?tour=" . ($Id + 1) . "&answer=1"}, + $bottom .= + "[" . a({href=>url . "?tour=" . ($Id + 1) . "&answer=1"}, "следующий тур с ответами") . "] "; } @@ -720,11 +704,12 @@ sub PrintField { $value =~ s/^\s+/
    /mg; $value =~ s/^\|([^\n]*)/
$1<\/pre>/mg;
 	}
-	return $text ? "$header:\n$value\n\n" : 
+
+	return $text ? "$header:\n$value\n\n" :
 		strong("$header: ") . $value . p . "\n";
 }
 
-# Gets a DB handler (ofcourse) and a question Id. Prints 
+# Gets a DB handler (ofcourse) and a question Id. Prints
 # that question, according to the options.
 sub PrintQuestion {
 	my ($dbh, $Id, $answer, $qnum, $title, $text) = @_;
@@ -745,19 +730,50 @@ sub PrintQuestion {
 		}
 		$output .= dl(strong($titles));
 	}
-	
+
 	$qnum = $Question{'Number'}
 		if ($qnum == 0);
 
-	$output .= 
+	$output .=
 		&PrintField("Вопрос $qnum", $Question{'Question'}, $text);
 
 	if ($answer) {
-		$output .= 
+		$output .=
 			&PrintField("Ответ", $Question{'Answer'}, $text);
 
 		if ($Question{'Authors'}) {
-			$output .= &PrintField("Автор(ы)", $Question{'Authors'}, $text);
+                      my $q=$Question{'Authors'};
+
+		      my $sth=$dbh->prepare("select Authors.Id,Name, Surname, Nicks from Authors, A2Q
+                                 where Authors.Id=Author And Question=$Id");
+                      $sth->execute;
+                      my ($AuthorId,$Name, $Surname,$other,$Nicks);
+
+                      while ((($AuthorId,$Name, $Surname,$Nicks)=$sth->fetchrow),$AuthorId)
+                      {
+                        my ($firstletter)=$Name=~m/^./g;
+#		        $other.=a({href=>url."?qofauthor=$AuthorId"},"$Name $Surname").". ";
+                         $Name=~s/\./\\\./g;
+                          my $sha="(?:$Name\\s+$Surname)|(?:$Surname\\s+$Name)|(?:$firstletter\\.\\s*$Surname)|(?:$Surname\\s+$firstletter\\.)|(?:$Surname)|(?:$Name)";
+                          if ($Nicks)
+                          {
+                            $Nicks=~s/^\|//;
+                            foreach (split /\|/, $Nicks)
+                            {
+                              s/\s+/ /g;
+                              s/\s+$//;
+                              s/ /\\s+/g;
+                              s/\./\\\./g;
+                              if (s/>$//) {$sha="$sha|(?:$_)"}
+                              else        {$sha="(?:$_)|$sha"}
+                            }
+                          }
+                          $q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei;
+                      }
+
+			$output .= &PrintField("Автор(ы)", $q, $text);
+
+#                        $output.= &PrintField("Другие вопросы", $other);
 		}
 
 		if ($Question{'Sources'}) {
@@ -792,7 +808,7 @@ sub Get12Random {
 	my ($qnum) = &GetMaxQId($dbh);
 	my (%chosen);
 	srand;
-	
+
    for ($i = 0; $i < $num; $i++) {
        do {
 	   $q = int(rand($qnum));
@@ -812,7 +828,7 @@ sub Include_virtual {
 
 	open F , $fn
 		or return; #die "Can't open the file $fn: $!\n";
-	
+
 	while () {
 		if (//&Include_virtual($1)/e;
@@ -831,7 +847,7 @@ sub PrintArchive {
 
 	my (%Tournament) = &GetTournament($dbh, $Id);
 	my (@Tours) = &GetTours($dbh, $Id);
-	
+
 	if ($Tournament{'Type'} =~ /Г/ || $Id == 0) {
 		for ($i = 0; $i <= $#Tours; $i++) {
 			push(@list ,&PrintArchive($dbh, $Tours[$i]));
@@ -847,7 +863,7 @@ sub PrintAll {
 
 	my (%Tournament) = &GetTournament($dbh, $Id);
 	my (@Tours) = &GetTours($dbh, $Id);
-	my ($New) = ($Id and $Tournament{'Type'} eq 'Ч' and 
+	my ($New) = ($Id and $Tournament{'Type'} eq 'Ч' and
 		&NewEnough($Tournament{"CreatedAt"})) ?
 		img({src=>"/znatoki/dimrub/db/new-sml.gif", alt=>"NEW!"}) : "";
 
@@ -869,7 +885,7 @@ sub PrintAll {
 
 sub PrintDates {
 	my ($dbh) = @_;
-	my ($from) = param('from_year') . "-" . param('from_month') . 
+	my ($from) = param('from_year') . "-" . param('from_month') .
 		"-" .  param('from_day');
 	my ($to) = param('to_year') . "-" . param('to_month') . "-" .  param('to_day');
 	$from = $dbh->quote($from);
@@ -896,11 +912,102 @@ sub PrintDates {
 	return $output;
 }
 
+sub PrintQOfAuthor
+{
+    my ($dbh, $id) = @_;
+   $id=$dbh->quote($id);
+    my $sth =  $dbh->prepare("SELECT  Name, Surname FROM Authors WHERE Id=$id");
+    $sth->execute;
+    my ($name,$surname)=$sth->fetchrow;
+
+    $sth =  $dbh->prepare("SELECT Question FROM A2Q WHERE Author=$id");
+    $sth->execute;
+    my $q;
+    my @Questions;
+    while (($q)=$sth->fetchrow,$q)
+     {push @Questions,$q unless $forbidden{$q}}
+
+    my ($output, $i, $suffix, $hits) = ('', 0, '', $#Questions + 1);
+
+    if ($hits =~ /1.$/  || $hits =~ /[5-90]$/) {
+		$suffix = 'й';
+	} elsif ($hits =~ /1$/) {
+		$suffix = 'е';
+	} else {
+		$suffix = 'я';
+	}
+
+	print p({align=>"center"}, "Автор ".strong("$name $surname. ")
+	. " : $hits попадани$suffix.");
+
+
+	for ($i = 0; $i <= $#Questions; $i++) {
+		$output = &PrintQuestion($dbh, $Questions[$i], 1, $i + 1, 1);
+		print $output;
+	}
+}
+
+
+sub PrintAuthors
+{
+     my ($dbh,$sort)=@_;
+     my($output,$out1,@array,$sth);
+     if ($sort eq 'surname')
+     {
+        $sth =
+             $dbh->prepare("SELECT Id, Name, Surname, QNumber FROM Authors order by Surname, Name");
+     }
+     elsif($sort eq 'name')
+     {
+        $sth =
+             $dbh->prepare("SELECT Id, Name, Surname, QNumber FROM Authors order by Name, Surname");
+     }
+     else
+     {
+        $sth =
+             $dbh->prepare("SELECT Id, Name, Surname, QNumber FROM Authors Order by QNumber DESC, Surname");
+     }
+
+     $output.=h2("Авторы вопросов")."\n";
+     $output.="";
+
+
+     $sth->execute;
+     $output.=Tr(th[a({href=>url."?authors=name"},"Имя")
+.", ".
+a({href=>url."?authors=surname"},"фамилия")
+     , a({href=>url."?authors=kvo"},"Количество вопросов")]);
+
+     $out1='';
+
+     my $ar=$sth->fetchall_arrayref;
+
+
+
+    foreach my $arr(@$ar)
+     {
+
+           my ($id,$name,$surname,$kvo)=@$arr;
+           if (!$name || !$surname) {#print "Opanki at $id\n"
+              } else
+           {
+             my $add=Tr(td([a({href=>url."?qofauthor=$id"},"$name $surname"), $kvo]))."\n";
+             print STDERR $add;
+             $output.=$add;
+           }
+     }
+     $output.="
"; + return $output; +} + + + MAIN: { setlocale(LC_CTYPE,'russian'); my($i, $tour); my($text) = (param('text')) ? 1 : 0; + my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") or do { print h1("Временные проблемы") . "База данных временно не @@ -932,13 +1039,24 @@ if ((uc 'а') ne 'А') {print "Koi8-r loca print header('text/plain'); } + if (param('hideequal')) { + my ($sth)= $dbh -> prepare("select first, second FROM equalto"); + $sth -> execute; + while ( my ($first, $second)=$sth -> fetchrow) + { + $forbidden{$first}=1; + } + $sth->finish; + } + + if (param('rand')) { my ($type, $qnum) = ('', 12); $type .= 'Б' if (param('brain')); $type .= 'Ч' if (param('chgk')); - $qnum = param('qnum') if (param('qnum') =~ /^\d+$/); + $qnum = param('qnum') if (param('qnum') =~ /^\d+$/); $qnum = 0 if (!$type); - if (param('email') && -x $SENDMAIL && + if (param('email') && -x $SENDMAIL && open(F, "| $SENDMAIL -t -n")) { my ($Email) = param('email'); my ($mime_type) = $text ? "plain" : "html"; @@ -957,12 +1075,19 @@ EOT } else { print &PrintRandom($dbh, $type, $qnum, $text); } - } elsif (param('sstr')) { + } + elsif (param('authors')){ + print &PrintAuthors($dbh,param('authors')); + } + elsif (param('qofauthor')){ + &PrintQOfAuthor($dbh,param('qofauthor')); + } + elsif (param('sstr')) { &PrintSearch($dbh, param('sstr'), param('metod')); } elsif (param('all')) { print &PrintAll($dbh, 0); } elsif (param('from_year') && param('to_year')) { - print &PrintDates($dbh); + print &PrintDates($dbh); } elsif (param('comp')) { print header( -'Content-Type' => 'application/x-zip-compressed; name="db.zip"',