#! c:/perl/bin/perl # # nerimb3.cgi # # Revision history # 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がない場合は、書き込みの名前そのままで集計されます。 # # $Id: nerimb3.cgi,v 1.79 2006/04/23 20:52:15 Hideki Kanayama Exp $ use CGI::Carp qw(fatalsToBrowser); use Time::Local; use GD; require "cgi-lib.pl"; $mbsetupfile = "mbsetup.pl"; $admindat = "adminpwd.dat"; $namedef = "namedef.dat"; $rejectlink = "rejectlink.dat"; $mbutil = "mbutil.pl"; $version = "3.129"; $reservedyear = "1997-2006"; $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 = ''; #トップからのSSI表示による更新時間のための予備のアップデートファイル # 1: on, 0: off $update1_file_en = 0; $update2_file_en = 0; $update1_file = "$mbdir/update1.log"; $update2_file = "$mbdir/update2.log"; ######################################################################### 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} = $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 { return ""; } } sub copyright { my $mysite = ('http://www.hidekik.com/','http://www.hidekik.com/en/')[$lang]; print "

$script 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 $im; $image =~ /\.jpe?g$/i and $im = GD::Image->newFromJpeg($imagefile); $image =~ /\.gif$/i and $im = GD::Image->newFromGif($imagefile); $image =~ /\.png$/i and $im = GD::Image->newFromPng($imagefile); $image =~ /\.xbm$/i and $im = GD::Image->newFromxbm($imagefile); $image =~ /\.gd$/i and $im = GD::Image->newFromgd($imagefile); $image =~ /\.gd2$/i and $im = GD::Image->newFromgd2($imagefile); $image =~ /\.xpm$/i and $im = GD::Image->newFromxpm($imagefile); my ($width, $height) = $im->getBounds() if ($im); 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} = $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; print "

\n"; } ############################################################################# # Write mode ################################################################ ############################################################################# sub mbwrite { while(-f "$lockfile"){ sleep(1); } 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\:$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} = $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; print "

\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} = $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"; close(FILE); print "
\n"; print ""; if ($in{ref} eq 'part' || $in{ref} eq 'timeframe' || $compatible == 1){ unlink("$tmpdata"); } exit; } ############################################################################# # Archive Form mode ######################################################### ############################################################################# sub mbarchform { print "Content-Type:text/html\n\n"; print < $mbarctitle END if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } $titleprint=&titleprint("$mbarctitle","$mbarc_logo","$mbarc_style","$mbarc_color","$mbarc_size","$mbarc_face","$mbarc_sel","$mbarc_loc"); print < $titleprint

このページでメッセージボードのアーカイブを作成できます。 下の項目から一つを選び、条件を入力して「作成」をクリックしてください。HTML,圧縮ファイル名は変更できます。ダウンロード後、WinZip等で解凍してブラウザでご覧ください(圧縮は$compmsgで行われています)。作成されたメッセージは、古い順になっています。圧縮ファイルは200件で約30KB、1000件で約150KBになります。画像は表\\示されません。

最新200件
Message#から最新メッセージまで
Message#からMessage#まで
HTMLファイル名:
圧縮ファイル名:
 

メッセージボードへ
END2 } ############################################################################# # Archive mode ############################################################## ############################################################################# sub mbarch { $outfile="$mbdir/$in{htmlname}"; $zipfile="$mbdir/$in{archname}"; if ($in{choice} eq "unread"){ $to=&newnum; $from=&getcookie+1; } elsif ($in{choice} eq "new200") { $to=&newnum; $from=$to-199; if ($from < 1) {$from = 1;} } elsif ($in{choice} eq "tillnew") { $to=&newnum; $from=$in{start1}; } elsif ($in{choice} eq "fromto") { $to=$in{end2}; $from=$in{start2}; } else { print "Content-type: text/html\n\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"; print "\n"; exit; } if ($compatible == 1){ $infile="$alldata"; `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; } else { $infile = $mbdata; } &printmb($from,$to,$infile,$outfile); chmod(0666,"$outfile"); if (-e $zipfile){unlink($zipfile);} `$compress $outfile`; if (-e "$outfile.gz"){ if ("$outfile.gz" ne "$zipfile"){rename("$outfile.gz","$zipfile");} chmod(0666,"$zipfile"); print "Location: $zipfile\n\n"; } else { print "Content-type: text/html\n\n"; print "\n"; print "
 
ファイルが作成されませんでした。圧縮コマンドの設定が正しくないと思われます。管理人へ連絡してください。
\n"; print "\n"; } exit; sub getcookie { $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} = $value; } return($COOKIE{done}); } sub newnum { open(FILE,"< $mbdata"); while (){ ($fin,@dummy)=split(/,/); } close(FILE); return($fin); } sub printmb { local($from,$to,$infile,$outfile)=@_; $titleprint=&titleprint("$mbtitle","$mblogo","$logo_style","$logo_color","$logo_size","$logo_face","$logo_sel","$logo_loc"); open(OUTMB,">$outfile"); print OUTMB "\n"; print OUTMB "\n"; print OUTMB "\n"; print OUTMB "\n"; print OUTMB "\n"; print OUTMB "$mbtitle\n"; if ($head_insert_en == 1){ print OUTMB "$head_insert\n"; } if ($style_sheet_en == 1){ print OUTMB "\n"; } print OUTMB "\n"; print OUTMB"\n"; print OUTMB "$titleprint\n"; if ($in{choice} eq "unread"){ print OUTMB "

未読分

\n"; } elsif ($in{choice} eq "new200") { print OUTMB "

$from - $to(最新200件)

\n"; } elsif ($in{choice} eq "tillnew") { print OUTMB "

$from - $to(最新まで)

\n"; } elsif ($in{choice} eq "fromto") { print OUTMB "

$from - $to

\n"; } print OUTMB "
\n"; print OUTMB "
"; open(INMB,"< $infile"); while(){ chop; ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/); &replace_color($user_name_color,$user_title_color,$user_text_color); if ($number >= $from && $number <= $to){ print OUTMB ""; # print OUTMB ""; print OUTMB "
Message#${number} $date
"; @darray = split(/[^\d]/,$date); @darray2 = split(/_/,$datecode); print OUTMB "
Message#${number} "; $dy = $darray2[0]+1900; if ($darray2[0] == 97 || ($darray2[0] == 98 && $darray2[1] < 7) || ($darray2[0] == 98 && $darray2[1] == 7 && $darray2[2] < 25)){ $date = "${dy}年" . $date; } else { $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; } print OUTMB "$date
"; print OUTMB "From: "; if ($mail ne ""){ print OUTMB "${name}" } else { print OUTMB "$name"; } if ($namesan_en == 1){ print OUTMB "$namesan"; } if ($mail ne "" && $maildisp_en == 1){ print OUTMB " ($mail)" } print OUTMB "
 
"; @sub2=split(/Re:/,$subject); print OUTMB "
"; if ($#sub2 > 1){ print OUTMB "Re$#sub2:$sub2[$#sub2]"; } else { print OUTMB "$subject"; } # print OUTMB "

$subject

"; print OUTMB "
"; if ($link_samewin_en == 1){ $link_target = '_top'; } else { $link_target = '_blank'; } @mainarry=split(/<[bB][rR]>/,$main); print OUTMB ""; print OUTMB ""; print OUTMB ""; print OUTMB "
"; print OUTMB ""; print OUTMB ""; foreach (@mainarry){ $_ = &replace_link($_,$number); $_ = &replace_tag($_); if(/^(\>)(.*)$/){ print OUTMB "$1$2"; } else { print OUTMB; } print OUTMB "
"; } print OUTMB "
"; print OUTMB "

\n"; } } print OUTMB "
\n"; print OUTMB "\n"; print OUTMB "\n"; close(INMB); close(OUTMB); } } ############################################################################# # Past mode ################################################################# ############################################################################# sub mbpast { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time_offset); if ($compatible == 1){ open(ALL,"< $mbpastdata"); while(){$fin=$_}; close(ALL); chop($fin); } else { open(FILE,"< $mbdata"); while(){ push(@alldata,$_); if ($#alldata >= 201){ shift(@alldata); } }; close(FILE); $fin = $alldata[0]; shift(@alldata); } ($endline,$findate,@dummy)=split(/,/,$fin); ($finyy,$finmm,$findd)=split(/_/,$findate); $how = 1; $endline2=$endline; if ($ENV{"REQUEST_METHOD"} eq "GET"){ $ago=$in{number}; $lin = 99; if ($in{number} ne ""){ $endline = $in{number}; $lin=$in{lin}; # if ($in{title} eq on){$t='title';} } $start = $endline - $lin; if ($in{title} eq on){$t='title';} if ($in{imlist} eq on){$t='imlist';} } elsif ($ENV{"REQUEST_METHOD"} eq "POST"){ if ($in{title} eq on){$t = 'title'}; if ($in{imlist} eq on){$t='imlist';} if ($in{see1} ne ""){ $ago=$in{endline}; $tmpline = $endline; # if ($ago > $tmpline){$ago=$tmpline;} $endline=$ago; $lin = $in{start} - 1; $start=$ago - $lin; } if ($in{see2} ne ""){ $yy=$in{yy}; $mm=$in{mm}; $dd=$in{dd}; $how=$in{how}; $finyy = $yy; $finmm = $mm; $findd = $dd; $in{start}=""; $in{endline}=""; $lin = 99; $fromtime=timelocal($sec,$min,$hour,$dd,$mm-1,$yy,$wday,$yday,$isdst); } } if ($start < 1){ $start = 1; } @pastdata=(); @numlist=(); if ($in{mode} eq 'print'){ @numlist=split(/\,/,$in{message}); @continiouslist = grep(/-/,@numlist); @numlist = grep(!/-/,@numlist); foreach (@continiouslist){ ($aa,$bb) = split(/-/); ($aa,$bb) = sort {$a <=> $b} ($aa,$bb); foreach $cc ($aa .. $bb){push(@numlist,$cc);} } @numlist = sort {$a <=> $b} @numlist; } if ($in{mode} eq 'print' && ($compatible == 0 || $endline2 < $numlist[0])){ $pastfile = "$mbdata"; } elsif ($in{mode} eq 'print' && $compatible == 1){ `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; chmod(0666,"$alldata"); $pastfile = "$alldata"; } elsif ($endline2 < $ago && $endline2 < $ago - $lin){ $pastfile = "$mbdata"; } elsif ($endline2 >= $ago - $lin && $compatible == 1) { `$cat $mbarchdata $mbpastdata $mbdata > $alldata`; chmod(0666,"$alldata"); $pastfile = "$alldata"; } else { if ($compatible == 1){ ($a_dev,$a_ino,$a_mode,$a_nlink,$a_uid,$a_gid,$a_rdev,$a_size,$a_atime,$a_mtime,$a_ctime,$a_blksize,$a_blocks)=stat("$mbpastdata"); ($p_dev,$p_ino,$p_mode,$p_nlink,$p_uid,$p_gid,$p_rdev,$p_size,$p_atime,$p_mtime,$p_ctime,$p_blksize,$p_blocks)=stat("$pastall"); if ($a_mtime > $p_mtime){ `$cat $mbarchdata $mbpastdata > $pastall`; chmod(0666,"$pastall"); } $pastfile = "$pastall"; } else { $pastfile = $mbdata; } } open(ALL,"<$pastfile"); while(){ chop; ($number,$dates,@dummy)=split(/,/); if ($in{mode} eq 'print'){ if (grep(/^$number$/,@numlist)){ push(@pastdata,$_); } } else { if (($in{see1} ne "") || ($ENV{"REQUEST_METHOD"} eq "GET")){ if ($number >= $start && $number <= $endline){ push(@pastdata,$_); } } elsif ($in{see2} ne ""){ for($ld=0;$ld<$how;$ld++){ $thattime = $fromtime - $ld*86400; ($sec,$min,$hour,$dd,$mm,$yy,$wday,$yday,$isdst)=gmtime($thattime); $mm2=$mm+1; if ("${yy}_${mm2}_${dd}" eq $dates){ push(@pastdata,$_); } } } } } close(ALL); @pastdata = reverse(@pastdata); print "Content-Type: text/html\n\n"; print ""; print < $mbtitle HEADPRINT if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print ""; #print "
\"$mbtitle\"
"; print "$body_insert1" if ($body_insert1_en == 1); print "
\n"; print "\n"; print "
タイトル "; if ($image_en) { print "画像"; } print "
"; print "Message#"; print ""; print "から前"; print ""; print "件を"; print "

"; print "
年\n"; print "月\n"; print "日から\n"; print ""; print "前を"; print "
"; print "
"; &getmbdata; &disphead(1); print "
\n"; if ($start != 1 && $in{mode} ne 'print'){ $start2=$start-1; if ($endline2 >= $ago){ if ($t eq 'title') { print "更に前100件 "; } else { print "更に前100件 "; } } } print "
"; if (($t eq 'title' or $t eq 'imlist') && $lin != 0) {print "
    \n";}; foreach $count (0 .. $#pastdata){ ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$pastdata[$count]); &replace_color($user_name_color,$user_title_color,$user_text_color); if ($t eq 'imlist' && $lin != 0) { chomp($imagefile); next if ($imagefile eq '' or ! -e "$imagedir/$imagefile"); print "
  • #${number}、"; @sub2=split(/Re:/,$subject); if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$subject"; } @darray = split(/[^\d]/,$date); @darray2 = split(/_/,$datecode); $dy = $darray2[0]+1900; if ($darray2[0] == 97 || ($darray2[0] == 98 && $darray2[1] < 7) || ($darray2[0] == 98 && $darray2[1] == 7 && $darray2[2] < 25)){ $date = "${dy}年" . $date; } else { $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; } print " ........ $date
    \n"; ($imagefile,$w,$h)=&get_image_size($imagefile,$ssiimage_w,$ssiimage_h); print ""; print &image_tag($imagefile,$w,$h); print ""; print "
  • \n"; } elsif ($t eq 'title' && $lin != 0) { print "
  • #${number}、"; @sub2=split(/Re:/,$subject); if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$subject"; } @darray = split(/[^\d]/,$date); @darray2 = split(/_/,$datecode); $dy = $darray2[0]+1900; if ($darray2[0] == 97 || ($darray2[0] == 98 && $darray2[1] < 7) || ($darray2[0] == 98 && $darray2[1] == 7 && $darray2[2] < 25)){ $date = "${dy}年" . $date; } else { $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; } print " ........ $date
  • \n"; } else { print ""; # print ""; print "
    Message#${number} $date
    "; @darray = split(/[^\d]/,$date); @darray2 = split(/_/,$datecode); print "
    Message#${number} "; $dy = $darray2[0]+1900; if ($darray2[0] == 97 || ($darray2[0] == 98 && $darray2[1] < 7) || ($darray2[0] == 98 && $darray2[1] == 7 && $darray2[2] < 25)){ $date = "${dy}年" . $date; } else { $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 "" && $maildisp_en == 1){ print " ($mail)" } print "
     
    "; @sub2=split(/Re:/,$subject); print "
    "; if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$subject"; } print "
    "; print ""; if ($link_samewin_en == 1){ $link_target = '_top'; } else { $link_target = '_blank'; } $main =~ s/\(#(\d+)\)/\(#$1<\/a>\)/g; $main =~ s/(message)#(\d+)/$1#$2<\/a>/gi; @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"; } } if (($t eq 'title' or $t eq 'imlist') && $lin != 0) {print "

\n";}; if ($start != 1 && $in{mode} ne 'print'){ $start2=$start-1; if ($endline2 >= $ago){ if ($t eq 'title') { print "更に前100件 "; } else { print "更に前100件 "; } } } print "
\n"; &disptail; ©right; print ""; print ""; } ############################################################################# # namedef form mode ######################################################### ############################################################################# sub mbnamedef { if ($in{pwd} eq ''){ print "Content-Type: text/html\n\n"; print "\n"; print "\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"; print "
管理者用パスワードを入力してください。
\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; exit; } if (open(FILE,"< $admindat")){; $filepwd = ; close(FILE); $inpwd = crypt($in{pwd},$filepwd); } else { print "Content-type:text/html\n\n"; print ""; print "パスワードファイルが存在しません。"; print ""; exit; } if ("$inpwd" ne "$filepwd") { print "Content-type:text/html\n\n"; print ""; print "
パスワードが違います。"; print "
"; print ""; exit; } print "Content-Type: text/html\n\n"; print < namedef form

namdef form

END print "
\n"; print "\n"; if (open(NAMEDEF,"< $namedef")){ @namelist=; close(NAMEDEF); } $datanum=$#namelist; print < namedef.datにそれらの名前を人物ごとに1行に登録されていると一番左の名前が代表\\として表\\示されます。
例:以下はnamedef.datの内容の例です。
  ----------------------------------------
  管理人,作成者,かんりにん
  ホークス,hawks
  ----------------------------------------
この例では、「作成者」「かんりにん」共に「管理人」と同一人物としてまとめて集計されます。
「ホークス」は改行されているので管理人と別人として判断されますが、「hawks」とは同一人物となります。
namedef.datがない場合は、書き込みの名前そのままで集計されます。
各名前は、半角カンマで区切ってください。
同一人物名のリストに表\\示名を含む必要はありません。

EXPLAIN print "\n"; print "\n"; $i=0; foreach (@namelist){ s/[\n\r]*$//; # instead of a chop /^([^,]+),(.+)$/; $main_name = $1; $sub_name=$2; print "\n"; print "\n"; print "\n"; print "\n"; $i = $i + 1; } for ($i2=$i;$i2<$i+3;$i2=$i2+1){ print "\n"; print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "
表\\示名表\\示名とみなされる同一人物名のリスト
\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "
管理人パスワード
\n"; print "

\n"; print "\n"; } ############################################################################# # namedef write mode ######################################################### ############################################################################# sub mbnamedefwr { if (open(FILE,"< $admindat")){; $filepwd = ; close(FILE); $inpwd = crypt($in{pwd},$filepwd); } else { print "Content-type:text/html\n\n"; print ""; print "パスワードファイルが存在しません。"; print ""; exit; } if ("$inpwd" ne "$filepwd") { print "Content-type:text/html\n\n"; print ""; print "
パスワードが違います。"; print "
"; print ""; exit; } foreach (keys(%in)){ /main_(\d+)/ && push(@numbers,$1); } @numbers = sort {$a <=> $b} @numbers; open(FILE,"> $namedef"); foreach (@numbers){ $main = "main_$_"; if ("$in{$main}" eq ''){next;} $sub = "sub_$_"; $in{$sub} =~ s/,/,/g; $in{$sub} =~ s/>/>/g; $in{$sub} =~ s/<//g; $in{$main} =~ s/</ 199){$next = 199}; $prev = $mesnum - 1; if ($prev < 0){$prev = 0;} print ""; print <MB read HEADPRINT print "
"; print "書く \n"; #print "書く
"; if ($mesnum != 0) { print "\n"; } else { print "↑\n"; } if ($mesnum != $#alldata){ print "\n"; } else { print "↓\n"; } print "
"; print "$top_link_title \n"; print "最新
\n
\n"; ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile)=split(/,/,$alldata[$mesnum]); print "#${number} "; @darray = split(/[^\d]/,$date); $dy = $darray[0]+1900; $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; print "$date
"; print "From: $name"; if ($namesan_en == 1){ print "$namesan"; } print "
\n"; @sub2=split(/Re:/,$subject); if ($#sub2 > 1){ print "Subject: Re$#sub2:$sub2[$#sub2]"; } else { print "Subject: $subject"; } print " [返事]

\n"; #print " [返事]

"; print "
\n"; if ($imode_image == 1 && $imagefile ne '' && -e "$imagedir/$imagefile"){ ($imagefile,$width,$height)=&get_image_size($imagefile,$imode_image_x,$imode_image_y); print &image_tag($imagefile,$width,$height); print "
"; } @mainarry=split(/<[bB][rR]>/,$main); foreach $eachline (@mainarry){ $eachline = &replace_link($eachline,$number); $eachline = &replace_tag($eachline); if($eachline =~ /^(\>)(.*)$/){ print "$1$2"; } else { print "$eachline"; } print "
"; } print "\n
\n"; print "\n


\n"; print "
書く \n"; if ($mesnum != 0) { print "\n"; } else { print "↑\n"; } if ($mesnum != $#alldata){ print "\n"; } else { print "↓\n"; } print "
"; print ""; } ############################################################################# # 携帯モード Write mode ######################################################### ############################################################################# sub mbiwrite { while(-f "$lockfile"){ sleep(1); } open(LOCK,"> $lockfile"); close(LOCK); $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}"; 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 ($in{name} eq "" || $in{subject} eq "") { &error('名前とタイトルは必ず書いてください。'); } if ($in{addr} =~ /[^$mail_pattern]/){ &error("$in{addr}:無効なメールアドレスです"); } if ($member_only == 1 && ($in{member_pwd} ne "$member_pwd")) { &error('メンバー専用パスワードが違います。'); } if ($compatible == 1){ push(@alldata,"$number,$datecode,$in{name},$in{addr},${ip}_${host},$date_now,$in{subject},$main,$encpwd\n"); open(FILE,">$mbdata") || &error("$mbdataを開けません。"); print FILE @alldata; close(FILE); } else { open(FILE,">>$mbdata") || &error("$mbdataを開けません。"); print FILE "$number,$datecode,$in{name},$in{addr},${ip}_${host},$date_now,$in{subject},$main,$encpwd\n"; close(FILE); } chmod(0666,"$mbdata"); print "Content-Type: text/html\n\n"; print ""; print "
書き込みました。
"; print "読むへ"; &extraupdate; unlink("$lockfile"); } ############################################################################# # 携帯モード Write Form mode #################################################### ############################################################################# sub mbiwrform { print "Content-Type:text/html\n\n"; print <MB Write
名前(必須)

タイトル(必須)

内容

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

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

END2 } print <
END3 } ############################################################################# # 携帯モード Res Form mode ###################################################### ############################################################################# sub mbiresform { $resnum = $in{number}; &getmbdata; @resdata = grep(/^$resnum,/,@alldata); ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$resimagefile)=split(/,/,$resdata[0]); print "Content-Type: text/html\n\n"; print <MB res

名前(必須)

タイトル(必須)

内容

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

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

END2 } print <
END3 } ############################################################################# # Back up mode ############################################################## # このモードはどこからもリンクされていません。 # これを実行するときは、直接URLをタイプして実行してください。 # このモードは、Version1.0 コンパチブルモードのみ有効です。 # # 動作説明: # $mbpastdataから1行だけを残して$mbarchdataにメッセージを移動します。 # # サーバーの書き込みデータをローカルディスクにコピーする手順: # ftpで$mbdataと$mbpastdataをローカルディスクにコピーする。 # ブラウザで$mbbackupを実行する。 # ローカルディスクでも$mbbackupを実行する。 # その後過去の全データは$mbarchdataに貯蓄されて少ない$mbpastdataと # $mbdataだけをftpでコピーすればバックアップが取れることになる。 # またログが貯まってきたら同じ作業をする。 ############################################################################# sub mbbackup { if ($in{pwd} eq ''){ print "Content-type:text/html\n\n"; print "\n"; if ($head_insert_en == 1){ print "$head_insert\n"; } if ($style_sheet_en == 1){ print "\n"; } print "\n"; print ""; print "

管理者用パスワードを入力してください。"; print "
"; print ""; print ""; print ""; print "
"; print ""; } else { open(FILE,"< $admindat"); $adminpwd = ; close(FILE); if (crypt($in{pwd},$adminpwd) ne "$adminpwd") { print "Content-type:text/html\n\n"; print ""; print "
パスワードが違います。"; print "
"; print ""; } else { while(-f "$lockfile"){ sleep(1); } if ($compatible == 1){ if (! open(PAST, "< $mbpastdata")){ print "Content-type:text/html\n\n"; print ""; print "
メッセージが200件以上貯まってからこの作業を行ってください。"; print ""; exit; } open(LOCK,"> $lockfile"); close(LOCK); @pastdata = ; close(PAST); $pastline = $#pastdata; open(ARCH, ">> $mbarchdata"); print ARCH @pastdata[0..$pastline-1]; close(ARCH); open(PAST, "> $mbpastdata"); print PAST $pastdata[$pastline]; close(PAST); print "Content-type:text/html\n\n"; print ""; print "
バックアップは作成されました。"; print ""; unlink("$lockfile"); } else { print "Content-type:text/html\n\n"; print ""; print "
データファイルがVersoin 1.0とコンパチブルではありません。"; print ""; } } } } ############################################################################# # SSI mode ################################################################## ############################################################################# sub mbssi { &getmbdata; @alldata = reverse @alldata; print "Content-Type: text/html\n\n"; for ($i=0;$i<$ssiken;$i++){ ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile)=split(/,/,$alldata[$i]); print ""; @darray = split(/[^\d]/,$date); print "\n"; print ""; print "
#${number}, "; $dy = $darray[0]+1900; $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; @sub2=split(/Re:/,$subject); if ($#sub2 > 1){ print "Re$#sub2:$sub2[$#sub2]"; } else { print "$subject"; } print ", $name"; if ($namesan_en == 1){ print "$namesan"; } print ", $date"; if ($link_samewin_en == 1){ $link_target = '_top'; } else { $link_target = '_blank'; } @mainarry=split(/<[bB][rR]>/,$main); print "
"; if ($ssiimage_en and $imagefile and -e "$imagedir/$imagefile"){ if ($image_samewin_en == 1){ $newwin = ''; } else { $newwin = 'target="_blank"'; } ($imagefile,$w,$h)=&get_image_size($imagefile,$ssiimage_w,$ssiimage_h); print "\n"; print &image_tag($imagefile,$w,$h); print "
\n"; } if ($#mainarry < $in{line}-1){ $endline = $#mainarry; } else { $endline = $in{line}-1; } foreach (0 .. $endline){ $eachline = $mainarry[$_]; $eachline = &replace_link($eachline,$number); $eachline =~ s/\(#(\d+)\)/\(#$1<\/a>\)/g; $eachline =~ s/(message)#(\d+)/$1#$2<\/a>/gi; $eachline = &replace_tag($eachline); if($eachline =~ /^(\>)(.*)$/){ print "$1$2"; } else { print "$eachline"; } print "
"; } print "
\n"; } print "$gotomb"; } ############################################################################# # Unlock mode ############################################################## ############################################################################# sub mbunlock { if (-e "$lockfile"){ unlink("$lockfile"); print "Content-type:text/html\n\n"; print ""; print "
lock fileは削除されました。"; print ""; } else { print "Content-type:text/html\n\n"; print ""; print "
lock fileは存在しませんでした。"; print ""; } } ############################################################################# # Miscellanious ############################################################ ############################################################################# sub mbdecode { local(%in) = @_; while (($key,$value)=each %in){ $flag{$key} = $value; } if ($flag{mode} eq "search"){ if ($ENV{"REQUEST_METHOD"} eq "GET"){ $data=$ENV{"QUERY_STRING"}; $method = 'GET'; } elsif ($ENV{"REQUEST_METHOD"} eq "POST"){ read(STDIN,$data,$ENV{"CONTENT_LENGTH"}); $method = 'POST' } @tmparry=split(/&/,$data); foreach $string (@tmparry){ ($key,$value)=split(/=/,$string); $in{"$key"}=$value; } } while (($key,$value)=each %in){ if ($key eq 'imagefile'){next;} # $value =~ tr/+/ /; if ("$flag{mode}" eq "search"){ # 正規表現のスペシャルな文字に関してエスケープする。 # \=%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'); if ($key ne main && $key ne style_sheet && $key !~ /insert/){ $br = ""; } else { $br = "
"; } $value =~ s/>/>/g; # When $tag_use==1, to be able to write <...> $value =~ s/</</g; # When $tag_use==1, to be able to write <...> $value =~ s//>/g; 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 subject){ $value =~ s/\'/'/g; } $in{"$key"}=$value; } return(%in); } sub mbcook { ($secg,$ming,$hourg,$mdayg,$mong,$yearg,$wdayg,$ydayg,$isdstg) = gmtime(time + 365*1*24*60*60); $yearg = $yearg + 1900; if ($yearg < 10) { $yearg = "0$yearg"; } if ($secg < 10) { $secg = "0$secg"; } if ($ming < 10) { $ming = "0$ming"; } if ($hourg < 10) { $hourg = "0$hourg"; } if ($mdayg < 10) { $mdayg = "0$mdayg"; } $y0="Sunday"; $y1="Monday"; $y2="Tuesday"; $y3="Wednesday"; $y4="Thursday"; $y5="Friday"; $y6="Saturday"; $youbi = ($y0,$y1,$y2,$y3,$y4,$y5,$y6) [$wdayg]; $m0="Jan"; $m1="Feb"; $m2="Mar"; $m3="Apr"; $m4="May"; $m5="Jun"; $m6="Jul"; $m7="Aug"; $m8="Sep"; $m9="Oct"; $m10="Nov"; $m11="Dec"; $month = ($m0,$m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10,$m11) [$mong]; $date_gmt = "$youbi, $mdayg\-$month\-$yearg $hourg:$ming:$secg GMT"; return($date_gmt); } sub makecrypt { my $plain = shift; my $salt = join "", ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]; my $result = crypt($plain,$salt) or crypt($plain,'$1$'.$salt.'$'); return $result; } sub setadminpwd { print "Content-type:text/html\n\n"; print "\n"; print "\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"; if ($in{mode} eq 'setup'){ print "
管理者用パスワードを入力してください。
\n"; print "\n"; print "\n"; print "\n"; if ($utility_en == 1){ print "
\n"; print "セットアップ\n"; print "ユーティリティ\n"; } } else { print "
管理者用パスワードを設定してください。
\n"; print "\n"; print "\n"; print "\n"; } print "
\n"; print "\n"; exit; } sub wradminpwd { $passwd = &makecrypt($in{pwd}); if (open(FILE,"> $admindat")){ print FILE "$passwd"; close(FILE); } else { print "Content-type:text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "パスワードファイル作成に失敗しました\n"; print "\n"; print "\n"; print "パスワードファイル作成に失敗しました。"; print "\n"; exit; } } ########################################################################### # Setup files form ######################################################## ########################################################################### sub asksetup { if (open(FILE,"< $admindat")){; $filepwd = ; close(FILE); $inpwd = crypt($in{pwd},$filepwd); } else { print "Content-type:text/html\n\n"; print "\n"; print "\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 "パスワードファイルが存在しません。"; print ""; exit; } $period = join(',',@period); $compatible_check[$compatible] = "checked"; $logo_check[$logo_sel] = "checked"; $mbwr_check[$mbwr_sel] = "checked"; $mbres_check[$mbres_sel] = "checked"; $mbsum_check[$mbsum_sel] = "checked"; $mbarc_check[$mbarc_sel] = "checked"; $mblink_check[$mblink_sel] = "checked"; $mbsrc_check[$mbsrc_sel] = "checked"; $mbdel_check[$mbdel_sel] = "checked"; $mbedit_check[$mbedit_sel] = "checked"; $logo_loc_check[$logo_loc] = "checked"; $mbwr_loc_check[$mbwr_loc] = "checked"; $mbres_loc_check[$mbres_loc] = "checked"; $mbsum_loc_check[$mbsum_loc] = "checked"; $mbarc_loc_check[$mbarc_loc] = "checked"; $mblink_loc_check[$mblink_loc] = "checked"; $mbsrc_loc_check[$mbsrc_loc] = "checked"; $mbdel_loc_check[$mbdel_loc] = "checked"; $mbedit_loc_check[$mbedit_loc] = "checked"; $bgimage_check[$bgimage_en] = "checked"; $summary_check[$summary_en] = "checked"; $archive_check[$archive_en] = "checked"; $link_check[$link_en] = "checked"; $title_check[$title_en] = "checked"; $imlist_check[$imlist_en] = "checked"; $search_check[$search_en] = "checked"; $imode_check[$imode_en] = "checked"; $imode_image_check[$imode_image] = "checked"; $delete_check[$delete_en] = "checked"; $dellog_save_check[$dellog_save] = "checked"; $pastlog_save_check[$pastlog_save] = "checked"; $modify_check[$modify_en] = "checked"; $usage_check[$usage_en] = "checked"; $setup_check[$setup_en] = "checked"; $utility_check[$utility_en] = "checked"; $link_samewin_check[$link_samewin_en] = "checked"; $top_link_check[$top_link_en] = "checked"; $update1_file_check[$update1_file_en] = "checked"; $update2_file_check[$update2_file_en] = "checked"; $namesan_check[$namesan_en] = "checked"; $ressan_check[$ressan_en] = "checked"; $image_check[$image_en] = "checked"; $image_samewin_check[$image_samewin_en] = "checked"; $style_sheet_check[$style_sheet_en] = "checked"; $head_insert_check[$head_insert_en] = "checked"; $maildisp_check[$maildisp_en] = "checked"; $tag_use_check[$tag_use] = "checked"; $autolink_when_tag_is_on_check[$autolink_when_tag_is_on] = "checked"; $autolink_head_only_check[$autolink_head_only] = "checked"; $member_only_check[$member_only] = "checked"; $body_insert1_check[$body_insert1_en] = "checked"; $body_insert2_check[$body_insert2_en] = "checked"; $body_insert3_check[$body_insert3_en] = "checked"; $body_insert4_check[$body_insert4_en] = "checked"; $user_name_color_check[$user_name_color_en] = "checked"; $user_title_color_check[$user_title_color_en] = "checked"; $user_text_color_check[$user_text_color_en] = "checked"; $ssiimage_check[$ssiimage_en] = "checked"; $attach_icon_check[$attach_icon_en] = "checked"; print "Content-type:text/html\n\n"; print "\n"; print "\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"; if ("$inpwd" eq "$filepwd"){ print "
\n"; print "\n"; print "\n"; #if (open(SETUP,"< $mbsetupfile")){ # $perlpath = ; # $perlpath =~ s/^#\! *(.+) *[\r\n]*$/$1/; # close(SETUP); #} else { # $perlpath = "/usr/local/bin/perl"; #} print <
  • セットアップリンクを非表\\示にしている場合は、$script?mode=setupからパスワードを入力してこのページに入ってください。
  • 削除機能\\を無効にしている場合は、$script?mode=deleteから削除するメッセージを選んで管理用パスワードで削除してください。
  • 変更機能\\を無効にしている場合は、$script?mode=edit&resnum=<number>で変更するメッセージナンバーを入力して変更してください。
  • 数字やカラー指定は必ず半角で指定してください。全角やブランクだとCGIが起動しなくなります。万一間違って全角で書いてしまった場合は、$mbsetupfileをエディタで開きその場所を半角に正しく修正してください。それで直ります。
データディレクトリ 画像格納ディレクトリ データファイル 過去のデータファイル Ver.1.0 コンパチブル インコンパチブル
以下はVersion1.0 コンパチブルモードのみ有効
\$mbpastdata =
\$mbarchdata =
\$pastall =
\$alldata = 削除変更元記事の保存 有効 無効
保存ファイル名 200件以前の過去記事の保存 有効 無効 使い方の説明 ロックファイル バックグランド 画像を使う カラー設定にする
画像を使う場合の画像ファイル
カラー設定の場合のカラー番号(白:#ffffff 又は white) 各記事のタイトル、色、サイズ 色:color= サイズ:size= フォント:face= 名前の色 color= 返信引用記事の色 カラー番号又はカラー名(default : #804040) 記事本文の色 カラー番号又はカラー名(default : black) 個人投稿記事色設定 名前の色 有効 無効
タイトルの色 有効 無効
本文の色 有効 無効
記事本文の表\\示幅 ブラウザ全体の% メッセージボードタイトル名
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 書き込みタイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 返事タイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 統計タイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 アーカイブタイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 リンクタイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 サーチタイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 削除タイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 変更タイトル
無し
デフォルト<H2></H2>
テキスト color= size= face=
ロゴ画像
スタイルシート
位置: 右 トップへのリンク 表\\示 非表\\示
リンク名
URL
名前欄のメールアドレス 表\\示 非表\\示
クッキー名1 クッキー名2 Message#キリ番設定 統計で使われるMessage#のキリ番
画像アップ機能\\ 有効 無効 統計 有効 無効 アーカイブ 有効 無効 リンク 有効 無効 タイトルリスト 有効 無効 画像リスト 有効 無効 サーチ 有効 無効 携帯モード 有効 無効 削除 有効 無効 変更 有効 無効 使い方 有効 無効 セットアップ表\\示 表\\示 非表\\示 ユーティリティ選択 有り 無し 自動リンククリック時 同じウィンドウ 別ウィンドウ 画像クリック時 同じウィンドウ 別ウィンドウ 画像表\\示サイズ 横幅
縦幅 画像アップサイズ KB
携帯モードでの画像表\\示 表\\示 非表\\示
横幅
縦幅 サポート外の画像ファイルがアップされた場合の表\示 <Attachment>表\示 アイコン使用
アイコンファイル タグ使用 不可
タグ使用可の時のhttp://からの文字列への自動リンク 有効 無効 自動リンクの適用 http://が行頭にある場合のみ 文中どこでも
タグ使用を「可」にして自動リンクを「有効」にし、適用を「文中どこでも」にすると<a href>や<img>タグ内のhttpさえも自動リンクされるのでそれらのタグがくずれます。 名前欄の敬称 あり なし
敬称
返信コメントでの敬称 あり なし
敬称
書き込みのメンバー制限 有効 無効
メンバー用パスワード(半角英数で)
SSIモード設定 SSIモードを使用するHTMLファイルから見たこのスクリプトへの相対パス、又はhttp://からのフルパス
続き表\\示リンクの文字列
SSIモードでの表\\示ライン数のデフォルト
SSIモードでの表\\示件数

上の表\示ラインの行数は全ての表\示件数に適用されます。 SSIモードで画像表\\示
表\\示 非表\\示
高さ <head>内挿入文 有効 無効
HTML書式
ポップアップ広告やJavascript、<META>を挿入したい場合にここに記述する。
以下の記述が<head>〜</head>内に挿入される。

スタイルシート 有効 無効

<body>内挿入文 メッセージボード上部に表\\示される文をHTMLで記述。ルールやコメント、広告やアクセスカウンタ、リンクなど記すことができます。
メッセージボードタイトルの上 有効 無効

メッセージボードタイトルの下 有効 無効

「新規書き込み」リンクの上 有効 無効

「新規書き込み」リンクの下 有効 無効

時間設定 GMTより時間(日本:+9時間) gzip コマンド
アーカイブで使用されます。アーカイブ機能\\をオフにするとこの設定は無視されます。 cat コマンド
Ver.1コンパチブルモードでの統計、アーカイブ、200件以前、サーチ、リンクで使用されます。Ver.1インコンパチブルに設定するとこの設定は無視されます。 棒グラフの棒 統計で使用されます。 予\\備のアップデートファイル 1 使用 非使用 ファイル名
使用 非使用 ファイル名
END print ""; print ""; } else { print "
パスワードが違います。
"; } print ""; exit; } ########################################################################### # Setup files write ####################################################### ########################################################################### sub makesetup { if (open(FILE,"< $admindat")){; $filepwd = ; close(FILE); $inpwd = crypt($in{pwd},$filepwd); } else { print "Content-type:text/html\n\n"; print ""; print "パスワードファイルが存在しません。"; print ""; exit; } #print "Content-Type: text/html\n\n"; #$item_value1 = ''; #foreach (keys(%in)){ # print "$_:$in{$_}
"; #} #exit; $in{post_title_size} =~ s/ /+/; $in{logo_size} =~ s/ /+/; $in{mbwr_size} =~ s/ /+/; $in{mbres_size} =~ s/ /+/; $in{mbsum_size} =~ s/ /+/; $in{mbarc_size} =~ s/ /+/; $in{mblink_size} =~ s/ /+/; $in{mbsrc_size} =~ s/ /+/; $in{mbdel_size} =~ s/ /+/; $in{mbedit_size} =~ s/ /+/; foreach (keys(%in)){ $in{$_} =~ s/
/\n/g; $in{$_} =~ s/,/,/g; $in{$_} =~ s/<//g; } #$in{period} =~ s/,/,/g; if ("$inpwd" eq "$filepwd"){ open(SETUP,"> $mbsetupfile"); print SETUP <〜内に挿入できる構\\文 1:on, 0:off \$head_insert_en = $in{head_insert_en}; \$head_insert = '$in{head_insert}'; #スタイルシート 1:on 0:off \$style_sheet_en = $in{style_sheet_en}; \$style_sheet = '$in{style_sheet}'; #メッセージボード上部に表\\示させる文 1:on, 0:off \$body_insert1_en = $in{body_insert1_en}; \$body_insert1 = '$in{body_insert1}'; \$body_insert2_en = $in{body_insert2_en}; \$body_insert2 = '$in{body_insert2}'; \$body_insert3_en = $in{body_insert3_en}; \$body_insert3 = '$in{body_insert3}'; \$body_insert4_en = $in{body_insert4_en}; \$body_insert4 = '$in{body_insert4}'; #トップからのSSI表\\示による更新時間のための予\\備のアップデートファイル # 1: on, 0: off \$update1_file_en = $in{update1_file_en}; \$update2_file_en = $in{update2_file_en}; \$update1_file = '$in{update1_file}'; \$update2_file = '$in{update2_file}'; END close(SETUP); print "Location: $script\n\n"; } else { print "Content-type:text/html\n\n"; print ""; print "
パスワードが違います。
"; print ""; exit; } } sub extraupdate { if ($update1_file_en == 1){ open(UPDATE,">$update1_file"); print UPDATE "dummy file1\n"; close(UPDATE); chmod(0666,"$update1_file"); } if ($update2_file_en == 1){ open(UPDATE,">$update2_file"); print UPDATE "dummy file2\n"; close(UPDATE); chmod(0666,"$update2_file"); } } sub error { unlink("$lockfile"); print "Content-Type: text/html\n\n"; print ""; print ""; print ""; print ""; print "
$_[0]
\n"; print ""; print ""; exit; } sub unlockdisp { print "\n"; } ### title print ### sub titleprint { ($title,$logo,$style,$color,$size,$face,$sel,$loc)=@_; @location = ('left','center','right'); if ($sel == 0) { $titleline = "

$title

"; } elsif ($sel == 1){ $titleline = "
$title

"; } elsif ($sel == 2){ $titleline = "
\"$title\"

"; } elsif ($sel == 3){ $titleline = "
$title

"; } elsif ($sel == 4){ $titleline = ""; } return($titleline); } ### 書き込みのコメント ### sub write_comment { my $head_only_comment = ''; $head_only_comment = '行頭の' if ($autolink_head_only == 1); my $tag_comment = '本文中にタグは使用できません。
'; $tag_comment = '本文中にタグを使用できます。
' if ($tag_use == 1); my $autolink_comment = ''; $autolink_comment = "${head_only_comment}http://から半角文字列の最後まで自動リンクされます。
" if ($autolink_when_tag_is_on == 1 || $tag_use == 0); print <
(#123)など半角括弧で囲んだ#<半角数字>はそのメッセージ番号のメッセージへ自動リンクされます。
Message#123など半角Message#<半角数字>もそのメッセージ番号のメッセージへ自動リンクされます。
WRITE_COMMENT if ($image_en == 1) { print "画像最大アップサイズは${maxmb}kBです。
\n"; } } ### タグ変換 ### sub replace_tag { my $value = shift; if ($tag_use == 1){ $value =~ s/<([\w\s\"\'\\\-\+\=\/\;\:\%\(\)#\?\.\~]*)>/<$1>/g; if ($value =~ /<\s*[aA]\s+.*>/){ $value =~ s/<([\w\s\"\'\\\-\+\=\/\;\:\%\(\)#\?\.\~\&\%\@]*)>/<$1>/g; } } return($value); } ### link replace sub replace_link { my $value = shift; my $number = shift; return ($value) if (grep /^$number$/, @reject); if ($tag_use == 0 || ($tag_use == 1 && $autolink_when_tag_is_on == 1)){ if ($autolink_head_only == 1){ # Has ^ at the head of the pattern $value =~ s/^(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/$1<\/a>$2/g; } else { # No ^ at the head of the pattern $value =~ s/(https?:\/\/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%\$]*)/$1<\/a>$2/g; } } return($value); } sub replace_color { my ($name_color,$title_color,$contents_color) = @_; chomp($contents_color); if ($user_name_color_en == 1 && $name_color =~ /[\w#]+/){ $each_name_color = $name_color; } else { $each_name_color = $post_name_color; } if ($user_title_color_en == 1 && $title_color =~ /[\w#]+/){ $each_title_color = $title_color; } else { $each_title_color = $post_title_color; } if ($user_text_color_en == 1 && $contents_color =~ /[\w#]+/){ $each_text_color = $contents_color; } else { $each_text_color = $text_color; } } sub user_color_input { my ($user_name_color,$user_title_color,$user_text_color)=@_; if ("$user_name_color" eq ''){ $user_name_color = $post_name_color; } if ("$user_title_color" eq ''){ $user_title_color = $post_title_color; } if ("$user_text_color" eq ''){ $user_text_color = $text_color; } $name_color_input = "(名前の色 )" if ($user_name_color_en == 1); $title_color_input = "(タイトルの色 )" if ($user_title_color_en == 1); $contents_color_input = "(記事の色 )" if ($user_text_color_en == 1); }