nicky.cgi?MonthList にアクセスすると月別ログが表示されるようにする。iMode版と共用。 「Modeによって何がしたいのかを判定&実行」の下の方の 「}elsif( ($arg eq "UserCustom") && $Admin ){if( !$f_mkns ){」の行の上に、 }elsif( $arg eq "MonthList" ){ &PutMonthList(); を追加。 ------------------------------------ 月別ログを表示するサブルーチンを適当な場所に追加。2つに分けた。 sub PutMonthList { &nickyGetHead(); if( &IsIMODE() ){ $iHead = &put_macro($iHead); $sts=&ReqJcode(); &jcode'euc2sjis(\$iHead) if( $sts ); &jcode'euc2sjis(\$TLmonth); &jcode'euc2sjis(\$TLyear); print $iHead; print "
\n"; }else{ if( $UseListHD eq "Yes" ){ $head2nd=~s/.*?<\/title>/<title>月別ログ<\/title>/i; print &put_macro($head2nd); }else{ $head=~s/<title>.*?<\/title>/<title>月別ログ<\/title>/i; print &put_macro($head); } } if( &IsIMODE() ){ print "<dl>"; }else{ print "<table class=\"mlt\">"; } &PutMonthListsub(); if( &IsIMODE() ){ $iFoot = &put_macro($iFoot); &jcode'euc2sjis(\$iFoot) if( $sts ); print "<hr>"; print $iFoot; }else{ if( $UseListFT eq "Yes" ){ print &put_macro($foot2nd); }else{ print &put_macro($foot); } } } sub PutMonthListsub{ my($yr, $mn,$print); local($mdstr); my($opt, $ctgl,$sts, $mtag); $ctgl="\?ctg=$ctg" if( $ctg ); if( $TitleListSort eq "UP" ){ $opt="r"; }else{ $opt="tr"; } @nli=&GetNickyList($opt); for $gfn( @nli ){ $NickyFname=$$gfn[0]; &GetDateFromFname(); next if($year>2900); $mdstr="<a href=\"$cgipath$ctgl?DT=$year$month$day$daysub#$year$month$day$daysub\">"; if( $yr != $year ){ if( $TitleListSort eq "UP" ){ $print =$mtag.$print; }else{ $print .=$mtag; } print $print; $print=""; if( &IsIMODE() ){ print "</dd>" if( $yr ); print "<dt>$year$TLyear</dt><dd>\n"; }else{ print "</td></tr>" if( $yr ); print "<tr><td class=\"mly\">$year$TLyear</td><td class=\"mlm\">\n"; } $mtag="$mdstr$month$TLmonth</a> "; $yr=$year; $mn=$month; }elsif( $mn != $month ){ if( $TitleListSort eq "UP" ){ $print =$mtag.$print; }else{ $print .=$mtag; } $mtag="$mdstr$month$TLmonth</a> "; $mn=$month; } } if( $TitleListSort eq "UP" ){ $print =$mtag.$print; }else{ $print .=$mtag; } print $print; if( &IsIMODE() ){ print "</dd></dl>\n"; }else{ print "</td></tr></table>\n"; } } ------------------------------------ これ以下は件数ログと同じ場所に表示してJAVAスクリプトで切り替える用 ------------------------------------ 「sub NickyPageOut」内の「 # $MsgOldForm:0,2=月, 1=件数」の行の少し下にある 「print "<div class=\"pastlink\">\n";」の行の下に以下を追加。 print "<div id=\"klog1\">\n"; ------------------------------------ その25行くらい下にある「print "\n</div>\n";」の上に以下を追加。 print "</div><table id=\"mlog1\" style=\"display:none;\">"; &PutMonthListsub(); 合計3行。前につけた個別記事のサブルーチンにも同じように追加した。 けどあっちはiMode版と兼用なので3行とも末尾に「if(!&IsIMODE)」と入れた。 ------------------------------------ HTMLフッタに切り替え用のリンクをつける。 <a id="klog2" href="./nicky.cgi?MonthList" onclick="document.getElementById('mlog1').style.display = 'block'; document.getElementById('klog1').style.display = 'none'; document.getElementById('klog2').style.display = 'none';document.getElementById('mlog2').style.display = 'block';location.href='#end';return false;">月別ログ</a> <a id="mlog2" style="display:none;" href="#" onclick="document.getElementById('mlog1').style.display = 'none'; document.getElementById('klog1').style.display = 'block'; document.getElementById('klog2').style.display = 'block';document.getElementById('mlog2').style.display = 'none';return false;">元に戻す</a> こんなの ------------------------------------ フッタの最後、</body>の前に、 <a name="end"></a> を追加