version 1.117, 2003/04/29 22:21:26
|
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 996 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 1086 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 1439 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 1831 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 1934 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 2002 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; |