--- db/prgsrc/db.cgi 2004/03/11 07:14:14 1.130 +++ db/prgsrc/db.cgi 2004/03/17 10:26:31 1.132 @@ -2,14 +2,16 @@ use DBI; use CGI ':all'; -use strict; +#use strict; use Time::Local; +my $proxyredirect=1; use POSIX qw(locale_h); use locale; use vars qw($opt_z); use Getopt::Std; -my ($dbuser,$dbname,$dbpass,$dbhost); +#my ($dbuser,$dbname,$dbpass,$dbhost); require "dbdefs.pl"; +my $url=url||''; $dbuser||="piataev"; $dbname||="chgk"; $dbpass||=""; @@ -24,8 +26,10 @@ open STDERR, ">/var/tmp/errors1"; my $newsurl='http://news.chgk.info/'; my $reklama="../dimrub/db/reklama.html"; my $footer="../dimrub/db/footer.html"; - +$footer="../../chgk/footer.html" if $url=~/zaba/; +$reklama="../../chgk/reklama.html" if $url=~/zaba/; my $datefooter="../dimrub/db/date"; +$datefooter="../../chgk/date" if $url=~/zaba/; my $fname; $reklama="../reklama.html" if $opt_z; @@ -40,7 +44,7 @@ if ($^O =~ /win/i) { { $realHTMLDIR="/home/piataev/public_html/dimrub/db/files/"; } -my $url=url||''; + my $usehtml=$opt_z||0; $usehtml=1; @@ -67,7 +71,7 @@ if ($url !~ /db\.chgk\.info/ && $url !~ exit; } -if ($metod=~/proxy/ && $url !~ /localhost/ && $url !~ /bilbo/ && $url !~ /zaba/) { +if ($proxyredirect && $metod=~/proxy/ && $url !~ /localhost/ && $url !~ /bilbo/ && $url !~ /zaba/) { my $u="http://chgk.zaba.ru/cgi-bin/db.cgi?$qs"; Redirect ($u); exit; @@ -286,8 +290,9 @@ sub tourhref { return $res; } else { $res=$url; - $res.="?tour=$t"; - $res.=$a?"&answers=1":""; + $res.=$a?"?answers=1&":"?"; + $res.="tour=$t"; + return $res; } @@ -424,6 +429,9 @@ action="/znatoki/cgi-bin/db.cgi"> +

Если при попытке поиска выдаётся сообщение об ошибке, +попробуйте воспользоваться +зеркалом базы EOT @@ -462,7 +470,7 @@ sub makeproxysstr { # $good{$words[$_]}=1 foreach 0..4; foreach (@words) { - $good{$_}=1 if $c{$_}<200; + $good{$_}=1 if $c{$_}<200 && length $_>2; } $good{$words[$_]}=0 foreach 16..$#words; @@ -1957,14 +1965,13 @@ MAIN: my $d=$destination; $d=~s/$HTMLDIR/$realHTMLDIR/; # print header.$destination; - print header."$d|".(-e "$realHTMLDIR$n.html"); +# print header."$d|".(-e "$realHTMLDIR$n.html"); if (-e $d) { Redirect($destination); exit } $d=~s/\.\d+//; $destination=~s/\.\d+//; -print br.br.$d; if (-e $d) { Redirect($destination); exit @@ -2052,11 +2059,10 @@ print br.br.$d; my $title="Результаты поиска на \"". ($proxysstr||$sstr) .'"' if ($proxysstr||$sstr); $title||="База вопросов"; - $globaloutput.=start_html(-"title"=>$title, -author=>'dimrub@icomverse.com', -bgcolor=>'#fff0e0', - -vlink=>'#800020'); + -vlink=>'#800020');#} $globaloutput.="