罪と罰++二律背反


# キャラデータ変更
# 書き換え画面
sub usr_regist{
〜〜〜〜〜〜〜〜〜〜〜〜
<td nowrap>
<select name="camp">
EOM
	foreach(0 .. $#cmp){
		print "<option value=$_";
		print " selected" if($camp==$_);
		print ">$_:$cmp[$_]\n";
	}
	print <<"EOM";
</select>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<th nowrap>HP</th>
<th nowrap>MP</th>
<th nowrap>UA</th>
<th nowrap>UD</th>
<th nowrap>LR</th>
<th nowrap>AG</th>
<th nowrap>GOLD</th>
<th nowrap>階級</th>
<th nowrap>称号</th>
<th nowrap>称号2</th>
<th nowrap>討伐回数</th>
<th nowrap>追加した回数名</th>  #←ここを追加
</tr>
<tr>
</td>
<td nowrap><input type="text" name="max_hp" value="$max_hp" style="width:40px"></td>
<td nowrap><input type="text" name="max_mp" value="$max_mp" style="width:40px"></td>
<td nowrap><input type="text" name="ua" value="$ua" style="width:30px"></td>
<td nowrap><input type="text" name="ud" value="$ud" style="width:30px"></td>
<td nowrap><input type="text" name="lr" value="$lr" style="width:30px"></td>
<td nowrap><input type="text" name="ag" value="$ag" style="width:30px"></td>
<td nowrap><input type="text" name="gold" value="$gold" style="width:80px"></td>
<td nowrap>
<select name="rank">
EOM
	foreach(0 .. $#cl){
		print "<option value=$_";
		print " selected" if($rank==$_);
		print ">$_:$cl[$_]\n";
	}
	print <<"EOM";
</select>
</td>
<td nowrap>
<select name="sogo">
EOM
	foreach(0 .. $#sogo_p){
		print "<option value=$_";
		print " selected" if($sogo==$_);
		print ">$_:$sogo_p[$_]\n";
	}
	print <<"EOM";
</select>
</td>
<td nowrap>
<select name="sogo2">
EOM
	foreach(0 .. $#sogo_p){
		print "<option value=$_";
		print " selected" if($sogo2==$_);
		print ">$_:$sogo_p[$_]\n";
	}
	print <<"EOM";
</select>
</td>
<td nowrap><input type="text" name="we" value="$we" style="width:30px"></td>
<td nowrap><input type="text" name="xxx" value="$xxx" style="width:30px"></td>     #ここを追加;追加した変数を$xxxにするとこんな感じです
</tr>
</table>
〜〜〜〜〜〜〜〜〜〜〜〜〜
# 書き換え処理&結果
sub usr_regist2{
	&admin_head;
	# ファイルロック(rename式)
	$lock		= &lock if $lock_check;
	# 参加者データ一括読み込み
	open(IN,"$usrdata$in{'id_old'}\.cgi") || &error("Open Error : $usrdata$in{'id_old'}\.cgi",1);
	@dat = <IN>;
	close(IN);
	%DAT = '';
	my @prats = split(/,/,$dat[0]);
	foreach (0 .. $#prats){
		my ($key,$v) = split(/;/,$prats[$_]);
		$DAT{$key} = $v;
	}
	# ハッシュ読み込み
	&hash_data;
	$dat[0] = "xxx;$in{'xxx'},fel_vit;$in{'fel_vit'},<中略>dis_con;$dis_con,\n";   #ここに追加した変数を$inで囲みます。
	open (OUT,">$usrdata$in{'id_old'}\.cgi") || &error("キャラデータが開けません[$in{'id_old'}]",1);
	print OUT @dat;
	close(OUT)		or die "Can't close   : $!";
	if($in{'id_old'} ne $in{'id'}){rename("$usrdata$in{'id_old'}\.cgi","$usrdata$in{'id'}\.cgi") || &error("ファイル名をID名に変更できません。",1);}
	# ファイルアンロック(rename式)
	&unlock($lock) if $lock_check;
〜〜〜〜〜〜〜〜〜〜〜〜〜
<table border="0" cellspacing="2" cellpadding="2" align="center">
<tr>
<th nowrap>HP</th>
<th nowrap>MP</th>
<th nowrap>UA</th>
<th nowrap>UD</th>
<th nowrap>LR</th>
<th nowrap>AG</th>
<th nowrap>GOLD</th>
<th nowrap>階級</th>
<th nowrap>称号</th>
<th nowrap>称号2</th>
<th nowrap>討伐回数</th>
<th nowrap>追加した回数名</th>  #←ここを追加
</tr>
<tr>
<td nowrap>$in{'max_hp'}</td>
<td nowrap>$in{'max_mp'}</td>
<td nowrap>$in{'ua'}</td>
<td nowrap>$in{'ud'}</td>
<td nowrap>$in{'lr'}</td>
<td nowrap>$in{'ag'}</td>
<td nowrap>$in{'gold'}</td>
<td nowrap>$in{'rank'}</td>
<td nowrap>$in{'sogo'}</td>
<td nowrap>$in{'sogo2'}</td>
<td nowrap>$in{'we'}</td>
<td nowrap>$in{'xxx'}</td>      #追加した変数を$xxxにするとこんな感じです
</tr>


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