Diff for /db/prgsrc/db.cgi between versions 1.77 and 1.79

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

Removed from v.1.77  
changed lines
  Added in v.1.79


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>