罪と罰++二律背反


#!/usr/local/bin/perl
# サーバーの環境に合わせて変更して下さい。
#-----------------------------------------------------------#
#  罪と罰++ 二律背反									 #
#  Copyright(C) 2001-2002 by Vivid Studio. BLANK BOARD		#
#  Vivid Studio.[ http://www17.big.or.jp/~obochan/vivid/ ]	#
#  BLANK BOARD [ http://pom.to/ ]							 #
#-----------------------------------------------------------#
$ver = '交流広場 v1.1';			# バージョン情報(変更不可)
#--- [注意事項] --------------------------------------------#
# 1.このスクリプトは以下の利用規程に従って配布しています。	#
#   http://www24.big.or.jp/~obo/game/ore_/gild/				#
#-----------------------------------------------------------#
 
#===============================================================================
# 設定項目
 
#-------------------------------------------------------------------------------
# 各種ファイル
 
require './inc/ore_sub-bbs.cgi';		# 各種掲示板共通な設定項目読み込み
 
$script		= "./come.cgi";				# このスクリプトのパス
 
$logfile	= "./logdata/come_log.cgi";	# ログファイル

$lockkey	= 0;						# ファイルロック(0=no 1=yes)

$lockfile = "./come.lock";				# ロックファイル名

#-------------------------------------------------------------------------------
# 環境設定

$title		= "各国宣伝掲示板";			# タイトル名

$max		= 100;						# 最大保有記事数

$reload_mn	= 5;						# 最短リロード間隔(この秒数以内に発言するとエラー[負荷対策])
 
$reload_limit= 120;						# この秒数発言がないと退室扱いにする

$com_limit	= 240;						# コメントの最大文字数(半角換算)

$tagkey		= 0;						# タグの許可 (0=no 1=yes)

$nolink		= 1;						# URL宣伝排除 (0=no 1=yes)

# 機種別設定
if($mv_mode eq 'mv'){

	# モバイル用設定

	$log_last= 15;						# 表示行数(モバイル)

	# BODYタグ装飾
	$body	= 'bgcolor="black" text="white" link="pink" vlink="pink" alink="pink"';

	$hr_color= 'white';					# 罫線の色(モバイル)
}else{

	# PC用設定

	@reload_time= (90,120,180);			# リロード時間

	$log_last= 50;						# 表示行数(PC)

	# BODYタグ装飾
	$body	= 'bgcolor="#111122" text="#ddddee" link="#ffddee" vlink="#ffddee" alink="#ffddee"';
}

#===============================================================================
# 以下処理 基本的にこれ以下はいじらないように。

#-------------------------------------------------------------------------------
# メイン処理
&axs_check;		# アクセス制御
&decode;		# フォームデコード
&get_time;		# 日時取得
&html;			# ページ表示


#-------------------------------------------------------------------------------
# 記事表示部
sub html {
	# 表示開始
	&header;

	if($mv_mode eq 'mv'){
		print <<"EOM";
$camp_info[$DAT{'camp'}][0]専用<br>$title
<form name="park" method="$method" action="$script">
<input type=hidden name=mode value="regist">
<input type=hidden name=id value="$id">
<input type=hidden name=pw value="$pw">
<input type=text name=comment size=8>
<input type=submit value="発言"><input type=reset value="クリア">
</form>
<form name="ore_" method="$method" action="$ore_game">
<input type=hidden name=id value="$id">
<input type=hidden name=pw value="$pw">
<input type=hidden name=cmd value="-1">
<input type=submit value="戻る">
</form>
EOM
	}
	else{

		print <<"EOM";
<table>
<tr>
<td width="220"><img src="./imgs/title_game.png" width="220" height="52"></td>
<td valign="bottom" align="left">
<b>$title</b><br>
<small>〜 各国の宣伝文です。仕官の参考にしましょう。 〜</small>
</td>
</tr>
<tr>
<form name="park" method="$method" action="$script">
<td colspan="2" nowrap>
<input type="hidden" name="mode" value="regist">
<input type="hidden" name="id" value="$id">
<input type="hidden" name="pw" value="$pw">
<input type="hidden" name="rd" value="$rd">
<input type="text" name="comment" class="button1" style="width:300px">
<input type="submit" value="発言/更新" class="button1" style="width:80px">
<input type="reset" value="クリア" class="button1" style="width:60px">
</td>
</form>
</tr>
<tr>
<form method="$method" action="$script">
<input type="hidden" name="mode" value="regist">
<input type="hidden" name="id" value="$id">
<input type="hidden" name="pw" value="$pw">
<td align="left">
<tt>更新:<select name="rd" size="1" class="button1" style="width:60px">
EOM

		print qq|<option value="$rd">$reload_time[$rd]秒</option>|;
		foreach(0 .. $#reload_time){
			print qq|<option value="$_">$reload_time[$_]秒</option>| if($rd!=$_);
		}
 
		print <<EOM;
</select> <input type="submit" value="変更" class="button1" style="width:60px">
</td>
</form>
<form name="ore_" method="$method" action="$ore_game">
<td align="right">
<input type=hidden name=id value="$id">
<input type=hidden name=pw value="$pw">
<input type=hidden name=cmd value="-1">
<input type=submit value="戻る" class="button1" style="width:80px">
</td>
</form>
</tr>
</table>
<br>
<br>
EOM
	}

	# ログを展開
	open(IN,"$logfile") || &error("Open Error : $logfile");
	local $log_last_flag=0;
	while (<IN>) {
		$log_last_flag++;
		local($date,$nm,$camp,$com,$sogo,$sogo2,$addr,$host) = split(/<>/);
		$nm = qq|$nm <small>[[$sogo_p[$sogo]][$sogo_p[$sogo2]]]</small>|;
		($mv_mode eq 'mv') ? $com =~ s/ハァト/<font color="pink">\&\#63726<\/font>/g : $com =~ s/ハァト/<span class="f1">ゥ<\/span>/g ;

		($mv_mode eq 'mv') ?
			print qq|$nm:$com [$camp_info[$camp][0] $date]<br>\n|:
			print qq|<span style="color:$camp_info[$camp][1]">$nm : $com </span><span class="date">[ $camp_info[$camp][0] $date ]</span><hr>\n|;
		last if $log_last_flag > $log_last;
	}
	close(IN);

	# 著作権表示(削除禁止)
	print "<hr>\n";
	&copyright;
	exit;
}

#-------------------------------------------------------------------------------
# ログ書き込み処理
sub regist {
 
	# ファイルロック
	if ($lockkey) { &lock; }

	# ログを読み込み
	open(IN,"$logfile") || &error("Open Error : $logfile");
	@lines = <IN>;
	close(IN);

	# 最大記事数処理
	while ($max <= @lines) { pop(@lines); }

	# ログ更新処理
	if($DAT{'sogo2'} ne 10){
		if($DAT{'sogo2'} ne 9){
	&error('君主以外は投稿できません。');
		}else{
		unshift (@lines,"$date<>$DAT{'nm'}<>$DAT{'camp'}<>$com<>$DAT{'sogo2'}<>$addr<>$host<>$agent<>\n");
		open(OUT,">$logfile") || &error("Write Error : $logfile");
		print OUT @lines;
		close(OUT);
			}
	}else{
		unshift (@lines,"$date<>$DAT{'nm'}<>$DAT{'camp'}<>$com<>$DAT{'sogo2'}<>$addr<>$host<>$agent<>\n");
		open(OUT,">$logfile") || &error("Write Error : $logfile");
		print OUT @lines;
		close(OUT);
	}
	# ロック解除
	if (-e $lockfile) { unlink($lockfile); }
}
 
#-------------------------------------------------------------------------------
# HTMLのヘッダー
sub header {
	print "Content-type: text/html\n\n";
	print <<"EOM";
<html>
<head>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=Shift_JIS">
<title>$title</title>
EOM
	if($mv_mode eq 'pc'){
		print <<"EOM";
<META HTTP-EQUIV="refresh" CONTENT="$reload_time[$rd];URL=$script?id=$id&pw=$pw&rd=$rd">
$css
<script language="JavaScript">
<!--
function textfocus(){
	document.park.comment.focus();
	return true;
}
//-->
</script>
EOM
	}
	(!$_[0] && $mv_mode eq 'pc') ? print qq|</head>\n<body $body onLoad="return textfocus()">| : print "</head>\n<body $body>" ;
}


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-06-08 (金) 00:29:59 (4781d)