--- db/prgsrc/db.cgi 2002/11/10 15:09:25 1.77
+++ db/prgsrc/db.cgi 2002/11/26 05:34:39 1.79
@@ -18,7 +18,7 @@ my %rusfieldname=('Question','Вопрос', '
'Comments', 'Комментарии', 'Authors', 'Автор',
'Sources', 'Источник','old','Старый','rus','Новый',
'chgk', 'ЧГК', 'brain', 'Брейн-ринг','game', 'Своя игра',
- 'ehruditka', 'Эрудитка', 'beskrylka', 'Бескрылка'
+ 'ehruditka', 'Эрудитка', 'beskrylka', 'Бескрылка', 'igp', 'Интернет'
);
my %searchin;
my $rl=qr/[йцукенгшщзхъфывапролджэячсмитьбюё]/;
@@ -33,7 +33,7 @@ my %metodchar=('rus',1,'old',2);
my $thislocale;
$searchin{$_}=1 foreach param('searchin');
-my %TypeName=('children'=>'Д', 'game'=>'И',
+my %TypeName=('children'=>'Д', 'game'=>'Я', 'igp'=>'И',
'chgk'=>'Ч', 'brain'=>'Б', 'beskrylka'=>'Л','ehruditka'=>'Э');
@@ -175,9 +175,9 @@ sub printform
my $fields=checkbox_group('searchin',['Question','Answer','Comments','Authors','Sources'], [@df],
'false',\%rusfieldname);
@df=param('type');
- @df=('chgk','brain','game','ehruditka','beskrylka') unless @df;
+ @df=('chgk','brain','igp','game','ehruditka','beskrylka') unless @df;
- my $types=checkbox_group('type',['chgk','brain','game','ehruditka','beskrylka'], [@df],
+ my $types=checkbox_group('type',['chgk','brain','igp','game','ehruditka','beskrylka'], [@df],
'false',\%rusfieldname);
my $metod=radio_group(-name=>'metod',-values=>['old','rus'],
-default=>(param('metod')||'rus'),
@@ -1041,6 +1041,8 @@ sub PrintField {
$value =~ s/^\s+/
/mg;
$value =~ s/^\|([^\n]*)/
$1<\/pre>/mg; $value =~ s/\s+-+\s+/ /mg; + $value =~ s/(http:\/\/\S+[^\s\)\(\,\.])/$1<\/a>/g if $header !~ /^Авто/; +# $value =~ s/(http:\/\/(?:\w+.)+[\w\\\~]+(\?[^\s.]+)?)/$1<\/a>/g if $header !~ /^Авто/; # $value =~ s/(\s)"/$1/mg; # $value =~ s/^"//mg; # $value =~ s/"//mg; @@ -1078,7 +1080,7 @@ return "" if $fname=~/mgp0203/; } - $output.= ""; + $output.= "" unless $text; $output .= &PrintField("Вопрос $qnum", $Question{'Question'}, $text); @@ -1087,14 +1089,14 @@ return "" if $fname=~/mgp0203/; $output .= &PrintField("Ответ", $Question{'Answer'}, $text); - if ($Question{'Authors'}) { + if ($Question{'Authors'} ) { 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); - + if (!$text) { while ((($AuthorId,$Name, $Surname,$Nicks)=$sth->fetchrow),$AuthorId) { my ($firstletter)=$Name=~m/^./g; @@ -1115,7 +1117,7 @@ return "" if $fname=~/mgp0203/; } $q=~s/($sha)/a({href=>url."?qofauthor=$AuthorId"},$1)/ei; } - + } $output .= &PrintField("Автор(ы)", $q, $text); } @@ -1161,7 +1163,7 @@ $output.="" } $output.=br.a({href=> url."?metod=proxy&qid=$Id"}, 'Близкие вопросы').p - if $answer; + if $answer && !$text; return $output; }