#! /usr/bin/perl # # dmb.cgi # 超多機能スレッド式メッセージボード # # 1.055 : 3/16/08 : スレッドサーチでの日にち表示を修正 # 1.054 : 2/18/08 : 携帯モード書き込み→PC削除の場合のエラーを修正 # 1.053 : 2/16/08 : 変更字にIP情報が冗長になるのを修正 # 1.052 : 1/28/08 : メッセージを古い順に表示するオプションを追加 # 1.051 : 1/22/08 : メッセージのパスワード未設定の処理を修正 # 1.050 : 12/2/07 : 縮小画像自動作成機能を追加。携帯画像ファイルサイズ制限機能を追加。 # 1.049 : 11/22/07 : 携帯モードでのID#への自動リンク、PCページへのリンクを追加 # 1.048 : 11/21/07 : 携帯モードの番号の指定を修正、及びMessage#のリンクを追加 # 1.047 : 10/21/07 : 携帯モードにperlコードを挿入できるオプションを追加 # 1.046 : 10/4/07 : 入力フォームを若干修正 # 1.045 : 9/5/07 : CAPTCHA画像をjpeg, gifで出力するオプションを追加 # 1.044 : 6/11/07 : ページ毎のソートを修正 # 1.043 : 5/11/07 : サーチの日付のデフォルトを修正 # 1.042 : 4/15/07 : リカバーのタイムスタンプを修正 # 1.041 : 4/8/07 : 200件以前の返事削除変更リンクを修正、個人最終書き込みの日付を修正 # 1.040 : 4/7/07 : 200件以前の日付検索を修正 # 1.039 : 3/29/07 : 名前のメールリンクをメールフォームにするオプションを追加 # 1.038 : 2/10/07 : デフォルトでCAPTCHAをオフに修正 # 1.037 : 1/22/07 : スレッド更新、recover modeを修正 # 1.036 : 1/18/07 : 200件以前のbody_insertを修正 # 1.035 : 1/9/07 : zipファイル作成を修正 # 1.034 : 1/8/07 : ファイルロックのバグを修正 # 1.033 : 1/6/07 : mode=read時にスレッドデータを触らないように修正 # 1.032 : 1/3/07 : 携帯モードにnoidexを追加 # 1.031 : 12/29/06 : robot用noindexを日数表示に追加 # 1.030 : 12/20/06 : 無効なスレッドIDを指定したときの処理を修正 # 1.029 : 12/19/06 : 検索結果表示を修正 # 1.028 : 12/17/06 : BODY内挿入に「の前」を追加。id#xによるスレッドへの直接リンクを追加。 # 1.027 : 12/8/06 : 検索をCase insensitiveに修正 # 1.026 : 12/2/06 : メールアドレスチェックを修正 # 1.025 : 12/1/06 : 200件以前にもタイトルと戻るリンクを追加。変更時のグループパスワードチェックを修正。 # 1.024 : 11/23/06 : 閲覧カウンタを修正 # 1.023 : 11/17/06 : サーチのバグを修正 # 1.022 : 11/15/06 : アップファイルサイズ処理を修正。 # 1.021 : 11/6/06 : SSIモード表示を修正。スレッドソート順を修正。 # 1.020 : 11/4/06 : タグ変換を修正。セットアップのバグを修正。 # 1.019 : 11/3/06 : robot用noindexを返信フォーム等に追加 # 1.018 : 10/30/06 : CAPTCHA導入, メンバーパスワードを強化、SSIモードに最新スレッドモード追加 # 1.017 : 10/29/06 : 全スレッド検索を追加 # 1.016 : 10/21/06 : 200件以前の日付、添付表示のバグを修正 # 1.015 : 10/20/06 : 最新メッセージの下にメッセージを追加できるように修正 # 1.014 : 10/16/06 : Cookieを修正 # 1.013 : 10/15/06 : スレッドファイル復活モードを強化 # 1.012 : 10/14/06 : スレッドファイル復活モードを追加 # 1.011 : 10/11/06 : 未読分計算を修正。スレッドを超えたリンク機能を追加。 # 1.010 : 10/10/06 : アップファイル処理を修正 # 1.009 : 10/1/06 : ID表示オプション追加。スレッドソート機能追加。 # 1.008 : 9/10/06 : 携帯書き込み時のエラーを修正 # 1.007 : 9/10/06 : スレッド更新ファイルを修正 # 1.006 : 8/6/06 : 修正フォームのテキストを修正 # 1.005 : 8/1/06 : クッキーとスレッド削除を修正 # 1.004 : 7/27/06 : トップに未読分表示 # 1.003 : 7/26/06 : アーカイブのデフォルトをチェック # 1.002 : 7/25/06 : クリーンリンク他修正 # 1.001 : 7/25/06 : 統計、アーカイブ、サーチを修正。 # 1.0 : 7/24/06 : Created # # http://www.hidekik.com # # $Id: dmb.cgi,v 1.86 2008/03/16 07:41:05 Hideki Kanayama Exp $ # Copyright(c) 1997-2008, Hideki Kanayama, All rights reserved. use CGI::Carp qw(fatalsToBrowser); use Time::Local; use CGI qw(:cgi-lib); use strict; use LWP::UserAgent; use Archive::Zip; use GD; use File::Basename; use File::Copy; use GD::SecurityImage::AC; use Jcode; my $mbsetupfile = "dmb_setup.pl"; my $admindat = "adminpwd.dat"; my $groupdat = "grouppwd.dat"; my $namedef = "namedef.dat"; my $rejectlink = "rejectlink.dat"; my $version = "1.055"; my $reservedyear = "1997-2008"; my $script = basename($0); my $lang = 0; my $charset = ('Shift_JIS','ISO-8859-1')[$lang]; #### File definitions ###################### ### thread setting ### our $thdata = "thread.dat"; our $thread_onepage_max = 100; our $th_title = ("ディスカッション","Discussion")[$lang]; our $th_logo = "mboard.gif"; our $th_style = ''; our $th_color = 'black'; our $th_size = '+1'; our $th_face = ''; our $th_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $th_loc=1; # 0:左、1:中、2:右 our $thwrtitle = ("スレッド作成","Make thread")[$lang]; our $thwr_logo = ""; our $thwr_style = ''; our $thwr_color = 'black'; our $thwr_size = '+1'; our $thwr_face = ''; our $thwr_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $thwr_loc=1; # 0:左、1:中、2:右 our $thed_title = ("スレッド名修正","Modify thread title")[$lang]; our $thed_logo = ""; our $thed_style = ''; our $thed_color = 'black'; our $thed_size = '+1'; our $thed_face = ''; our $thed_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $thed_loc=1; # 0:左、1:中、2:右 our $thdel_title = ("スレッド削除","Delete thread")[$lang]; our $thdel_logo = ""; our $thdel_style = ''; our $thdel_color = 'black'; our $thdel_size = '+1'; our $thdel_face = ''; our $thdel_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $thdel_loc=0; # 0:左、1:中、2:右 # リストページ内挿入文 our $topdisp1 = ''; our $topdisp2 = '
'; our $topdisp3 = '

'; our $bottomdisp1 = ''; #携帯モードリストページにperlコードを挿入 1:on 0:off our $top_mob_perl_insert1 = ''; our $top_mob_perl_insert2 = ''; sub top_mob_insert_perl1 {}; sub top_mob_insert_perl2 {}; our $th_title_col_bgcolor = '#dddddd'; our $th_col_odd_bgcolor = '#dddddd'; our $th_col_even_bgcolor = '#eeeeee'; our $to_prevpage = '更に最近のスレッド'; our $to_nextpage = '更に古いスレッド'; our $to_toppage = '最新スレッド'; our $mbmailtitle = "へメール送信"; our $mbmail_logo = ""; our $mbmail_style = ''; our $mbmail_color = 'black'; our $mbmail_size = '+1'; our $mbmail_face = ''; our $mbmail_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbmail_loc=1; # 0:左、1:中、2:右 # Background設定 # 1:画像を使う 0:カラー番号を使う our $thbgimage_en = 0; our $thbgimagefile = "sample.jpg"; our $thbgcolor="#ffffff"; # 修正リンク 1:on, 0:off our $th_edit_en = 1; # 削除リンク 1:on, 0:off our $th_delete_en = 1; # 管理用リンク 1:on, 0:off our $thadmin_en = 1; # トップへのリンク 1:on, 0:off our $thtoplink_en = 1; our $thtoplink_title = ('トップへ','Top')[$lang]; our $thtoplink = '../index.html'; # 携帯モードへのリンク 1:on, 0:off our $thmob_en = 1; our $thmoblink_title = ('携帯モード','Mobile mode')[$lang]; # PCモードへのリンク 1:on, 0:off our $pcmode_link_en = 1; our $pcmode_link = 'PCモードへ'; # SSI mode時の表示が最新スレッド 1:最新 0:$ssiid指定のスレッド our $ssi_latest = 1; # SSI mode ID our $ssiid = 1; # ID display our $iddisp_en = 0; #会員専用書き込み 1:on 0:off our $member_only = 0; #〜内に挿入できる構文 1:on, 0:off our $th_head_insert_en = 0; our $th_head_insert = ''; #スタイルシート 1:on 0:off our $th_style_sheet_en = 0; our $th_style_sheet = ' A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none} '; #セキュリティイメージ our $captcha_en = 0; our $capimage_width = 230; our $capimage_height = 80; our $scramble_en = 1; our $cap_text_num = 4; #文字数 our $cap_expire = 60; #有効期限(分) our $capimage_sel = 0; # 0:png, 1:jpg, 2:gif # セキュリティイメージデータディレクトリ our $capdatadir = 'capdata'; # ttffontファイルを絶対パスで。 "Document and Setting"のようなパス内のspace禁止 our $ttffont = "c:/windows/fonts/cour.ttf"; # ttfrontのポイントサイズ our $ttffont_ptsize = 30; #### mb setting ### our $mbdir = "."; our $mbdata = "$mbdir/logdata.dat"; our $mbdellog="$mbdir/mbdel.log"; our $cookiename = "mb_cookie"; our $cookiename2 = "read_cookie"; our $lockfile = "$mbdir/lockfile.txt"; our $mbtitle = ("メッセージボード","Message Board")[$lang]; our $mblogo = "$mbdir/mboard.gif"; our $logo_style = ''; our $logo_color = 'black'; our $logo_size = '+1'; our $logo_face = ''; our $logo_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $logo_loc=1; # 0:左、1:中、2:右 our $mbwrtitle = ("書き込み","Post Message")[$lang]; our $mbwr_logo = ""; our $mbwr_style = ''; our $mbwr_color = 'black'; our $mbwr_size = '+1'; our $mbwr_face = ''; our $mbwr_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbwr_loc=0; # 0:左、1:中、2:右 our $mbrestitle = ("返事","Reply Message")[$lang]; our $mbres_logo = ""; our $mbres_style = ''; our $mbres_color = 'black'; our $mbres_size = '+1'; our $mbres_face = ''; our $mbres_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbres_loc=0; # 0:左、1:中、2:右 our $mbsumtitle = ("書き込み統計","Statistics")[$lang]; our $mbsum_logo = ""; our $mbsum_style = ''; our $mbsum_color = 'black'; our $mbsum_size = '+1'; our $mbsum_face = ''; our $mbsum_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbsum_loc=1; # 0:左、1:中、2:右 our $mbarctitle = ("アーカイブ作成","Archive")[$lang]; our $mbarc_logo = ""; our $mbarc_style = ''; our $mbarc_color = 'black'; our $mbarc_size = '+1'; our $mbarc_face = ''; our $mbarc_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbarc_loc=1; # 0:左、1:中、2:右 our $mblinktitle = ("リンク抜粋","Link")[$lang]; our $mblink_logo = ""; our $mblink_style = ''; our $mblink_color = 'black'; our $mblink_size = '+1'; our $mblink_face = ''; our $mblink_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mblink_loc=1; # 0:左、1:中、2:右 our $mbsrctitle = ("サーチ","Search")[$lang]; our $mbsrc_logo = ""; our $mbsrc_style = ''; our $mbsrc_color = 'black'; our $mbsrc_size = '+1'; our $mbsrc_face = ''; our $mbsrc_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbsrc_loc=1; # 0:左、1:中、2:右 our $mbdeltitle = ("削除","Delete Message")[$lang]; our $mbdel_logo = ""; our $mbdel_style = ''; our $mbdel_color = 'black'; our $mbdel_size = '+1'; our $mbdel_face = ''; our $mbdel_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbdel_loc=1; # 0:左、1:中、2:右 our $mbedititle = ("変更","Delete Message")[$lang]; our $mbedit_logo = ""; our $mbedit_style = ''; our $mbedit_color = 'black'; our $mbedit_size = '+1'; our $mbedit_face = ''; our $mbedit_sel = 0; # 0:デフォルト、1:テキスト、2:ロゴ、3:スタイルシート our $mbedit_loc=0; # 0:左、1:中、2:右 # Background設定 # 1:画像を使う 0:カラー番号を使う our $bgimage_en = 0; our $bgimagefile = "$mbdir/sample.jpg"; our $bgcolor="#ffffff"; # 統計の「ピッタリ賞」でキリ番として扱われるメッセージナンバーの設定。 our @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:無効 our $summary_en = 1; # アーカイブ 1:有効 0:無効 our $archive_en = 1; # リンク 1:有効 0:無効 our $link_en = 1; # タイトル 1:有効 0:無効 our $title_en = 1; # 画像リスト 1:有効 0:無効 our $imlist_en = 1; # サーチ 1:有効 0:無効 our $search_en = 1; # 携帯モード 1:有効 0:無効 our $imode_en = 1; # 削除機能 1:有効 0:無効 our $delete_en = 1; # 変更機能 1:有効 0:無効 our $modify_en = 1; # 表示順 1:新しい順 0:古い順 our $disp_order = 1; # 名前のメールリンク 2:mailtoでリンク 1:メールフォーム 0:リンク無し our $mailform_en = 1; # mail command our $mail_cmd = '/usr/sbin/sendmail -t'; #タグ使用 1:可 0:不可 our $tag_use = 0; #削除変更元記事保存 1:有効 0:無効 our $dellog_save = 1; #200件以前の過去記事保存 1:有効 0:無効 our $pastlog_save = 1; #携帯モードでの画像表示 1:有効 0:無効 our $imode_image = 0; #携帯モーででの画像表示サイズ our $imode_image_x = 100; our $imode_image_y = 100; #タグ使用可の時にhttp://からのオートリンク 1:on 0:off our $autolink_when_tag_is_on = 0; #http://の適用 1:行頭のみ 0:どこでも our $autolink_head_only = 0; # セットアップ表示 1:表示 0:非表示 our $setup_en = 1; # 自動リンククリック時 1:同じウィンドウ 0:別ウィンドウ our $link_samewin_en = 1; # トップへのリンク 1:表示 0:非表示 our $top_link_en = 1; our $top_link_title = ('トップへ','Top')[$lang]; our $top_link = '../index.html'; # スレッドへのリンク 1:表示 0:非表示 our $th_link_en = 1; our $th_link_title = ('ディスカッションへ','To Discussion')[$lang]; # 書き込みタイトルのサイズ、色、フォント our $post_title_color = '#00aa00'; our $post_title_size = '+2'; our $post_title_face = ''; # 名前の色 our $post_name_color = '#0000ee'; # 返信引用記事の色 our $quate_color = '#804040'; # 記事本文の色 our $text_color = 'black'; # 投稿者個人色設定 1:on 0:off our $user_name_color_en = 0; our $user_title_color_en = 0; our $user_text_color_en = 0; # 記事本文の表示幅 ブラウザ全体の% our $body_width = 100; # 名前欄のメールアドレス表示 1:on 0:off our $maildisp_en = 0; # 名前欄の敬称 1:on 0:off our $namesan_en = 0; our $namesan = ('さん','-san')[$lang]; # 返信コメントでの敬称 1:on 0:off our $ressan_en = 0; our $ressan = ('さん','-san')[$lang]; # SSIモード設定 # SSIモードを使用するHTMLファイルから見たこのスクリプトへの相対パス、 # 又はhttp://からのフルパス our $httpcgibin = "http://localhost/cgi-bin"; # 続き表示リンクの文字列 our $gotomb = ('続きはこちら.....','See more')[$lang]; # SSIモードの表示ライン数のデフォルト our $ssiline = 7; # SSIモードの表示件数 # $ssikenが2以上の場合は$ssilineは無効 our $ssiken = 1; # SSIモードで画像表示 0:off 1:on our $ssiimage_en = 0; #画像サイズ our $ssiimage_w = 100; our $ssiimage_h = 100; # サポートされていない画像やファイルの場合のアイコン使用 1:有効 0:無効 our $attach_icon_en = 0; our $attach_icon = ''; # アップロード禁止な拡張子 our $prohibit_en = 1; our $prohibit_extention = "cgi pl php php3"; # 半角スペースで区切る # Use localtime? our $localtime_en = 0; # If not using localtime, 時間設定 GMTからのオフセット 日本:+9 our $offset = 9; # Summary で使われる棒グラフの棒 our $gif="$mbdir/bar.gif"; # ファイルアップ機能 0:無し 1:有り our $image_en = 1; # アップファイル格納ディレクトリ our $imagedir = "$mbdir"; # 画像クリック時のウィンドウ 0:別ウィンドウ 1:同じウィンドウ our $image_samewin_en = 0; # 縮小表示時のサイズ our $max_width = 150; our $max_height = 150; #縮小画像自動作成 1:on 0:off our $thumb_gen_en = 1; our $thumb_dir = 'mbthumb'; #携帯モード画像ファイルサイズ制限 (KB) our $mob_image_size = 25; #携帯モード画像フォーマット 0:jpg 1:gif 2:png our $mob_image_format = 1; #最大ファイルアップサイズ(kB) our $maxmb = 100; #スタイルシート 1:on 0:off our $style_sheet_en = 0; our $style_sheet = ' A:link {text-decoration: none} A:visited {text-decoration: none} A:active {text-decoration: none} '; #〜内に挿入できる構文 1:on, 0:off our $head_insert_en = 0; our $head_insert = ''; #メッセージボード上部に表示させる文 1:on, 0:off our $body_insert1_en = 0; our $body_insert1 = ''; our $body_insert2_en = 0; our $body_insert2 = ''; our $body_insert3_en = 0; our $body_insert3 = ''; our $body_insert4_en = 0; our $body_insert4 = ''; our $body_insert5_en = 0; our $body_insert5 = ''; our $body_insert6_en = 0; our $body_insert6 = ''; #携帯モードにperlコードを挿入 1:on 0:off our $mob_perl_insert1 = ''; our $mob_perl_insert2 = ''; sub mob_insert_perl1 {}; sub mob_insert_perl2 {}; #トップからのSSI表示による更新時間のための予備のアップデートファイル # 1: on, 0: off our $update1_file_en = 0; our $update2_file_en = 0; our $update1_file = "$mbdir/update1.log"; our $update2_file = "$mbdir/update2.log"; #スパム防止のためのキーワード our $ticket = 'qualified'; ######################################################################### if (-e "$mbsetupfile"){ require "$mbsetupfile"; } my $url_pattern = 'https?:\/\/[\w\.\~\/\?\&\+\=\:\@\%\;\#\$\%\-]*'; my $tag_pattern = '[\w\s\"\'\\\+\=\/\;\:\%\(\)#\?\.\~\-\!]*'; my $mail_pattern = '(^[\w\.\-]+\@[\w\.\-]+\.[a-zA-Z]{2,4}$|^$)'; my $color_pattern = '\w\#'; if ($maxmb < 100) {$maxmb = 100;} my $maxmb2 = $maxmb + 20; # Margin for text up size $CGI::POST_MAX = $maxmb2 * 1024; my $q = new CGI; my $cgierror = $q->cgi_error; &error($cgierror) if ($cgierror); my %in = $q->Vars; %in = &postprocess(%in); if ($script eq 'dmbssi.cgi'){ $script = 'dmb.cgi'; $in{mode} = 'ssi'; } elsif ($script eq 'dmbmob.cgi'){ $script = 'dmb.cgi'; $in{mode} = 'mobile'; } if (defined $in{mode} and $in{mode} eq 'ssi'){ if ($in{line} eq ''){ $in{line} = $ssiline; } if ($in{id} eq ''){ if ($ssi_latest){ my @tmp = split /,/, &get_latest_thread; $in{id} = $tmp[0]; } else { $in{id} = $ssiid; } } } my $id = $in{id}; my $idmbsetupfile = "$id-$mbsetupfile"; if (-e "$idmbsetupfile"){ require "$idmbsetupfile"; } if ($in{mode} ne 'thwrite' and $in{mode} ne 'thiwrite' and $in{mode} ne 'setup' and $in{mode} ne 'admin'){ my ($body,$path,$ext) = fileparse($mbdata, '\.\w+'); $path = '.' if ($path eq ''); $mbdata = "$path$id-$body$ext"; ($body,$path,$ext) = fileparse($mbdellog, '\.\w+'); $path = '.' if ($path eq ''); $mbdellog = "$path$id-$body$ext"; $rejectlink = "$id-$rejectlink"; } #if ($in{mode} !~ /viewthread/ and # $in{mode} ne 'setup' and # $in{mode} ne 'admin'){ # my ($body,$path,$ext) = fileparse($lockfile, '\.\w+'); # $path = '.' if ($path eq ''); # $lockfile = "$path$id-$body$ext"; #} my @thline = split ',', &get_one_thread; my $thtitle = $thline[6]; my $thread_sofar = $thline[9]; my $mbread = "$script?mode=read&id=$id"; my $mbreadt = "$script?mode=title&id=$id"; my $mbwrite = "$script?mode=write&id=$id"; my $mbres = "$script?mode=res&id=$id"; my $mbpast = "$script?mode=past&id=$id"; my $mbwrform = "$script?mode=wrform&id=$id"; my $mblink = "$script?mode=link&id=$id"; my $mbdel1 = "$script?mode=delete&id=$id"; my $mbdel2 = "$script?mode=del2&id=$id"; my $mbdel3 = "$script?mode=del3&id=$id"; my $mbsum = "$script?mode=summary&id=$id"; my $mbsearch = "$script?mode=search&id=$id"; my $mbschform = "$script?mode=schform&id=$id"; my $mbarchform = "$script?mode=archform&id=$id"; my $mbarch = "$script?mode=archive&id=$id"; my $mbsumfm = "$script?mode=sumform&id=$id"; my $mbsumpsfm = "$script?mode=sumpsnl&id=$id"; my $mbiread = "$script?mode=iread&id=$id"; my $mbiwrite = "$script?mode=iwrite&id=$id"; my $mbiwrform = "$script?mode=iwrform&id=$id"; my $mbires = "$script?mode=iresform&id=$id"; my $mbsetup = "$script?mode=setup&id=$id"; my $mbedit = "$script?mode=edit&id=$id"; my $mbnamedef = "$script?mode=namedef&id=$id"; my $mbnamedefwr = "$script?mode=namedefwr&id=$id"; my $mbprint = "$script?mode=print&id=$id"; my $mbssi = "$script?mode=ssi&id=$id"; if (! -e "$admindat"){ if ($in{mode} eq 'adminpwd'){ &wradminpwd; } else { &setadminpwd; } } my $member_pwd; if ($member_only){ if (! -e "$groupdat"){ if ($in{mode} eq 'grwradminpwd'){ &wradminpwd($groupdat); } else { &setadminpwd($groupdat); } } open(FILE,"< $groupdat") or &error("$groupdatが開けません。"); $member_pwd = ; close(FILE); } my $link_target = $link_samewin_en ? '_top' : '_blank'; my @reject = &reject_list; if ((! defined $in{mode}) or $in{mode} eq 'thwrform') { $bgimage_en = $thbgimage_en; $bgimagefile = $thbgimagefile; $bgcolor = $thbgcolor; } my $host = $ENV{'REMOTE_HOST'}; my $ip = $ENV{'REMOTE_ADDR'}; my $captcha; if ($captcha_en){ $captcha = GD::SecurityImage::AC->new; $captcha->gdsi( new => { width => $capimage_width, height => $capimage_height, lines => 10, scramble => $scramble_en, font => "$ttffont", ptsize => $ttffont_ptsize, }, create => ['ttf', 'rect', '#000000', '#555555'], particle => [500], ); if (! -d "$capdatadir") {mkdir $capdatadir;} $captcha->data_folder($capdatadir); $captcha->output_folder($capdatadir); $captcha->expire($cap_expire * 60); } my @mobext = qw(jpg gif png); if (! defined $in{mode}) { &dmblist; } elsif ($in{mode} eq 'thedit' && $th_edit_en) { &thedit_form; } elsif ($in{mode} eq 'thedit2' && $th_edit_en) { &thedit_delete; } elsif ($in{mode} eq 'thdelete' && $th_delete_en) { &thdelete_form; } elsif ($in{mode} eq 'thdelete2' && $th_delete_en) { &thedit_delete; } elsif ($in{mode} eq 'mobile') { &thmobile; } elsif ($in{mode} eq 'thiwrform') { &thiwrform; } elsif ($in{mode} eq 'thiwrite') { &mbiwrite; } elsif ($in{mode} eq 'iviewthread') { &iviewthread; } elsif ($in{mode} eq 'read') { &mbread; } elsif ($in{mode} eq 'viewthread') { &viewthread; } elsif ($in{mode} eq 'title' && $title_en == 1){ &mbread; } elsif ($in{mode} eq 'imlist' && $image_en){ &mbread; } elsif ($in{mode} eq 'wrform'){ &mbwrform; } elsif ($in{mode} eq 'thwrform'){ &thwrform; } elsif ($in{mode} eq 'write'){ &mbwrite; } elsif ($in{mode} eq 'thwrite'){ &mbwrite; } elsif ($in{mode} eq 'res'){ &mbres; } elsif ($in{mode} eq 'delete'){ &mbdel1; } elsif ($in{mode} eq 'del2'){ &mbdel2; } elsif ($in{mode} eq 'del3'){ &mbwrite; } elsif ($in{mode} eq 'edit'){ &mbedit; } elsif ($in{mode} eq 'edit2'){ &mbwrite; } 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 'thsearch' && $search_en == 1){ &thsearch; } 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 'admin'){ &thsetup; } elsif ($in{mode} eq 'thsetup2'){ &makethsetup; } elsif ($in{mode} eq 'setup'){ &setup; } elsif ($in{mode} eq 'setup2'){ &makesetup; } elsif ($in{mode} eq 'ssi'){ &mbssi; } elsif ($in{mode} eq 'cleanlink'){ &mbcleanlink; } elsif ($in{mode} eq 'cleanlink2'){ &cleanlink; } elsif ($in{mode} eq 'makebar'){ &mbmakebargif; } elsif ($in{mode} eq 'makebar2'){ &makebar; } elsif ($in{mode} eq 'dispbar'){ &dispbar; } elsif ($in{mode} eq 'recover'){ &recover; } elsif ($in{mode} eq 'mail'){ &mailform; } elsif ($in{mode} eq 'send'){ &send; } else { &dmblist; } exit; ############################################################################# # Read mode ################################################################# ############################################################################# sub mbread { my @alldata = reverse &getmbdata; my @findata = split(/,/,$alldata[0]); my ($donename, $done) = split /:/, $q->cookie("$cookiename2$id"); my $cook="$thline[1]:$findata[0]"; my $cookie = $q->cookie(-name => "$cookiename2$id", -value => "$cook", -expires => "+1y"); $cookie = &cookie_path_fix($cookie); print "Set-Cookie: $cookie\n"; my $fdone; if ($donename == $thline[1]){ $fdone=$findata[0] - $done; } else { $fdone=$findata[0]; } my $fnext=$findata[0] - 20; my $startpoint = 0; my @day_before = &get_before_data(@alldata); my $line; my $t = $in{mode}; my $ago = $in{number}; if($ago eq "done"){ $line=$fdone; } elsif ($ago =~ /&/) { ($ago,$t)=split(/&/,$ago); $line = $ago; } elsif ($ago =~ /^d/) { $ago =~ s/d(\d+)/$1/; my $i; foreach $i (0 .. $ago){ $line = $line + $day_before[$i]; } } 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; } my $finline; if ($#alldata < $line){ $finline=$#alldata; } else { $finline=$line-1; } &htmlhead($thtitle); &disphead($fdone,$thtitle,@day_before); if (($fnext > $findata[0] - 200) && (($ago eq '')||($startpoint != 0))) { if ($fnext > 0) { print ""; print (('更に前の20件を見る','Older massage')[$lang]); print ""; } } 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 ""; print (('更に前の20件を見る','Older messages')[$lang]); print " \n"; } } &disptail; print "

"; print (('新規書き込み','New post')[$lang]); print "

\n"; &htmltail; } #sub cookie_encode { # my $a = shift; # $a =~ s/([\W])/sprintf("%%%02X", ord($1))/eg; # return $a; #} sub cookie_path_fix { my $a = shift; $a =~ s/path\s*=\s*[^;]*;//i; return $a; } #sub cookie_decode { # my $a = shift; # $a =~ s/%([A-Fa-f0-9][A-Fa-f0-9])/pack("C", hex($1))/eg; # return $a; #} sub display_one_title { my $line = shift; my $t = ($in{mode} eq 'imlist') ? $in{mode} : shift; my ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$line); my ($each_name_color,$each_title_color,$each_text_color) = &replace_color($user_name_color,$user_title_color,$user_text_color); if ($t ne 'imlist' or ($t eq 'imlist' and $imagefile ne '' and -e "$imagedir/$imagefile")) { print "

  • Message#${number}"; my $disp_subject = &subject_text($subject); # print "$disp_subject"; if ($lang == 0){ my @darray = split(/[^\d]/,$date); if ($darray[0] < 1900){ my $dy = $darray[0]+1900; $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; } } print " ........ $date"; } if ($t eq 'imlist' and $imagefile ne '' and -e "$imagedir/$imagefile") { my ($imagefile,$w,$h)=&get_image_size($imagefile,$ssiimage_w,$ssiimage_h); print "
    "; print &image_tag($imagefile,$w,$h); print ""; } print "
  • \n"; } sub image_tag { my ($image,$w,$h) = @_; if ($w == 0 or $h == 0) { if ($attach_icon_en) { if ($in{mode} eq 'ssi'){ return ""; } else { return ""; } } else { return "<Attachment>"; } } else { if ($in{mode} =~ /^i/ and $in{mode} ne 'imlist'){ $image = &mob_image_gen($image,$w,$h); } else { $image = &image_gen($image,$w,$h) if ($thumb_gen_en); } return ""; } } sub subject_text { my $subject = shift; my @sub2=split(/Re:/,$subject); my $disp_subject; if ($#sub2 > 1){ $disp_subject = "Re" . $#sub2 . ":" . $sub2[$#sub2]; } else { $disp_subject = "$subject"; } } sub display_one_message { my $one_line = shift; my $noreplink = shift; my ($number,$datecode,$name,$mail,$host,$date,$subject,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$one_line); my ($each_name_color,$each_title_color,$each_text_color) = &replace_color($user_name_color,$user_title_color,$user_text_color); my $one_message; $one_message = ""; my @darray = split(/[^\d]/,$date); $one_message .= ""; $one_message .= "
    Message#${number} "; if ($lang == 0){ if ($darray[0] < 1900){ my $dy; $dy = $darray[0]+1900; $date =~ s/^\d?\d\d([^\d]..*)$/$dy$1/; } } $one_message .= "$date
    "; $one_message .= "From: "; if ($mail){ if ($mailform_en == 2){ $one_message .= "$name"; } elsif ($mailform_en == 1){ $one_message .= "$name"; } else { $one_message .= "$name"; } } else { $one_message .= "$name"; } if ($namesan_en){ $one_message .= "$namesan"; } if ($mail && $maildisp_en){ $one_message .= " ($mail)" } $one_message .= "
    "; unless (($in{mode} eq 'past' and $noreplink) or ($in{mode} eq 'print' and $noreplink) or $in{mode} eq 'del2' or $in{mode} eq 'archive'){ if ($in{mode} ne 'delete'){ $one_message .= ""; $one_message .= (('返事','reply')[$lang]); $one_message .= " \n"; } if ($delete_en or $in{mode} eq 'delete') { $one_message .= " "; $one_message .= (('削除','delete')[$lang]); $one_message .= " \n"; } if ($modify_en or $in{mode} ne 'delete') { $one_message .= ""; $one_message .= (('変更','edit')[$lang]); $one_message .= " \n"; } } $one_message .= "
    "; # $one_message .= "
    "; # my $disp_subject = &subject_text($subject); # $one_message .= "$disp_subject"; # $one_message .= "
    "; my $link_target; if ($link_samewin_en){ $link_target = '_top'; } else { $link_target = '_blank'; } $main =~ s/\(\#(\d+)\-(\d+)\)/\(\#$1-$2<\/a>\)/g; $main =~ s/(message)\#(\d+)\-(\d+)/$1\#$2-$3<\/a>/gi; $main =~ s/\(\#(\d+)\)/\(\#$1<\/a>\)/g; $main =~ s/(message)\#(\d+)/$1\#$2<\/a>/gi; $main =~ s/(id)\#(\d+)/$1\#$2<\/a>/gi; my @mainarry=split /
    /i, $main; $one_message .= ""; $one_message .= ""; $one_message .= ""; $one_message .= "
    "; chomp($imagefile); if ($image_en && $imagefile ne '' && -e "$imagedir/$imagefile"){ my ($actual_width, $actual_height); ($imagefile,$actual_width,$actual_height) = &get_image_size("$imagefile",$max_width,$max_height); my $newwin; if ($image_samewin_en){ $newwin = ''; } else { $newwin = 'target="_blank"'; } $imagefile = basename($imagefile) if ($in{mode} eq 'archive'); $one_message .= ""; $one_message .= &image_tag($imagefile,$actual_width,$actual_height); $one_message .= ""; } $one_message .= ""; $one_message .= ""; foreach (@mainarry){ $_ = &replace_link($_,$number); $_ = &replace_tag($_); if(/^\>.*$/){ $one_message .= "$_"; } else { $one_message .= "$_"; } $one_message .= "
    "; } $one_message .= "
    "; $one_message .= "

    \n"; if ($in{mode} eq 'archive'){ return($one_message); } else { print $one_message; } } sub get_before_data { my @alldata = @_; my $today; if ($localtime_en) { $today = time; } else { $today = time + $offset*3600; } my $ago = $in{number}; my @day_before; my $i; my $yesterday; my ($ysec,$ymin,$yhour,$ymday,$ymon,$yyear,$ywday,$yyday,$yisdst); my $yrmon; my @yesterdata; foreach $i (0 .. 5){ $yesterday=$today-86400*$i; ($ysec,$ymin,$yhour,$ymday,$ymon,$yyear,$ywday,$yyday,$yisdst) = $localtime_en ? localtime($yesterday) : gmtime($yesterday); $yrmon=$ymon+1; @yesterdata=grep(/^\d\d*,${yyear}_${yrmon}_${ymday},/,@alldata); $day_before[$i] = $#yesterdata + 1; } return @day_before; } sub htmlhead { my $mbtitle = shift; my $firstyear = shift; my $head_message; $head_message = $q->header(-charset=>"$charset") if ($in{mode} ne 'archive'); $head_message .= "\n"; $head_message .= "\n"; $head_message .= "\n"; $head_message .= "\n"; $head_message .= "$mbtitle\n"; if ($in{mode} eq 'sumform' or $in{mode} eq 'sumpsnl'){ $head_message .= ' '; } if ($in{mode} eq 'schform'){ $head_message .= " "; } if ($in{mode} eq '' or $in{mode} eq 'thwrform'){ if ($th_head_insert_en == 1){ $head_message .= "$th_head_insert\n"; } if ($th_style_sheet_en == 1){ $head_message .= "\n"; } } else { if ($head_insert_en == 1){ $head_message .= "$head_insert\n"; } if ($style_sheet_en == 1){ $head_message .= "\n"; } } if ($in{mode} eq 'res' or $in{mode} eq 'del2' or $in{mode} eq 'edit' or $in{mode} eq 'iresform' or $in{mode} =~ /wrform/ or $in{number} =~ /^d/) { $head_message .= "\n"; } $head_message .= "\n"; my $onload; if ($in{mode} eq 'sumform' or $in{mode} eq 'sumpsnl' or $in{mode} eq 'schform') { $onload = 'onLoad="setopt();"'; } else { $onload = ''; } my $bgimage; if ($bgimage_en == 1){ $bgimage = "background=\"$bgimagefile\""; } else { $bgimage = "bgcolor=\"$bgcolor\""; } $head_message .= "\n"; $head_message .= "
    \n"; if ($in{mode} eq 'archive'){ return($head_message); } else { print $head_message; } } sub lockfile { open(LOCKFILE,"> $lockfile"); flock LOCKFILE, 2; } sub unlockfile { no strict; close (LOCKFILE) if (defined LOCKFILE); close (TMPFILE) if (defined TMPFILE); # Do not delete in Unix system. # The lock file can be deleted even it is locked by flock in unix system. # Leave it all time. # unlink "$lockfile" if (-e "$lockfile"); unlink "tmp.$$" if (-e "tmp.$$"); } sub htmltail { print ©right; print "
    \n"; print "$bottomdisp1"; print "\n"; print "\n"; exit; } sub copyright { my $mysite = ('http://www.hidekik.com/','http://www.hidekik.com/en/')[$lang]; my $copyright; $copyright = "
    dmb.cgi Ver. $version
    \n"; $copyright .= "
    Copyright(C) $reservedyear, hidekik.com
    \n"; return $copyright; } sub get_image_size { my ($image,$max_width,$max_height) = @_; my $imagefile = "$imagedir/$image"; my $im = &get_imobj($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 { my ($fdone,$thtitle,@line) = @_; my $i; my $mb0=$line[0]; my $mb1=$mb0+$line[1]; my $mb2=$mb1+$line[2]; my $mb3=$mb2+$line[3]; my $mb4=$mb3+$line[4]; my $mb5=$mb4+$line[5]; my $titleprint=&titleprint("$thtitle","$mblogo","$logo_style","$logo_color","$logo_size","$logo_face","$logo_sel","$logo_loc"); print "$body_insert1" if ($body_insert1_en == 1 and $in{mode} ne 'past' and $in{mode} ne 'print' and $in{mode} ne 'link'); if ($in{mode} ne 'past' and $in{mode} ne 'link' and $in{mode} ne 'print'){ if ($logo_sel != 4){ print "$titleprint\n"; } print "$body_insert2" if ($body_insert2_en == 1); if ($lang) { print "
    Recent post: Today :$mb0, Yesterday:$line[1]
    \n"; } else { print "
    最近の書き込み件数: 今日 $mb0件、昨日 $line[1]件
    \n"; } if ($fdone > 0) {print "";} if ($lang){ print "Unread : $fdone"; } else { 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 "; } if ($th_link_en == 1){ print "$th_link_title "; } print ""; print (('新規書き込み','New post')[$lang]); print "
    \n"; print "

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

    "; print (('最新20件','latest 20')[$lang]); print " \n"; print ""; print (('最新50件','latest 50')[$lang]); print " \n"; print ""; print (('最新100件','latest 100')[$lang]); print " \n"; print ""; print (('最新200件','latest 200')[$lang]); print " \n"; print "", ('200件以前','Before 200')[$lang], "" if ($pastlog_save); print "
    \n"; print ""; print (('昨日以降','since yesterday')[$lang]); print "($mb1) \n"; print ""; print (('2日前以降','since two days ago')[$lang]); print "($mb2) \n"; print ""; print (('3日前以降','since three days ago')[$lang]); print "($mb3) \n"; print ""; print (('4日前以降','since four days ago')[$lang]); print "($mb4) \n"; print ""; print (('5日前以降','since five days ago')[$lang]); print "($mb5)
    \n"; if ($summary_en){ print ""; print (('統計','stat')[$lang]); print " \n"; } if ($archive_en){ print ""; print (('アーカイブ','archive')[$lang]); print " \n"; } if ($link_en){ print ""; print (('リンク','link')[$lang]); print " \n"; } # if ($title_en){ # print ""; # print (('タイトル','title')[$lang]); # print " \n"; # } if ($imlist_en == 1 and $image_en == 1){ print ""; print (('添付','attachment')[$lang]); print " \n"; } if ($search_en){ print ""; print (('サーチ','search')[$lang]); print " \n"; } if ($imode_en){ print ""; print (('携帯モード','mobile')[$lang]); print " \n"; } if ($setup_en){ print ""; print (('セットアップ','setup')[$lang]); print " \n"; } print "
    "; print "\n"; print "

    " if ($body_insert5_en == 0); print "$body_insert5" if ($body_insert5_en == 1); } sub disptail { print "

    "; print (('最新20件','latest 20')[$lang]); print " \n"; print ""; print (('最新50件','latest 50')[$lang]); print " \n"; print ""; print (('最新100件','latest 100')[$lang]); print " \n"; print ""; print (('最新200件','latest 200')[$lang]); print " \n"; print "", ('200件以前','Before 200')[$lang], "" if ($pastlog_save); print "
    \n"; print ""; print (('昨日以降','since yesterday')[$lang]); print " \n"; print ""; print (('2日前以降','since two days ago')[$lang]); print " \n"; print ""; print (('3日前以降','since three days ago')[$lang]); print " \n"; print ""; print (('4日前以降','since four days ago')[$lang]); print " \n"; print ""; print (('5日前以降','since five days ago')[$lang]); print "
    \n"; } sub getmbdata { my @alldata; if (open(GETFILE,"< $mbdata")){ flock GETFILE, 1; while(){ chomp; push(@alldata,$_); if ($#alldata >= 200){ shift(@alldata); } }; close(GETFILE); return (@alldata); } else { &error("無効なスレッドIDです。"); } } ############################################################################# # Write Form mode ########################################################### ############################################################################# sub mbwrform { my $titleprint = &titleprint("$thtitle $mbwrtitle","$mbwr_logo","$mbwr_style","$mbwr_color","$mbwr_size","$mbwr_face","$mbwr_sel","$mbwr_loc"); &htmlhead($mbwrtitle); my %cookie = &input_forms($titleprint); print "\n"; print "

    \n"; &input_forms2(%cookie); &wrticket; &display_after_write; &write_comment; print ""; print "\n"; print "\n"; &htmltail; } sub input_forms { my %COOKIE; my @pairs = split /,/, $q->cookie($cookiename); foreach my $pair (@pairs) { my ($name, $value) = split(/:/, $pair); # $COOKIE{$name} = &cookie_decode($value); $COOKIE{$name} = $value; } my ($titleprint,$name_color_input,$title_color_input,$contents_color_input,$name, $mail,$subject) = @_; if ($in{mode} eq 'wrform' or $in{mode} eq 'res'){ ($name, $mail) = ($COOKIE{name},$COOKIE{email}); ($name_color_input,$title_color_input,$contents_color_input) = &user_color_input("$COOKIE{user_name_color}","$COOKIE{user_title_color}","$COOKIE{user_text_color}"); } # if ($in{mode} eq 'res'){ # $subject = "Re:" . $subject; # } print "

    \n"; print "$titleprint"; print (('お名前(必須)','Name')[$lang]); if ($in{mode} eq 'edit' and ($mailform_en == 1 and $maildisp_en == 0 or $mailform_en == 0 and $maildisp_en == 0)) { $mail = ''; } print "\n
    $name_color_input\n"; print "
    "; print (('メールアドレス','Mailaddress')[$lang]); print "\n
    \n"; # print "
    "; # print (('タイトル(必須)','Subject')[$lang]); # print "\n
    $title_color_input\n"; # print "
    \n"; print "\n"; print "

    "; print (('内容','Contents')[$lang]); print "$contents_color_input\n"; print "

    "; &input_forms2(%cookie); &wrticket; &display_after_write; &write_comment; print "\n"; print "\n"; print "

    \n"; &htmltail; } ############################################################################# # Message edit Form mode #################################################### ############################################################################# sub mbedit { my @alldata = &getmbdata; my @resdata = grep(/^$in{resnum},/,@alldata); my ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$resimagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/,$resdata[0]); &htmlhead($mbedititle); my $titleprint=&titleprint("$thtitle $mbedititle","$mbedit_logo","$mbedit_style","$mbedit_color","$mbedit_size","$mbedit_face","$mbedit_sel","$mbedit_loc"); my ($name_color_input, $title_color_input, $contents_color_input) = &user_color_input("$user_name_color","$user_title_color","$user_text_color"); my %cookie = &input_forms($titleprint, $name_color_input, $title_color_input, $contents_color_input,$resname,$resmail,$ressubject); @resdata=split(/<[bB][rR]>/,$resmain); foreach (@resdata){ print "$_\n"; } print "

    "; if ($image_en == 1){ if ($resimagefile ne ''){ print qq//; print (('添付(画像)ファイルはそのまま','No image change')[$lang]); print "
    \n"; print qq//; print (('添付(画像)ファイルを削除','Delete image')[$lang]); print "
    \n"; print qq//; print (('添付(画像)ファイルを差し替え','Replace image')[$lang]); print "
    \n"; print (('差し替え添付(画像)ファイル(ファイル名は半角英数、アンダースコア、ドット、ハイフンのみ)','New image file')[$lang]); print "\n"; } else { print qq//; print (('アップファイル(ファイル名は半角英数、アンダースコア、ドット、ハイフンのみ)','Uploading file')[$lang]); print "\n"; } print "

    \n"; } if ($delete_en == 1 || $modify_en == 1){ print (('削除修正用個人パスワード(半角英数で)','Your password')[$lang]); print "
    \n"; print "

    \n"; } &display_after_write; &write_comment; print ""; print "\n"; print "\n"; print "\n"; &htmltail; } ############################################################################# # Delete display mode ####################################################### # $delete_en = 0 の場合は直接$mbdel1をタイプして実行してください。 # 管理人のみ削除できることになります。 ############################################################################# sub mbdel1 { my @alldata = &getmbdata; @alldata = reverse(@alldata); my @findata = split(/,/,$alldata[0]); my $line = 200; my $finline; if ($#alldata < $line){ $finline=$#alldata; } else { $finline=$line-1; } my $titleprint=&titleprint("$thtitle $mbdeltitle","$mbdel_logo","$mbdel_style","$mbdel_color","$mbdel_size","$mbdel_face","$mbdel_sel","$mbdel_loc"); &htmlhead($mbdeltitle); print "$titleprint\n"; my @day_before = &get_before_data(@alldata); &disphead(0,$thtitle,@day_before); print "


    \n"; foreach my $count (0 .. $finline){ &display_one_message($alldata[$count]); } &disptail; } ############################################################################# # Delete confirm mode ####################################################### ############################################################################# sub mbdel2 { my @alldata = &getmbdata; my @resdata = grep(/^$in{resnum},/,@alldata); my ($resnumber,$rescode,$resname,$resmail,$reshost,$resdate,$ressubject,$resmain,$resencpwd,$imagefile,$name_text_color,$title_text_color,$contents_text_color)=split(/,/,$resdata[0]); my ($each_name_color,$each_title_color,$each_text_color) = &replace_color($name_text_color,$title_text_color,$contents_text_color); my $titleprint=&titleprint("$thtitle $mbdeltitle","$mbdel_logo","$mbdel_style","$mbdel_color","$mbdel_size","$mbdel_face","$mbdel_sel","$mbdel_loc"); &htmlhead($mbdeltitle); print $titleprint; print "
    \n"; &display_one_message($resdata[0]); my $withimage; if ($image_en == 1 && $imagefile ne ''){ $withimage = ('と添付(画像)ファイル','and the image')[$lang]; } else { $withimage = ''; } print (("上のメッセージ$withimageを削除します。
    よければパスワードを入力し、削除ボタンをクリックしてください。

    ","Delete the above message $withimage.
    If OK, click the Delete button")[$lang]); print "

    \n"; print (("パスワード:","Password")[$lang]); print "\n"; print "\n"; print "\n"; my $delbutton = ("削除","Delete")[$lang]; print ""; print "

    \n"; print "

    \n"; &htmltail; } ############################################################################# # Link display mode ######################################################### # メッセージ中のリンクの中でデッドリンク等でリンク表示のリストから # 除外したいメッセージナンバーをrejectlink.datに1行つづ記述してください。 ############################################################################# sub mblink { my @alldata = &getmbdata; &htmlhead($mblinktitle); my $titleprint=&titleprint("$thtitle $mblinktitle","$mblink_logo","$mblink_style","$mblink_color","$mblink_size","$mblink_face","$mblink_sel","$mblink_loc"); my @numarray; my @datearray; my @titlearray; my @linkarray; my @user_title_color; open(FILE,"< $mbdata"); while (){ chomp; my ($number,$b,$c,$d,$e,$date,$title,$main,$encpwd,$imagefile,$user_name_color,$user_title_color,$user_text_color)=split(/,/); my $linkarray2; if (/$url_pattern/){ foreach (split(/
    /i,$main)){ if (/($url_pattern)/ && !/^\>/){ $linkarray2 .= "$1
    "; } } if($linkarray2 ne ""){ if (! grep(/^$number$/,@reject)){ push(@numarray,$number); push(@datearray,$date); push(@titlearray,$title); push(@linkarray,$linkarray2); push(@user_title_color,$user_title_color); } } $linkarray2=""; } } close(FILE); print "$body_insert1" if ($body_insert1_en == 1); print $titleprint; print "$body_insert4" if ($body_insert4_en == 1); my @day_before = &get_before_data(@alldata); &disphead(0,$thtitle,@day_before); print "
    \n"; print "
      \n"; my $i; for($i=$#linkarray;$i>=0;$i=$i-1){ my ($each_name_color,$each_title_color,$each_text_color) = &replace_color('',$user_title_color[$i],''); print "
    • #$numarray[$i],"; my $subject = &subject_text($titlearray[$i]); print "$subject
      \n"; foreach my $url (split(/
      /i,$linkarray[$i])){ print "$url
      "; } print "

    • \n"; } print "
    \n"; print "
    ", ("$rejectlinkを更新する","Update $rejectlink")[$lang], "
    \n"; print "
    \n"; &disptail; &htmltail; } sub reject_list { my @reject; if (open(REJECT,"< $rejectlink")){ @reject = ; close(REJECT); } else { @reject = (); } map {chomp} @reject; return (@reject); } ############################################################################# # Summary Form mode ######################################################### ############################################################################# sub mbsumform { my ($firstyear,$finyear) = &get_firstyear; my $titleprint=&titleprint("$thtitle $mbsumtitle","$mbsum_logo","$mbsum_style","$mbsum_color","$mbsum_size","$mbsum_face","$mbsum_sel","$mbsum_loc"); &htmlhead($mbsumtitle,$firstyear); print qq!
    \n!; print qq!\n!; print qq!\n!; print qq!$titleprint\n!; print qq!\n!; print qq!\n!; print qq!\n!; print qq!\n!; print qq!
    !; print (('参照対象','Range')[$lang]); print qq! \n!; print qq!\n!; print qq!\n!; print qq!
    \n!; print qq!!; print (('全部','all')[$lang]); print "\n"; print qq!Message#\n!; print "from" if ($lang == 1); print qq!!; print "から" if ($lang == 0); print "to" if ($lang == 0); print qq!!; print "まで\n" if ($lang == 0); print qq!
    \n!; print qq!!; print (('日付が','date')[$lang]); print qq!\n!; print "Year" if ($lang == 1); print qq!"; print '年' if ($lang == 0); print "Month" if ($lang == 1); print <
    個人名方式   名前  人物 (印のみ有効) 同一人物設定
    日毎の集計
    トップ100 書き込み量の上位100
    件数対日数 日数を件数でソ\ート
    時間帯集計 時間帯毎の書き込みの量
    曜日毎集計 曜日毎の書き込みの量
    月毎の集計 毎月の書き込みの量
    年毎の集計 毎年の書き込みの量
    ぴったり賞 Message#100, 777, 等に当たった人
    個人別集計 名前別書き込みの量
    月間個人別集計
    年間個人別集計
    月間トップ3 歴代の月間トップ3
    個人最終書き込み 特定の名前で最後に書き込んだ日
         

    $thtitleへ $th_titleへ 個人データ詳細

    END5 print "bar.gif作成\n"; &htmltail; } sub optyear { my ($firstyear,$finyear) = @_; foreach ($firstyear .. $finyear){ my $dispy = $_+1900; my $selected = ''; $selected = 'selected' if ($_ == $finyear); print "