--- db/prgsrc/db.cgi 2003/04/20 12:21:13 1.109 +++ db/prgsrc/db.cgi 2003/04/20 12:48:48 1.113 @@ -11,7 +11,9 @@ use Getopt::Std; getopts('z'); open STDERR, ">/var/tmp/errors1"; my $newsurl='http://news.chgk.info/'; -my $HTMLDIR=""; +my $reklama="../dimrub/db/reklama.html"; +$reklama="../reklama.html" if $opt_z; +my $HTMLDIR="/znatoki/dimrub/db/baza/"; my $realHTMLDIR; if ($^O =~ /win/i) { $realHTMLDIR="/html/znatoki/baza/"; @@ -225,6 +227,7 @@ sub tourhref { $res.=$a?"-a":"-q" unless $gr; $res.=".html"; $res=~s/(\#\d+)(.*)$/$2$1/; + $res="$HTMLDIR$res" unless $opt_z; return $res; } else { $res=$url; @@ -1415,7 +1418,7 @@ sub Get12Random { sub Include_virtual { my ($fn, $output) = (@_, ''); - + return "" if ($opt_z); open F , $fn or return ""; #die "Can't open the file $fn: $!\n"; @@ -1812,7 +1815,7 @@ MAIN: or do { print h1("Временные проблемы") . "База вопросов временно не работает. Заходите попозже."; - print &Include_virtual("../dimrub/db/reklama.html") if $url!~/localhost/; + print &Include_virtual("$reklama") if $url!~/localhost/; print end_html; die "Can't connect to DB chgk\n"; }; @@ -1877,7 +1880,7 @@ td {font-size: x-small; font-family : sa th {font-size: x-small; font-family : sans-serif} \n"; - $globaloutput.=&Include_virtual("../dimrub/db/reklama.html")||''; + $globaloutput.=&Include_virtual("$reklama")||''; } if (length ($qs)<=255 && $qs !~ /(sstr)|(rand)|(comp)|(all=)/i) { @@ -2056,7 +2059,7 @@ my ($sth) = $dbh->prepare("SELECT t1.Id, $fname=~s/\.txt$//; if ($type=~/Т/ || $c<=1) { - open FF, ">$realHTMLDIR$fname-q.html" or die "ERROR! - $HTMLDIR$fname-q.html\n"; + open FF, ">$realHTMLDIR$fname-q.html" or die "ERROR! - $fname-q.html\n"; my $o=$globaloutput; $o.=&PrintTournament($dbh, $Id, 0); $o.=&Bottom; @@ -2070,7 +2073,7 @@ my ($sth) = $dbh->prepare("SELECT t1.Id, close FF; } else { - open FF, ">$realHTMLDIR$fname.html" or die "ERROR! - $HTMLDIR$fname-q.html\n"; + open FF, ">$realHTMLDIR$fname.html" or die "ERROR! - $fname-q.html\n"; my $o=$globaloutput; $o.=&PrintTournament($dbh, $Id, 0); $o.=&Bottom;