*アイコンの別メニューでの変更 [#c424ac5b]
-ページ: [[罪罰改造板2]]
-投稿者: [[小麦粉]]
-優先順位: 重要
-状態: 提案
-カテゴリー: 罪罰管理者の雑談
-投稿日: 2007-02-02 (金) 23:13:24
-バージョン:
**内容 [#f1cbf50d]
初めまして。
早速ですが、
アイコンの変更を情報ではなく別メニューにて
出来るようにしようと試行錯誤をしていました。
サブルーチンのinfomationのcgiを原型にして
色々といじって表示はまともになったのですが、
変更のボタンを押すとなぜか情報に飛んでしまいます。
おまけにメイン画面にはNowPrintingのままです。
下記がアイコンのサブルーチンCGIの一部です。
# 情報
sub iconda{
$log .= qq|アイコンの変更が出来ます。<br><br>|;
if($com){
if($com =~ /:/){ &error("名前に不正な文字( : )が含まれています。",1); }
if($com =~ /;/){ &error("名前に不正な文字( ; )が含まれています。",1); }
if($com =~ /,/){ &error("名前に不正な文字( , )が含まれています。",1); }
if($com =~ /"/){ &error("名前に不正な文字( \" )が含まれています。",1); }
if($com =~ /'/){ &error("名前に不正な文字( ' )が含まれています。",1); }
if($com =~ /\//){ &error("名前に不正な文字( / )が含まれています。",1); }
if(length($com)>80){ &error("全角40文字までです。",1); }
$com =~ s/\n//g;
$info_mes=$com;
}
$icon = $icon_fn if($icon_fn);
local(@usrfile,@tdat);
# 参加者データファイル一覧取得/読み込み
&usrdata_read;
&usrdata_open;
require './inc/ore_sub-members-p1.cgi';&member_list;
if($camp eq'' || $camp < 1 || $camp > 5){
foreach (0 .. $#tdat){
%R = '';
my @prats = split(/,/,$tdat[$_]);
foreach $prats (@prats){
my($y,$x) = split(/;/,$prats);
$R{$y} = $x;
}
$NM_V = $R{'nm'};
$HP_MAX_V = $R{'max_hp'};
$MP_MAX_V = $R{'max_mp'};
$LV_V = $R{'rank'};
$TM_V = $R{'lv'};
$UA_V = $R{'ua'};
$UD_V = $R{'ud'};
$LR_V = $R{'lr'};
$AG_V = $R{'ag'};
$DG_A_V = $R{'dg_a'};#武具
$DF_A_V = $R{'df_a'};#防具
$SOGO_V = $R{'sogo'};#称号
$SEI_V = $R{'sei'};#性別
$MES_V = $R{'info_mes'};
$TYPE_V = ($R{'type'}) ? "$R{'type'}" : "待機中";
$cnt = $_+1;
if($R{'camp'} == 0){
$log .=qq||;
# 称号
$log .=qq||;
$log .=qq||;
$log .=qq||;
}
}
}else{
foreach(0 .. $#tdat){
%R = '';
my @prats = split(/,/,$tdat[$_]);
foreach $prats (@prats){
my($y,$x) = split(/;/,$prats);
$R{$y} = $x;
}
if($camp == $R{'camp'}){
$NM_V{$R{'nm'}} = $R{'nm'};
$HP_MAX_V{$R{'nm'}} = $R{'max_hp'};
$MP_MAX_V{$R{'nm'}} = $R{'max_mp'};
$LV_V{$R{'nm'}} = $R{'rank'};
$TM_V{$R{'nm'}} = $R{'lv'};
$UA_V{$R{'nm'}} = $R{'ua'};
$UD_V{$R{'nm'}} = $R{'ud'};
$LR_V{$R{'nm'}} = $R{'lr'};
$AG_V{$R{'nm'}} = $R{'ag'};
$DG_A{$R{'nm'}} = $R{'dg_a'};#武具
$DF_A{$R{'nm'}} = $R{'df_a'};#防具
$SOGO_V{$R{'nm'}} =$R{'sogo'};#称号
$SEI_V{$R{'nm'}} =$R{'sei'};#性別
$MES_V{$R{'nm'}} =$R{'info_mes'};
$TYPE_V{$R{'nm'}} = ($R{'type'}) ? "$R{'type'}" : "待機中";
$N_M{$R{'nm'}} = $_;
}
}
$log .=qq||;
$l = $rk = 1;
foreach $nm (sort sclv keys(%LV_V)){
$lv_v = $LV_V{$nm};
next if($lv_v<=0);
if($lv_v<$prv_lv){ $rk = $l; }
$log .=qq||;
#称号
$log .=qq||;
$log .=qq||;
$log .=qq||;
$prv_lv = $lv_v;
$l++;
}
}
$log .="\n";
$select_icon = qq|<select name="icon" style="width:100px" >|;
for($no=1;$no<11;$no++){ # アイコン番号 001-010 までをループ
$no0 = sprintf('%03.d',$no);
if("$no0" eq $icon){ # $icon変数と同じなら選択する
$select_icon .= qq|<option value="$no0" selected>$no0</option>|;
} else {
$select_icon .= qq|<option value="$no0">$no0</option>|;
}
}
$select_icon .= "</select>";
$log.=<<EOM;
<br><br>
<div align="center" class="moji2">
<form method="$method" action="$script" name="ore_">
<input type="hidden" name="id" value="$id">
<input type="hidden" name="pw" value="$pw">
<input type="hidden" name="cmd" value="6">
<input type=text name="com" class="button2" style="width:0px">
$select_icon<input type=submit value="変更する" class="button2" style="width:100px">
</form>
</div>
EOM
見ての通りinfomationをいじっただけですので、
無駄な記述が多すぎます。
下記はore_.cgiのサブルーチン呼び出す部分です。
# 初期メニュー
elsif(!$type && $cmd==1 && $act_cnt<$act_cnt_limit) { require "./inc/ore_sub-training_$mv_mode\.cgi"; &training; }
elsif(!$type && $cmd==2) { require './inc/ore_sub-politics.cgi'; &politics; }
elsif(!$type && $cmd==3 && $act_cnt<$act_cnt_limit) { require './inc/ore_sub-war.cgi'; &war; }
elsif(!$type && $cmd==4 && $act_cnt<$act_cnt_limit) { require './inc/ore_sub-ability.cgi'; &ability; }
elsif(!$type && $cmd==5 && $act_cnt<$act_cnt_limit) { require './inc/ore_sub-changes.cgi'; &changes; }
elsif(!$type && $cmd==6) { require "./inc/ore_sub-infomation_$mv_mode\.cgi";&infomation_com; }
elsif(!$type && $cmd==7 && $act_cnt<$act_cnt_limit) { require './inc/ore_sub-subdue.cgi'; &subdue; }
elsif(!$type && $cmd==8 && $act_cnt<$act_cnt_limit) { require './inc/ore_sub-mission.cgi'; &mission; }
elsif(!$type && $cmd==9) { require "./inc/ore_sub-icon_$mv_mode\.cgi";&iconda; }
elsif(!$type && $cmd==20) { require './inc/ore_sub-shop.cgi'; &shop; }
# 続行メニュー
elsif($type eq '修行') { require "./inc/ore_sub-training_$mv_mode\.cgi"; &training_exe; }
elsif($type eq '修行中') { require './inc/ore_sub-battle.cgi'; &bt_st; }
elsif($type eq '戦争') { require './inc/ore_sub-war.cgi'; &war_exe; }
elsif($type eq '戦争中') { require './inc/ore_sub-wartime.cgi'; &wr_st; }
elsif($type eq '討伐') { require './inc/ore_sub-subdue.cgi'; &subdue_exe; }
elsif($type eq '討伐中') { require './inc/ore_sub-subduetime.cgi';&ws_st; }
elsif($type eq '軍事') { require './inc/ore_sub-mission.cgi'; &mission_exe; }
elsif($type eq '内政') { require './inc/ore_sub-politics.cgi'; &politics_exe; }
elsif($type eq '仕官') { require './inc/ore_sub-changes.cgi'; &changes_exe; }
elsif($type eq '能力') { require './inc/ore_sub-ability.cgi'; &ability_exe; }
elsif($type eq '整形手術') { require './inc/ore_sub-icon_$mv_mode\.cgi'; &iconda_exe; }
elsif($type eq 'お買い物') { require './inc/ore_sub-shop.cgi'; &shop_exe; }
else { require './inc/ore_sub-main.cgi'; &main_st; }
NowPrintingが直るか、どうすれば情報に飛ばなくなるか、またもっとお手軽な方法があるのであれば教えて頂きたいです。よろしくお願いします。
----
-<input type="hidden" name="cmd" value="6">の"6"を新しく増やした項目の番号に。 -- [[三毛猫]] &new{2007-02-02 (金) 23:36:45};
-それと、丸ごと載せるのは見にくいし、規約的にも微妙ではないでしょうか? -- [[三毛猫]] &new{2007-02-02 (金) 23:41:27};
-返答ありがとうございます。私自身も投稿後に自分の記事を見て反省致しました。 -- [[小麦粉]] &new{2007-02-03 (土) 13:53:08};
-ぃぇぃぇ、記号が自動で色々な効果になってしまうので、多少は仕方がないと思いますょ^^;>ただ、あまり原文を多く含んで貼り付けていると、罪罰の規約?(利用規定?)に抵触してしまう恐れがあるので。。。^^;;; -- [[三毛猫]] &new{2007-02-03 (土) 20:21:30};
#comment