#!/usr/local/bin/perl ## Fantasy Board v1.5 ## (C)1997-2000 Kent Web (00/05/04) ## Mail: webmaster@kent-web.com ## Home: http://www.kent-web.com/ $ver = 'Fantasy v1.5'; # バージョン情報 #--- [注意事項] ------------------------------------------------# # 1. このスクリプトはフリーソフトです。このスクリプトを使用した # # いかなる損害に対して作者は一切の責任を負いません。 # # 2. 設置に関する質問はサポート掲示板にお願いいたします。 # # 直接メールによる質問は一切お受けいたしておりません。 # #---------------------------------------------------------------# #============# # 設定 # #============# require './jcode.pl'; require "/home/systems/cgi-bin-common/deny-lib.pl"; &check_deny($ENV{'REMOTE_ADDR'}, $ENV{'REMOTE_HOST'}, 31); # タイトル名 $title = "KaPoLo Club"; # タイトル文字の色 $t_color = "#FFFF66"; # タイトル文字のタイプ $t_face = "Arial"; # タイトル文字サイズ(スタイルシートで有効) $t_point = '18pt'; # スクリプト名 $script = "./fantasy.cgi"; # ログファイル名 $logfile = "./fantasy.log"; # Adminパスワード $pass = 'supersaka'; # 最大記事数(これを超える記事は古い順にRemoveされます) $max = 1000; # 戻り先 $home = "http://saka.syste.ms/index.html"; # 画像格納ディレクトリ(絶対パスなら http://から記述) $imgurl = "."; # 背景色、文字色 $bgrnd = ""; # 壁紙 $bgcol = "#FFCC99"; # 背景色 $text = "#222222"; # 文字色 $link = "#FF7777"; # リンク色:未訪問 $vlink = "#FF7777"; # リンク色:既訪問 $alink = "#CC66FF"; # リンク色:訪問中 # ワンポイントカラー $onepnt = "#008000"; # method形式 (POST/GET) $method = 'POST'; # タグ許可 (0=no 1=yes) $tagkey = 0; # URLの自動リンク (0=no 1=yes)# --> タグ許可の場合は no とすること。 $autolink = 1; # 1ページあたりの記事表示件数 $p_log = 10; # ホスト名取得に gethostbyaddr関数を使用 (0=no 1=yes) $gethostbyaddr = 1; # ロックファイル機構 (0=no 1=symlink関数 2=open関数) # --> ロックファイル機構を使用する場合ロックファイルを生成するディレクトリ # のパーミッションは 777 に設定する $lockkey = 1; # ロックファイル名 $lockfile = "./fantasy.lock"; # メール通知機能 # 0=no # 1=yes:自分の投稿記事もメール通知する # 2=yes:自分の投稿記事はメール通知しない $mailing = 0; # sendmailのパス(メール通知する場合) $sendmail = '/usr/sbin/sendmail'; # メール通知先アドレス(メール通知する場合) $mailto = 'saka@syste.ms'; # Location @areas = ( 'USA','Japan','Thailand','Asia','North America','South America', 'Europe','Africa','Antartica','Arctic','Australia','Earth','Moon','Another Galaxy','Another Dimension'); # キャラクタを指定(上下の配列はペアで) @icon1 = ( 'f01.gif','f02.gif','f03.gif','f04.gif','f05.gif', 'f06.gif','f07.gif','f08.gif','f09.gif','f10.gif', 'f11.gif','f12.gif','f14.gif','f15.gif','f16.gif','f17.gif','f18.gif','f19.gif','f20.gif', 'm01.gif','m02.gif','m03.gif','m04.gif','m05.gif', 'm06.gif','m07.gif','m08.gif','m09.gif','m10.gif','m11.gif','m12.gif','bo.gif','bo2.gif', 'cocoanut.gif','coffee.gif','marshmallow.gif','ham.gif','scratch.gif'); @icon2 = ( 'f01','f02','f03','f04','f05', 'f06','f07','f08','f09','f10', 'f11','f12','f14','f15','f16','f17','f18','f19','f20', 'm01','m02','m03','m04','m05', 'm06','m07','m08','m09','m10','m11','m12','Bo','Bo 2', 'Cocoanut','Coffee','Marshmallow','hamster','scratch'); # 管理者名 $master = "Saka"; # 返信Messageの文字色 $mas_color = "#C100C1"; # 管理者用アイコン $mas_icon = "master.gif"; # タグ広告挿入オプション (FreeWebなど) # → の代わりに「広告タグ」を挿入する。 # → 広告タグ以外に、MIDIタグ や LimeCounter等のタグにも使用可能です。 $banner1 = ''; # 掲示板上部に挿入 $banner2 = ''; # 掲示板下部に挿入 # アクセス制限(拒否するホスト名を記述) @deny = ( "anonymizer", "cache*.*.interlog.com", "", "", "", "", "", "", "" ); # タイトル画像を使う場合 # --> 画像URLを http:// から記述 $ImgT = ""; $ImgW = "150"; # 画像横幅 $ImgH = "50"; # 画像縦幅 #============# # 設定完了 # #============# # Imageディレクトリ調整 $imgurl =~ s/\/$//; &decode; &axs_check; if ($mode eq 'regist') { ®ist; } if ($mode eq 'find') { &find; } if ($mode eq 'howto') { &howto; } if ($mode eq 'admin1') { &admin1; } if ($mode eq 'admin2') { &admin2; } if ($mode eq 'usrdel') { &usrdel; } if ($mode eq 'image') { ℑ } if ($mode eq 'res') { &res_msg; } &html; #----------------# # アクセス制限 # #----------------# sub axs_check { if ($deny[0]) { # ホスト名を取得 &get_host; $flag=0; foreach (@deny) { if ($_ eq '') { last; } $_ =~ s/\*/\.\*/g; if ($host =~ /$_/) { $flag=1; last; } } if ($flag) { &error("Access Denied") } } } #----------------# # 記事表示処理 ##----------------# sub html { # ブラウザ情報を取得 &get_agent; # クッキー情報を取得 &get_cookie; &header; print "
\n"; if ($banner1 ne "") { print "$banner1

\n"; } # タイトル部 if ($ImgT) { print "\"$title\"\n"; } else { print "$title\n"; } # [Help] print <<"EOM";


[Return to Top] [Search] [Admin]
Name
E-MAIL
URL
Location \n"; # Imageの選択フォームを表示 print "Image [View Icons]
Suggestions

Passcode (For removing messages)
Use Cookie (Save Info)

EOM # ページ区切り処理 $start = $page + 1; $end = $page + $p_log; open(IN,"$logfile") || &error("Open Error : $logfile"); $i=0; $j=0; while ($_ = ) { $i++; $j++; if ($i < $start) { next; } if ($i > $end) { next; } ($no,$date,$name,$mail,$area,$icon, $icon2,$com,$res,$url,$host,$pw) = split(/<>/, $_); if ($mail) { $name = "$name"; } if ($url) { $url = ""; } # 1ワクの大きさ $pix=18; # 記事を表示 print "\n"; # 反転対象部分1 if (!$flag) { print "\n"; print "
\n"; print "\n"; print "\n"; } else { print "

\n"; print "\n"; } print "\n"; print "\n"; print "\n"; # 反転対象部分2 if ($flag == 0) { print "\n"; } else { print "\n"; } print "\n"; print "\n"; if ($flag == 1) { print "\n"; } print "\n"; # 反転対象部分3 if ($flag == 0) { print "\n"; } print "\n"; print "\n"; print "\n"; if ($flag == 1) { print "\n"; } print "



\n"; print "[$no] $name [$area] "; print "$date $url
\n"; print "
$com
\n"; # 管理者レス if ($res) { print "
\n"; print ""; print "\n"; print "\n"; print "

$res
\n"; print "[ From $master ]
\n"; } print "




\n"; if ($flag == 1) { print "
\n"; } print "
\n"; print "

\n"; if ($flag == 0) { $flag = 1;} else { $flag = 0; } } close(IN); $next_page = $page + $p_log; $back_page = $page - $p_log; print "
\n"; if ($back_page >= 0) { print "\n"; } if ($next_page < $i) { 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 "[Form Removal]
\n"; print "Form #\n"; print "Passcode\n"; print "\n"; print "

\n"; # 著作権表示(Remove不可) print "
$banner2

\n"; print "- Fantasy Board -\n"; print "

\n"; print "\n"; exit; } #----------------# # 書きこみ処理 # #----------------# sub regist { # フォーム内容をチェック if ($name eq "") { &error("Please enter your name"); } if ($com eq "") { &error("Please do not leave your message blank"); } # ロック処理 if ($lockkey == 1) { &lock1; } elsif ($lockkey == 2) { &lock2; } open(IN,"$logfile") || &error("Open Error : $logfile","lock"); @lines = ; close(IN); ($tno,$tdate,$tname,$tmail,$tarea,$tico,$tico2,$tcom) = split(/<>/, $lines[0]); if ($name eq "$tname" && $com eq "$tcom") { &error("Your entry was already submitted.","lock"); } # 記事Noを採番 $no = $tno + 1; # ホスト名を取得 &get_host; # Passcodeを暗号化 if ($in{'pwd'}) { $PW = &encrypt($in{'pwd'}); } # URL自動リンク if ($autolink) { &auto_link($com); } # 最大記事数処理 while ($max <= @lines) { pop(@lines); } # 更新 unshift(@lines,"$no<>$date<>$name<>$email<>$areas[$area]<>$icon<>$icon2<>$com<><>$url<>$host<>$PW<>\n"); open(OUT,">$logfile") || &error("Write Error : $logfile","lock"); print OUT @lines; close(OUT); # ロック解除 if (-e $lockfile) { unlink($lockfile); } if ($in{'cook'} eq 'on') { &set_cookie; } # メール通知処理 if ($mailing == 1) { &mail_to; } elsif ($mailing == 2 && $email ne "$mailto") { &mail_to; } } #--------------# # Search # #--------------# sub find { &header; print <<"HTML"; [Return to BBS]
Search

  • Enter the keyword in which you want to search for, and click on the Search button.

キーワード
検索条件 AND OR
HTML # Searchの実行と結果表示 if ($in{'word'} ne "") { # 入力内容を整理 $cond = $in{'cond'}; $word = $in{'word'}; $word =~ s/ / /g; $word =~ s/\t/ /g; @pairs = split(/ /,$word); # 検索処理 print "
    \n"; open(IN,"$logfile") || &error("Open Error : $logfile"); $i=0; while ($_ = ) { $flag = 0; foreach $pair (@pairs) { if (index($_,$pair) >= 0) { $flag=1; if ($cond eq 'or') { last; } } else { if ($cond eq 'and') { $flag = 0; last; } } } if ($flag == 0) { next; } # 結果を表示 $i++; ($no,$date,$name,$mail,$area,$icon, $icon2,$com,$res,$url,$host,$pw) = split(/<>/, $_); if ($mail) { $name = "$name"; } if ($url) { $url = "http://$url"; } print "
  1. [$no] Submitted by:$name Date: $date
    \n"; print "
    $com

    $url


    \n"; } close(IN); print "$i result(s) found.\n"; print "
\n"; } print "\n"; exit; } #------------------# # Admin入室画面 # #------------------# sub admin1 { &header; print <<"EOM"; [戻る]
Admin Mode

Please Enter Admin Password

Form Remove Reply

EOM exit; } #--------------# # 管理モード # #--------------# sub admin2 { if ($in{'pass'} ne "$pass") { &error("Wrong Password"); } # ロック処理 if ($DEL[0] && $lockkey == 1) { &lock1; } elsif ($DEL[0] && $lockkey == 2) { &lock2; } open(IN,"$logfile") || &error("Open Error : $logfile"); @lines = ; close(IN); &header; print "[Back]\n"; print "
\n"; print "Admin Mode\n"; print "

\n"; # Remove処理 if ($DEL[0]) { # Remove情報をマッチングし更新 @new=(); foreach (@lines) { $flag=0; ($no,$date) = split(/<>/, $_); foreach $del (@DEL) { if ($no eq "$del") { $flag=1; last; } } if ($flag == 0) { push(@new,$_); } } open(OUT,">$logfile") || &error("Write Error : $logfile","lock"); print OUT @new; close(OUT); @lines = @new; # ロック解除 if (-e $lockfile) { unlink($lockfile); } } # 管理を表示 print "

\n"; if ($in{'action'} eq 'res') { print "Please click on the Reply button.

\n"; } else { print "Check whatever you wish to remove, and click on the Remove button.

\n"; print "

\n"; print "\n"; print "\n"; print "\n"; print ""; print "\n"; } print "

\n"; print ""; print "\n"; # ページ区切り処理 $start = $page + 1; $end = $page + $p_log; $i=0; $j=0; foreach (@lines) { $i++; $j++; if ($i < $start) { next; } if ($i > $end) { next; } ($no,$date,$name,$mail,$area,$icon, $icon2,$com,$res,$url,$host,$pw) = split(/<>/, $_); if ($mail) { $name="$name"; } ($date,$dmy) = split(/\(/, $date); $com =~ s/
//ig; $com =~ s//>/g; if (length($com) > 50) { $com = substr($com,0,48); $com = "$com" . "..."; } if ($res eq '') { $res = '
'; } else { $res =~ s/
//ig; $res =~ s//>/g; if (length($res) > 50) { $res = substr($res,0,48); $res = "$res" . "..."; } } # Removeチェックボックス if ($in{'action'} eq 'del') { print ""; } # 返信ボタン else { print ""; } print ""; print ""; print "\n"; } print "
処理No投稿日投稿者コメントレス
\n"; print "\n"; print "\n"; print "\n"; print "$no$date$name$com
[$host]
$res
\n"; $next_page = $page + $p_log; $back_page = $page - $p_log; print "

\n"; if ($back_page >= 0) { print "\n"; } if ($next_page < $i) { 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"; exit; } #--------------------# # 返信レスフォーム # #--------------------# sub res_msg { if ($in{'pass'} ne "$pass") { &error("Wrong Password"); } # レス書込み処理 if ($in{'action'} eq "res") { # ロック開始 if ($lockkey == 1) { &lock1; } elsif ($lockkey == 2) { &lock2; } # ファイル更新 open(IN,"$logfile") || &error("Open Error : $logfile","lock"); @lines = ; close(IN); @new=(); foreach (@lines) { ($no,$date,$name,$mail,$area,$icon, $icon2,$MSG,$res,$url,$host,$pw) = split(/<>/, $_); if ($in{'no'} eq "$no") { $_ = "$no<>$date<>$name<>$mail<>$area<>$icon<>$icon2<>$MSG<>$com<>$url<>$host<>$pw<>\n"; } push(@new,$_); } # 更新 open(OUT,">$logfile") || &error("Write Error : $logfile","lock"); print OUT @new; close(OUT); # ロック解除 if (-e $lockfile) { unlink($lockfile); } # 管理画面に戻る &admin2; } # 返信フォーム表示の場合 else { open(IN,"$logfile") || &error("Open Error : $logfile"); while ($_ = ) { ($no,$date,$name,$mail,$area,$icon, $icon2,$com,$res,$url,$host,$pw) = split(/<>/, $_); if ($in{'no'} eq "$no") { last; } } close(IN); } if ($mail) { $name = "$name"; } if ($method eq 'POST' && $url) { $url = "(Home)"; } else { $url = ''; } $res =~ s/
/\r/ig; $res =~ s/<//g; &header; print <<"EOM"; [Return to BBS]
Reply Mode
[$no] 投稿者:$name [$area] $date $url
$com
Reply Message

EOM exit; } #--------------# # Help表示 # #--------------# sub howto { if ($tagkey == 0) { $tag_msg = "Tags will not be saved in your text(will become spaces instead).\n"; } else { $tag_msg = "You can use tags in your messages\n"; } &header; print <<"EOM"; [Return to BBS]
BBS Help

  1. この掲示板はクッキー対応です。1度記事を投稿いただくと、Name、E-MAIL、URL、Passcodeの情報は2回目以降は自動入力されます。(ただし利用者のブラウザがクッキー対応の場合)

  2. $tag_msg

  3. 記事を投稿する上での必須入力項目は「Name」「Message」です。E-MAIL、URL、Passcodeは任意です。

  4. 記事には、半角カナは一切使用しないで下さい。文字化けの原因となります。

  5. 記事の投稿時に「Passcode」にパスワード(英数字で8文字以内)を入れておくと、その記事は次回PasscodeによってRemoveすることができます。

  6. 記事の保持件数は最大 $max件です。それを超えると古い順に自動Removeされます。

  7. 過去の投稿記事から「キーワード」によって簡易検索ができます。トップメニューの「Search」のリンクをクリックすると検索モードとなります。

  8. 管理者が著しく不利益と判断する記事や他人を誹謗中傷する記事は予\告なくRemoveすることがあります。
EOM exit; } #------------------# # ユーザ記事Remove # #------------------# sub usrdel { if ($in{'no'} eq '' || $in{'pwd'} eq '') { &error("RemoveNoまたはPasscodeが入力モレです"); } open(IN,"$logfile") || &error("Open Error : $logfile"); @lines = ; close(IN); $flag=0; @new=(); foreach (@lines) { ($no,$date,$name,$mail,$area,$icon, $icon2,$com,$res,$url,$host,$pw) = split(/<>/, $_); if ($in{'no'} eq "$no") { $flag=1; $PW=$pw; } else { push(@new,$_); } } if ($flag == 0) { &error("Error Found"); } if ($PW eq '') { &error("This message contains no passcode"); } # Passcodeを照合 $match = &decrypt("$in{'pwd'}","$PW"); if ($match ne 'yes') { &error("Wrong Passcode"); } else { # ロック処理 if ($lockkey == 1) { &lock1; } elsif ($lockkey == 2) { &lock2; } open(OUT,">$logfile") || &error("Open Error : $logfile","lock"); print OUT @new; close(OUT); # ロック解除 if (-e $lockfile) { unlink($lockfile); } } } #----------------# # デコード処理 # #----------------# sub decode { if ($ENV{'REQUEST_METHOD'} eq "POST") { if ($ENV{'CONTENT_LENGTH'} > 51200) { &error("投稿量が大きすぎます"); } read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # S-JISコード変換 &jcode'convert(*value,'sjis'); # タグ処理 if ($tagkey == 0) { $value =~ s/\&/&/g; $value =~ s//>/g; } else { $value =~ s/<>/<>/g; $value =~ s///g; } # Remove情報 if ($name eq 'del') { push(@DEL,$value); } $in{$name} = $value; } $name = $in{'name'}; $com = $in{'com'}; $com =~ s/\r\n/
/g; $com =~ s/\r/
/g; $com =~ s/\n/
/g; $email = $in{'email'}; $url = $in{'url'}; $url =~ s/^http\:\/\///; $mode = $in{'mode'}; $pwd = $in{'pwd'}; $icon = $in{'icon'}; $area = $in{'area'}; $page = $in{'page'}; # 日時の取得 $ENV{'TZ'} = "JST-9"; ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime(time); # 日時のフォーマット @week = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); $date = sprintf("%04d/%02d/%02d(%s) %02d:%02d", $year+1900,$mon+1,$mday,$week[$wday],$hour,$min); } #--------------# # HTMLヘッダ # #--------------# sub header { $HEAD = 1; # ヘッダ表示フラグ print "Content-type: text/html\n\n"; print <<"EOM"; $title EOM } #------------------------------------# # ブラウザ情報からフォーム長を定義 # #------------------------------------# sub get_agent { $agent = $ENV{'HTTP_USER_AGENT'}; if ($agent =~ /MSIE 4/i || $agent =~ /MSIE 5/i) { $f_name = 28; $f_url = 63; $f_cols = 58; } else { $f_name = 22; $f_url = 42; $f_cols = 55; } } #--------------# # エラー処理 # #--------------# sub error { if ($_[1] eq "lock" && -e $lockfile) { unlink($lockfile); } if (-e $tmpfile) { unlink($tmpfile); } if ($HEAD eq "") { &header; } print "


ERROR !

\n"; print "

$_[0]\n"; print "


\n"; print "\n"; exit; } #------------------# # クッキーの発行 # #------------------# sub set_cookie { ($secg,$ming,$hourg,$mdayg,$mong,$yearg,$wdayg) = gmtime(time + 60*24*60*60); @mons = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); $date_g = sprintf("%s, %02d\-%s\-%04d %02d:%02d:%02d GMT", $week[$wdayg],$mdayg,$mons[$mong],$yearg+1900,$hourg,$ming,$secg); $cook="name\:$name\,email\:$email\,url\:$url\,pwd\:$pwd\,area\:$area\,icon\:$icon"; print "Set-Cookie: FANTA=$cook; expires=$date_g\n"; } #------------------# # クッキーを取得 # #------------------# sub get_cookie { $cookies = $ENV{'HTTP_COOKIE'}; @pairs = split(/;/, $cookies); foreach $pair (@pairs) { local($name, $value) = split(/=/, $pair); $name =~ s/ //g; $DUMMY{$name} = $value; } @pairs = split(/,/, $DUMMY{'FANTA'}); foreach $pair (@pairs) { local($name, $value) = split(/:/, $pair); $COOKIE{$name} = $value; } $c_name = $COOKIE{'name'}; $c_email = $COOKIE{'email'}; $c_url = $COOKIE{'url'}; $c_pwd = $COOKIE{'pwd'}; $c_area = $COOKIE{'area'}; $c_icon = $COOKIE{'icon'}; if ($in{'cook'} eq 'on') { if ($name) { $c_name = $name; } if ($email) { $c_email = $email; } if ($url) { $c_url = $url; } if ($pwd) { $c_pwd = $pwd; } if ($area) { $c_area = $area; } if ($icon) { $c_icon = $icon; } } } #----------------# # ホスト名取得 # #----------------# sub get_host { $host = $ENV{'REMOTE_HOST'}; $addr = $ENV{'REMOTE_ADDR'}; if ($gethostbyaddr) { if ($host eq "" || $host eq "$addr") { $host = gethostbyaddr(pack("C4", split(/\./, $addr)), 2); } } if ($host eq "") { $host = $addr; } } #----------------------# # パスワード暗号処理 # #----------------------# sub encrypt { local($inpw) = $_[0]; local(@SALT, $salt, $encrypt); @SALT = ('a'..'z', 'A'..'Z', '0'..'9', '.', '/'); srand; $salt = $SALT[int(rand(@SALT))] . $SALT[int(rand(@SALT))]; $encrypt = crypt($inpw, $salt) || crypt ($inpw, '$1$' . $salt); return $encrypt; } #----------------------# # パスワード照合処理 # #----------------------# sub decrypt { local($inpw, $logpw) = @_; local($salt, $key, $check); $salt = $logpw =~ /^\$1\$(.*)\$/ && $1 || substr($logpw, 0, 2); $check = "no"; if (crypt($inpw, $salt) eq "$logpw" || crypt($inpw, '$1$' . $salt) eq "$logpw") { $check = "yes"; } return $check; } #--------------------------------# # ロックファイル : symlink関数 # #--------------------------------# sub lock1 { local($retry) = 5; while (!symlink(".", $lockfile)) { if (--$retry <= 0) { &error("LOCK is BUSY","lock"); } sleep(1); } } #-----------------------------# # ロックファイル : open関数 # #-----------------------------# sub lock2 { local($flag) = 0; foreach (1 .. 5) { if (-e $lockfile) { sleep(1); } else { open(LOCK,">$lockfile") || &error("Write Error : $lockfile","lock"); close(LOCK); $flag = 1; last; } } if ($flag == 0) { &error("LOCK is BUSY","lock"); } } #--------------# # メール送信 # #--------------# sub mail_to { # メール送信用に他変数に置換 $m_sub = "Mail from $title"; $m_name = $name; $m_com = $com; # Message部の改行、タグを復元 $m_com =~ s/
/\n/ig; $m_com =~ s/&/&/g; $m_com =~ s/<//g; # 文字コードをJIS変換 &jcode'convert(*m_sub,'jis'); &jcode'convert(*m_name,'jis'); &jcode'convert(*m_com,'jis'); # sendmail起動 if (!open(MAIL,"| $sendmail -t")) { &error("Error sending mail"); } print MAIL "To: $mailto\n"; # メールアドレスがない場合はダミーメールに置き換え if ($email eq "") { $email = 'nomail@xxx.xxx'; } print MAIL "From: $email\n"; print MAIL "Subject: $m_sub\n"; print MAIL "MIME-Version: 1.0\n"; print MAIL "Content-type: text/plain; charset=ISO-2022-JP\n"; print MAIL "Content-Transfer-Encoding: 7bit\n"; print MAIL "X-Mailer: $ver\n\n"; print MAIL "--------------------------------------------------------\n"; print MAIL "TIME : $date\n"; print MAIL "HOST : $host\n"; print MAIL "NAME : $m_name\n"; if ($in{'email'}) { print MAIL "EMAIL: $in{'email'}\n"; } if ($url) { print MAIL "URL : http://$url\n"; } print MAIL "$m_com\n"; print MAIL "--------------------------------------------------------\n"; close(MAIL); } #----------------# # Image表示 # #----------------# sub image { &header; print "

\n"; print "

Image Sample

\n"; print "

Here are the images available\n"; print "


\n"; print "

\n"; $i=0; $j=0; $stop = @icon1; foreach (0 .. $#icon1) { $i++; $j++; print "\n"; if ($i >= 5) { print ''; $i=0; } if ($j eq "$stop") { if ($i == 0) { last; } while ($i < 5) { print ""; $i++; } } } print "
$icon2[$_]


\n"; print "

\n"; print "\n"; exit; } #-----------------# # 自動URLリンク # #-----------------# sub auto_link { $_[0] =~ s/([^=^\"]|^)(http\:[\w\.\~\-\/\?\&\=\@\;\#\:\%]+)/$1$2<\/a>/g; }