Diff for /db/prgsrc/db.cgi between versions 1.54 and 1.57

version 1.54, 2001/12/25 04:05:46 version 1.57, 2002/01/08 23:15:31
Line 585  sub PrintList { Line 585  sub PrintList {
             (" "x4).              (" "x4).
             a({href=>url."?".$qs."\&first=1"},"<<").("&nbsp;"x4).              a({href=>url."?".$qs."\&first=1"},"<<").("&nbsp;"x4).
             a({href=>(url."?".$qs."\&first=".($first-$kvo))},"<").("&nbsp;"x4)              a({href=>(url."?".$qs."\&first=".($first-$kvo))},"<").("&nbsp;"x4)
         }                  }
   
         else {$nav.='&nbsp;'x15;}          else {$nav.='&nbsp;'x15;}
   
Line 668  sub PrintSearch { Line 668  sub PrintSearch {
           $sth->execute;            $sth->execute;
           my ($q,$nf);            my ($q,$nf);
           ($sstr, $q,$nf)=($sth->fetchrow);            ($sstr, $q,$nf)=($sth->fetchrow);
           @Questions=unpack 'S*',$q;                    @Questions=unpack 'S*',$q; 
           @allnf=unpack 'S*',$nf;                    @allnf=unpack 'S*',$nf;        
           $sth->finish;            $sth->finish;
         } else           } else 
Line 677  sub PrintSearch { Line 677  sub PrintSearch {
              my $tmp=$dbh->quote(pack("S*",@Questions));               my $tmp=$dbh->quote(pack("S*",@Questions));
              my $qsstr=$dbh->quote($sstr);               my $qsstr=$dbh->quote($sstr);
              my $nf=$dbh->quote(pack("S*", @allnf));               my $nf=$dbh->quote(pack("S*", @allnf));
                my $ss=200;
              do                do 
              {               {
                $was=int rand(32000);                 $was=int rand(32000);
              }               }
              while (!$dbh->do ("insert into lastqueries (id,sstr,questions,allnf)                while (--$ss && (!$dbh->do ("insert into lastqueries (id,sstr,questions,allnf) 
                          values ($was, $qsstr,$tmp,$nf)"));                           values ($was, $qsstr,$tmp,$nf)")));
                print "Something is wrong...".br unless $ss;
         }          }
   
   
   
         print p. "Время поиска: " . (time-$t) ." сек.".p;          print p. "Время поиска: " . (time-$t) ." сек.".p;
         my ($output, $i, $suffix, $hits) = ('', 0, '', $#Questions + 1);          my ($output, $i, $suffix, $hits) = ('', 0, '', $#Questions + 1);
   
Line 1425  EOT Line 1428  EOT
           elsif (param('sstr')||param('was')) {            elsif (param('sstr')||param('was')) {
                 &PrintSearch($dbh, param('sstr'), param('metod'),param('was'));                  &PrintSearch($dbh, param('sstr'), param('metod'),param('was'));
                 $dbh->do("delete from lastqueries where                  $dbh->do("delete from lastqueries where
                            time_to_sec(now())-time_to_sec(t) >3600")                        (TO_DAYS(NOW()) - TO_DAYS(t) >= 2) OR
                              (time_to_sec(now())-time_to_sec(t) >3600)")
         }           } 
           elsif (param('qid')) {            elsif (param('qid')) {
               my $qid=param('qid');                my $qid=param('qid');

Removed from v.1.54  
changed lines
  Added in v.1.57


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>