version 1.112, 2003/04/20 12:45:30
|
version 1.115, 2003/04/22 10:50:37
|
Line 9 use locale;
|
Line 9 use locale;
|
use vars qw($opt_z); |
use vars qw($opt_z); |
use Getopt::Std; |
use Getopt::Std; |
getopts('z'); |
getopts('z'); |
|
my $withanswers=param('answer')||param('answers'); |
open STDERR, ">/var/tmp/errors1"; |
open STDERR, ">/var/tmp/errors1"; |
my $newsurl='http://news.chgk.info/'; |
my $newsurl='http://news.chgk.info/'; |
my $reklama="../dimrub/db/reklama.html"; |
my $reklama="../dimrub/db/reklama.html"; |
Line 21 if ($^O =~ /win/i) {
|
Line 22 if ($^O =~ /win/i) {
|
{ |
{ |
$realHTMLDIR="/home/znatoki/public_html/dimrub/db/baza/"; |
$realHTMLDIR="/home/znatoki/public_html/dimrub/db/baza/"; |
} |
} |
my $usehtml=1; |
my $usehtml=$opt_z||0; |
my $usewas=0; |
my $usewas=0; |
my $cashednumber=500; |
my $cashednumber=500; |
my $outputnumber=10; |
my $outputnumber=10; |
Line 232 sub tourhref {
|
Line 233 sub tourhref {
|
} else { |
} else { |
$res=$url; |
$res=$url; |
$res.="?tour=$t"; |
$res.="?tour=$t"; |
$res.=$a?"?answers=1":""; |
$res.=$a?"&answers=1":""; |
return $res; |
return $res; |
} |
} |
|
|
Line 1815 MAIN:
|
Line 1816 MAIN:
|
or do { |
or do { |
print h1("Временные проблемы") . "База вопросов временно не |
print h1("Временные проблемы") . "База вопросов временно не |
работает. Заходите попозже."; |
работает. Заходите попозже."; |
print &Include_virtual("../dimrub/db/reklama.html") if $url!~/localhost/; |
print &Include_virtual("$reklama") if $url!~/localhost/; |
print end_html; |
print end_html; |
die "Can't connect to DB chgk\n"; |
die "Can't connect to DB chgk\n"; |
}; |
}; |
Line 1880 td {font-size: x-small; font-family : sa
|
Line 1881 td {font-size: x-small; font-family : sa
|
th {font-size: x-small; font-family : sans-serif} |
th {font-size: x-small; font-family : sans-serif} |
</style>\n"; |
</style>\n"; |
|
|
$globaloutput.=&Include_virtual("../dimrub/db/reklama.html")||''; |
$globaloutput.=&Include_virtual("$reklama")||''; |
} |
} |
|
|
if (length ($qs)<=255 && $qs !~ /(sstr)|(rand)|(comp)|(all=)/i) { |
if (length ($qs)<=255 && $qs !~ /(sstr)|(rand)|(comp)|(all=)/i) { |
Line 2021 EOT
|
Line 2022 EOT
|
$QuestionNumber=($sth->fetchrow)[0]||0; |
$QuestionNumber=($sth->fetchrow)[0]||0; |
} |
} |
if ($QuestionNumber) { |
if ($QuestionNumber) { |
$globaloutput.= &PrintQuestion($dbh, $QuestionNumber, param('answer')||0, $qnum, 1,0,0); |
$globaloutput.= &PrintQuestion($dbh, $QuestionNumber, $withanswers||0, $qnum, 1,0,0); |
# $dbh, $Id, $answer, $qnum, $title, $text |
# $dbh, $Id, $answer, $qnum, $title, $text |
} else { |
} else { |
$globaloutput.=&PrintTournament($dbh, $tour, param('answer')); |
$globaloutput.=&PrintTournament($dbh, $tour, $withanswers); |
} |
} |
} |
} |
else { |
else { |