Diff for /db/prgsrc/db.cgi between versions 1.138 and 1.143

version 1.138, 2004/11/21 13:37:29 version 1.143, 2006/09/24 19:53:59
Line 44  if ($^O =~ /win/i) { Line 44  if ($^O =~ /win/i) {
  $realHTMLDIR="/html/znatoki/baza/";   $realHTMLDIR="/html/znatoki/baza/";
 } else   } else 
 {  {
   $realHTMLDIR="/home/piataev/public_html/dimrub/db/files/";    $realHTMLDIR="/home/znatoki/chgk-db/public_html/dimrub/db/files/";
 }  }
   
   
Line 67  $outputkvo=100 if $outputkvo>100; Line 67  $outputkvo=100 if $outputkvo>100;
   
 if (param('debug')) {$debug=1; $printqueries=1}  if (param('debug')) {$debug=1; $printqueries=1}
 *STDERR=*STDOUT if $debug;  *STDERR=*STDOUT if $debug;
 if ($url !~ /db\.chgk\.info/ && $url !~ /localhost/ && $url !~ /bilbo/ && $url !~ /zaba/) {  if ($url !~ /db\.chgk\.info/ && $url !~ /localhost/ && $url !~ /bilbo/ && $url !~ /zaba/ && $url !~ /question\.chgk\.info/ ) {
    my $u="http://db.chgk.info/cgi-bin/db.cgi?$qs";     my $u="http://db.chgk.info/cgi-bin/db.cgi?$qs";
    Redirect ($u);     Redirect ($u);
    exit;     exit;
Line 130  my $all=param('all'); Line 130  my $all=param('all');
 $all=0 if lc $all eq 'no';  $all=0 if lc $all eq 'no';
 my ($PWD) = `pwd` if $^O!~/win/i;  my ($PWD) = `pwd` if $^O!~/win/i;
 chomp $PWD if $PWD;  chomp $PWD if $PWD;
 my ($SRCPATH) = "/home/piataev/public_html/dimrub/src";  my ($SRCPATH) = "/home/db-chgk/public_html/dimrub/src";
 my ($ZIP) = "/usr/local/bin/zip";  my ($ZIP) = "/usr/bin/zip";
 my $DUMPFILE = "/tmp/chgkdump";  my $DUMPFILE = "/tmp/chgkdump";
 my ($SENDMAIL) = "/usr/sbin/sendmail";  my ($SENDMAIL) = "/usr/sbin/sendmail";
 my ($TMPDIR) = "/var/tmp";  my ($TMPDIR) = "/var/tmp";
Line 433  action="/znatoki/cgi-bin/db.cgi"> Line 433  action="/znatoki/cgi-bin/db.cgi">
 </td>  </td>
 </tr>  </tr>
 </table>  </table>
 <p><i>Если при попытке поиска выдаётся сообщение об ошибке,   <!--p><i>Если при попытке поиска выдаётся сообщение об ошибке, 
 попробуйте воспользоваться   попробуйте воспользоваться 
 <a href="http://chgk.zaba.ru/search.html">зеркалом базы</a></i>  <a href="http://chgk.zaba.ru/search.html">зеркалом базы</a></i-->
 </center>  </center>
   
 EOT  EOT
Line 904  sub PrintList { Line 904  sub PrintList {
         for (my $i = $first; $i <= $last; $i++) {          for (my $i = $first; $i <= $last; $i++) {
                 my $q=$q{$$Questions[$i-1]};                  my $q=$q{$$Questions[$i-1]};
                 my $output;                  my $output;
                 $output = &PrintQuestion($dbh, $q, 1, 0, 1,0,1  );                  $output = &PrintQuestion($dbh, $q, 1, 0, 1,$text,1  );
 #                if (param('metod') && (param('metod') eq 'rus' || param('metod') eq 'proxy'))  #                if (param('metod') && (param('metod') eq 'rus' || param('metod') eq 'proxy'))
                 {                  {
                      $output=~s/\b($shablon)\b/\<strong\>$1\<\/strong\>/gi;                       $output=~s/\b($shablon)\b/\<strong\>$1\<\/strong\>/gi;
Line 1278  sub PrintTour { Line 1278  sub PrintTour {
         my $sth=SelectQuestions($dbh,\@Questions,0);          my $sth=SelectQuestions($dbh,\@Questions,0);
         for ($q = 0; $q <= $#Questions; $q++) {          for ($q = 0; $q <= $#Questions; $q++) {
                 fetchquestion($sth,\%q,0);                  fetchquestion($sth,\%q,0);
                 $output .= &PrintQuestion($dbh, \%q, $answer, 0,0,0,1);                  $output .= &PrintQuestion($dbh, \%q, $answer, 0,0,$text,1);
         }          }
         $sth->finish;          $sth->finish;
         $output .= hr({-'align'=>'center', -'width'=>'80%'});          $output .= hr({-'align'=>'center', -'width'=>'80%'});
Line 1499  $output.="</span>" Line 1499  $output.="</span>"
   
         }          }
         $output=~s/\(pic: ([^\)]*)\)/<p><img src="\/znatoki\/images\/db\/$1"><p>/g unless $text;          $output=~s/\(pic: ([^\)]*)\)/<p><img src="\/znatoki\/images\/db\/$1"><p>/g unless $text;
           $output=~s/⌡/\&iuml;/g;
           $output=~s/⌠/\&Iuml;/g;
   
         $paramtour||=param("tour");          $paramtour||=param("tour");
         $fname=$fname.".$Question{'TourNumber'}" if $fname && $Question{'TourNumber'};          $fname=$fname.".$Question{'TourNumber'}" if $fname && $Question{'TourNumber'};
 $fname||=param('tour');  $fname||=param('tour');
Line 1979  MAIN: Line 1982  MAIN:
         my $texttour=$tour;          my $texttour=$tour;
         my ($sth,$dbh);          my ($sth,$dbh);
         my($dsn) = "DBI:mysql:database=$dbname;host=$dbhost";          my($dsn) = "DBI:mysql:database=$dbname;host=$dbhost";
         $dbh = DBI->connect($dsn, $dbuser, $dbpass)           $dbh = DBI->connect($dsn, $dbuser, $dbpass)
 #       $dbh = DBI->connect("DBI:mysql:$dbname", $username, $dbpass)  #       $dbh = DBI->connect("DBI:mysql:$dbname", $username, $dbpass)
                 or do {                  or do {
                         print header.h1("Временные проблемы") . "База вопросов временно не                          print header.h1("Временные проблемы") . "База вопросов временно не
Line 1991  MAIN: Line 1994  MAIN:
   
   
         if (param('qid') && (param('qid')=~/^\d+$/) || $tour && $tour=~/^\d+$/) {          if (param('qid') && (param('qid')=~/^\d+$/) || $tour && $tour=~/^\d+$/) {
            my $destination='http://chgk.zaba.ru/search.html';  #          my $destination='http://chgk.zaba.ru/search.html';
 #               print header (-'Content-Type' => 'text/html',  #               print header (-'Content-Type' => 'text/html',
 #                -'Location:'=> 'http:\\db.chgk.info');  #                -'Location:'=> 'http:\\db.chgk.info');
                 Redirect($destination);                  Redirect($destination);
Line 2229  EOT Line 2232  EOT
                   $QuestionNumber=($sth->fetchrow)[0]||0;                    $QuestionNumber=($sth->fetchrow)[0]||0;
                 }                  }
                 if ($QuestionNumber) {                  if ($QuestionNumber) {
                   $globaloutput.= &PrintQuestion($dbh, $QuestionNumber, $withanswers||0, $qnum, 1,0,0);                    $globaloutput.= &PrintQuestion($dbh, $QuestionNumber, $withanswers||0, $qnum, 1,$text,0);
 #                                        $dbh, $Id, $answer, $qnum, $title, $text  #                                        $dbh, $Id, $answer, $qnum, $title, $text
                 } else  {                  } else  {
                    $globaloutput.=&PrintTournament($dbh, $tour, $withanswers);                     $globaloutput.=&PrintTournament($dbh, $tour, $withanswers);

Removed from v.1.138  
changed lines
  Added in v.1.143


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