Diff for /db/prgsrc/db.cgi between versions 1.116 and 1.120

version 1.116, 2003/04/28 22:49:50 version 1.120, 2003/06/04 23:18:46
Line 53  if ($url !~ /db\.chgk\.info/ && $url !~ Line 53  if ($url !~ /db\.chgk\.info/ && $url !~
    Redirect ($u);     Redirect ($u);
    exit;     exit;
 }  }
 if (!param('sstr') && param('all')) {  #if (!param('sstr') && param('all')) {
            my $destination='http://db.chgk.info/all.html';  #          my $destination='http://db.chgk.info/all.html';
                 Redirect($destination);  #               Redirect($destination);
                 exit;  #                exit;
 }  #}
 my $thislocale;  my $thislocale;
 if ($^O =~ /win/i) {  if ($^O =~ /win/i) {
         $thislocale = "Russian_Russia.20866";          $thislocale = "Russian_Russia.20866";
Line 450  sub russearch { Line 450  sub russearch {
             my %count;              my %count;
         POSIX::setlocale( &POSIX::LC_ALL, $thislocale );          POSIX::setlocale( &POSIX::LC_ALL, $thislocale );
 $sstr=~tr/ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀ/êãõëåîçûýúèÿæù÷áðòïìäöüñþóíéôøâà/;  $sstr=~tr/ÊÃÕËÅÎÇÛÝÚÈßÆÙ×ÁÐÒÏÌÄÖÜÑÞÓÍÉÔØÂÀ/êãõëåîçûýúèÿæù÷áðòïìäöüñþóíéôøâà/;
             @qw=@w =split (' ', uc $sstr);  #           @qw=@w =split (' ', uc $sstr);
               my $ts=uc $sstr;
               @qw=@w= $ts=~m/(?:(?:${RLrl})+)|(?:[A-Za-z0-9]+)/gom;
   
   
 #-----------  #-----------
             foreach $i (0..$#w) # ÚÁÐÏÌÎÑÅÍ ÍÁÓÓÉ× @nf ÎÁÞÁÌØÎÙÈ ÆÏÒÍ              foreach $i (0..$#w) # ÚÁÐÏÌÎÑÅÍ ÍÁÓÓÉ× @nf ÎÁÞÁÌØÎÙÈ ÆÏÒÍ
Line 745  sub PrintList { Line 748  sub PrintList {
    my ($dbh,$Questions,$shablon,$was)=@_;     my ($dbh,$Questions,$shablon,$was)=@_;
         my $Output;          my $Output;
         my $first=param('first') ||1;          my $first=param('first') ||1;
 print "shablon=$shablon".p;  
         $first=$first-($first-1)%$outputkvo;          $first=$first-($first-1)%$outputkvo;
         my $fkvo=param('fkvo')||($#$Questions+1);          my $fkvo=param('fkvo')||($#$Questions+1);
         my $last=$first+$outputkvo-1;          my $last=$first+$outputkvo-1;
Line 997  sub PrintTournament { Line 999  sub PrintTournament {
   
         %Tournament = &GetTournament($dbh, $Id) if ($Id);          %Tournament = &GetTournament($dbh, $Id) if ($Id);
   
         my ($URL) = $Tournament{'URL'};          my ($URL) = $Tournament{'URL'}||'';
         $URL=~s/http:\/znatoki\/boris\/reports\//$newsurl/ if $url=~/kulichki/ || $url=~/db.chgk.info/;          $URL=~s/http:\/znatoki\/boris\/reports\//$newsurl/ if $url=~/kulichki/ || $url=~/db.chgk.info/;
         $URL=~s/\/znatoki\/boris\/reports\//$newsurl/ if url=~/kulichki/ || $url=~/db.chgk.info/;          $URL=~s/\/znatoki\/boris\/reports\//$newsurl/ if url=~/kulichki/ || $url=~/db.chgk.info/;
         my ($Info) = $Tournament{'Info'};          my ($Info) = $Tournament{'Info'};
Line 1087  sub PrintTournament { Line 1089  sub PrintTournament {
                   "×ÏÐÒÏÓÙ + ÏÔ×ÅÔÙ") . "]")                    "×ÏÐÒÏÓÙ + ÏÔ×ÅÔÙ") . "]")
                                 );                                  );
                 } else {                  } else {
                         $list .= dd(#a({href=>                          $list .= dd(a({href=>
 #                                 $url . "?tour=$textid&comp=1"},                                   $url . "?tour=$textid&comp=1"},
 #                               img({src=>'/icons/compressed.gif', alt=>'[ZIP]', border=>1}))                           .                                    img({src=>'/icons/compressed.gif', alt=>'[ZIP]', border=>1}))                           .  
                                 " " .                                   " " . 
                                 img({src=>$imgsrc, alt=>$alt})                                  img({src=>$imgsrc, alt=>$alt})
                                 . " " . a({href=>tourhref($textid,0,1)},                                  . " " . a({href=>tourhref($textid,0,1)},
Line 1440  sub Get12Random { Line 1442  sub Get12Random {
   
 sub Include_virtual {  sub Include_virtual {
         my ($fn, $output) = (@_, '');          my ($fn, $output) = (@_, '');
         return "<!--#include virtual=\"$fn\"-->" if ($opt_z);          return "\n<!--#include virtual=\"$fn\"-->\n" if ($opt_z);
         open F , $fn          open F , $fn
                 or return ""; #die "Can't open the file $fn: $!\n";                  or return ""; #die "Can't open the file $fn: $!\n";
   
         while (<F>) {          while (<F>) {
                 if (/<!--#include/o) {                  if (/<!--#include/o) {
                         s/<!--#include virtual="\/(.*)" -->/&Include_virtual($1)/e;                          s/<!--#include virtual="\/?([^\/].*)" -->/&Include_virtual($1)/e;
                 }                  }
                 if (/<!--#exec/o) {                  if (/<!--#exec/o) {
                         s/<!--#exec.*cmd\s*=\s*"([^"]*)".*-->/`$1`/e;                          s/<!--#exec.*cmd\s*=\s*"([^"]*)".*-->/`$1`/e;
Line 1832  MAIN: Line 1834  MAIN:
                 exit                  exit
         }          }
   
         if ($text) {          if ($text && !param ('comp')) {
                 print header('text/plain');                  print header('text/plain');
         } else {print header;}          } elsif (!param('comp')) {print header;}
         my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "")          my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "")
                 or do {                  or do {
                         print h1("÷ÒÅÍÅÎÎÙÅ ÐÒÏÂÌÅÍÙ") . "âÁÚÁ ×ÏÐÒÏÓÏ× ×ÒÅÍÅÎÎÏ ÎÅ                          print h1("÷ÒÅÍÅÎÎÙÅ ÐÒÏÂÌÅÍÙ") . "âÁÚÁ ×ÏÐÒÏÓÏ× ×ÒÅÍÅÎÎÏ ÎÅ
Line 1935  th {font-size: x-small; font-family : sa Line 1937  th {font-size: x-small; font-family : sa
         }          }
                 $tour = (param('tour')) ? param('tour') : 0;                  $tour = (param('tour')) ? param('tour') : 0;
                 my $sth;                  my $sth;
                 if ($tour !~ /^[0-9]*$/) {                  my $texttour=$tour;
                   if ($tour !~ /^[0-9]*$/) {          
                     if ($tour=~/\./)                      if ($tour=~/\./)
                     {                      {
                         my ($fname,$n)= split /\./ , $tour;                          my ($fname,$n)= split /\./ , $tour;
Line 2003  EOT Line 2006  EOT
         elsif (param('getfile')){          elsif (param('getfile')){
            $globaloutput.=&writefile             $globaloutput.=&writefile
         } elsif (param('all')) {          } elsif (param('all')) {
            my $destination='http://db.chgk.info/all.html';  #          my $destination='http://db.chgk.info/all.html';
                 Redirect($destination);  #               Redirect($destination);
                 exit;  #                exit;
 #               $globaloutput.=&PrintAll($dbh, 0);                  $globaloutput.=&PrintAll($dbh, 0);
         } elsif (param('from_year') && param('to_year')) {          } elsif (param('from_year') && param('to_year')) {
                 $globaloutput.=&PrintDates($dbh);                  $globaloutput.=&PrintDates($dbh);
         } elsif (param('comp')) {          } elsif (param('comp')) {
             $globaloutput.="Content-Type: application/octet-stream\n";              print "Content-Type: application/octet-stream\n";
             $globaloutput.="Content-Type: application/force-download\n";              print  "Content-Type: application/force-download\n";
             $globaloutput.="Content-Type: application/download\n";              print  "Content-Type: application/download\n";
             $globaloutput.="Content-Type: application/x-zip-compressed; name=db.zip\n";              print  "Content-Type: application/x-zip-compressed; name=$texttour.zip\n";
             $globaloutput.="Content-Disposition: attachment; filename=db.zip \n\n";              print "Content-Disposition: attachment; filename=$texttour.zip \n\n";
             $tour ||= 0;              $tour ||= 0;
             my (@files) = &PrintArchive($dbh, $tour);              my (@files) = &PrintArchive($dbh, $tour);
             WriteFile($dbh,$_) foreach @files;              WriteFile($dbh,$_) foreach @files;
             open F, "$ZIP -j - @files |";              open F, "$ZIP -j - @files |";
             binmode(F);              binmode(F);
             binmode(STDOUT);              binmode(STDOUT);
             $globaloutput.= join "",<F>;              print join "",<F>;
             close F;              close F;
             $dbh->disconnect;              $dbh->disconnect;
             exit;              exit;

Removed from v.1.116  
changed lines
  Added in v.1.120


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