namazu-ml(avocado)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Perl version search program (Re: Tawagoto?)
- From: tmu@xxxxxxxxxxxxx (MURASHITA Takuya)
- Date: Fri, 6 Mar 1998 15:11:31 +0900
- X-ml-name: namazu
- X-mail-count: 00332
村下@池上通信機です
はじめまして、先日より参加させていただいています。
最近はperl好きなので勝手にですが、pnamazu.cgiにpatchを当ててみました。
主にpatchを当てたのは、表示件数がらみです。
よろしければ取り入れて下さい。>古川様
diff -c pnamazu.cgi.orig pnamazu.cgi
*** pnamazu.cgi.orig Fri Mar 6 10:17:34 1998
--- pnamazu.cgi Fri Mar 6 15:02:07 1998
***************
*** 20,25 ****
--- 20,30 ----
$DBNAME = 'NMZ';
+ $max = 20;
+ $whence = 0;
+ $dbname = $DBNAME;
+ $format = long;
+
print "Content-Type: text/html\n\n";
$SORT = 'later';
$HASH = "$DBNAME.h";
***************
*** 208,213 ****
--- 213,222 ----
while (($_, $VAL) = each(%QUERY)){
@ARGV = split(/\s+/, $VAL) if /key/i;
$SORT = $VAL if /sort/i;
+ $max = $VAL if /max/i;
+ $whence = $VAL if /whence/i;
+ $dbname = $VAL if /dbname/i;
+ $format = $VAL if /format/i;
}
}
***************
*** 282,293 ****
}
read(FLIST, $F, $S - $P);
($DT, $ST, $F) = split(/\n/, $F, 3);
! print "$DT$N. $ST (score: $SCORE{$KEY})\n$F";
$N++;
}
print "</DL>\n";
}
# NMZ.foot の出力
@_ = <FOOT>;
print @_;
--- 291,313 ----
}
read(FLIST, $F, $S - $P);
($DT, $ST, $F) = split(/\n/, $F, 3);
! print "$DT$N. $ST (score: $SCORE{$KEY})\n$F" if($whence < $N);
$N++;
+ last if(($whence + $max) < $N);
}
print "</DL>\n";
}
+ $PAGE_MAX = 20;
+ for($i = 1;$i < $PAGE_MAX ;$i++)
+ {
+ $num = ($i - 1) * $max;
+ last if($num > $#KEYS);
+ print '<A HREF="/cgi-bin/pnamazu.cgi?';
+ print "key=$ORGKEY\&format=$format\&max=$max\&whence=$num\">";
+ print "[$i]</A>";
+ }
+
# NMZ.foot の出力
@_ = <FOOT>;
print @_;
***************
*** 301,306 ****
--- 321,327 ----
while( $_ = shift(@LIST) ){
local($LINE) = "";
($KEY,$_) = split(/=/, $_);
+ $ORGKEY = $_ if($KEY eq "key");
s/\+/ /g;
s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("C",hex($1))/eg;
----
MURASHITA Takuya Ikegami Tsushinki Co.,Ltd. Information Planning Div.
http://www.ikegami.co.jp/