--- db/prgsrc/db.cgi 2003/04/29 22:21:26 1.117 +++ db/prgsrc/db.cgi 2003/05/01 20:46:59 1.118 @@ -53,11 +53,11 @@ if ($url !~ /db\.chgk\.info/ && $url !~ Redirect ($u); exit; } -if (!param('sstr') && param('all')) { - my $destination='http://db.chgk.info/all.html'; - Redirect($destination); - exit; -} +#if (!param('sstr') && param('all')) { +# my $destination='http://db.chgk.info/all.html'; +# Redirect($destination); +# exit; +#} my $thislocale; if ($^O =~ /win/i) { $thislocale = "Russian_Russia.20866"; @@ -996,7 +996,7 @@ sub PrintTournament { %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/\/znatoki\/boris\/reports\//$newsurl/ if url=~/kulichki/ || $url=~/db.chgk.info/; my ($Info) = $Tournament{'Info'}; @@ -1086,9 +1086,9 @@ sub PrintTournament { "вопросы + ответы") . "]") ); } else { - $list .= dd(#a({href=> -# $url . "?tour=$textid&comp=1"}, -# img({src=>'/icons/compressed.gif', alt=>'[ZIP]', border=>1})) . + $list .= dd(a({href=> + $url . "?tour=$textid&comp=1"}, + img({src=>'/icons/compressed.gif', alt=>'[ZIP]', border=>1})) . " " . img({src=>$imgsrc, alt=>$alt}) . " " . a({href=>tourhref($textid,0,1)}, @@ -1831,9 +1831,9 @@ MAIN: exit } - if ($text) { + if ($text && !param ('comp')) { print header('text/plain'); - } else {print header;} + } elsif (!param('comp')) {print header;} my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") or do { print h1("Временные проблемы") . "База вопросов временно не @@ -2002,25 +2002,25 @@ EOT elsif (param('getfile')){ $globaloutput.=&writefile } elsif (param('all')) { - my $destination='http://db.chgk.info/all.html'; - Redirect($destination); - exit; -# $globaloutput.=&PrintAll($dbh, 0); +# my $destination='http://db.chgk.info/all.html'; +# Redirect($destination); +# exit; + $globaloutput.=&PrintAll($dbh, 0); } elsif (param('from_year') && param('to_year')) { $globaloutput.=&PrintDates($dbh); } elsif (param('comp')) { - $globaloutput.="Content-Type: application/octet-stream\n"; - $globaloutput.="Content-Type: application/force-download\n"; - $globaloutput.="Content-Type: application/download\n"; - $globaloutput.="Content-Type: application/x-zip-compressed; name=db.zip\n"; - $globaloutput.="Content-Disposition: attachment; filename=db.zip \n\n"; + print "Content-Type: application/octet-stream\n"; + print "Content-Type: application/force-download\n"; + print "Content-Type: application/download\n"; + print "Content-Type: application/x-zip-compressed; name=db.zip\n"; + print "Content-Disposition: attachment; filename=db.zip \n\n"; $tour ||= 0; my (@files) = &PrintArchive($dbh, $tour); WriteFile($dbh,$_) foreach @files; open F, "$ZIP -j - @files |"; binmode(F); binmode(STDOUT); - $globaloutput.= join "",; + print join "",; close F; $dbh->disconnect; exit;