#!/usr/local/bin/perl
#━<初期設定開始>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
require './jcode.pl'; #日本語コード変換
$url = 'http://www.google.co.jp/';#戻り先URL
$script = './index.cgi'; #このCGIの名前を指定
$logfile = './log.txt'; #ログファイルの名前を指定 http://〜で指定してはダメですよ
$lockfile = './chi-tai.lock'; #ロックファイルの名前を指定(自分で作る必要無し)
$cntfile = ''; #カウンターファイルの名前を指定(未使用の場合は'')
$logfile2 = './cnt.txt'; #←昇進機能ファイル
#カウンター用画像を使う場合、画像のIMGタグを指定。src=の後ろに画像のパスを指定してね。画像サイズがわからない場合は、width〜、height〜の部分は消してください。
#画像ファイル名の指定方法は、src=http://www.〜/xxx.gifというように設定したほうが確実ですよ。
#画像を使わない場合はテキストカウンターとなります。この場合、以下を''として下さい。
$cnt_gif[0] = '';
$cnt_gif[1] = '';
$cnt_gif[2] = '';
$cnt_gif[3] = '';
$cnt_gif[4] = '';
$cnt_gif[5] = '';
$cnt_gif[6] = '';
$cnt_gif[7] = '';
$cnt_gif[8] = '';
$cnt_gif[9] = '';
$cnt_keta = 5; #カウンターの桁数は?
$title = '雑談掲示板'; #タイトルを指定
$titlelogo = ''; #タイトル画像を指定。src=の後ろに画像のパスを指定してね。(使用しない場合は、'')
$backpicture = ''; #背景画像を指定(使用しない場合は、'')
$bgcolor = '#ffffff'; #背景色を指定
$tbgcolor = ''; #入力フォームの背景色を指定(透明にしたい場合は'')
$tcolor = "#666666"; # 文字色
$linkcolor = "#cc6600"; # リンク色(未読リンク)
$vlinkcolor = "#666666"; # リンク色(既読リンク)
$alinkcolor = "#ff3300"; # リンク色(押した時)
$hovercolor = '#ff0000'; #リンクをポイントした際のアンダーライン色(IEのみ) i000331
$pt = '13px'; #全体のフォントサイズ(pt指定以外何があるのか、僕知らない。(^^ゞ) #i000331
$res_gif = './res.gif'; #メッセージ表示部分にある「返信」に画像を使う場合。画像を使わない場合は、以下を''として下さい。
$name_color = "#666666"; #投稿メッセージ表示部分の「名前」の色
$msg_color = "#ffffff"; #投稿メッセージ表示部分の「メッセージ」の背景色
$titleset = 1; #入力フォームに「タイトル」必要?(0:不要 1:必要)
$homelinklogo = '';#ホームページ・リンク画像へのIMGタグを指定(未使用の場合は'')
$maillinklogo = '';#メール・リンク画像へのIMGタグを指定(未使用の場合は'')
$top_l = ''; #yuki設定項目
$top_r = ''; # 〃
$bottom_l = ''; # 〃
$bottom_r = ''; # 〃
$datamax = 100 ; #最大データ保存件数(親記事)…越えたら過去ログを作成します。(過去ログ作成する設定の場合)
$pagemax = 5 ; #1ページ内に表示する件数(親記事の件数)
$password = '1234'; #メンテナンス用パスワード(管理者用)
$tag = 'no'; #タグ許可(yes,no)
$resflag = 'yes' ; #最新レスを先頭に表示する?(yes,no)
$hostflag = 'yes' ; #リモートホストを表示する?(yes.no)
$row = 7 ; #入力フォーム・メッセージ欄の行数
$col = 77; #入力フォーム・メッセージ欄の文字数
#色の指定(枠色)
@COLORS_B = ('#666666','#8c98e8','lightcoral','lightsalmon','#6ab43f','#40a495','orchid','burlywood','#9933ff');
#↑みたいに、枠色は選択しないという(1色でいい)方はチェック(1)
$colb_use = 0; #(0:色指定する 1:色指定しない)
$colb = '#cccccc' ; #上記が'1'の場合、背景色を指定
#色の指定(文字色)
@COLORS_F = ('#666666','#8c98e8','lightcoral','lightsalmon','#6ab43f','#40a495','orchid','burlywood','#9933ff');
#↑みたいに、文字色は選択しないという(1色でいい)方はチェック(1)
$colf_use = 0; #(0:色指定する 1:色指定しない)
$colf = '#000000' ; #上記が'1'の場合、文字色を指定
#入力フォームの各項目見出し部分(NAME,EMAIL,HP,TITLE等)に画像を使用しない場合は、0を設定
$gif_flg = 0; #yuki設定項目。削除不可 #(0:使用しない 1:使用する)
$icon_use = 'yes'; #アイコンを使用しますか?(yes,no)
#↓管理者用アイコンとパスワードを指定。管理人は1つしかアイコン登録出来ません。
# $oiconpassに指定したパスワードで投稿した場合、$oicon_gifのアイコンが表示されるようになってます。
#管理者アイコンは特に必要無い場合は、$oiconpass = '';として下さい。
$oicon_gif = 'tutu' ; $oiconpass = '2345';
$oicon_gif_w = 65 ; $oicon_gif_h = 65 ;
#↓常連者用アイコンと投稿時の名前を指定。$jicon_gif[2]...[5]のように適当に増やして下さいね。
# $jiconnmに指定した名前で投稿した場合、$jicon_gifのアイコンが表示されるようになってます。
#その下は、画像サイズ。_wは幅。_hは高さです。わからない場合は_wの方だけ0にしておいてね。
$jicon_gif[0] = 'abc'; $jiconnm[0] = 'abc';
$jicon_gif_w[0] = 80 ; $jicon_gif_h[0] = 72 ;
$jicon_gif[1] = 'xyz'; $jiconnm[1] = 'xyz';
$jicon_gif_w[1] = 80 ; $jicon_gif_h[1] = 71 ;
#↓訪問者用アイコンとアイコンの名前の指定。$icon_gif[3]...[10]のように適当に増やして下さいね。
$icon_gif[0] = 'img/aren.png' ; $iconnm[0] = 'アレン' ;
#アイコン一覧を表示する際、1行にアイコンを何個表示します?
$icon_line = 3 ; #←の場合、3個表示したら改行するって事です。
$method = 'POST'; #METHODの指定(POST又はGET)
#<<<↓の画像はそのまま使用してね。パスだけ修正。
$gif_spacer = './spacer.gif'; #ダミー透過画像
#掲示板荒らし対策。排除したいプロバのアドレスを設定して下さい。
# "xxx?.com"とした場合、"xxx1.com","xxx2.com"等、「?」の部分が文字列1つと判断します
# "xxx*.com"とした場合、"xxx1.com","xxx12345.com等、「*」の部分が0個以上の文字列と判断します。
@DANGER_LIST=("xxx1","xxxj","bbb7");
#掲示板荒らし対策その2。メッセージ最大文字数を指定。特に設定しない場合は、''として下さい。
$maxword = '2000' ; #2000=日本語で1000文字という意味です。
#↓昇進機能を使う場合のみ設定。昇進機能を使用しない場合は、このままで構いません。
@rank = ('市民','アーマーナイト','魔道士','傭兵','剣士','ジェネラル','賢者','勇者','ソードマスター','ロード','マスターロード','八神将');
#↓指定した回数で昇進していきます
@rankno = ('0','5','10','20','40','50','70','100','130','150','180','250');
#昇進機能を使う場合、昇進状態に従ってアイコンを変えますか?
#この場合、投稿時にはアイコンの選択は出来ません。
#又、昇進状態の個数とアイコンの個数は同じにしておいて下さい。
#ex.
# $icon_gif[0] = 'xx1.gif';
# $icon_gif[1] = 'xx2.gif';
# $icon_gif[2] = 'xx3.gif';
# @rankno = ('0','10','100'); ※画像も3個、昇進状態も3個ですよね?このようにして下さい。
$icon_rank = 0 ; #0:昇進とは別にアイコンを使う(投稿時にアイコン選択) 1:昇進に合わせてアイコンを表示
#投稿時に管理者にメール送信する場合、sendmailのパスを指定
#プロバがsendmailに対応していなければなりません。詳細はプロバに質問して下さいね。
#※使用しない(又は、できない)場合は、$sendmail = "";のようにして下さい!!
$sendmail = "";
#メール送信先アドレス。(管理者のアドレス)…「@」の前には「\」を必ずつけてね。「\」を付けないとInternalServererrorになるからね。でもなんない時もあるなぁ。よくわからん。(^^;;;
#(Sendmailを使わない場合は設定しても意味ありません)
$smail_address = "xxxxx\@xxxxx.co.jp";
$sendsw = 1 ; #Sendmailを使う場合: 0:管理人の投稿($smail_addressで指定したメルアド入力時)はメール送信しない 1:全ての記事に対してメール送信する
$hiho = 0 ; #プロバイダーが「hi-ho」の人のみ「1」にして下さい。 ※Sendmail使う場合
#投稿時のパスワードをcrypt関数を使用する(暗号化)
#crypt関数が利用出来ない場合もありますので、投稿時にエラーになる場合は、「0:使用しない」にして下さいね。
$ango = 1 ; #0:使用しない 1:使用する (推奨:1:使用する)
#<<< 過去ログ設定…指定したディレクトリ($olddir)直下に"01.txt".."10.txt"のように作成します
#<<< ※CGIと同じ階層には、設置出来ません。必ず過去ログ保存用フォルダを作成してください。
$olddir = './old/' ; #過去ログ作成用ディレクトリを指定。(不要の場合は'')
$oldmax = 100 ; #1過去ログファイルの最大件数(親記事)。越えたら次の過去ログを作成します
#=============================================================================================================================================================================================
#フォームCSS設定(全体的なCSS)※使用しない場合は$body_css = "";とし,そこから2行(先頭がEOMの行までを)を削除して下さい。
$body_css = <<"EOM";
EOM
#フォームCSS設定(入力欄のCSS)※使用しない場合は$css_style = "";とし,そこから2行(先頭がEOMの行までを)を削除して下さい。
$css_style = <<"EOM";
onMouseover="this.focus();this.style.backgroundColor='#ffffff';this.style.color='#666666';this.style.borderColor='#609bff'" onMouseout="this.style.backgroundColor='#ffffff';this.style.color='#666666';this.style.borderColor='#609bff'"
EOM
#フォームCSS設定(ボタンのCSS)※使用しない場合は$css_style = "";とし,そこから2行(先頭がEOMの行までを)を削除して下さい。
$css_style2 = <<"EOM";
onMouseover="this.style.backgroundColor='#ffffff';this.style.color='#666666';this.style.borderColor='#609bff'" onMouseout="this.style.backgroundColor='#ffffff';this.style.color='#666666';this.style.borderColor='#609bff'"
EOM
#■↓の機能がわからない、又は降格はしないのであれば、「$rdm = 0 ;」と、0を指定してください。
$rdm = 0 ; #0〜30のランダム値を$rdm2で割った余りが0の場合、以下のランダム降格を行います
#もし、降格の確率が多い場合は、$rdmの値を増やしてください。<15以下の値で。
@DOWN = (1,2,3,5,7,10) ; #ランダム降格(左記で設定した値の中からランダムに投稿回数を減少させます)
#減少回数は2個くらいでいいなら、@DOWN(1,3);としてね。<1回分投稿回数を減少、又は3回分投稿回数減少の意味となります。
#ちなみに、-10とかを設定したら、一気に昇進となります。
$kaisu_disp = 1 ; #投稿回数をログ表示部にも表示する?(0:no 1:yes)
$ikkiflg = 0 ; #一気にレスモードを使う?(0:no 1:yes)
#一気にレスを使う場合、ResModeがONの際に入力フォームの下に表示させるメッセージ。表示しない場合は、この次の行〜先頭がEOMの行までを削除してね。
$ikkimsg = <<"EOM";
■ResModeがONの場合は、各記事の下にあるメッセージ欄を複数入力する事によって、一度に
複数記事へのレスが出来ます。※注意:1ページ毎。
ResModeをON→OFFにすると、各記事の下のメッセージ欄は非表\示となります。
|
EOM
$autolink = 1 ; #「http〜」を入力すると「こちら」と自動リンクするのを使う?(0:no 1:yes)
#<<< ここから下はいじらない方がいいです。
@errtag = ('table','meta','form','!--','embed','html','body','tr','td','th','a'); #デンジャラ〜なタグ
#━<初期設定終了>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#utime time(), time(), __FILE__; # スクリプト生成日時の更新
###############################################################################
#### Main Process START #####################################################
###############################################################################
$agent = $ENV{'HTTP_USER_AGENT'};
$agent =~ s/,/./g; $col2 = 1;if ($agent =~ /Mozilla\/4/i && $agent !~ /compatible/i) { $col2 = 0.8; }
$ENV{'TZ'} = "JST-9";
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); #システム日時・時刻取得
$year = sprintf("%02d",$year + 1900); $month = sprintf("%02d",$mon + 1); $mday = sprintf("%02d",$mday);
$hour = sprintf("%02d",$hour); $min = sprintf("%02d",$min);
if ( substr($month,0,1) == 0 ) { $month =~ s/0/ /; } if ( substr($mday,0,1) == 0 ) { $mday =~ s/0/ /; }
$week = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat') [$wday]; $today = "$month/$mday($week) $hour:$min";
if ($ENV{'HTTP_USER_AGENT'} !~ /MSIE/i) { $css_style = "" ; } #Netscape-CSS対応 i000331
&logchk ;
&cookieget; #<</i) { &error("使用出来ないタグが入力されています"); }
}
} else {
$value =~ s/</g;
$value =~ s/>/>/g;
}
$value =~ s/\,/,/g;
&jcode'convert(*value,'sjis');
$FORM{$name} = $value;
}
$FORM{'hp'} =~ s/^http\:\/\///;
$FORM{'comment'} =~ s/\r\n/
/g; $FORM{'comment'} =~ s/\r|\n/
/g;
for ( 1..$pagemax ) { #i001103
$wk = "rescomment" . $_ ;
if ( $FORM{$wk} ne '' ) {
$FORM{$wk} =~ s/\r\n/
/g; $FORM{$wk} =~ s/\r|\n/
/g;
}
}
}
###<--------------------------------------------------------------
###<--- 入力フォーム
###<--------------------------------------------------------------
sub forminput {
print "\n";
print "\n";
if ( $FORM{'action'} ne 'res' ) {
if ( $FORM{'action'} ne 'maintenance' ) {
$c_name = $COOKIE{'nm'} ; $c_email = $COOKIE{'em'} ; $c_hp = $COOKIE{'hp'} ;
$c_color = $COOKIE{'cl'} ; $c_color_f = $COOKIE{'cl_f'} ;
$c_icon = $COOKIE{'icon'} ; $c_pass = $COOKIE{'ps'} ;
$c_title = '' ; $c_comment = '' ;
} else {
print "
▼この記事を修正します▼\n";
if ( $FORM{'proc'} eq 'delete' ) {
$c_name = $COOKIE{'nm'} ; $c_email = $COOKIE{'em'} ; $c_hp = $COOKIE{'hp'} ;
$c_color = $COOKIE{'cl'} ; $c_color_f = $COOKIE{'cl_f'} ;
$c_icon = $COOKIE{'icon'} ; $c_pass = $COOKIE{'ps'} ;
$c_title = '' ; $c_comment = '' ;
}
}
} else {
print "
▼この記事に対する返信メッセージです▼\n";
$c_name = $COOKIE{'nm'} ; $c_email = $COOKIE{'em'} ; $c_hp = $COOKIE{'hp'} ;
$c_color_f = $COOKIE{'cl_f'} ;
$c_icon = $COOKIE{'icon'} ; $c_pass = $COOKIE{'ps'} ;
$c_title = '' ; $c_comment = '' ;
}
print "
" if ( $FORM{'kflg'} eq '' ); #i001103
print "
\n";
if ( $FORM{'kflg'} ne '' ) { print "
$ikkimsg
" ; }
return ;
}
}
#パスワード
print "
Password | \n";
print "
";
print " 修正・削除に使用 | \n";
print "";
print "" if ( $FORM{'kflg'} eq '' ); #i001103
print "\n";
if ( $FORM{'kflg'} ne '' ) { print "
$ikkimsg
" ; }
print "
\n";
}
###<--------------------------------------------------------------
###<--- HTMLヘッダー書き出し
###<--------------------------------------------------------------
sub header {
print "Content-type: text/html; charset=Shift_JIS\n\n";
print "\n\n";
print "\n";
print "$title\n";
print "$body_css\n";
print "\n";
print "\n";
if ($backpicture) { $set = "background=\"$backpicture\""; if ( $bgcolor ) { $set .= " bgcolor=\"$bgcolor\"" ; } }
elsif ($bgcolor ) { $set = "bgcolor=\"$bgcolor\""; }
print "\n";
}
###<--------------------------------------------------------------
###<--- ヘッダー上部書き出し
###<--------------------------------------------------------------
sub header2 {
print "\n";
print "";
if ( $cntfile ) {
#カウンター表示
$edt = "%0" .$cnt_keta . "d" ;
$COUNT = sprintf("$edt",$COUNT) ;
if ( $cnt_gif[0] ) {
for ( $i = 1 ; $i <= $cnt_keta ; $i++ ) {
$c = substr($COUNT,$i - 1 , 1 ) ;
print "$cnt_gif[$c]";
}
} else {
print "Counter : $COUNT";
}
} else {
print " ";
}
if ( $titlelogo ) {
print " \n";
} else {
print "$title \n";
}
print "";
print <<"EOM";
[トップ] .
[昇進資格説明] .
[昇進状態] .
EOM
if ( $ikkiflg ) {
if ( $FORM{'kflg'} eq '' ) {
print " R e s m o d e ( O N )\n";
} else {
print " R e s m o d e ( O F F )\n";
}
}
print <<"EOM";
雑談掲示板です。マナーを守って楽しく雑談しましょう。
40回書き込み(昇進が剣士になったら)で専用アイコンゲットです。
EOM
print " |
";
print "
\n";
if ( $#oldcnt >= 0 ) {
print "\n";
}
print "
\n";
print "\n";
}
###<--------------------------------------------------------------
###<--- HTMLフッダー書き出し
###<--------------------------------------------------------------
sub footer { #<<< ↓著作部の変更を禁じます
print "\n";
print "\n";
}
###<--------------------------------------------------------------
###<--- ログファイル読み込み
###<--------------------------------------------------------------
sub dataread {
#<<<ログ読み込み
if ( ( $FORM{'action'} ne 'oldlogfind' && $FORM{'action'} ne 'download' ) || $FORM{'oldlogno'} == 0 ) {
if ( !(open(IN,"$logfile"))) { &error("ログファイル($logfile)のオープンに失敗しました"); }
} else {
$wk = $olddir . $FORM{'oldlogno'} . ".txt" ;
if ( !(open(IN,"$wk"))) { &error("ログファイル($wk)のオープンに失敗しました"); }
}
@LOG = ;
close(IN);
@RESLOG = () ; @MAINLOG = () ;
$MAXNO = '';
@SVLOG = () ;
foreach ( @LOG ) {
($no,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$_);
if ( $resno eq '' ) {
push(@MAINLOG,$_) ;
} else {
push(@RESLOG,$_) ;
}
push(@SVLOG,"$_");
if ( $no >= $MAXNO ) { #最新の投稿Noを退避
$MAXNO = $no ;
}
}
if ( $FORM{'action'} ne 'oldlogfind' || $FORM{'oldlogno'} == 0 ) { #I991220
@RESLOG = reverse @RESLOG ; #レスログは古い順に。
} #I991220
#<<<カウンターファイル読み込み(初回表示時のみ)
if ( $cntfile && $FORM{'action'} ne 'download' ) { #u001112
if ( !(open(IN,"$cntfile"))) { &error("カウンターファイル($cntfile)のオープンに失敗しました"); }
$COUNT = ;
close(IN);
if ( $FORM{'action'} eq '') {
$COUNT++ ;
if ( !(open(OUT,">$cntfile"))) { &error("カウンターファイル($cntfile)のオープンに失敗しました"); }
print OUT $COUNT;
close(OUT);
}
}
}
###<--------------------------------------------------------------
###<--- ログ表示
###<--------------------------------------------------------------
sub view {
print "\n";
#表示対象ページの先頭データ件数を算出
$dm = @MAINLOG;
if ( $dm % $pagemax == 0) {
$p = $dm / $pagemax ;
} else {
$p = $dm / $pagemax + 1;
}
$p = sprintf("%3d",$p);
if ( $FORM{'page'} eq "NEXT" ) {
if ( $FORM{'disppage'} == 0 ) { $FORM{'disppage'} = 1 } ;
$d = ($FORM{'disppage'} + 1) * $pagemax - $pagemax ;
$FORM{'disppage'} = $FORM{'disppage'} + 1 ;
} elsif ( $FORM{'page'} eq "BACK" ) {
$d = ($FORM{'disppage'} - 1) * $pagemax - $pagemax ;
$FORM{'disppage'} = $FORM{'disppage'} - 1 ;
} elsif ( $FORM{'disppage'} ne "" ) { #I991123
$d = $FORM{'disppage'} * $pagemax - $pagemax ; #I991123
} else {
$d = 0 ;
$FORM{'disppage'} = 1 ;
}
if ( $msg_color ) { $tbbg = "bgcolor=\"$msg_color\"" ; } else { $tbbg = "" ; }
$z = 1 ;
if ( $FORM{'action'} eq 'download' ) { #i001112
$d = 0 ; $pagemax = $dm ; $maru = 0 ; $maillinklogo=""; $homelinklogo=""; $icon_use = "no";
print "
$title\n";
}
for ( $i = $d ; ( $z <= $pagemax ) && ( $i < $dm ); $i++ ) {
($no,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$host,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$MAINLOG[$i]);
if ( ($FORM{'action'} ne 'res' || ($FORM{'action'} eq 'res' && $FORM{'no'} eq $no)) || $FORM{'action'} eq 'download' ) { #u001112
if ( $FORM{'action'} ne 'res' && $FORM{'kflg'} eq '' ) { #i001103
print "\n" if ( $FORM{'kflg'} eq '' ) ; #i001103
}
$z++;
}
print "\n" if ( $FORM{'kflg'} == 1 ) ; #i001112
if ( $FORM{'action'} ne 'res' && $FORM{'action'} ne 'download') {
$dm = @MAINLOG;
if ( $dm % $pagemax == 0) {
$p = $dm / $pagemax ;
} else {
$p = $dm / $pagemax + 1;
}
$p = sprintf("%3d",$p);
print "\n";
}
if ( $FORM{'action'} eq 'download' ) { return; } #i001112
if ( $FORM{'action'} ne 'res' ) {
print "\n";
if ( $FORM{'oldlogno'} == 0 ) {
print "\n";
print "";
print "\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "
\n";
}
}
}
###<--------------------------------------------------------------
###<--- ログ出力
###<--------------------------------------------------------------
sub regist {
# ホスト名を取得
$host = $ENV{'REMOTE_HOST'};
$addr = $ENV{'REMOTE_ADDR'};
if ($host eq "" || $host eq "$addr") {
($p1,$p2,$p3,$p4) = split(/\./,$addr);
$temp = pack("C4",$p1,$p2,$p3,$p4);
$host = gethostbyaddr("$temp", 2);
if ($host eq "") { $host = $addr; }
}
#掲示板荒らし対策
foreach $buf(@DANGER_LIST){
if ( $buf ) {
$buf=~ s/\./\\./g; $buf=~ s/\?/\./g; $buf=~ s/\*/\.\*/g;
if($host =~ /$buf/gi){ &error("\申\し\訳ありません。
あなたのプロバイダーからは投稿できませんでした. "); }
}
}
if ( $FORM{'name'} eq '') { &error("お名前を入力して下さい。"); }
if ( $FORM{'kflg'} eq '' ) { #i001103
if ( $FORM{'comment'} eq '') { &error("メッセージは省略出来ません。"); }
if ( $maxword ne '' && (length($FORM{'comment'}) > $maxword)) { &error("メッセージは$maxword文字までしか登録出来ません。"); }
} #i001103
for ( $i = $pagemax ; $i >= 1 ; $i-- ) {
$wk = "resno" . $i ;
$rno = $FORM{$wk} ;
$wk = "rescomment" . $i ;
$rcom = $FORM{$wk} ;
if ( $rno ne '' && $rcom ne '' ) {
if ( $maxword ne '' && (length($rcom) > $maxword)) { &error("メッセージは$maxword文字までしか登録出来ません。"); }
}
}
&filelock ; #ファイルロック
&dataread ; #<<<ログ読み込み
if ( $FORM{'kflg'} eq '' ) { #i001103
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$SVLOG[0]);
if ( $name eq $FORM{'name'} && $ttl eq $FORM{'title'} && $comment eq $FORM{'comment'} ) {
&fileunlock ; &error("二重投稿は禁止しています。") ;
}
if ( $logfile2 ne '' && ( $FORM{'action'} ne 'oldlogfind' || $FORM{'oldlogno'} == 0 )) {
if ( !(open(IN2,"$logfile2"))) { &fileunlock ; &error("ログファイル2($logfile2)のオープンに失敗しました"); }
$flg = 0 ;
while ( ) {
($n,$k) = split(/,/,$_);
$k =~ s/\n//;
if ( $FORM{'name'} eq $n ) {
if ( $rdm != 0 ) {
#■ランダムに投稿回数を減少させる
srand(time ^ ($$ + ($$ << 15)));
$w = int(rand(30)) ;
$p = 0 ;
#■乱数が$rdmで割り切れる場合のみ投稿回数を減少させる
if ( $w % $rdm == 0 ) {
$k = $k - $DOWN[int(rand($#DOWN))] ;
if ( $k < 0 ) { $k = 0 ; }
} else {
$k++;
}
} else {
$k++ ;
}
$dcnt = $k ;
$flg = 9;
}
push(@sv,"$n,$k\n");
}
if ( $flg == 0 ) {
push(@sv,"$FORM{'name'},1\n");
$dcnt = 1;
}
close(IN2);
if ( !(open(OUT2,">$logfile2"))) { &fileunlock ; &error("ログファイル($logfile2)のオープンに失敗しました"); }
print OUT2 @sv;
close(OUT2);
}
$dcnt2 = @SVLOG;
if ( $dcnt2 < 1 ) {
$no = 1; #1件目
} else {
$no = $MAXNO + 1;
}
#レス記事登録時で、ログを先頭に移動する場合の処理
if ( $resflag eq 'yes' && $FORM{'resno'} ne '') {
$cnt = 0 ; $oyacnt = 1 ;
foreach $buf ( @SVLOG ) {
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $oyano eq $FORM{'resno'} ) {
$sv_title = $ttl ;
splice(@SVLOG,$cnt,1);
$wk = "$oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon";
unshift(@SVLOG,$wk);
last ;
}
$cnt++ ;
}
} else {
if ( $sendmail ) {
foreach $buf ( @SVLOG ) {
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $oyano eq $FORM{'resno'} ) {
$sv_title = $ttl ;
last ;
}
}
}
}
if ( $olddir ) { #過去ログ作成処理
if ( !($FORM{'resno'}) && $#MAINLOG + 1 >= $datamax ) {
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$MAINLOG[$#MAINLOG]);
@OLD = () ;
if ( $#oldcnt >= 0 ) {
if ( !(open(IN,"$oldfile"))) { &fileunlock ; &error("ログファイル($oldfile)のオープンに失敗しました"); }
@OLD = ;
close(IN);
if ( $#OLD + 1 >= $oldmax ) {
$i = sprintf("%02d",$#oldcnt + 2) ;
$oldfile = "$olddir$i" . ".txt" ;
@OLD = () ;
}
} else {
$oldfile = "$olddir" . "01.txt" ;
}
$cnt = 0 ;
@SVLOG2 = @SVLOG ; @SVLOG = () ;
foreach $buf ( @SVLOG2 ) {
($oyano2,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno2,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $oyano == $oyano2 || $oyano == $resno2) {
unshift(@OLD,$buf) ;
} else {
push(@SVLOG,$buf);
}
$cnt++ ;
}
if ( !(open(OUT,">$oldfile"))) { &fileunlock ; &error("過去ログファイル($oldfile)のオープンに失敗しました"); }
print OUT @OLD;
close(OUT);
# パーミッション変更
chmod(0666,"$oldfile");
}
} else {
if ( !($FORM{'resno'}) && $#MAINLOG + 1 >= $datamax ) {
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$MAINLOG[$#MAINLOG]);
@SVLOG2 = @SVLOG ; @SVLOG = () ;
foreach $buf ( @SVLOG2 ) {
($oyano2,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno2,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $oyano == $oyano2 || $oyano == $resno2) {
} else {
push(@SVLOG,$buf);
}
}
}
}
# パスワードの暗号化(crypt関数使用))
if ($FORM{'pass'} ne "") { &pass_enc($FORM{'pass'}); }
else { $pass = '' ; }
unshift(@SVLOG,"$no,$FORM{'name'},$FORM{'email'},$FORM{'hp'},$FORM{'title'},$FORM{'comment'},$today,$FORM{'color_f'},$FORM{'color'},$FORM{'resno'},$host,$dcnt,$pass,$dmy,$dmy,$FORM{'icon'}\n");
if ( !(open(OUT,">$logfile"))) { &fileunlock ; &error("ログファイル($logfile)のオープンに失敗しました"); }
print OUT @SVLOG;
close(OUT);
} else { #↓i001103
for ( $i = $pagemax ; $i >= 1 ; $i-- ) {
$wk = "resno" . $i ;
$rno = $FORM{$wk} ;
$wk = "rescomment" . $i ;
$rcom = $FORM{$wk} ;
if ( $rno ne '' && $rcom ne '' ) {
&dataread ; #<<<ログ読み込み
($no,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$SVLOG[0]);
if ( $name eq $FORM{'name'} && $comment eq $rcom && $resno == $resno ) {
&fileunlock ; &error("二重投稿は禁止しています。") ;
}
if ( $logfile2 ne '' ) {
if ( !(open(IN2,"$logfile2"))) { &fileunlock ; &error("ログファイル2($logfile2)のオープンに失敗しました"); }
$flg = 0 ;
@sv = ();
while ( ) {
($n,$k) = split(/,/,$_);
$k =~ s/\n//;
if ( $FORM{'name'} eq $n ) {
$k++ ;
$dcnt = $k ;
$flg = 9;
}
push(@sv,"$n,$k\n");
}
if ( $flg == 0 ) {
push(@sv,"$FORM{'name'},1\n");
$dcnt = 1;
}
close(IN2);
if ( !(open(OUT2,">$logfile2"))) { &fileunlock ; &error("ログファイル($logfile2)のオープンに失敗しました"); }
print OUT2 @sv;
close(OUT2);
}
$dcnt2 = @SVLOG;
if ( $dcnt2 < 1 ) {
$no = 1; #1件目
} else {
($no,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$SVLOG[0]);
$no++;
}
#レス記事登録時で、ログを先頭に移動する場合の処理
if ( $resflag eq 'yes') {
$cnt = 0 ; $oyacnt = 1 ;
foreach $buf ( @SVLOG ) {
($oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $oyano eq $rno ) {
splice(@SVLOG,$cnt,1);
$wk = "$oyano,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$hst,$ksu,$pass,$dmy,$dmy,$icon";
unshift(@SVLOG,$wk);
last ;
}
$cnt++ ;
}
}
# パスワードの暗号化(crypt関数使用))
if ($FORM{'pass'} ne "") { &pass_enc($FORM{'pass'}); }
else { $pass = '' ; }
unshift(@SVLOG,"$no,$FORM{'name'},$FORM{'email'},$FORM{'hp'},,$rcom,$today,$FORM{'color_f'},,$rno,$host,$dcnt,$pass,$dmy,$dmy,$FORM{'icon'}\n");
if ( !(open(OUT,">$logfile"))) { &fileunlock ; &error("ログファイル($logfile)のオープンに失敗しました"); }
print OUT @SVLOG;
close(OUT);
}
}
} #↑i001103
&fileunlock ; #ファイルロック解除
$wk = $smail_address ; $wk =~ s/\\//g;
if ( $sendmail && ($sendsw == 1 || ( $sendsw == 0 && $FORM{'email'} ne $wk ) ) ) { &SMail ; }
#COOKIE設定
&cookieset ;
}
###<--------------------------------------------------------------
###<--- メンテナンスモード
###<--------------------------------------------------------------
sub Maintenance {
if ( $FORM{'pass'} eq "") { &error("パスワードを入力して下さい。"); }
@DELWORD = split(/ /,$FORM{'no'});
if ($FORM{'pass'} eq $password && $FORM{'proc'} eq 'delete' && @DELWORD > 1 ) {
&update ; return ;
}
&dataread ; #<<<ログ読み込み
$found = 0 ;
foreach ( @SVLOG ) {
($no,$c_name,$c_email,$c_hp,$c_title,$c_comment,$regdate,$c_color_f,$c_color,$c_resno,$host,$ksu,$passwd,$dmy,$dmy,$c_icon) = split(/,/,$_);
if ( $FORM{'no'} eq $no ) {
if ($FORM{'pass'} ne $password && (&pass_dec($passwd))) {
&fileunlock ; #ファイルロック解除
&error("パスワードが違います。");
}
$found = 1 ;
if ( $FORM{'proc'} eq "delete" ) {
$c_resno=""; #i010131
&update ;
return;
}
&header ;
$c_pass = $FORM{'pass'} ;
$c_comment =~ s/
/\n/g;
&forminput ;
last;
}
}
if ( $found == 0 ) {
&fileunlock ; #ファイルロック解除
&error("該当する記事Noのデータは存在していません。");
}
&footer ;
exit;
}
###<--------------------------------------------------------------
###<--- ログファイル更新
###<--------------------------------------------------------------
sub update {
&filelock ; #ファイルロック
&dataread ; #<<<ログ読み込み
$j = 0 ; @new = () ;
foreach $buf (@SVLOG) {
($no,$name,$email,$hp,$ttl,$comment,$regdate,$color_f,$color,$resno,$host,$ksu,$pass,$dmy,$dmy,$icon) = split(/,/,$buf);
if ( $FORM{'no'} eq $no || ( $FORM{'proc'} eq 'delete' && $FORM{'no'} eq $resno ) ) { #<<<メンテ対象者の場合
if ( $FORM{'proc'} eq "edit" ) {
# パスワードの暗号化(crypt関数使用))
if ($FORM{'pass'} ne "") { &pass_enc($FORM{'pass'}); }
else { $pass = '' ; }
if ( $rno eq '' ) {
push(@new,"$no,$FORM{'name'},$FORM{'email'},$FORM{'hp'},$FORM{'title'},$FORM{'comment'},$regdate,$FORM{'color_f'},$FORM{'color'},$resno,$host,$ksu,$pass,$dmy,$dmy,$FORM{'icon'}\n");
} else {
push(@new,"$no,$FORM{'name'},$FORM{'email'},$FORM{'hp'},$ttl,$FORM{'comment'},$regdate,$FORM{'color_f'},$FORM{'color'},$resno,$host,$ksu,$pass,$dmy,$dmy,$FORM{'icon'}\n");
}
}
} else {
$found = 0 ;
if ( $FORM{'proc'} eq 'delete' ) {
@DELWORD = split(/ /,$FORM{'no'});
foreach $word ( @DELWORD ) {
if ( $word && ( $no eq $word || $resno eq $word ) ) { $found = 1 ; last ; } #u000726
}
}
if ( $found == 0 ) { push(@new,$buf); }
}
}
if ( !(open(OUT,">$logfile"))) { &fileunlock ; &error("ログファイル($logfile)のオープンに失敗しました"); }
print OUT @new;
close(OUT);
&fileunlock ; #ファイルロック解除
$FORM{'action'} = '' ;
}
###<--------------------------------------------------------------
###<--- Information(アイコン一覧)
###<--------------------------------------------------------------
sub icondisp {
&header ; #<<BACK]\n"; #i010204
print "
■■■ アイコン一覧 ■■■
\n";
print "\n";
$i = 0 ; $j = 0 ;
while ( 1 ) {
print "\n";
for ( $ln = 1 ; $j <= $#icon_gif && $ln <= $icon_line ; ) {
print " | \n";
print "$iconnm[$j] | \n";
$j++ ; $ln++ ;
}
if ( $j > $#icon_gif ) {
if ( $ln < $icon_line ) {
for ( ; $ln <= $icon_line ; ) {
print " | \n";
print " | \n";
$ln++ ;
}
}
print "
\n";
last ;
}
print "\n";
$i++;
}
print "
";
if ( $jiconnm[0] ne '' ) {
print "
\n";
print "
▼常連様専用のアイコンです▼
\n";
$i = 0 ; $j = 0 ;
while ( 1 ) {
print "\n";
for ( $ln = 1 ; $j <= $#jicon_gif && $ln <= $icon_line ; ) {
print " | \n";
print "$jiconnm[$j] | \n";
$j++ ; $ln++ ;
}
if ( $j > $#jicon_gif ) {
if ( $ln < $icon_line ) {
for ( ; $ln <= $icon_line ; ) {
print " | \n";
print " | \n";
$ln++ ;
}
}
print "
\n";
last ;
}
print "\n";
$i++;
}
print "
";
}
print "\n";
&footer ; #<<";
last ;
}
}
#管理者の投稿の場合、管理者用アイコンに置き換える
if ( $oiconpass ) {
if ( $ango == 1 ) { $wpass = crypt($oiconpass, $oiconpass); }
else { $wpass = $oiconpass ; }
if ( $pass eq $wpass ) {
$found = 1 ;
if ( $oicon_gif_w != 0 ) { $dmy = "width=\"$oicon_gif_w\" height=\"$oicon_gif_h\"" ; } else { $dmy = "" ; }
print "";
}
}
if ( $found == 0 ) {
if ( !($icon) ) { $icon = 0 ; }
if ( $icon_gif_w[$icon] != 0 ) { $dmy = "width=\"$icon_gif_w[$icon]\" height=\"$icon_gif_h[$icon]\"" ; } else { $dmy = "" ; }
print "";
}
} else {
#管理者の投稿の場合、管理者用アイコンに置き換える
$found = 0 ;
if ( $oiconpass ) {
if ( $ango == 1 ) { $wpass = crypt($oiconpass, $oiconpass); }
else { $wpass = $oiconpass ; }
if ( $pass eq $wpass ) {
$found = 1 ;
if ( $oicon_gif_w != 0 ) { $dmy = "width=\"$oicon_gif_w\" height=\"$oicon_gif_h\"" ; } else { $dmy = "" ; }
print "";
}
}
if ( $found == 0 ) {
print "";
}
}
}
###<-------------------------------------------------------------
###<--- クッキー取得
###<--------------------------------------------------------------
sub cookieget {
$cookies = $ENV{'HTTP_COOKIE'};
@pairs = split(/;/,$cookies);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ s/ //g;
$DUMMY{$name} = $value;
}
@pairs = split(/,/,$DUMMY{'mkakikomitai'});
foreach $pair (@pairs) {
($name, $value) = split(/\!/, $pair);
$COOKIE{$name} = $value;
}
if ($FORM{'name'}) { $COOKIE{'nm'} = $FORM{'name'}; }
if ($FORM{'email'}) { $COOKIE{'em'} = $FORM{'email'}; }
if ($FORM{'hp'}) { $COOKIE{'hp'} = $FORM{'hp'}; }
if ($FORM{'pass'}) { $COOKIE{'ps'} = $FORM{'pass'}; }
if ($FORM{'icon'}) { $COOKIE{'icon'} = $FORM{'icon'}; }
if ($FORM{'color'}) { $COOKIE{'cl'} = $FORM{'color'}; }
if ($FORM{'color_f'}) { $COOKIE{'cl_f'} = $FORM{'color_f'}; }
}
###<-------------------------------------------------------------
###<--- クッキー設定
###<--------------------------------------------------------------
sub cookieset {
($secg,$ming,$hourg,$mdayg,$mong,$yearg,$wdayg,$ydayg,$isdstg)
=gmtime(time + 30*24*60*60);
$yearg += 1900 ;
if ($secg < 10) { $secg = "0$secg"; }
if ($ming < 10) { $ming = "0$ming"; }
if ($hourg < 10) { $hourg = "0$hourg"; }
if ($mdayg < 10) { $mdayg = "0$mdayg"; }
$mong = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')[$mong];
$youbi = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')[$wdayg];
$date_gmt = "$youbi, $mdayg\-$mong\-$yearg $hourg:$ming:$secg GMT";
if ($FORM{'color'} eq '') { $FORM{'color'} = $COOKIE{'cl'} ; }
$cook="nm\!$FORM{'name'},em\!$FORM{'email'},hp\!$FORM{'hp'},cl_f\!$FORM{'color_f'},cl\!$FORM{'color'},ps\!$FORM{'pass'},icon\!$FORM{'icon'}";
print "Set-Cookie: mkakikomitai=$cook; expires=$date_gmt\n";
}
###<--------------------------------------------------------------
###<--- エラー処理
###<--------------------------------------------------------------
sub error {
&header ;
print "
$_[0]\n";
&footer;
exit;
}
###<--------------------------------------------------------------
###<--- ファイルロック設定
###<--------------------------------------------------------------
sub filelock {
if (-e $lockfile) {
($ftm) = (stat($lockfile))[9];
if ($ftm < time - 150) { unlink($lockfile); }
}
foreach (1 .. 5) {
if (-e $lockfile) { sleep(1); }
else {
open(LOCK,">$lockfile");
close(LOCK);
return;
}
}
&error("只今他の方が書き込み中です。ブラウザの「戻る」で戻って再度登録を行って下さい。
又は設置時にロックファイル($lockfile)が残ったままかもしれませんので、同ファイルを削除して下さい。");
}
###<--------------------------------------------------------------
###<--- ファイルロック解除
###<--------------------------------------------------------------
sub fileunlock {
if (-e $lockfile) { unlink($lockfile); }
}
###<-------------------------------------------------------------
###<--- ランキング取得
###<--------------------------------------------------------------
sub rankget {
$set = 0 ;
$tmax = $#rankno ;
for ( $j = 0 ; $j <= $tmax ; $j++ ) {
if ( $_[0] >= $rankno[$j] ) {
$ranking = $rank[$j] ;
$rank_idx = $j ;
}
}
return ($ranking);
}
###<--------------------------------------------------------------
###<--- Information
###<--------------------------------------------------------------
sub info {
&header ; #<<戻る\n";
print "<<< \昇\進資格 >>>
\n";
print "以下の投稿回数に従って、あなたは\昇\進していきます!!
\n";
$i = 0;
print "\n";
print "\n";
$k = $#rank ;
for ( @rank ) {
print "$rank[$i] | \n";
print "";
$j = $rankno[$i+1] - 1 ;
if ( $i != $k ) {
print "$rankno[$i] 〜$j 回\n";
} else {
print "$rankno[$i] 以上\n";
}
print " | \n";
$i++;
}
print " |
";
&footer ; #<</\n/g;
if ($FORM{'resno'} ne "") { $ttl = "「$sv_title」についての返信です"; }
elsif ($FORM{'resno'} eq "" && $ttl eq "") { $ttl = "無題"; }
&jcode'convert(*ttl,'jis');
&jcode'convert(*name,'jis');
&jcode'convert(*today,'jis');
&jcode'convert(*comment,'jis');
$comment =~ s/<//g;
if ( !($email) ) { $email = $smail_address ; }
if ( $hiho == 1 ) {
&jcode'convert(*ttl2,'euc');
open(MAIL,"| $sendmail -s \"$ttl2\" -f \"$email\" $smail_address") || &error("Sendmail Error!!");
} else {
&jcode'convert(*ttl2,'jis');
open(MAIL,"| $sendmail -t") || &error("Sendmail Error!!");
print MAIL "X-Mailer: $ttl2\n";
print MAIL "To: $smail_address\n";
print MAIL "From: $email\n";
print MAIL "Subject: $ttl2\n";
print MAIL "Content-Transfer-Encoding: 7bit\n";
print MAIL "Content-type: text/plain; charset=ISO-2022-JP\n";
print MAIL "\n\n";
}
print MAIL "<<< $ttl2 >>>\n\n";
print MAIL "----------------------------------------------------------------\n";
print MAIL "DATE : $today\n";
print MAIL "NAME : $name\n";
print MAIL "EMAIL: $email\n";
if ($FORM{'hp'} ne "") { print MAIL "URL : http://$FORM{'hp'}\n"; }
print MAIL "TITLE: $ttl\n\n";
print MAIL "$comment\n\n";
print MAIL "----------------------------------------------------------------\n";
close(MAIL);
}
###<-------------------------------------------------------------
###<--- パスワード暗号化
###<--------------------------------------------------------------
sub pass_enc {
if ( $ango == 1 ) { $pass = crypt($_[0], $_[0]); }
else { $pass = $_[0]; }
}
###<-------------------------------------------------------------
###<--- パスワードチェック
###<--------------------------------------------------------------
sub pass_dec {
if ( $ango == 1 ) {
if ($_[0] ne '' && ( crypt($FORM{'pass'}, $_[0]) eq $_[0]) ) { return 0 ; }
} else { if ($FORM{'pass'} eq $_[0]) { return 0 ; } }
return 1;
}
###<-------------------------------------------------------------
###<--- ログファイルチェック
###<--------------------------------------------------------------
sub logchk {
if ( $olddir ) { #過去ログ設定する場合、該当ディレクトリの存在チェック
if ( !(opendir(DIR,"$olddir"))) { &error("過去ログ保存用フォルダ($olddir)が見つからないか又は開けません"); }
@oldcnt = grep(/\.txt/,readdir(DIR));
$i = sprintf("%02d",$#oldcnt + 1) ;
$oldfile = "$olddir$i" . ".txt" ;
closedir(DIR) ;
}
}
###<-------------------------------------------------------------
###<--- みんなの昇進状態
###<--------------------------------------------------------------
sub rankdisp {
if ( !(open(IN,"$logfile2"))) { &error("ログファイル($logfile2)のオープンに失敗しました"); }
while ( ) {
($n,$k) = split(/,/,$_);
$k =~ s/\n//g;
push(@RANKDATA,"$k,$n") ;
}
close(IN);
@RANKDATA = sort { $a <=> $b } @RANKDATA ;
@RANKDATA = reverse @RANKDATA ;
&header ; #<<戻る
\n";
print "<<< みんなの昇進状態 >>>
\n";
print "\n";
print "\n";
print "お名前 | \n";
print "投稿回数 | \n";
print "昇進状態 | \n";
foreach ( @RANKDATA ) {
($k,$n) = split(/,/,$_);
for ( $j = 0 ; $j <= $#rankno ; $j++ ) {
if ( $k >= $rankno[$j] ) {
$ranking = $rank[$j] ;
$rank_idx = $j ;
}
}
print "$n | \n";
print "$k回 | \n";
print "$ranking | \n";
}
print " |
\n";
&footer ;
exit ;
}
###<-------------------------------------------------------------
###<--- ログダウンロードi001112
###<--------------------------------------------------------------
sub download {
print "Content-type: text/download\n\n";
print "$title";
$wk = "bgcolor=\"$bgcolor\"";
print "\n";
&view ;
print "
\n";
&footer ;
exit;
}