#! /usr/bin/perl # # nerimb3.cgi # # Revision history # 4/9/08 : 3.135 : GDをImage::Size変更 # 11/17/06 : 3.134 : サーチのバグを修正 # 11/9/06 : 3.133 : SSIモードの画像パスを修正 # 10/21/06 : 3.132 : 最新メッセージの下にメッセージを追加できるように修正 # 10/16/06 : 3.131 : Cookieを修正 # 6/1/06 : 3.130 : 直接書き込み防止機能を追加 # 4/24/06 : 3.129 : メールアドレスチェックを追加 # 1/23/06 : 3.128 : サポート外のファイルがアップされた場合に添付ファイルと # して表示するよう修正 # 1/7/06 : 3.127 : 画像処理を変更 # 12/11/05 : 3.126 : rejectlink.datにあるMessage#のリンクは自動リンクしない # ように修正 # 11/6/05 : 3.125 : 過去ログを保存しないモードのユーザータイトルカラーの保存を修正 # 10/29/05 : 3.124 : 過去ログを保存しないモード、SSIで表示件数指定、SSIで # 画像表示オプション追加、画像リストモードを追加 # 10/6/05 : 3.123 : logo設定のタイプミスを修正 # 10/3/05 : 3.122 : dellogをoffにした場合の変更モードを修正 # 10/1/05 : 3.121 : Copyrightにリンクを追加 # 9/16/05 : 3.120 : メンバー用パスワード入力を変更画面から削除。 # 9/14/05 : 3.119 : jcode.plを削除。内挿入文の改行を修正。 # 7/25/05 : 3.118 : 検索結果ページに文字コードヘッダーを追加 # 6/19/05 : 3.117 : アーカイブの未読分を削除。アーカイブメッセージにスタイルシート、 # 内挿入分を追加。 # 6/3/05 : 3.116 : 削除変更元記事保存選択オプションを追加。 # 携帯モードの画像表示オプション追加。 # 5/9/05 : 3.115 : 統計入力画面のJavascriptを修正。 # 5/1/05 : 3.114 : IEで本文の色が指定と違う色になるのを修正。 # 4/30/05 : 3.113 : 投稿時に名前、タイトル、本文の色指定できるよう修正。 # 自動リンクの適用オプションを追加。 # 4/28/05 : 3.112 : 本文のフォントタグを修正, タグオンの時<>表示を修正 # 4/27/05 : 3.111 : タグ変換を修正、メッセージボード上部にコメントを入れる欄を # 追加。名前の色を変えられるように修正。記事の色を変更できる # ように修正。Textareaをwrap=softに修正。 # 表示幅変更オプション追加。 # 4/25/05 : 3.110 : メンバー専用投稿パスワードオプションを追加。タグ使用可、不可のオプション追加。 # 4/9/05 : 3.109 : mode=backupのパスワードチェックを修正 # 3/12/05 : 3.108 : 携帯モードに戻るリンクを追加 # 3/10/05 : 3.107 : Netscapeでまれにタイトル表示が崩れるのを修正 # 2/28/05 : 3.106 : 管理用セットアップに「ユーティリティ選択」のオプション追加 # 2/21/05 : 3.105 : 管理用セットアップのパスワード認証でまれにミスするバグを修正 # 2/10/05 : 3.104 : 200件以前のコンパチブルモードのエラーを修正 # 2/8/05 : 3.103 : CGI::Carpをコメントアウト # 2/7/05 : 3.102 : Location:の後にスペースを追加。AnHTTPD対応。 # 2/6/05 : 3.101 : CGI::Carpを追加、$subjectのを削除、アーカイブのHTML表示を修正 # 1/30/05 : 3.100 : スクリプト名がmbssi.cgiの時SSIモード、mbiread.cgiの時携帯モードで # 起動するように変更 # 1/23/05 : 3.099 : Message#xxxのリンクの()を削除 # 1/19/05 : 3.098 : $mbdirチェッカーを削除 # 1/15/05 : 3.097 : デフォルトの$mbdirを変更 # 11/25/04 : 3.096 : +をスペースに変換するのを除去 # 8/4/04 : 3.095 : SSI modeを追加 # 6/23/04 : 3.094 : 「サマリー」を「統計」に修正 # サーチにメッセージ番号と日付の範囲も検索事項で選択できるように修正 # 6/16/04 : 3.093 : mbpastで最新200件以内の検索をすると表示されなかったバグを修正 # 6/6/04 : 3.092 : 返信引用記事の色を設定できるように変更 # 4/25/04 : 3.091 : 書き込み時の注意事項を書き込み、返事、変更画面に追加 # 4/11/04 : 3.09 : (#1234)でメッセージナンバーへのリンクする機能を追加 # 3/11/04 : 3.08 : サマリーの結果画面にもスタイルシートとタイトル設定が有効になるように # 修正 # 3/7/04 : 3.07 : mode=deleteを修正 # 2/16/04 : 3.06 : 名前欄のメールアドレス表示非表示設定追加 # 2/4/04 : 3.05 : 各ページのタイトルのデザインを変更できるように変更 # 1/13/04 : 3.04 : mode=printを追加。任意のメッセージを指定して表示できるように変更。 # 1/11/04 : 3.031 : 200件以前でタイトル表示した時の文字サイズを修正 # 12/10/03 : 3.03 : スタイルシート、ヘッド内構文をセットアップで挿入できるように変更 # 9/9/03 : 3.02 : サーチの特殊文字のエスケープを修正 # 8/28/03 : 3.01 : mbpastにもCopyright表記を追加 # 8/16/03 : 3.0 : ねりMBver.2.1シリーズ(2.152)から画像アップ対応に変更 # 10/12/03 : 2.1 : 管理人パスワードと個別にパスワードを入力可能にし、削除可能に変更 # 9/22/02 : 2.0 : Vresion 1.0より全てのファイルを統合、機能アップ # 10/27/97 : 1.0 : オリジナルメッセージボード初版作成 # Author : Hideki Kanayama # # 直接実行可能なMode Options: # mode=read # mode=title # mode=wrform # mode=res # mode=delete # mode=edit # mode=link # mode=sumform # mode=sumpsnl # mode=schform # mode=archform # mode=past # mode=iread # mode=iwrform # mode=iresform # mdoe=backup(ver1 compatible modeのみ有効) # mode=unlock # mode=setup # mode=namedef # mode=print # mode=ssi(SSIで呼び出すときのみ有効) # # mode=unlockとmode=backupはメニューに出てきませんので直接URLを # タイプしてください。 # 例)nerimb3.cgi?mode=unlock #   nerimb3.cgi?mode=backup (ver.1.0 compatibleのみ有効) # 他のメニュー表示、非表示はセットアップ画面で選択できます。 # 非表示にした場合、mode=delete(削除)、mode=setup(セットアップ)のみ # URL直接指定で実行できます。その他の機能は直接指定しても動きません。 # # パスワードファイルを削除することにより新パスワードを設定し直す事ができます。 # # - mode=ssi # 次のようにSSIとして埋め込むのことによって最新メッセージの最初のline行を # を表示することができます。 # # # Undocumented Usage : # 次のようになどで直接リンクすることで特定のメッセージを表示させることが # できます。 # - nerimb3.cgi?mode=print&message= # でMessage# を表示します。 # は、ハイフン、カンマで複数指定することが出来ます。 # ハイフンは範囲、カンマは区切りを表します。 # 例:nerimb3.cgi?mode=print&message=12,15,24,20-22,8-5 # Message#5,6,7,8,12,15,20,21,22,24を表示します。 # - nerimb3.cgi?mode=print&message=&title=on # でMessage# のタイトルを表示します。 # は、ハイフン、カンマで複数指定することが出来ます。 # ハイフンは範囲、カンマは区切りを表します。 # 例:nerimb3.cgi?mode=print&message=12,15,24,20-22,8-5 # Message#5,6,7,8,12,15,20,21,22,24のタイトルを表示します。 # # - nerimb3.cgi?mode=past&number= # でMessage# を表示します。 # - nerimb3.cgi?mode=past&number=&lin= # でから分前までを表示します。 # 例:nerimb3.cgi?mode=past&number=1232&lin=6 # Message#1226から#1232まで計7件表示します。 # - nerimb3.cgi?mode=read&number=d # で今日から過去日分のメッセージを表示します。 # 例:nerimb3.cgi?mode=read&number=d16 # 今日から過去16日分表示(最新200件分以内のみ有効) # - nerimb3.cgi?mode=read&number= # で最新メッセージから過去分のメッセージを表示します。 # 例:nerimb3.cgi?mode=read&number=120 # 最新メッセージから過去120件分表示(最新200件分以内のみ有効) # # 自動リンク: # - 書き込み記事内のhttp://から半角文字の最後まで自動リンクされます。 # - 書き込み記事内の(#1234)などの表記でそのメッセージナンバーへリンクされます。 # - 書き込み記事内のMessage#1234の表記でもそのメッセージナンバーへリンクされます。 # # rejectlink.datとnamedef.datはファイル名が決まっています。 # rejectlink.datは、link modeで、namedef.datは、summary modeで # 使用されますが、無くても問題ありません。 # どちらもnerimb3.cgiと同じディレクトリに置いてください。 # 通常どちらもcgi-binに置いてください。 # # rejectlink.dat : # メッセージ中のリンクの中でデッドリンク等でリンク表示のリストから # 除外したいメッセージナンバーをrejectlink.datに1行つづ記述してください。 # 例:以下はrejectlink.datの内容の例です。 #   ---------------------------------------- #   1 #   120 #   123 #   523 #   ---------------------------------------- # # namedef.dat : # 統計の個人名方式で「人物」を選んだ場合に違う名前を同一人物と # 判断させることができます。 # namedef.datにそれらの名前を人物ごとに1行に登録されていると # 一番左の名前が代表として表示されます。 # 例:以下はnamedef.datの内容の例です。 #   ---------------------------------------- #   管理人,作成者,かんりにん #   ホークス,hawks #   ---------------------------------------- # この例では、「作成者」「かんりにん」共に「管理人」と同一人物として # まとめて集計されます。 # 「ホークス」は改行されているので管理人と別人として判断されますが、 # 「hawks」とは同一人物となります。 # namedef.datがない場合は、書き込みの名前そのままで集計されます。 # # http://www.hidekik.com # # $Id: nerimb3.cgi,v 1.87 2008/04/09 02:57:36 Hideki Kanayama Exp $ # Copyright(c) 1997-2008, Hideki Kanayama, All rights reserved. use CGI::Carp qw(fatalsToBrowser); use Time::Local; use Image::Size; require "cgi-lib.pl"; $mbsetupfile = "mbsetup.pl"; $admindat = "adminpwd.dat"; $namedef = "namedef.dat"; $rejectlink = "rejectlink.dat"; $mbutil = "mbutil.pl"; $version = "3.135"; $reservedyear = "1997-2008"; $program = $0; $program =~ s/^.+[\/\\]([^\/\\]+)$/$1/; $script = "$program"; $lang = 0; #### File definitions ###################### #$cgibin = "../cgi-bin"; $mbdir = "."; $mbdata = "$mbdir/logdata.dat"; # The following files are only used in versino 1.0 compatible mode. $mbpastdata = "$mbdir/logpast.dat"; $mbarchdata = "$mbdir/logarch.dat"; $pastall = "$mbdir/logpast.all"; $alldata = "$mbdir/logdata.all"; $mbdellog="$mbdir/mbdel.log"; $cookiename = "mb_cookie"; $cookiename2 = "read_cookie"; # 使い方の説明ファイルは各自で用意してください。 $mbusage = "$mbdir/mbusage.html"; $lockfile = "$mbdir/lockfile.lock"; $mbtitle = "メッセージボード"; $mblogo = "$mbdir/mboard.gif"; $logo_style = ''; $logo_color = 'black'; $logo_size = '+1'; $logo_face = ''; $logo_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $logo_loc=1; # 0:左、1:中、2:右 $mbwrtitle = "メッセージボード書き込み"; $mbwr_logo = ""; $mbwr_style = ''; $mbwr_color = 'black'; $mbwr_size = '+1'; $mbwr_face = ''; $mbwr_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbwr_loc=0; # 0:左、1:中、2:右 $mbrestitle = "メッセージボード返事"; $mbres_logo = ""; $mbres_style = ''; $mbres_color = 'black'; $mbres_size = '+1'; $mbres_face = ''; $mbres_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbres_loc=0; # 0:左、1:中、2:右 $mbsumtitle = "メッセージボード 書き込み統計"; $mbsum_logo = ""; $mbsum_style = ''; $mbsum_color = 'black'; $mbsum_size = '+1'; $mbsum_face = ''; $mbsum_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbsum_loc=1; # 0:左、1:中、2:右 $mbarctitle = "メッセージボード アーカイブ作成"; $mbarc_logo = ""; $mbarc_style = ''; $mbarc_color = 'black'; $mbarc_size = '+1'; $mbarc_face = ''; $mbarc_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbarc_loc=1; # 0:左、1:中、2:右 $mblinktitle = "リンク抜粋"; $mblink_logo = ""; $mblink_style = ''; $mblink_color = 'black'; $mblink_size = '+1'; $mblink_face = ''; $mblink_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mblink_loc=1; # 0:左、1:中、2:右 $mbsrctitle = "メッセージボード サーチ"; $mbsrc_logo = ""; $mbsrc_style = ''; $mbsrc_color = 'black'; $mbsrc_size = '+1'; $mbsrc_face = ''; $mbsrc_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbsrc_loc=1; # 0:左、1:中、2:右 $mbdeltitle = "メッセージボード削除"; $mbdel_logo = ""; $mbdel_style = ''; $mbdel_color = 'black'; $mbdel_size = '+1'; $mbdel_face = ''; $mbdel_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbdel_loc=1; # 0:左、1:中、2:右 $mbedititle = "メッセージボード変更"; $mbedit_logo = ""; $mbedit_style = ''; $mbedit_color = 'black'; $mbedit_size = '+1'; $mbedit_face = ''; $mbedit_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート $mbedit_loc=1; # 0:左、1:中、2:右 ############################################# #### Function settings ###################### # Background設定 # 1:画像を使う 0:カラー番号を使う $bgimage_en = 0; $bgimagefile = "$mbdir/sample.jpg"; $bgcolor="#ffffff"; # 統計の「ピッタリ賞」でキリ番として扱われるメッセージナンバーの設定。 @period=(1,100,111,200,222,300,333,400,444,500,555,600,666,700,777,800,888,900,999,1000,1111,1234,2000,2222,2345,3000,3333,3456,4000,4321,4444,4567,5000,5555,5678,6000,6666,6789,7000,7777,8000,8888,9000,9999,10000,11111,20000,22222,30000,33333); # 統計 1:有効 0:無効 $summary_en = 1; # アーカイブ 1:有効 0:無効 $archive_en = 1; # リンク 1:有効 0:無効 $link_en = 1; # タイトル 1:有効 0:無効 $title_en = 1; # 画像リスト 1:有効 0:無効 $imlist_en = 1; # サーチ 1:有効 0:無効 $search_en = 1; # 携帯モード 1:有効 0:無効 $imode_en = 1; # 削除機能 1:有効 0:無効 $delete_en = 1; # 変更機能 1:有効 0:無効 $modify_en = 1; #タグ使用 1:可 0:不可 $tag_use = 0; #削除変更元記事保存 1:有効 0:無効 $dellog_save = 1; #200件以前の過去記事保存 1:有効 0:無効 $pastlog_save = 1; #携帯モードでの画像表示 1:有効 0:無効 $imode_image = 0; #携帯モーででの画像表示サイズ $imode_image_x = 100; $imode_image_y = 100; #タグ使用可の時にhttp://からのオートリンク 1:on 0:off $autolink_when_tag_is_on = 0; #http://の適用 1:行頭のみ 0:どこでも $autolink_head_only = 0; # ユーティリティ 1:on 0:off $utility_en = 0; # セットアップパスワード入力にユーティリティの選択を表示 # 使い方 1:有効 0:無効 # 使い方の説明ファイルは各自で用意してください。 $usage_en = 0; # セットアップ表示 1:表示 0:非表示 $setup_en = 1; # 自動リンククリック時 1:同じウィンドウ 0:別ウィンドウ $link_samewin_en = 1; # トップへのリンク 1:表示 0:非表示 $top_link_en = 1; $top_link_title = 'トップへ'; $top_link = '../index.html'; # 書き込みタイトルのサイズ、色、フォント $post_title_color = '#00aa00'; $post_title_size = '+2'; $post_title_face = ''; # 名前の色 $post_name_color = '#0000ee'; # 返信引用記事の色 $quate_color = '#804040'; # 記事本文の色 $text_color = 'black'; # 投稿者個人色設定 1:on 0:off $user_name_color_en = 0; $user_title_color_en = 0; $user_text_color_en = 0; # 記事本文の表示幅 ブラウザ全体の% $body_width = 100; # 名前欄のメールアドレス表示 1:on 0:off $maildisp_en = 1; # 名前欄の敬称 1:on 0:off $namesan_en = 0; $namesan = 'さん'; # 返信コメントでの敬称 1:on 0:off $ressan_en = 0; $ressan = 'さん'; # SSIモード設定 # SSIモードを使用するHTMLファイルから見たこのスクリプトへの相対パス、 # 又はhttp://からのフルパス $httpcgibin = "http://localhost/cgi-bin"; # 続き表示リンクの文字列 $gotomb = '続きはこちら.....'; # SSIモードの表示ライン数のデフォルト $ssiline = 7; # SSIモードの表示件数 # $ssikenが2以上の場合は$ssilineは無効 $ssiken = 1; # SSIモードで画像表示 0:off 1:on $ssiimage_en = 0; #画像サイズ $ssiimage_w = 100; $ssiimage_h = 100; # 時間設定 GMTからのオフセット 日本:+9 $offset = 9; $time_offset = time + $offset * 3600; # Data file compatible with version 1.0 # 1: Compatible, 0: Incompatible # Version 1.0 では、200件以前の過去のデータを # $mbarchdataと$mbpastdataに分割して保存します。 # Versoin 2.0 以降では、全てのデータを$mbdataの一つのファイルに保存します。 $compatible = 0; # Archiveで使われる圧縮コマンド $compress = "gzip"; #実行されるコマンド $compmsg = "gzip"; #説明に使われるコマンド名 # Compantible modeで使われるUNIX コマンド $cat = "cat"; # Summary で使われる棒グラフの棒 $gif="$mbdir/bar.gif"; # 画像機能 0:無し 1:有り $image_en = 1; # 画像格納ディレクトリ $imagedir = "$mbdir"; # 画像クリック時のウィンドウ 0:別ウィンドウ 1:同じウィンドウ $image_samewin_en = 1; # 縮小表示時のサイズ $max_w = 150; $max_h = 150; #最大画像アップサイズ(kB) $maxmb = 100; #会員専用書き込み 1:on 0:off $member_only = 0; $member_pwd = '12345'; # サポートされていない画像やファイルの場合のアイコン使用 1:有効 0:無効 $attach_icon_en = 0; $attach_icon = ''; #スタイルシート 1:on 0:off $style_sheet_en = 0; $style_sheet = ' A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none} '; #〜内に挿入できる構文 1:on, 0:off $head_insert_en = 0; $head_insert = ''; #メッセージボード上部に表示させる文 1:on, 0:off $body_insert1_en = 0; $body_insert1 = ''; $body_insert2_en = 0; $body_insert2 = ''; $body_insert3_en = 0; $body_insert3 = ''; $body_insert4_en = 0; $body_insert4 = ''; $body_insert5_en = 0; $body_insert5 = ''; #トップからのSSI表示による更新時間のための予備のアップデートファイル # 1: on, 0: off $update1_file_en = 0; $update2_file_en = 0; $update1_file = "$mbdir/update1.log"; $update2_file = "$mbdir/update2.log"; #スパム防止のためのキーワード $ticket = 'qualified'; ######################################################################### if (-e "$mbsetupfile"){ require "$mbsetupfile"; } $mail_pattern = '\w\@\.\-'; $color_pattern = '\w\#'; if ($maxmb < 100) {$maxmb = 100;} $maxmb2 = $maxmb + 20; # Margin for text up size $cgi_lib::maxdata = $maxmb2 * 1024; &ReadParse; %in=&mbdecode(%in); if ($script eq 'mbssi.cgi'){ $script = 'nerimb3.cgi'; $in{mode} = 'ssi'; } elsif ($script eq 'mbiread.cgi'){ $script = 'nerimb3.cgi'; $in{mode} = 'iread'; } if ($in{mode} eq 'ssi' && $in{line} eq ''){ $in{line} = $ssiline; } $mbread = "$script?mode=read"; $mbreadt = "$script?mode=title"; $mbwrite = "$script?mode=write"; $mbres = "$script?mode=res"; $mbpast = "$script?mode=past"; $mbwrform = "$script?mode=wrform"; $mblink = "$script?mode=link"; $mbdel1 = "$script?mode=delete"; $mbdel2 = "$script?mode=del2"; $mbdel3 = "$script?mode=del3"; $mbsum = "$script?mode=summary"; $mbsearch = "$script?mode=search"; $mbschform = "$script?mode=schform"; $mbarchform = "$script?mode=archform"; $mbarch = "$script?mode=archive"; $mbsumfm = "$script?mode=sumform"; $mbsumpsfm = "$script?mode=sumpsnl"; $mbiread = "$script?mode=iread"; $mbiwrite = "$script?mode=iwrite"; $mbiwrform = "$script?mode=iwrform"; $mbires = "$script?mode=iresform"; $mbbackup = "$script?mode=backup"; $mbunlock = "$script?mode=unlock"; $mbsetup = "$script?mode=setup"; $mbedit = "$script?mode=edit"; $mbnamedef = "$script?mode=namedef"; $mbnamedefwr = "$script?mode=namedefwr"; $mbprint = "$script?mode=print"; $mbssi = "$script?mode=ssi"; if (! -e "$admindat"){ if ($in{mode} eq 'adminpwd'){ &wradminpwd; } else { &setadminpwd; } } if ($bgimage_en == 1){ $bgimage = "background=\"$bgimagefile\""; } else { $bgimage = "bgcolor=\"$bgcolor\""; } if (open(REJECT,"< $rejectlink")){ @reject = ; close(REJECT); } else { @reject = (); } #if ($in{mode} ne 'setup' && $in{mode} ne 'setup1' && $in{mode} ne 'setup2'){ # if (! -d "$mbdir"){ # print "Content-Type:text/html\n\n"; # print "\n"; # print "\n"; # print "\n"; # print "\n"; # print "ディレクトリ$mbdirが存在しません\n"; # print "\n"; # print "\n"; # print "
ディレクトリ$mbdirが存在しません。
\n"; # print "\n"; # exit; # } #} if ($in{mode} eq 'read' || ($in{mode} eq 'title' && $title_en == 1) || $in{mode} eq ''){ &mbread; } elsif ($in{mode} eq 'wrform'){ &mbwrform; } elsif ($in{mode} eq 'write'){ &mbwrite; } elsif ($in{mode} eq 'res'){ &mbres; } elsif ($in{mode} eq 'delete'){ &mbdel1; } elsif ($in{mode} eq 'del2'){ &mbdel2; } elsif ($in{mode} eq 'del3'){ &mbdel3; } elsif ($in{mode} eq 'edit'){ &mbedit; } elsif ($in{mode} eq 'edit2'){ &mbedit2; } elsif ($in{mode} eq 'link' && $link_en == 1){ &mblink; } elsif ($in{mode} eq 'sumform' && $summary_en == 1){ &mbsumform; } elsif ($in{mode} eq 'sumpsnl' && $summary_en == 1){ &mbsumpsnl; } elsif ($in{mode} eq 'summary' && $summary_en == 1){ &mbsum; } elsif ($in{mode} eq 'namedef' && $summary_en == 1){ &mbnamedef; } elsif ($in{mode} eq 'namedefwr' && $summary_en == 1){ &mbnamedefwr; } elsif ($in{mode} eq 'schform' && $search_en == 1){ &mbschform; } elsif ($in{mode} eq 'search' && $search_en == 1){ &mbsearch; } elsif ($in{mode} eq 'archform' && $archive_en == 1){ &mbarchform; } elsif ($in{mode} eq 'archive' && $archive_en == 1){ &mbarch; } elsif ($in{mode} eq 'past' || $in{mode} eq 'print'){ &mbpast; } elsif ($in{mode} eq 'iread' && $imode_en == 1){ &mbiread; } elsif ($in{mode} eq 'iwrite' && $imode_en == 1){ &mbiwrite; } elsif ($in{mode} eq 'iwrform' && $imode_en == 1){ &mbiwrform; } elsif ($in{mode} eq 'iresform' && $imode_en == 1){ &mbiresform; } elsif ($in{mode} eq 'backup'){ &mbbackup; } elsif ($in{mode} eq 'unlock'){ &mbunlock; } elsif ($in{mode} eq 'setup'){ &setadminpwd; } elsif ($in{mode} eq 'setup1'){ if ($in{util} == 0){ &asksetup; } else { print "Location: $mbutil\n\n"; } } elsif ($in{mode} eq 'setup2'){ &makesetup; } elsif ($in{mode} eq 'ssi'){ &mbssi; } else { &mbread; } exit; ############################################################################# # Read mode ################################################################# ############################################################################# sub mbread { &getmbdata; @alldata = reverse(@alldata); $cookies = $ENV{'HTTP_COOKIE'}; @pairs = split(/;/,$cookies); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/ //g; $DUMMY{$name} = $value; } @pairs = split(/,/,$DUMMY{$cookiename2}); foreach $pair (@pairs) { ($name, $value) = split(/:/, $pair); $COOKIE{$name} = &cookie_decode($value); } $date_gmt=&mbcook; @findata = split(/,/,$alldata[0]); $cook="done:$findata[0]"; #$ago = $ENV{"QUERY_STRING"}; $ago = $in{number}; #if ($ago ne ''){ print "Set-Cookie: $cookiename2=$cook; expires=$date_gmt\n"; #} print "Content-Type: text/html\n\n"; $fdone=$findata[0] - $COOKIE{done}; $fnext=$findata[0] - 20; $startpoint = 0; if($ago eq done){ $line=$fdone; } elsif ($ago =~ /&/) { ($ago,$t)=split(/&/,$ago); $line = $ago; } elsif ($ago =~ /^d/) { $ago =~ s/d(\d+)/$1/; $today=$time_offset; for($i=0;$i<=$ago;$i=$i+1){ $yesterday=$today-86400*$i; ($ysec,$ymin,$yhour,$ymday,$ymon,$yyear,$ywday,$yyday,$yisdst)=gmtime($yesterday); $yrmon=$ymon+1; $yester1="${yyear}_${yrmon}_${ymday}"; @yesterdata=grep(/^\d\d*,$yester1,/,@alldata); $ycount=$#yesterdata + 1; $line = $line + $ycount; } } elsif ($ago =~ /^n/) { $ago =~ s/n(\d+)/$1/; $startpoint=$findata[0] - $ago; $fnext=$ago - 20; $line=$startpoint+20; } elsif ($ago =~ /^\d/) { $line=$ago; } else { $line=20; } $t = $in{mode}; if ($#alldata < $line){ $finline=$#alldata; } else { $finline=$line-1; } print ""; print < $mbtitle HEADPRINT if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print "\n"; &disphead; print "
\n"; if (($fnext > $findata[0] - 200) && (($ago eq '')||($startpoint != 0))) { if ($fnext > 0) {print "更に前の20件を見る ";} } print "
\n"; if ($t eq 'title' or $t eq 'imlist') {print "
\n";}; if (($fnext > $findata[0] - 200) && (($ago eq '')||($startpoint != 0))) { if ($fnext > 0) {print "更に前の20件を見る ";} } print "
\n"; &disptail; print "

新規書き込み

\n"; ©right; print ""; print ""; } sub image_tag { my ($image,$w,$h) = @_; if ($w == 0 or $h == 0) { if ($attach_icon_en) { if ($in{mode} eq 'ssi'){ return ""; } else { return ""; } } else { return "<Attachment>"; } } else { if ($in{mode} eq 'ssi'){ return ""; } else { return ""; } } } sub copyright { my $mysite = ('http://www.hidekik.com/','http://www.hidekik.com/en/')[$lang]; print "

nerimb3.cgi Ver. $version
\n"; print "
Copyright(C) $reservedyear, hidekik.com
\n"; } sub get_image_size { my ($image,$max_width,$max_height) = @_; my $imagefile = "$imagedir/$image"; my ($width, $height); if ($image =~ /\.gif$/i or $image =~ /\.jpe?g$/i or $image =~ /\.[xp][bp]m$/i or $image =~ /\.xv$/i or $image =~ /\.[pm]ng$/i or $image =~ /\.tif$/i or $image =~ /\.bmp$/i or $image =~ /\.psd$/i or $image =~ /\.swf$/i or $image =~ /\.cws$/i or $image =~ /\.pcd$/i) { ($width, $height) = imgsize($imagefile); } my $actual_width; my $actual_height; if ($width > $max_width or $height > $max_height){ my $width_shrink = $max_width / $width; my $height_shrink = $max_height / $height; my $shrink_ratio; if ($width_shrink < $height_shrink){ $shrink_ratio = $width_shrink; } else { $shrink_ratio = $height_shrink; } $actual_width = int($width * $shrink_ratio); $actual_height = int($height * $shrink_ratio); } else { $actual_width = $width; $actual_height = $height; } return($imagefile,$actual_width,$actual_height); } sub disphead { local(@md)=@_; $today=$time_offset; foreach $i (0 .. 5){ $yesterday=$today-86400*$i; ($ysec,$ymin,$yhour,$ymday,$ymon,$yyear,$ywday,$yyday,$yisdst)=gmtime($yesterday); $yrmon=$ymon+1; $yester1="${yyear}_${yrmon}_${ymday}"; @yesterdata=grep(/^\d\d*,$yester1,/,@alldata); $ycount=$#yesterdata + 1; $line[$i] = $ycount; } $mb0=$line[0]; $mb1=$mb0+$line[1]; $mb2=$mb1+$line[2]; $mb3=$mb2+$line[3]; $mb4=$mb3+$line[4]; $mb5=$mb4+$line[5]; $titleprint=&titleprint("$mbtitle","$mblogo","$logo_style","$logo_color","$logo_size","$logo_face","$logo_sel","$logo_loc"); print "$body_insert1" if ($body_insert1_en == 1 and $md[0] == 0); if ($md[0] == 0){ if ($logo_sel != 4){ # print "
\"$mbtitle\"

\n"; print "$titleprint\n"; } print "$body_insert2" if ($body_insert2_en == 1); print "
最近の書き込み件数: 今日 $mb0件、昨日 $line[1]件
\n"; if ($fdone > 0) {print "";} print "未読分:$fdone件"; if ($fdone > 0) {print "\n";} print "
\n"; print "
" if ($body_insert3_en == 0); print "$body_insert3" if ($body_insert3_en == 1); print "
"; if ($top_link_en == 1){ print "$top_link_title "; } print "新規書き込み
\n"; print "

" if ($body_insert4_en == 0); print "$body_insert4" if ($body_insert4_en == 1); } print "

最新20件最新50件最新100件最新200件\n"; print "*200件以前\n" if ($pastlog_save == 1); print "
昨日以降($mb1)*2日前以降($mb2)*3日前以降($mb3)*4日前以降($mb4)*5日前以降($mb5)
\n"; if ($summary_en == 1){print "統計*";} if ($archive_en == 1){print "アーカイブ*";} if ($link_en == 1){print "リンク*";} if ($title_en == 1){print "タイトル*";} if ($imlist_en == 1 and $image_en == 1){print "画像*";} if ($search_en == 1){print "サーチ*";} #if ($delete_en == 1){print "削除*";} if ($imode_en == 1){print "携帯モード*";} if ($usage_en == 1){print "使い方*";} if ($setup_en == 1){print "セットアップ";} print "
"; print "\n"; } sub disptail { print "
最新20件最新50件最新100件最新200件"; print "*200件以前\n" if ($pastlog_save == 1); print "
昨日以降2日前以降3日前以降4日前以降5日前以降
\n"; } sub getmbdata { if ($compatible == 1){ open(FILE,"< $mbdata"); @alldata=; close(FILE); } else { open(FILE,"< $mbdata"); while(){ push(@alldata,$_); if ($#alldata >= 200){ shift(@alldata); } }; close(FILE); } } ############################################################################# # Write Form mode ########################################################### ############################################################################# sub mbwrform { $cookies = $ENV{'HTTP_COOKIE'}; @pairs = split(/;/,$cookies); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/ //g; $DUMMY{$name} = $value; } @pairs = split(/,/,$DUMMY{$cookiename}); foreach $pair (@pairs) { ($name, $value) = split(/:/, $pair); $COOKIE{$name} = &cookie_decode($value); } print "Content-Type: text/html\n\n"; print < $mbwrtitle END1 if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbwrtitle","$mbwr_logo","$mbwr_style","$mbwr_color","$mbwr_size","$mbwr_face","$mbwr_sel","$mbwr_loc"); &user_color_input("$COOKIE{user_name_color}","$COOKIE{user_title_color}","$COOKIE{user_text_color}"); print <
$titleprint お名前(必須)
$name_color_input
メールアドレス

タイトル(必須)
$title_color_input

内容 $contents_color_input

END if ($image_en == 1){ print <

ENDIMAGE } if ($member_only == 1){ print <

END3 } if ($delete_en == 1 || $modify_en == 1){ print <

END2 } print "書き込み後の表\示:"; print <

 書き込む前にもう一度チェック

END2 &write_comment; &unlockdisp; &wrticket; print "

\n\n\n"; } ############################################################################# # Write mode ################################################################ ############################################################################# sub mbwrite { while(-f "$lockfile"){ sleep(1); } if ($ENV{REQUEST_METHOD} ne 'POST' or $in{ticket} ne "$ticket") { &error("正規の書き込み方法ではありません。"); } open(LOCK,"> $lockfile"); close(LOCK); if ($compatible == 1 or $pastlog_save == 0){$max=200;} ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time_offset); @wday_array = ('日','月','火','水','木','金','土'); $date_now = sprintf("%02d年%01d月%01d日(%s)%02d時%02d分",$year,$mon +1,$mday,$wday_array[$wday],$hour,$min); $rmon=$mon+1; $datecode="${year}_${rmon}_${mday}"; $cook="name\:" . &cookie_encode($in{name}) . "\,email\:$in{addr}\,mypwd\:$in{pwd}\,member_pwd\:$in{member_pwd}\,user_name_color\:$in{user_name_color},user_title_color\:$in{user_title_color}\,user_text_color\:$in{user_text_color}"; $date_gmt = &mbcook; print "Set-Cookie: $cookiename=$cook; expires=$date_gmt\n"; if ($in{name} eq "" || $in{subject} eq "") { &error('名前とタイトルは必ず書いてください'); } if ($in{addr} =~ /[^$mail_pattern]/){ &error("$in{addr}:無効なメールアドレスです"); } if ($in{user_name_color} =~ /[^$color_pattern]/) { $message = ('無効な色指定です','Invalid color name')[$lang]; &error("$in{user_name_color}:$message"); } if ($in{user_title_color} =~ /[^$color_pattern]/){ $message = ('無効な色指定です','Invalid color name')[$lang]; &error("$in{user_title_color}:$message"); } if ($in{user_text_color} =~ /[^$color_pattern]/){ $message = ('無効な色指定です','Invalid color name')[$lang]; &error("$in{user_text_color}:$message"); } if ($member_only == 1 && ($in{member_pwd} ne "$member_pwd")) { &error('メンバー専用パスワードが違います。'); } if (! open(RD,"<$mbdata")){ $number = 1; } else { if ($compatible == 1){ @alldata=; @tmpdata=@alldata; $line=pop(@tmpdata); ($number,@dummy)=split(/,/,$line); close(RD); if ($max <= $#alldata + 1) { open(LOG,">>$mbpastdata"); print LOG shift(@alldata); close(LOG); chmod(0666,"mbpastdata"); } } else { &getmbdata; ($number,@dummy)=split(/,/,$alldata[$#alldata]); } $number = $number + 1; } $host = $ENV{'REMOTE_HOST'}; $ip = $ENV{'REMOTE_ADDR'}; if ($in{pwd} ne '') { $encpwd = &makecrypt($in{pwd}); } else { $encpwd = ''; } $main=$in{main}; if ($image_en == 1 && $in{imagefile} ne ''){ foreach (@in){ if ($_ =~ /name=\"imagefile\"/){ if ($_ =~ /(.*)Content-type:(.*)/i) { $tail=$2; } if ($_ =~ /(.*)filename=\"(.*)\"/i) { $origfile=$2; $origfile =~ s/^.*[\\\/]([^\\\/]+)$/$1/; $imagefile="$number-$origfile"; } } } if ("$origfile" !~ /^[0-9a-zA-Z\._\-]+$/) { &error("$origfile:アップ後のファイル名は半角英数で。"); } open(OUT,"> $imagedir/$imagefile") || &error("アップロードに失敗しました。"); binmode(OUT); print OUT $in{imagefile}; close(OUT); chmod (0666,"$imagedir/$imagefile"); } if ($compatible == 1){ push(@alldata,"$number,$datecode,$in{name},$in{addr},${ip}_${host},$date_now,$in{subject},$main,$encpwd,$imagefile,$in{user_name_color},$in{user_title_color},$in{user_text_color}\n"); open(FILE,">$mbdata") || &error("$mbdataを開けません。"); print FILE @alldata; close(FILE); } else { if ($pastlog_save == 1) { open(FILE,">>$mbdata") || &error("$mbdataを開けません。"); print FILE "$number,$datecode,$in{name},$in{addr},${ip}_${host},$date_now,$in{subject},$main,$encpwd,$imagefile,$in{user_name_color},$in{user_title_color},$in{user_text_color}\n"; close(FILE); } else { push(@alldata,"$number,$datecode,$in{name},$in{addr},${ip}_${host},$date_now,$in{subject},$main,$encpwd,$imagefile,$in{user_name_color},$in{user_title_color},$in{user_text_color}\n"); if ($#alldata >= $max) { my ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,shift(@alldata)); chomp($imagefile); unlink("$imagedir/$imagefile") if ($imagefile ne ''); } open(FILE,">$mbdata") || &error("$mbdataを開けません。"); print FILE @alldata; close(FILE); } } chmod(0666,"$mbdata"); &extraupdate; unlink("$lockfile"); if ($in{name} ne "" && $in{subject} ne "") { print "Location: $mbread$in{past}\n\n"; } } ############################################################################# # Res Form mode ############################################################# ############################################################################# sub mbres { &getmbdata; @resdata = grep(/^$in{resnum},/,@alldata); ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$resimagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$resdata[0]); $cookies = $ENV{'HTTP_COOKIE'}; @pairs = split(/;/,$cookies); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/ //g; $DUMMY{$name} = $value; } @pairs = split(/,/,$DUMMY{$cookiename}); foreach $pair (@pairs) { ($name, $value) = split(/:/, $pair); $COOKIE{$name} = &cookie_decode($value); } #$ressubject =~ s/,(\d)/,$1/g; print "Content-Type: text/html\n\n"; print < $mbrestitle END1 if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbrestitle","$mbres_logo","$mbres_style","$mbres_color","$mbres_size","$mbres_face","$mbres_sel","$mbres_loc"); &user_color_input("$COOKIE{user_name_color}","$COOKIE{user_title_color}","$COOKIE{user_text_color}"); print <
$titleprint お名前(必須)
$name_color_input
メールアドレス

タイトル(必須)
$title_color_input

内容 $contents_color_input

"; if ($image_en == 1){ print <

ENDIMAGE } if ($member_only == 1){ print <

END3 } if ($delete_en == 1 || $modify_en == 1){ print <

END2 } print "書き込み後の表\示:"; print <

 書き込む前にもう一度チェック

END2 &write_comment; &unlockdisp; &wrticket; print "

\n\n\n"; } ############################################################################# # Message edit Form mode #################################################### ############################################################################# sub mbedit { &getmbdata; @resdata = grep(/^$in{resnum},/,@alldata); ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$resimagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$resdata[0]); $cookies = $ENV{'HTTP_COOKIE'}; @pairs = split(/;/,$cookies); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ s/ //g; $DUMMY{$name} = $value; } @pairs = split(/,/,$DUMMY{$cookiename}); foreach $pair (@pairs) { ($name, $value) = split(/:/, $pair); $COOKIE{$name} = &cookie_decode($value); } #$ressubject =~ s/,(\d)/,$1/g; &user_color_input("$user_name_color","$user_title_color","$user_text_color"); print "Content-Type: text/html\n\n"; print < $mbedititle END1 if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbedititle","$mbedit_logo","$mbedit_style","$mbedit_color","$mbedit_size","$mbedit_face","$mbedit_sel","$mbedit_loc"); print <
$titleprint お名前(必須)
$name_color_input
メールアドレス

タイトル(必須)
$title_color_input

内容 $contents_color_input

"; if ($image_en == 1){ $resimagefile =~ s/[\n\r]*$//; if ($resimagefile ne ''){ print <画像はそのまま
画像を削除
画像を差し替え
差し替え画像ファイル(ファイル名は半角英数、アンダースコア、ドットのみ) ENDIMAGE } else { print < アップ画像ファイル(ファイル名は半角英数、アンダースコア、ドットのみ) ENDIMAGE2 } print "

\n"; } #if ($member_only == 1){ #print < #

#END3 #} if ($delete_en == 1 || $modify_en == 1){ print <

END2 } print "書き込み後の表\示:"; print <

 書き込む前にもう一度チェック

END2 &write_comment; &unlockdisp; print "

\n"; } ############################################################################# # Edit execute mode ####################################################### ############################################################################# sub mbedit2 { while(-f "$lockfile"){ sleep(1); } open(LOCK,"> $lockfile"); close(LOCK); $host = $ENV{'REMOTE_HOST'}; $ip = $ENV{'REMOTE_ADDR'}; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time_offset); @wday_array = ('日','月','火','水','木','金','土'); $date_now = sprintf("%01d月%01d日(%s)%02d時%02d分",$mon +1,$mday,$wday_array[$wday],$hour,$min); $rmon=$mon+1; $datecode="${year}_${rmon}_${mday}"; #if ($in{pwd} ne '') { # $encpwd = &makecrypt($in{pwd}); #} else { # $encpwd = ''; #} if ($in{name} eq "" || $in{subject} eq "") { &error('名前とタイトルは必ず書いてください'); } open(FILE,"< $admindat"); $adminpwd = ; close(FILE); open(RD,"< $mbdata"); open(FILE,"> $mbdir/tmp.$$"); while(){ s/[\r\n]*$//; # instead of chop ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$oldencpwd,$old_imagefile)=split(/,/); if ($number == $in{resnum}){ if (((crypt($in{pwd},$oldencpwd) eq "$oldencpwd") && ($oldencpwd ne '')) || (crypt($in{pwd},$adminpwd) eq "$adminpwd")) { if ($image_en == 1){ if ($in{imageedit} eq 'delete'){ unlink("$imagedir/$old_imagefile"); $imagefile = ''; } elsif ($in{imageedit} eq 'asis'){ $imagefile = "$old_imagefile"; } elsif ($in{imageedit} eq 'replace'){ if ($in{imagefile} ne ''){ unlink("$imagedir/$old_imagefile"); foreach (@in){ if ($_ =~ /name=\"imagefile\"/){ if ($_ =~ /(.*)Content-type:(.*)/i) { $tail=$2; } if ($_ =~ /(.*)filename=\"(.*)\"/i) { $origfile=$2; $origfile =~ s/^.*[\\\/]([^\\\/]+)$/$1/; $imagefile="$number-$origfile"; } } } if ("$origfile" !~ /^[0-9a-zA-Z\._\-]+$/) { &error("$origfile:アップ後のファイル名は半角英数で。"); } open(OUT,"> $imagedir/$imagefile") || &error("アップロードに失敗しました。"); binmode(OUT); print OUT $in{imagefile}; close(OUT); chmod (0666,"$imagedir/$imagefile"); } } else { $imagefile = "$old_imagefile"; } } else { $imagefile = "$old_imagefile"; } if ($dellog_save == 1){ open(LOG,">>$mbdellog"); print LOG "$_\n"; close(LOG); chmod(0666,"$mbdellog"); } print FILE "$number,$datecode,$in{name},$in{addr},${ip}_${host},$date,$in{subject},$in{main},$oldencpwd,$imagefile,$in{user_name_color},$in{user_title_color},$in{user_text_color}\n"; $error = 0; } else { print "Content-Type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "パスワードエラー\n"; print "\n"; print "\n"; if ("$oldencpwd" ne '') { print "
 
パスワードが違います。
\n"; } else { print "
 
パスワードが設定されていないので管理人のみ変更できます。
\n"; } print "\n"; print "\n"; print FILE "$_\n"; $error = 1; } } else { print FILE "$_\n"; } } close(RD); close(FILE); rename("$mbdir/tmp.$$","$mbdata"); chmod(0666,"$mbdata"); &extraupdate; unlink("$lockfile"); if ($error == 0) {print "Location: $mbread\n\n";} } ############################################################################# # Delete display mode ####################################################### # $delete_en = 0 の場合は直接$mbdel1をタイプして実行してください。 # 管理人のみ削除できることになります。 ############################################################################# sub mbdel1 { &getmbdata; @alldata = reverse(@alldata); @findata = split(/,/,$alldata[0]); print "Content-Type: text/html\n\n"; $ago = $in{number}; if ($ago eq ''){ $line = 200; } elsif ($ago >= 1 && $ago <= 5) { $today=time; for($i=0;$i<=$ago;$i=$i+1){ $yesterday=$today-86400*$i; ($ysec,$ymin,$yhour,$ymday,$ymon,$yyear,$ywday,$yyday,$yisdst)=gmtime($yesterday); $yrmon=$ymon+1; $yester1="${yyear}_${yrmon}_${ymday}"; @yesterdata=grep(/^\d\d*,$yester1,/,@alldata); $ycount=$#yesterdata + 1; $line = $line + $ycount; } } else { $line=$ago; } if ($#alldata < $line){ $finline=$#alldata; } else { $finline=$line-1; } $titleprint=&titleprint("$mbdeltitle","$mbdel_logo","$mbdel_style","$mbdel_color","$mbdel_size","$mbdel_face","$mbdel_sel","$mbdel_loc"); print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " $mbdeltitle\n"; if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print "\n"; print "$titleprint\n"; &disphead(1); print "
\n"; foreach $count (0 .. $finline){ ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$name_text_color,$title_text_color,$contents_text_color)=split(/,/,$alldata[$count]); &replace_color($name_text_color,$title_text_color,$contents_text_color); print ""; # print ""; print "
Message#${number} $date
"; @darray = split(/[^\d]/,$date); print "
Message#${number} "; $dy = $darray[0]+1900; $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; print "$date
"; print "From: "; if ($mail ne ""){ print "${name}" } else { print "$name"; } if ($namesan_en == 1){ print "$namesan"; } if ($mail ne ""){ print " ($mail)" } print "
"; print "
"; if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$subject"; } print "
"; if ($link_samewin_en == 1){ $link_target = '_top'; } else { $link_target = '_blank'; } # $main =~ s/(#)(\d+)/$1$2<\/a>/g; # $main =~ s/(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/$1<\/a>$2/g; @mainarry=split(/<[bB][rR]>/,$main); print ""; print ""; print ""; print "
"; $imagefile =~ s/[\r\n]*$//; if ($image_en == 1 && $imagefile ne '' && -e "$imagedir/$imagefile"){ ($imagefile,$width,$height)=&get_image_size($imagefile,$max_w,$max_h); if ($image_samewin_en == 1){ $newwin = ''; } else { $newwin = 'target="_blank"'; } print ""; print &image_tag($imagefile,$width,$height); print ""; } print ""; print ""; foreach (@mainarry){ $_ = &replace_link($_,$number); $_ = &replace_tag($_); if(/^(\>)(.*)$/){ print "$1$2"; } else { print; } print "
"; } print "
"; print "

\n"; } &disptail; print ""; print ""; } ############################################################################# # Delete confirm mode ####################################################### ############################################################################# sub mbdel2 { &getmbdata; @resdata = grep(/^$in{resnum},/,@alldata); ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$imagefile,$name_text_color,$title_text_color,$contents_text_color)=split(/,/,$resdata[0]); &replace_color($name_text_color,$title_text_color,$contents_text_color); print "Content-Type: text/html\n\n"; print < $mbdeltitle END1 if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbdeltitle","$mbdel_logo","$mbdel_style","$mbdel_color","$mbdel_size","$mbdel_face","$mbdel_sel","$mbdel_loc"); print <
$titleprint END2 print "
"; @darray = split(/[^\d]/,$resdate); print ""; print "
Message#${resnumber} "; $dy = $darray[0]+1900; $resdate =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; print "$resdate
"; print "From: "; if ($resmail ne ""){ print "${resname}" } else { print "$resname"; } if ($namesan_en == 1){ print "$namesan"; } if ($resmail ne ""){ print " ($resmail)" } print "
 
"; print "
"; @sub2=split(/Re:/,$ressubject); if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$ressubject"; } print "
"; print ""; print ""; print ""; print "
"; $imagefile =~ s/[\r\n]*$//; if ($image_en == 1 && $imagefile ne ''){ $withimage = 'と画像'; } else { $withimage = ''; } if ($image_en == 1 && $imagefile ne '' && -e "$imagedir/$imagefile"){ ($imagefile,$width,$height)=&get_image_size($imagefile,$max_w,$max_h); if ($image_samewin_en == 1){ $newwin = ''; } else { $newwin = 'target="_blank"'; } print ""; print &image_tag($imagefile,$width,$height); print ""; } print ""; @mainarry=split(/<[bB][rR]>/,$resmain); print ""; foreach (@mainarry){ $_ = &replace_link($_,$resnumber); $_ = &replace_tag($_); if(/^(\>)(.*)$/){ print "$1$2"; } else { print; } print "
"; } print "
"; print "

\n"; print "上のメッセージ$withimageを削除します。
よければパスワードを入力し、削除ボタンをクリックしてください。

"; print "パスワード:"; print ""; print ""; print "

"; print "

"; print "
"; print ""; print ""; } ############################################################################# # Delete execute mode ####################################################### ############################################################################# sub mbdel3 { while(-f "$lockfile"){ sleep(1); } open(LOCK,"> $lockfile"); close(LOCK); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time_offset); @wday_array = ('日','月','火','水','木','金','土'); $date_now = sprintf("%01d月%01d日(%s)%02d時%02d分",$mon +1,$mday,$wday_array[$wday],$hour,$min); $rmon=$mon+1; $datecode="${year}_${rmon}_${mday}"; open(FILE,"< $admindat"); $adminpwd = ; close(FILE); open(RD,"< $mbdata"); open(FILE,"> $mbdir/tmp.$$"); while(){ s/[\r\n]*$//; # instead of chop ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile)=split(/,/); if ($number == $in{number}){ if (((crypt($in{pwd},$encpwd) eq "$encpwd") && ($encpwd ne '')) || (crypt($in{pwd},$adminpwd) eq "$adminpwd")) { if ($dellog_save == 1){ open(LOG,">>$mbdellog"); print LOG "$_\n"; close(LOG); chmod(0666,"$mbdellog"); } unlink("$imagedir/$imagefile"); $error = 0; } else { print "Content-Type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "パスワードエラー\n"; print "\n"; print "\n"; if ($encpwd ne '') { print "
 
パスワードが違います。
\n"; } else { print "
 
パスワードが設定されていないので管理人のみ削除できます。
\n"; } print "\n"; print "\n"; print FILE "$_\n"; $error = 1; } } else { print FILE "$_\n"; } } close(RD); close(FILE); rename("$mbdir/tmp.$$","$mbdata"); chmod(0666,"$mbdata"); &extraupdate; unlink("$lockfile"); if ($error == 0) {print "Location: $mbread\n\n";} } ############################################################################# # Link display mode ######################################################### # メッセージ中のリンクの中でデッドリンク等でリンク表示のリストから # 除外したいメッセージナンバーをrejectlink.datに1行つづ記述してください。 ############################################################################# sub mblink { &getmbdata; if ($compatible == 1) { $in{past} = on; $in{new} = on; if (($in{new} eq on)&&($in{past} eq on)){ `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; chmod(0666,"$alldata"); $filename="$alldata"; } elsif ($in{new} eq on){ $filename="$mbdata"; } elsif ($in{past} eq on){ `$cat $mbarchdata $mbpastdata > $pastall`; chmod(0666,"$pastall"); $filename="$pastall"; } } else { $filename = $mbdata; } print "Content-Type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "$mblinktitle\n"; if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mblinktitle","$mblink_logo","$mblink_style","$mblink_color","$mblink_size","$mblink_face","$mblink_sel","$mblink_loc"); print "\n"; print "\n"; if (($in{m1} =~ /^[13578]$/) || ($in{m1} =~ /^1[02]$/)){ $finday = 31; } elsif (($in{m1} =~ /^[469]$/) || ($in{m1} == 11)){ $finday = 30; } elsif ($in{m1} == 2){ $finday = 28; } open(FILE,"< $filename"); while (){ chop; ($number,$b,$c,$d,$e,$date,$title,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/); if (/https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*/){ foreach (split(/<[Bb][rR]>/,$main)){ # print "$_
\n"; if (/(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/ && !/^\>/){ # print "$_
\n"; $linkarray2 .= "$1
"; } } if($linkarray2 ne ""){ ($aaa)=grep(/^$number/,@reject); if ($aaa != $number){ push(@numarray,$number); push(@datearray,$date); push(@titlearray,$title); push(@linkarray,$linkarray2); # push(@user_name_color,$user_name_color); push(@user_title_color,$user_title_color); # push(@user_text_color,$user_text_color); } } $linkarray2=""; } } close(FILE); print "$titleprint\n"; print "
メッセージボード中にあるURLを抜粋して表\\示してあります。
デッドリンク、重複しているものは除外していますが、残っている場合もあります。
Message#の番号をクリックするとそのメッセージが表\\示されます。

\n"; &disphead(1); print "
\n"; print "
"; print "
    \n"; for($i=$#linkarray;$i>=0;$i=$i-1){ &replace_color($user_name_color[$i],$user_title_color[$i],$user_text_color[$i]); print "
  • #$numarray[$i],"; $subject = $titlearray[$i]; # $subject =~ s/,(\d)/,$1/g; @sub2=split(/Re:/,$subject); if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]
    \n"; } else { print "$subject
    \n"; } # print "
  • #$numarray[$i], $titlearray[$i]
    \n"; foreach $url (split(/<[Bb][Rr]>/,$linkarray[$i])){ # $url =~ s/,(\d)/,$1/g; if ($link_samewin_en == 1){ $link_target = '_top'; } else { $link_target = '_blank'; } print "$url
    "; } print "

  • \n"; } print "
\n"; print "
\n"; print "
\n"; &disptail; print ""; } ############################################################################# # Summary Form mode ######################################################### ############################################################################# sub mbsumform { &getmbdata; ($num,$datecode,@dum)=split(/,/,$alldata[$#alldata]); $datecode =~ /^(\d\d+)_\d+_\d+/; $finyear = $1; if ($compatible == 0){ open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } else { open(FILE,"< $mbarchdata") || open(FILE,"< $mbpastdata") || open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } ($num,$datecode,@dum)=split(/,/,$firstdata); $datecode =~ /^(\d\d+)_/; $firstyear = $1; $titleprint=&titleprint("$mbsumtitle","$mbsum_logo","$mbsum_style","$mbsum_color","$mbsum_size","$mbsum_face","$mbsum_sel","$mbsum_loc"); print "Content-Type:text/html\n\n"; print < $mbsumtitle END if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print <

$titleprint
参照対象  
全部  Message# から まで
日付が
個人名方式   名前  人物 (印のみ有効) 同一人物設定
日毎の集計
トップ100 書き込み量の上位100
件数対日数 日数を件数でソ\\ート
時間帯集計 時間帯毎の書き込みの量
曜日毎集計 曜日毎の書き込みの量
月毎の集計 毎月の書き込みの量
年毎の集計 毎年の書き込みの量
ぴったり賞 Message#100, 777, 等に当たった人
個人別集計 名前別書き込みの量
月間個人別集計
年間個人別集計
月間トップ3 歴代の月間トップ3
個人最終書き込み 特定の名前で最後に書き込んだ日
     

メッセージボードへ  個人データ詳細

END5 } ############################################################################# # Summary personal Form mode ################################################ ############################################################################# sub mbsumpsnl { &getmbdata; ($num,$datecode,@dum)=split(/,/,$alldata[$#alldata]); $datecode =~ /^(\d\d+)_\d+_\d+/; $finyear = $1; if ($compatible == 0){ open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } else { open(FILE,"< $mbarchdata") || open(FILE,"< $mbpastdata") || open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } ($num,$datecode,@dum)=split(/,/,$firstdata); $datecode =~ /^(\d\d+)_/; $firstyear = $1; print "Content-Type:text/html\n\n"; $titleprint=&titleprint('個人データ詳細',"$mbsum_logo","$mbsum_style","$mbsum_color","$mbsum_size","$mbsum_face","$mbsum_sel","$mbsum_loc"); print < 個人データ詳細 END if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print <
$titleprint
参照対象  
全部  Message# から まで
日付が
個人名方式   名前  人物 同一人物設定
名前  
日毎の集計
トップ30 書き込み量の上位30
件数対日数 日数を件数でソ\\ート
時間帯集計 時間帯毎の書き込みの量
曜日毎集計 曜日毎の書き込みの量
月毎の集計 毎月の書き込みの量
年毎の集計 毎年の書き込みの量
     

メッセージボードへ  書き込み統計へ

END3 } ############################################################################# # Summary mode ############################################################## ############################################################################# sub mbsum { ($filename,$tmpdata) = &gentmpdata; %sum_item_titles = ( 'data1', '日毎の集計', 'data1a', 'トップ100', 'data1b', '件数対日数', 'data2', '時間帯集計', 'data3', '曜日毎集計', 'data4', '月毎の集計', 'data4a', '年毎の集計', 'data5', 'ぴったり賞', 'data6', '個人データ集計', 'data6a', '月間個人別集計', 'data6b', '年間個人別集計', 'data6c', '歴代月間トップ3', 'data7', '個人最終書き込み', 'data10', '日ごとのデータ集計', 'data11', '書き込みトップ30', 'data12', '件数対日数', 'data13', '時間帯集計', 'data14', '曜日毎集計', 'data15', '毎月の書き込み集計', 'data15a', '毎年の書き込み集計', ); $titleprint=&titleprint("$sum_item_titles{$in{choise}}","$mbsum_logo","$mbsum_style","$mbsum_color","$mbsum_size","$mbsum_face","$mbsum_sel","$mbsum_loc"); print "Content-Type: text/html\n\n"; print < $mbsumtitle SUM_HEAD if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; $rightend = 400; if ($in{choise} eq data1){ print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,@line)=split(/,/); if ($date =~ /^${in{y1}}_${in{m1}}_/){ $count{$date}++; $total++; } } close(FILE); for ($i=1;$i<=$finday;$i++){ $date="${in{y1}}_${in{m1}}_${i}"; printf("%04d/%02d/%02d | ",$in{y1}+1900,$in{m1},$i); $linemax = 40; $width=($count{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count{$date};$j++){ # print "*"; # } if ($count{$date} eq ""){$count{$date}=0;} print " $count{$date}
"; } $mean=$total/$finday; print "---------------------
"; print "トータル=$total件、 一日平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data1a){ print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,@line)=split(/,/); $count{$date}++; $total++; } close(FILE); $i=0; foreach (keys(%count)){ $content{"${count{$_}}_${i}"}="$_"; $i++; } @tmp=keys(%content); @tmp1=reverse(sort({$a<=>$b}@tmp)); @sortdata=splice(@tmp1,0,100); foreach $number (@sortdata){ $date=$content{$number}; ($yy,$mm,$dd,$dummy)=split(/_/,$date); printf("%04d/%02d/%02d | ",$yy+1900,$mm,$dd); $linemax = 60; $width=($count{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$number;$j++){ # print "*"; # } if ($number eq ""){$number=0;} print " $count{$date}
"; } $mean=$total/$finday; print "---------------------
"; print "トータル=$total件、 一日平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data1b){ print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); $i=0; while (){ chop; ($num,$date,@line)=split(/,/); if ($i==0){$date1=$date;$num0=$num;} $count{$date}++; $i++; } close(FILE); ($yyy,$mmm,$ddd)=split(/_/,$date1); ($yyy2,$mmm2,$ddd2)=split(/_/,$date); @timetmp=gmtime($time_offset); $firstline=timelocal(0,0,0,$ddd,$mmm-1,$yyy,$timetmp[6],$timetmp[7],$timetmp[8]); $endline=timelocal(0,0,0,$ddd2,$mmm2-1,$yyy2,$timetmp[6],$timetmp[7],$timetmp[8]); @tmp=sort {$a<=>$b} values(%count); $max=$tmp[$#tmp]; $total=$#tmp+1; $yyyy = $yyy; $yyyy2 = $yyy2; $yyy=$yyy+1900; $yyy2=$yyy2+1900; print "$yyy年$mmm月$ddd日から$yyy2年$mmm2月$ddd2日まで

"; for ($i=0;$i<=$max;$i++){ @dnum=grep(/^$i$/,@tmp); $value=$#dnum+1; if ($i==0){ for($y=$yyyy;$y<=$yyyy2;$y++){ for($m=1;$m<=12;$m++){ if (($m =~ /^[13578]$/) || ($m =~ /^1[02]$/)){ $finday = 31; } elsif (($m =~ /^[469]$/) || ($m == 11)){ $finday = 30; } elsif ($m == 2){ $finday = 28; } for($d=1;$d<=$finday;$d++){ $curline=timelocal(0,0,0,$d,$m-1,$y,$timetmp[6],$timetmp[7],$timetmp[8]); if (($curline < $firstline)||($curline > $endline)){next;} if ($count{"${y}_${m}_${d}"} eq ""){ $value++; } if ($date eq "${y}_${m}_${d}"){last;} } if ($date eq "${y}_${m}_${d}"){last;} } if ($date eq "${y}_${m}_${d}"){last;} } $gtotal=$value; } printf("%02d件 | ",$i); $linemax=600; $width=($value/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$value;$j=$j+5){ # print "*"; # } $num2 = $num2+$value*$i; $mean1=($value/($total+$gtotal))*100; print " $value日"; printf(" (%3.2f%%)
",$mean1); } $total=$total+$gtotal; $mean=($total/($num2))*24; print "---------------------
"; print "トータル=$total日、$num2件、 投稿平均間隔="; printf("%3.2f",$mean); print "時間
"; } if ($in{choise} eq data2){ if (($in{new} eq on)&&($in{past} eq on)){ $inc=10; } elsif ($in{new} eq on){ $inc=1; } elsif ($in{past} eq on){ $inc=10; } print "$titleprint\n"; &subtitle; print "

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($today =~ /(\d\d)時\d\d分$/){ $count[$1]++; $total++; } } close(FILE); @tmp=sort {$a <=> $b} @count; $linemax=$tmp[$#tmp]; for($i=0;$i<=23;$i++){ printf("%02d時〜%02d時 | ",$i,$i+1); if ($linemax == 0){last;} $width=($count[$i]/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count[$i];$j=$j+$inc){ # print "*"; # } if ($total == 0){last;} $pars=($count[$i]/$total)*100; if ($count[$i] eq ""){$count[$i] = 0;} print " $count[$i]"; printf(" (%2.2f%%)
\n",$pars); } print "---------------------
"; print "トータル=$total件
"; } if ($in{choise} eq data3){ if (($in{new} eq on)&&($in{past} eq on)){ $inc=20; } elsif ($in{new} eq on){ $inc=1; } elsif ($in{past} eq on){ $inc=20; } print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($today =~ /\((.*)\)\d\d時\d\d分$/){ $count{$1}++; $total++; } } close(FILE); @tmp=sort {$a <=> $b} values(%count); $linemax=$tmp[$#tmp]; foreach $week ('日','月','火','水','木','金','土'){ printf("%s | ",$week); if ($linemax == 0){last;} $width=($count{$week}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count{$week};$j=$j+$inc){ # print "*"; # } if ($count{$week} eq ""){$count{$week}=0;} if ($total == 0){$last;} $pars=($count{$week}/$total)*100; print " $count{$week}\n"; printf(" (%2.2f%%)
\n",$pars); } print "---------------------
"; print "トータル = $total件
\n"; } if ($in{choise} eq data4){ $inc=10; print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,@line)=split(/,/); $date =~ s/^(\d?\d\d_\d?\d)_\d?\d$/$1/; $count{$date}++; $total++; } close(FILE); @item=keys(%count); @item1=(); foreach (@item){ s/^(\d?\d\d)_(\d)$/${1}0$2/; s/^(\d?\d\d)_(\d\d)$/$1$2/; push(@item1,$_); } @item1=sort {$a <=> $b} @item1; @tmp=sort {$a <=> $b} values(%count); $linemax= $tmp[$#tmp]; foreach $date (@item1){ $date =~ s/^(\d?\d\d)([1-9]\d)$/${1}_$2/; $date =~ s/^(\d?\d\d)0(\d)$/${1}_$2/; ($yy,$mm)=($1,$2); printf("%04d年%02d月 | ",$yy+1900,$mm); if ($linemax == 0){last;} $width=($count{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count{$date};$j=$j+$inc){ # print "*"; # } if ($count{$date} eq ""){$count{$date}=0;} print " $count{$date}
"; } $mean=$total/($#item+1); print "---------------------
"; print "トータル=$total件、 月平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data4a){ $inc=10; print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,@line)=split(/,/); $date =~ s/^(\d?\d\d)_\d?\d_\d?\d/$1/; $count{$date}++; $total++; # print "$date
\n"; } close(FILE); @item=keys(%count); @item1=@item; # @item1=(); # foreach (@item){ # s/^(\d?\d\d)_/$1/; # push(@item1,$_); # } @item1=sort {$a <=> $b} @item1; @tmp=sort {$a <=> $b} values(%count); $linemax=$tmp[$#tmp]; foreach $date (@item1){ printf("%04d年 | ",$date+1900); if ($linemax == 0){last;} $width=($count{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } if ($count{$date} eq ""){$count{$date}=0;} print " $count{$date}
"; } $mean=$total/($#item+1); print "---------------------
"; print "トータル=$total件、 年平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data5){ print "$titleprint\n"; &subtitle; print "
\n"; # @period=(1,100,111,200,222,300,333,400,444,500,555,600,666,700,777,800,888,900,999,1000,1111,1234,2000,2222,2345,3000,3333,3456,4000,4321,4444,4567,5000,5555,5678,6000,6666,6789,7000,7777,8000,8888,9000,9999,10000); open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if (grep(/^$num$/,@period) ne ""){ $pname{$num}=$name; $date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/; $today2=$today; $today2 =~ s/^(\d\d?\d?)..*/$1/; if ($today2 != $date){ $date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/; # $ptoday{$num}=sprintf("%s年%s",$date+1900,$today); } else { @darray = split(/[^\d]/,$today); @tmpaaa = split(/日[^\)]/,$today); $date=$darray[0]; $today=sprintf("%s月%s日(%s",$darray[2],$darray[4],$tmpaaa[1]); # $ptoday{$num}=$today; } $ptoday{$num}=sprintf("%s年%s",$date+1900,$today); } } close(FILE); print ""; foreach $number (reverse(@period)){ if ($pname{$number} eq ""){next;} if ($in{perso} eq "nokeep"){ $name=&checkname($pname{$number}); } else { $name = $pname{$number} } print ""; printf("",$number,$name,$ptoday{$number}); print "\n"; } print "
Message# %d%s%s
"; } if ($in{choise} eq data6){ if (($in{new} eq on)&&($in{past} eq on)){ $inc=25; } elsif ($in{new} eq on){ $inc=1; } elsif ($in{past} eq on){ $inc=25; } print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($in{perso} eq "nokeep"){$name=&checkname($name);} $count{$name}++; $total++; } close(FILE); $i=0; foreach (keys(%count)){ $content{"${count{$_}}_${i}"}="$_"; $i++; } @tmp=keys(%content); @sortdata=reverse(sort({$a<=>$b}@tmp)); print "\n"; foreach $data (@sortdata){ print ""; print " \n"; $data =~ s/^(\d\d*)_\d\d*/$1/; print ""; print ""; } print "
$content{$data}"; $linemax=$sortdata[0]; if ($linemax == 0){last;} $width=($data/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$data;$j=$j+$inc){ # print "*"; # } if ($total == 0){last;} $pars=($data/$total)*100; print " $data"; printf(" (%3.2f%%)",$pars); print "
"; $people=$#sortdata+1; print "
"; print "トータル=$total件、 延べ人数="; print "$people"; print "人、一人平均="; if ($people == 0){$people=1;} $mean=$total/$people; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data6a){ $inc=2; print "$titleprint\n"; &subtitle; print "
\n"; $realy=$in{y2}+1900; print "$realy年$in{m2}月のデータ

"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($date =~ /^$in{y2}_$in{m2}_\d\d?$/){ if ($in{perso} eq "nokeep"){$name=&checkname($name);} $count{$name}++; $total++; } } close(FILE); $i=0; foreach (keys(%count)){ $content{"${count{$_}}_${i}"}="$_"; $i++; } @tmp=keys(%content); @sortdata=reverse(sort({$a<=>$b}@tmp)); $linemax=$sortdata[0]; print "\n"; foreach $data (@sortdata){ print ""; print " \n"; $data =~ s/^(\d\d*)_\d\d*/$1/; print ""; print ""; } print "
$content{$data}"; if ($linemax == 0){last;} $width=($data/$linemax)*400; if ($width != 0){ print "\n"; } # for($j=0;$j<$data;$j=$j+$inc){ # print "*"; # } if ($total == 0){last;} $pars=($data/$total)*100; print " $data"; printf(" (%3.2f%%)",$pars); print "
"; $people=$#sortdata+1; print "
"; print "トータル=$total件、 延べ人数="; print "$people"; print "人、一人平均="; if ($people == 0){$people=1;} $mean=$total/$people; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data6b){ $inc=20; print "$titleprint\n"; &subtitle; print "

\n"; $realy=$in{y3}+1900; print "$realy年のデータ

"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($date =~ /^$in{y3}_\d\d?_\d\d?$/){ $name1=$name; if ($in{perso} eq "nokeep"){$name=&checkname($name);} $count{$name}++; $total++; } } close(FILE); $i=0; foreach (keys(%count)){ $content{"${count{$_}}_${i}"}="$_"; $i++; } @tmp=keys(%content); @sortdata=reverse(sort({$a<=>$b}@tmp)); $linemax=$sortdata[0]; print "\n"; foreach $data (@sortdata){ print ""; print " \n"; $data =~ s/^(\d\d*)_\d\d*/$1/; print ""; print ""; } print "
$content{$data}"; if ($linemax == 0){last;} $width=($data/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$data;$j=$j+$inc){ # print "*"; # } if ($total == 0){last;} $pars=($data/$total)*100; print " $data"; printf(" (%3.2f%%)",$pars); print "
"; $people=$#sortdata+1; print "
"; print "トータル=$total件、 延べ人数="; print "$people"; print "人、一人平均="; if ($people == 0){$people=1;} $mean=$total/$people; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data6c){ $inc=2; print "$titleprint\n"; &subtitle; print "

\n"; print ""; print ""; print ""; print ""; print ""; print ""; open(FILE,"< $filename"); $j=0; while () { chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($in{perso} eq "nokeep"){$name=&checkname($name);} $date =~ s/^(\d?\d\d_\d\d?)_\d\d?$/$1/; if ($lastmon ne '' && $lastmon ne $date){ &mktbl; $j=$j+1; undef %count; undef %content; } $count{"$name"}++; $total++; $lastmon=$date; } close(FILE); &mktbl; for($i=$j;$i>=0;$i=$i-1){ ($ym,$a1,$a2,$b1,$b2,$c1,$c2)=split(/\,/,$tbl[$i]); ($yyy,$mmm)=split(/_/,$ym); $yyy=$yyy+1900; print ""; print ""; print ""; print ""; print ""; } print "
1位2位3位
$yyy年$mmm月$a1
$a2件
$b1
$b2件
$c1
$c2件
"; } sub mktbl { $i=0; foreach (keys(%count)){ $content{"${count{$_}}_$i"}="$_"; $i++; } @tmp = keys(%content); @tmp1 = reverse(sort {$a<=>$b} @tmp); $top=$tmp1[0]; $top =~ s/^(\d\d*)_\d\d*$/$1/; $second=$tmp1[1]; $second =~ s/^(\d\d*)_\d\d*$/$1/; $third=$tmp1[2]; $third =~ s/^(\d\d*)_\d\d*$/$1/; $tbl[$j]="$lastmon,$content{$tmp1[0]},$top,$content{$tmp1[1]},$second,$content{$tmp1[2]},$third"; } if ($in{choise} eq data7){ print "$titleprint\n"; &subtitle; print "
\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); $date =~ s/_(\d_\d?\d)$/_0${1}/; $date =~ s/_(\d\d_)(\d)$/_${1}0${2}/; $date =~ s/^(9\d_\d\d_\d\d)$/0${1}/; $date2=$date; $date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/; $today2=$today; $today2 =~ s/^(\d\d?\d?)..*/$1/; if ($in{perso} eq "nokeep"){$name=&checkname($name);} if ($today2 != $date){ $count{$name}=sprintf("%s_%s年%s_%s",$date2,$date,$today,$num); } else { $count{$name}="${date2}_${today}_${num}"; } } close(FILE); foreach (keys(%count)){ $content{"$count{$_}"}="$_"; } @tmp=keys(%content); @sortdata=reverse(sort(@tmp)); print ""; foreach $today (@sortdata){ $today2 = $today; $today2 =~ s/^\d?\d\d_\d\d_\d\d_(..*)_(\d\d*)$/$1/; @darray = split(/[^\d]/,$today2); @tmpaaa = split(/日[^\)]/,$today2); $datex=$darray[0]; $tx=sprintf("%s月%s日(%s",$darray[2],$darray[4],$tmpaaa[1]); $today2=sprintf("%s年%s",$datex+1900,$tx); $mesnum=$2; print "\n"; } print "
$content{$today}$today2 #$mesnum
"; } if ($in{choise} eq data10){ print "$titleprint\n"; &subtitle; print "
\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } if ($name eq $hname){ if ($date =~ /^${in{y1}}_${in{m1}}_/){ $count{$date}++; $total++; } } } close(FILE); for ($i=1;$i<=$finday;$i++){ $date="${in{y1}}_${in{m1}}_${i}"; printf("%04d/%02d/%02d | ",$in{y1}+1900,$in{m1},$i); $linemax=40; $width=($count{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count{$date};$j++){ # print "*"; # } if ($count{$date} eq ""){$count{$date}=0;} print " $count{$date}
"; } $mean=$total/$finday; print "---------------------
"; print "トータル=$total件、 一日平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data11){ print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } if ($name eq $hname){ $count{$date}++; $total++; } } close(FILE); $i=0; foreach (keys(%count)){ $content{"${count{$_}}_${i}"}="$_"; $i++; } @tmp=keys(%content); @tmp1=reverse(sort({$a<=>$b}@tmp)); @sortdata=splice(@tmp1,0,30); foreach $number (@sortdata){ $date=$content{$number}; ($yy,$mm,$dd,$dummy)=split(/_/,$date); printf("%04d/%02d/%02d | ",$yy+1900,$mm,$dd); $linemax=20; $width=($number/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$number;$j++){ # print "*"; # } if ($number eq ""){$number=0;} print " $count{$date}
"; } $mean=$total/$finday; print "---------------------
"; print "トータル=$total件、 一日平均="; printf("%3.2f",$mean); print "件
"; } if ($in{choise} eq data12){ print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); $i=0; while (){ chop; ($num,$date,$name,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } if ($name eq $hname){ if ($i==0){$date1=$date;$num0=$num;} $count{$date}++; $i++; } } close(FILE); ($yyy,$mmm,$ddd)=split(/_/,$date1); ($yyy2,$mmm2,$ddd2)=split(/_/,$date); @timetmp=gmtime($time_offset); $firstline=timelocal(0,0,0,$ddd,$mmm-1,$yyy,$timetmp[6],$timetmp[7],$timetmp[8]); $endline=timelocal(0,0,0,$ddd2,$mmm2-1,$yyy2,$timetmp[6],$timetmp[7],$timetmp[8]); @tmp=sort {$a<=>$b} values(%count); $max=$tmp[$#tmp]; $total=$#tmp+1; $yyy = $yyy + 1900; $yyy2 = $yyy2 + 1900; print "$yyy年$mmm月$ddd日から$yyy2年$mmm2月$ddd2日まで

"; for ($i=0;$i<=$max;$i++){ @dnum=grep(/^$i$/,@tmp); $value=$#dnum+1; if ($i==0){ for($y=$yyy-1900;$y<=$yyy2-1900;$y++){ for($m=1;$m<=12;$m++){ if (($m =~ /^[13578]$/) || ($m =~ /^1[02]$/)){ $finday = 31; } elsif (($m =~ /^[469]$/) || ($m == 11)){ $finday = 30; } elsif ($m == 2){ $finday = 28; } for($d=1;$d<=$finday;$d++){ $curline=timelocal(0,0,0,$d,$m-1,$y,$timetmp[6],$timetmp[7],$timetmp[8]); if (($curline < $firstline)||($curline > $endline)){next;} if ($count{"${y}_${m}_${d}"} eq ""){ $value++; } if ($date eq "${y}_${m}_${d}"){last;} } if ($date eq "${y}_${m}_${d}"){last;} } if ($date eq "${y}_${m}_${d}"){last;} } $gtotal=$value; } $linemax=2000; printf("%02d件 | ",$i); $width=($value/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$value;$j=$j+5){ # print "*"; # } $num2 = $num2+$value*$i; $mean1=($value/($total+$gtotal))*100; print " $value日"; printf(" (%3.2f%%)
",$mean1); } $total=$total+$gtotal; $mean=($total/($num2))*24; print "---------------------
"; print "トータル=$total日、$num2件、 投稿平均間隔="; printf("%3.2f",$mean); print "時間
"; } if ($in{choise} eq data13){ if (($in{new} eq on)&&($in{past} eq on)){ $inc=5; } elsif ($in{new} eq on){ $inc=1; } elsif ($in{past} eq on){ $inc=5; } print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } if ($name eq $hname){ if ($today =~ /(\d\d)時\d\d分$/){ $count[$1]++; $total++; } } } close(FILE); @tmp = sort {$a <=> $b} @count; $linemax=$tmp[$#tmp]; for($i=0;$i<=23;$i++){ printf("%02d時〜%02d時 | ",$i,$i+1); if ($linemax == 0){last;} $width=($count[$i]/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count[$i];$j=$j+$inc){ # print "*"; # } if ($total == 0){last;} $pars=($count[$i]/$total)*100; if ($count[$i] eq ""){$count[$i] = 0;} print " $count[$i]"; printf(" (%2.2f%%)
\n",$pars); } print "---------------------
"; print "トータル=$total件
"; } if ($in{choise} eq data14){ if (($in{new} eq on)&&($in{past} eq on)){ $inc=5; } elsif ($in{new} eq on){ $inc=1; } elsif ($in{past} eq on){ $inc=5; } print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,$mail,$host,$today,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } if ($name eq $hname){ if ($today =~ /\((.*)\)\d\d時\d\d分$/){ $count{$1}++; $total++; } } } close(FILE); @tmp = sort {$a <=> $b} values(%count); $linemax=$tmp[$#tmp]; foreach $week ('日','月','火','水','木','金','土'){ printf("%s | ",$week); if ($linemax == 0){last;} $width=($count{$week}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$count{$week};$j=$j+$inc){ # print "*"; # } if ($count{$week} eq ""){$count{$week}=0;} if ($total == 0){last;} $pars=($count{$week}/$total)*100; print " $count{$week}\n"; printf(" (%2.2f%%)
\n",$pars); } print "---------------------
"; print "トータル = $total件
\n"; } if ($in{choise} eq data15){ $inc=2; print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } $date =~ s/^(\d?\d\d_\d?\d)_\d?\d$/$1/; $count{$date}++; $total++; if ($name eq $hname){ $personal{$date}++; $ptotal++; } } close(FILE); @item=keys(%count); @item1=(); foreach (@item){ s/^(\d?\d\d)_(\d)$/${1}0$2/; s/^(\d?\d\d)_(\d\d)$/$1$2/; push(@item1,$_); } @item1=sort {$a <=> $b} @item1; $flag = 0; @tmp = sort {$a <=> $b} values(%personal); $linemax=$tmp[$#tmp]; foreach $date (@item1){ $date =~ s/^(\d?\d\d)([1-9]\d)$/${1}_$2/; $date =~ s/^(\d?\d\d)0(\d)$/${1}_$2/; ($yy,$mm)=($1,$2); if ($personal{$date} == 0 && $flag == 0){next;} printf("%04d年%02d月 | ",$yy+1900,$mm); if ($linemax == 0){last;} $width=($personal{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } # for($j=0;$j<$personal{$date};$j=$j+$inc){ # print "*"; # } if ($count{$date} != 0){ $pers=($personal{$date}/$count{$date})*100; } else { $pers=0; } if ($personal{$date} eq ""){$personal{$date}=0;} print " $personal{$date}"; printf(" (%3.2f%%)
\n",$pers); # if ($personal{$date} == 0 && $flag == 0){next;} $flag = 1; $item3++; $p2total = $p2total + $count{$date}; } # $mean1=$total/($#item+1); if ($total != 0){$pers2=($ptotal/$total)*100;} if ($p2total != 0){$pers1=($ptotal/$p2total)*100;} if ($item3 != 0){$mean2=$ptotal/$item3;} print "---------------------
"; print "トータル=$ptotal件、 初書き込み以来月平均="; printf("%3.2f",$mean2); print "件、
"; print "初書き込み以来全体の"; printf("%3.2f%%、",$pers1); print "全書き込みの"; printf("%3.2f%%",$pers2); print "
\n"; } if ($in{choise} eq data15a){ $inc=2; print "$titleprint\n"; &subtitle; print "

\n"; print "$in{hname}」での集計

\n"; open(FILE,"< $filename"); while (){ chop; ($num,$date,$name,@line)=split(/,/); if ($in{perso} eq "nokeep"){ $name=&checkname($name); $hname=&checkname($in{hname}); } else { $hname=$in{hname}; } $date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/; $count{$date}++; $total++; if ($name eq $hname){ $personal{$date}++; $ptotal++; } } close(FILE); @item=keys(%count); @item1=@item; # @item1=(); # foreach (@item){ # s/^(\d?\d\d)_(\d)$/${1}0$2/; # s/^(\d?\d\d)_(\d\d)$/$1$2/; # push(@item1,$_); # } @item1=sort {$a <=> $b} @item1; $flag = 0; @tmp = sort {$a <=> $b} values(%personal); $linemax=$tmp[$#tmp]; foreach $date (@item1){ # $date =~ s/(\d?\d\d)([1-9]\d)/${1}_$2/; # $date =~ s/(\d?\d\d)0(\d)/${1}_$2/; $yy=$date; if ($personal{$date} == 0 && $flag == 0){next;} printf("%04d年 | ",$yy+1900); if ($linemax == 0){last;} $width=($personal{$date}/$linemax)*$rightend; if ($width != 0){ print "\n"; } $pers=($personal{$date}/$count{$date})*100; if ($personal{$date} eq ""){$personal{$date}=0;} print " $personal{$date}"; printf(" (%3.2f%%)
\n",$pers); # if ($personal{$date} == 0 && $flag == 0){next;} $flag = 1; $item3++; $p2total = $p2total + $count{$date}; } # $mean1=$total/($#item+1); if ($item3 != 0){$mean2=$ptotal/$item3;} if ($p2total != 0){$pers1=($ptotal/$p2total)*100;} if ($total != 0){$pers2=($ptotal/$total)*100;} print "---------------------
"; print "トータル=$ptotal件、 初書き込み以来年平均="; printf("%3.2f",$mean2); print "件、
"; print "初書き込み以来全体の"; printf("%3.2f%%、",$pers1); print "全書き込みの"; printf("%3.2f%%",$pers2); print "
\n"; } print "

\n"; print ""; if ($in{ref} eq 'part' || $in{ref} eq 'timeframe' || $compatible == 1){ unlink("$tmpdata"); } exit; sub subtitle { if ($in{ref} eq 'part'){ print "Message#$in{startnum}から$in{endnum}まで

\n"; } elsif ($in{ref} eq 'timeframe'){ $fullsty=$in{styear}+1900; $fulledy=$in{endyear}+1900; print "$fullsty年$in{stmon}月$in{stday}日から$fulledy年$in{endmon}月$in{endday}日まで

\n"; } } } sub gentmpdata { local($filename,$tmpdata); $tmpdata = "$mbdir/tmp.$$"; if ($compatible == 1) { `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; chmod(0666,"$alldata"); $filename="$alldata"; } else { $filename = $mbdata; } if (($in{m1} =~ /^[13578]$/) || ($in{m1} =~ /^1[02]$/)){ $finday = 31; } elsif (($in{m1} =~ /^[469]$/) || ($in{m1} == 11)){ $finday = 30; } elsif ($in{m1} == 2){ $finday = 28; } if ($in{ref} eq 'part'){ open(ALLFILE,"< $filename"); open(TMPFILE,"> $tmpdata"); while(){ ($num,@dum)=split(/,/); if ($num >= $in{startnum} && $num <= $in{endnum}){ print TMPFILE; } if ($num > $in{endnum}){last;} } close(ALLFILE); close(TMPFILE); $filename=$tmpdata; } elsif ($in{ref} eq 'timeframe'){ open(ALLFILE,"< $filename"); open(TMPFILE,"> $tmpdata"); @timetmp=gmtime($time_offset); $firstline=timelocal(0,0,0,$in{stday},$in{stmon}-1,$in{styear},$timetmp[6],$timetmp[7],$timetmp[8]); $endline=timelocal(0,0,0,$in{endday},$in{endmon}-1,$in{endyear},$timetmp[6],$timetmp[7],$timetmp[8]); while(){ ($num,$datecode,@dum)=split(/,/); ($cury,$curm,$curd)=split(/_/,$datecode); $curline=timelocal(0,0,0,$curd,$curm-1,$cury,$timetmp[6],$timetmp[7],$timetmp[8]); if (($curline >= $firstline)&&($curline <= $endline)){ print TMPFILE; } if ($curline > $endline){last;} } close(ALLFILE); close(TMPFILE); $filename=$tmpdata; } return ($filename,$tmpdata); } # 統計の個人名方式で「人物」を選んだ場合に違う名前を同一人物と # 判断させることができます。 # namedef.datにそれらの名前を人物ごとに1行に登録されていると # 一番左の名前が代表として表示されます。 # 例:以下はnamedef.datの内容の例です。 #   ---------------------------------------- #   管理人,作成者,かんりにん #   ホークス,hawks #   ---------------------------------------- # この例では、「作成者」「かんりにん」共に「管理人」と同一人物として # まとめて集計されます。 # 「ホークス」は改行されているので管理人と別人として判断されますが、 # 「hawks」とは同一人物となります。 # namedef.datがない場合は、書き込みの名前そのままで集計されます。 sub checkname { local($name)=@_; open(NAMES,"< $namedef") || return($name); while(){ s/[\r\n]*$//; # instead of chop; (@nicknames)=split(/,/); foreach $nick (@nicknames){ if ("$name" eq "$nick"){ close(NAMES); return($nicknames[0]); } } } close(NAMES); return($name); } ############################################################################# # Search Form mode ########################################################## ############################################################################# sub mbschform { &getmbdata; ($num,$datecode,@dum)=split(/,/,$alldata[$#alldata]); $datecode =~ /^(\d\d+)_\d+_\d+/; $finyear = $1; if ($compatible == 0){ open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } else { open(FILE,"< $mbarchdata") || open(FILE,"< $mbpastdata") || open(FILE,"< $mbdata"); $firstdata = ; close(FILE); } ($num,$datecode,@dum)=split(/,/,$firstdata); $datecode =~ /^(\d\d+)_/; $firstyear = $1; print "Content-Type:text/html\n\n"; print < $mbsrctitle END if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbsrctitle","$mbsrc_logo","$mbsrc_style","$mbsrc_color","$mbsrc_size","$mbsrc_face","$mbsrc_sel","$mbsrc_loc"); print <

$titleprint
  • ブランクにしている項目は無視されます。
  • 本文中に「>」でインデントされている部分(返事のための引用部)は検索しません。
  • 検索結果は1ページで表\\示されるので大量にマッチする検索は表\\示に時間がかかります。
検索範囲
全部  Message# から まで
日付が
名前でサーチ
AND  OR
タイトルでサーチ
AND  OR
本文でサーチ
AND  OR

AND  OR

   

メッセージボードへ

END2 } ############################################################################# # Search mode ############################################################### ############################################################################# sub mbsearch { print "Content-Type: text/html\n\n"; @tmparry=split(/&/,$data); foreach $string (@tmparry){ ($key,$value)=split(/=/,$string); # $value =~ tr/+/ /; # 正規表現のスペシャルな文字に関してエスケープする。 # \=%5C, (=%28, )=%29, [=%5B, ]=%5D, |=%7C # ?=%3F, +=%2B, ^=%5E, $=%24, {=%7B, }=%7D # 圭=%8C%5C、表=%95%5C、ー=%81%5B、望=%96%5D、 # 評=%95%5D、従=%8F%5D、転=%93%5D、余=%97%5D、ゾ=%83%5D、犠=%8B%5D、 $value =~ s/%5[bBcCdDeE]/%5c$&/g; $value =~ s/%2[489B]/%5c$&/g; $value =~ s/%3F/%5c$&/g; $value =~ s/%7[BCD]/%5c$&/g; $value =~ s/[\.\*]/%5c$&/g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # &jcode::convert(*value,'sjis'); $value =~ s//>/g; if ($key ne main){ $br = ""; } else { $br = "
"; } if ($value =~ /\r\n/) { $value =~ s/\r\n/$br/g; } if ($value =~ /\n/) { $value =~ s/\n/$br/g; } if ($value =~ /\r/) { $value =~ s/\r/$br/g; } if ($value =~ /,/) { $value =~ s/,/,/g; } if ($key eq title){ $value =~ s/\'/'/g; } $in{"$key"}=$value; } #if ($compatible == 1){ # `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; # chmod(0666,"$alldata"); # $filename="$alldata"; #} else { # $filename = $mbdata; #} ($filename,$tmpdata) = &gentmpdata; $name = $in{name}; #print "Content-Type: text/html\n\n"; print "\n"; print "\n"; print "\n"; if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print "\n"; print "
\n"; open(FILE,"< $filename") || "die Cannot open file\n"; print "
    \n"; while (){ s/[\r\n]*$//; my $name = $in{name}; my $title = $in{title}; my $main1 = $in{main1}; my $main2 = $in{main2}; my $main3 = $in{main3}; my $nameres = 0; my $titleres = 0; my $main1res = 0; my $main2res = 0; my $main3res = 0; ($lnum,$ldcode,$lname,$lmadd,$lip,$ldate,$ltitle,$lm