--- db/prgsrc/db.cgi 2004/03/16 12:03:38 1.131 +++ db/prgsrc/db.cgi 2004/03/17 10:59:16 1.133 @@ -4,7 +4,7 @@ use DBI; use CGI ':all'; #use strict; use Time::Local; -my $proxyredirect=0; +my $proxyredirect=1; use POSIX qw(locale_h); use locale; use vars qw($opt_z); @@ -26,7 +26,8 @@ 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/; @@ -289,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; } @@ -468,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; @@ -1332,6 +1334,7 @@ sub PrintField { sub PrintQuestion { my ($dbh, $Id, $answer, $qnum, $title, $text,$h) = @_; my ($output, $titles) = ('', ''); + my $fname; my (%Question); if ($h) { %Question=%$Id; @@ -1353,7 +1356,7 @@ sub PrintQuestion { if (!$text) { $output .= hr({width=>"50%"}) if $answer>=0; if ($title) { - my $fname=$Question{'FileName'}; + $fname=$Question{'FileName'}; $fname=~s/\.txt//; $titles .= dd(img({src=>"/icons/folder.open.gif"}) . " " . @@ -1459,7 +1462,9 @@ $output.="" } $output=~s/\(pic: ([^\)]*)\)/

/g unless $text; $paramtour||=param("tour"); - my $qid=$paramtour ? ($paramtour.".$Question{'Number'}" ): ''; + $fname=$fname.".$Question{'TourNumber'}" if $fname && $Question{'TourNumber'}; +$fname||=param('tour'); + my $qid=$fname ? ($fname.".$Question{'Number'}" ): ''; $output.=br.a({href=> $url."?metod=proxy& qid=$qid"}, 'Близкие вопросы').p @@ -2057,17 +2062,10 @@ MAIN: my $title="Результаты поиска на \"". ($proxysstr||$sstr) .'"' if ($proxysstr||$sstr); $title||="База вопросов"; - if ($url=~/zaba/) { - $globaloutput.= -" -$title - -"; - } else { $globaloutput.=start_html(-"title"=>$title, -author=>'dimrub@icomverse.com', -bgcolor=>'#fff0e0', - -vlink=>'#800020');} + -vlink=>'#800020');#} $globaloutput.="