--- db/prgsrc/db.cgi 2001/12/25 04:05:46 1.54 +++ db/prgsrc/db.cgi 2002/01/13 00:32:12 1.58 @@ -354,8 +354,9 @@ print "$query\n",br if $printqueries; { ($field,$lo,$hi,$wordnumber)=@blob[$ii..($ii+3)]; $ii+=4; - $number=$lo+$hi*256; - $field=$fieldname{$field}; + my $addnumber=($field >> 4) << 16; + $number=(($field >> 4) << 16)+($hi << 8) + $lo; + $field=$fieldname{$field & 0xF}; if ($searchin{$field}) { push @{$tasksof{$i}{$number}}, $wordnumber; @@ -585,7 +586,7 @@ sub PrintList { (" "x4). a({href=>url."?".$qs."\&first=1"},"<<").(" "x4). a({href=>(url."?".$qs."\&first=".($first-$kvo))},"<").(" "x4) - } + } else {$nav.=' 'x15;} @@ -668,24 +669,27 @@ sub PrintSearch { $sth->execute; my ($q,$nf); ($sstr, $q,$nf)=($sth->fetchrow); - @Questions=unpack 'S*',$q; - @allnf=unpack 'S*',$nf; + @Questions=unpack 'L*',$q; + @allnf=unpack 'L*',$nf; $sth->finish; } else { @Questions=&Search($dbh, \$sstr,$metod,$all,\@allnf); - my $tmp=$dbh->quote(pack("S*",@Questions)); + my $tmp=$dbh->quote(pack("L*",@Questions)); my $qsstr=$dbh->quote($sstr); - my $nf=$dbh->quote(pack("S*", @allnf)); + my $nf=$dbh->quote(pack("L*", @allnf)); + my $ss=200; do { $was=int rand(32000); } - while (!$dbh->do ("insert into lastqueries (id,sstr,questions,allnf) - values ($was, $qsstr,$tmp,$nf)")); + while (--$ss && (!$dbh->do ("insert into lastqueries (id,sstr,questions,allnf) + values ($was, $qsstr,$tmp,$nf)"))); + print "Something is wrong...".br unless $ss; } + print p. "Время поиска: " . (time-$t) ." сек.".p; my ($output, $i, $suffix, $hits) = ('', 0, '', $#Questions + 1); @@ -1425,7 +1429,8 @@ EOT elsif (param('sstr')||param('was')) { &PrintSearch($dbh, param('sstr'), param('metod'),param('was')); $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')) { my $qid=param('qid');