検索(sub NickySerch)を以下のように変更
#
# 検索
#
sub NickySerch{
my($next, $back,$pagea,$pageb);
my($zk,$zko,$zha,$zhb,$i);
my($SWord,$cword,$skekka);
my($hania,$hanib,$hiduke,$sts,$ncfname);
my($iflag,$hili,$yflag,$mflag,$jflag,$dflag,$ttflag,$cflag);
if($Iserch){
$sts=&ReqJcode();
&jcode'sjis2euc(\$SerchWord) if( $sts );
}
$ModeSub=16;
$Mode="MONTH";
if ($SerchWord =~ / sw(\d\d?\d?\d?)$/){
$SPageNo=$1;
$SerchWord=~s/ sw(\d\d?\d?\d?)$//;
}
$VWord = &tagenc($SerchWord);
$DWord = $SerchWord;
$DWord =~ s/([^\w ])/'%' . unpack('H2', $1)/eg;
$DWord =~ tr/ /+/;
$SerchWord=~s/ / /g;
$zha = qr{(?";
}else{
if( $UseSearchHD eq "Yes" ){
$head2nd=~s/
/$TWord \- /i;
$head2nd=~s/(type=\"text\" name=\"SerchWord\")/$1 value=\"$VWord\"/i;
print &put_macro($head2nd);
}else{
$head=~s//$TWord \- /i;
$head=~s/(type=\"text\" name=\"SerchWord\")/$1 value=\"$VWord\"/i;
print &put_macro($head);
}
}
$Scnt = 0;
SLABEL:for $gfn(@nli){
$NickyFname="$vDir/$$gfn[0]";
&GetDateFromFname();
&GetNickyFile($NickyFname);
if($cflag ==1){
$Tmessage ="";
$ncfname=$NickyFname;
$ncfname=~s/(\/\d\d\d\d\w).*?nky/$1\.cmnt/;
if( open(RRDD, $ncfname) ){
binmode(RRDD);
while(){$Tmessage .= $_;}
close(RRDD);
}
}
next if( $cflag==1 && !$Tmessage);
next if( !$Title && !$Message );
next if($year>2900);
if ($iflag > 0){
next if( !$GrpFileName );
}
$hiduke=$year.$month.$day;
next SLABEL if($hiduke < $hania);
if(!($hanib == 0)){
next if($hiduke > $hanib);
}
$msg=$SerchWord;
$Tmessage = $Title.$Message if(!$cflag) ;
$Tmessage =~ s/<[^>]*>//g;
while(){
if($SerchWord =~ /([^(]|^)([0-9a-zA-Z])/){
if($2 =~ /([^(]|^)([a-z])/){
$zk =pack("C*", 0xA3, ord($2) + 0x80);
$zko =pack("C*", 0xA3, ord($2) + 0x60);
$SerchWord=~s/([^(]|^)([a-z])/$1($2\|$zk\|$zko)/;
}elsif($2 =~ /([^(]|^)([A-Z])/){
$zk =pack("C*", 0xA3, ord($2) + 0xA0);
$zko =pack("C*", 0xA3, ord($2) + 0x80);
$SerchWord=~s/([^(]|^)([A-Z])/$1($2\|$zk\|$zko)/;
}else{
$zk =pack("C*", 0xA3, ord($2) + 0x80);
$SerchWord=~s/([^(]|^)([0-9])/$1($2\|$zk)/;
}
}else{
last;
}
}
@SWord = split(/ /, $SerchWord);
$cword = @SWord;
for($i = 0; $i<$cword; $i++){
if($SWord[$i] =~ /^\\\-/){
$SWord[$i]=~s/^\\\-//;
if($ttflag == 1){
next SLABEL if($Title =~ /$SWord[$i]/i);
}else{
next SLABEL if($Tmessage =~ /$SWord[$i]/i);
}
} else {
if($ttflag == 1){
next SLABEL if($Title !~ /$SWord[$i]/i);
}else{
next SLABEL if($Tmessage !~ /$SWord[$i]/i);
}
}
}
$Scnt++;
next if ($Scnt < $SPageNo + 1);
next if ($Scnt > $SPageNo + $Ken);
if ($hili == 1){
for($i = 0; $i<$cword; $i++){
if( &IsIMODE() ){
$Message =~ s/$zha($SWord[$i])$zhb/$1<\/font>/ig;
$Title =~ s/$zha($SWord[$i])$zhb/$1<\/font>/ig;
1 while $Title =~ s/(<[^>]*)()([^<]*)(<\/font>)/$1$3/ig;
1 while $Message =~ s/(<[^>]*)()([^<]*)(<\/font>)/$1$3/ig;
}else{
$Message =~ s/$zha($SWord[$i])$zhb/$1<\/span>/ig;
$Title =~ s/$zha($SWord[$i])$zhb/$1<\/span>/ig;
1 while $Title =~ s/(<[^>]*)()([^<]*)(<\/span>)/$1$3/ig;
1 while $Message =~ s/(<[^>]*)()([^<]*)(<\/span>)/$1$3/ig;
}
}
}
if ($tflag == 1){
&NickySerchTitle($yflag,$mflag,$iflag,$jflag);
$yflag = $year;
$mflag = $month;
print $br;
}elsif ($iflag == 2 && !&IsIMODE()){
&NickySerchImg();
}else{
if( &IsIMODE() ){
&PutNickyOneDayIMODE();
}else{
&PutNickyOneDay();
print $br;
}
}
}
if ($tflag == 1){
if( &IsIMODE() ){
print "<\/dd>
";
}else{
print "<\/td><\/tr><\/table>";
}
}
if(!$dflag){
$pagea = $SPageNo + 1;
$pageb = $SPageNo + $Ken ;
$skekka="『$VWord』を含む記事 $Scnt件";
if($Ken >= $Scnt){
}elsif($pageb >= $Scnt){
$skekka .= "中 $pagea〜$Scnt件";
}elsif(($Ken < $Scnt)&&($pageb < $Scnt)){
$skekka .= "中 $pagea〜$pageb件";
}
if( &IsIMODE() ){
&jcode'euc2sjis(\$skekka);
&jcode'euc2sjis(\$VWord);
print "$skekka
";
}else{
print "$skekka
\n";
}
}
if( !&IsIMODE() ){
print "\n";
}
$next = $SPageNo + $Ken;
$back = $SPageNo - $Ken;
if ($back >= 0) {
print "
$MsgNew\n";
}
if( $MsgPageOut && !&IsIMODE() ){
&PutSerchPageTag();
}
if ($next < $Scnt) {
print "
$MsgOld\n";
}
print "<\/div>";
if($dflag ==1){
$VWord="";
}
if( &IsIMODE() ){
$iFoot = &put_macro($iFoot);
&jcode'euc2sjis(\$iFoot) if( $sts );
$iFoot=~s/name=\"SerchWord\"/name=\"SerchWord\" value=\"$VWord\"/i;
print $iFoot;
}else{
$foot=~s/(type=\"text\" name=\"SerchWord\")/$1 value=\"$VWord\"/i;
$foot2nd=~s/(type=\"text\" name=\"SerchWord\")/$1 value=\"$VWord\"/i;
if( $UseSearchFT eq "Yes" ){
print &put_macro($foot2nd);
}else{
print &put_macro($foot);
}
}
}
sub PutSerchPageTag
{
local($i, $j, $cntl, $lastpage, $fs, $fe);
my( $cnt,$spage,$p);
$fs=$fe="";
if( $tagpl ne "strict" ){
$fs="
";
$fe="";
}
#件数分リンクする
print $fs;
if( ($Scnt > $Ken) && ($SPageNo) ){
print "$MsgOldNEWks
$MsgOldNEW$MsgOldNEWke";
}elsif($Scnt <= $Ken){
}else{
print "$MsgOldNEWks
$MsgOldNEW$MsgOldNEWke";
}
$j=$Scnt-$Ken;
$lastpage=$j/$Ken;
if( $j%$Ken ){
$lastpage=($j-($j%$Ken))/$Ken;
$lastpage++;
}
$lastpage=0 if( $lastpage < 0 );
$maxpage=10;
$cnt=$SPageNo/$Ken-($maxpage/2);
$maxpage=$maxpage-1;
$cntl=0;
if( $cnt + $maxpage > $lastpage ){ $cnt=$lastpage-$maxpage; }
if( $cnt < 1 ){ $cnt = 1; }
for($j=$Ken+$cnt*$Ken; ($j<$Scnt+$Ken) && ($cntl<$maxpage) ; $j+=$Ken){
$spage=$cnt * $Ken;
if( $spage != $SPageNo ){
print "$ks
$cnt$ke";
}else{
print "$ks$cnt$ke";
}
$cnt++;
$cntl++;
}
$p=$lastpage*$Ken;
print "$MsgOldOLDks
$MsgOldOLD$MsgOldOLDke" if($p!=$SPageNo);
}
sub NickySerchTitle{
my($len,$titlez,$mdstr,$pt,$sts);
my($NWordy,$NWordm);
($yflag, $mflag,$iflag,$jflag) = @_ ;
$pt="$year$month$day$daysub";
if( &IsIMODE() ){
$sts=&ReqJcode();
&jcode'euc2sjis(\$TLyear) if( $sts );
&jcode'euc2sjis(\$TLmonth) if( $sts );
&jcode'euc2sjis(\$TLday) if( $sts );
&jcode'euc2sjis(\$Title) if( $sts );
}
$mdstr="
= $len ) {
$titlez =~ s/(
|
|).*/\.\.\./;
}
$titlez =~ s/<[^>]*>//g;
if( length($titlez) >= $len ) {
$titlez =substr($titlez,0,$len);
$titlez =~ s/([\x00-\x7F]|[\x8E\xA1-\xFE][\xA1-\xFE]|\x8F[\xA1-\xFE][\xA1-\xFE])/$1\n/g;
$titlez =~ s/(\n.*?$)//;
$titlez =~ s/\n//g;
$titlez .= "...";
}
if($jflag ==1){
$NWord .= " o";
}
if($iflag ==1){
$NWord .= " i";
}
$NWordy = "$NWord $year\/";
$NWordy =~ s/([^\w ])/'%' . unpack('H2', $1)/eg;
$snurl="";
if($yflag == 0){
if( &IsIMODE() ){
print "$snurl$year$TLyear<\/a>
\n";
}else{
print "