#!/usr/bin/perl
require '/home/rexi-jp/public_html/jj/lib/lib.pl';
require '/home/rexi-jp/public_html/jj/lib/mypage.pl';
$mycgi = 'mypage.cgi';
$file_mine = "mypage_mine.html";
$file_other = "mypage_other.html";
$hist_mine = "mypage_history.html";
$hist_other = "mypage_history_other.html";
$file_other_npc = "mypage_npc_other.html";
$file_mine_npc = "mypage_mine_npc.html";
use CGI;
use CGI::Carp qw(fatalsToBrowser);
$ip = $ENV{'REMOTE_ADDR'};
$host = gethostbyaddr(pack("C4", split(/\./, $ip)), 2);
$host ||= $ENV{'REMOTE_HOST'};
$host ||= $ip;
$referer=$ENV{'HTTP_REFERER'};
$script=$ENV{'SCRIPT_NAME'};
$id = $ENV{'REMOTE_USER'};
$query = CGI->new;
my @params = $query->param();#全てのパラメータ名を取得 なのでこれを$inにしてしまえば$inで使用可能
foreach my $param (@params) {
$in{$param} = $query->param($param);
}
$uid = &get_usr_cookie;
$pcid = &get_pcid_cookie;
#テスト固定
#if ($in{'pcid'} ne ''){$pcid = $in{'pcid'};}
#if ($pcid eq ''){$pcid = 'ja0018';}
$dbh = &connectDB($mainDB);
if ($in{'type'} eq 'another'){
if ($in{'no'} eq '' || $in{'no'} eq 1){
$file_mine = "mypage_another_mine.html";
$file_other = "mypage_another_other.html";
$file_mine_npc = "mypage_another_mine.html";
$file_other_npc = "mypage_another_other.html";
}
elsif ($in{'no'} eq 2){
$file_mine = "mypage_another_spica_mine.html";
$file_other = "mypage_another_spica_other.html";
$file_mine_npc = "mypage_another_spica_mine.html";
$file_other_npc = "mypage_another_spica_other.html";
}
elsif ($in{'no'} eq 3){
$file_mine = "mypage_another_ma_mine.html";
$file_other = "mypage_another_ma_other.html";
$file_mine_npc = "mypage_another_ma_mine.html";
$file_other_npc = "mypage_another_ma_other.html";
}
}
if ($pcid eq $in{'pcid'} || $in{'pcid'} eq ''){
if (substr($pcid,0,2) ne 'jz'){
$myfile = $file_mine;
$myhist = $hist_mine;
}
else{
$myfile = $file_mine_npc;
}
#自分用Myページ表示
$out{'pcid'} = $pcid;
$flg_mode = 0;
}
else{
if (substr($in{'pcid'},0,2) ne 'jz'){
$myfile = $file_other;
$myhist = $hist_other;
}
else{
$myfile = $file_other_npc;
}
$out{'pcid'} = $in{'pcid'};
$flg_mode = 1;
}
if ($in{'mode'} eq ''){
&mypage_mine;
}
elsif ($in{'mode'} eq 'history'){
&history;
}
elsif ($in{'mode'} eq 'help'){
&help;
}
elsif ($in{'mode'} eq 'item'){
&item;
}
elsif ($in{'mode'} eq 'setup'){
&setup;
}
elsif ($in{'mode'} eq 'gallery_setting'){
&gallery_setting;
}
elsif ($in{'mode'} eq 'gallery'){
&gallery;
}
elsif ($in{'mode'} eq 'replay'){
&replay;
}
elsif ($in{'mode'} eq 'kizuna'){
&kizuna;
}
elsif ($in{'mode'} eq 'another_info_correct'){
&another_info_correct;
}
elsif ($in{'mode'} eq 'another_info_correct_conf'){
&another_info_correct_conf;
}
elsif ($in{'mode'} eq 'another_info_correct_reg'){
&another_info_correct_reg;
}
elsif ($in{'mode'} eq 'another_bustup'){
&another_bustup;
}
elsif ($in{'mode'} eq 'another_bustup_set'){
&another_bustup_set;
}
else{
&mypage_err("不正なパラメータ");
}
&disconDB($dbh);
exit;
#---------------------------------------
# 自分用Myページ表示
#---------------------------------------
sub mypage_mine {
&com_data($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
&com_bt($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
#お気に入り
$out{'favorite'} = '';
&date_rtn;
$now_m = "$g_year$g_mon";
if ($g_mon eq "01"){
$prv_y = "12";
$prv_t = int($g_year) - 1;
$prv_m = "$prv_t$prv_y";
}
else{
$prv_y = int($g_mon) - 1;
if (int($prv_y) < 10){$prv_y = "0" . int($prv_y);}
$prv_m = "$g_year$prv_y";
}
# if ($uid eq 4){
$sql = "select b.name from poll a,master b where a.pcid = '$out{'pcid'}' and a.month = $now_m and a.msid = b.id;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($okiniiri)=@{$ref->[0]};
# if ($okiniiri eq ''){
# #先月のを取得
# $sql = "select b.name from poll a,master b where a.pcid = '$out{'pcid'}' and a.month = $prv_m and a.msid = b.id;";
# $ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
# ($okiniiri)=@{$ref->[0]};
# }
if ($okiniiri eq ''){$out{'favorite'} = '';}
else{$out{'favorite'} = $okiniiri;}
# }
#次の経験値
$out{'nexp'} = &lv_str($out{'exp'});
#名声値
if (substr($out{'pcid'},0,2) ne 'jz'){
$sql = "select lv from sp_status where pcid = '$out{'pcid'}' and no = 13;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($f_lv)=@{$ref->[0]};
if ($f_lv ne ''){$fame = $fame + ($f_lv * 3500);}
$out{'famestr'} = &fame_rank($fame);
$out{'fame'} = $fame;
}
else{
$out{'fame'} = '−';
}
if (substr($out{'pcid'},0,2) ne 'jz'){
if ($in{'type'} eq ''){
&cal_ability($out{'pcid'},$out{'age'},$out{'name1'},$out{'name3'},$training,$sex,$out{'hometown'},$class,$figure,$fame,$out{'height'},$out{'weight'});
$tmp2="$out{'pcid'},$out{'age'},$out{'name1'},$out{'name3'},$training,$sex,$out{'hometown'},$class,$figure,$fame,$out{'height'},$out{'weight'}";
}
else{
&cal_ability($out{'pcid'},$out{'age'},$out{'name1'},$out{'name3'},$training,$sex,$out{'hometown'},$class,$figure,$fame,$out{'height'},$out{'weight'},undef,undef,1);
}
$out{'wweight'} = $s_weight;
$out{'wheight'} = $s_height;
$out{'weight'} = $s_weight2;
$out{'t1_1'} = $t1_1;
$out{'t1_2'} = $t1_2;
$out{'t1_3'} = $t1_3;
$out{'t2_1'} = $t2_1;
$out{'t2_2'} = $t2_2;
$out{'t2_3'} = $t2_3;
$out{'sk1_1'} = &skill_rank($s1_1,$sk_ka);
$out{'sk2_1'} = &skill_rank($s2_1,$sk_ka);
$out{'sk1_2'} = &skill_rank($s1_2,$sk_so);
$out{'sk2_2'} = &skill_rank($s2_2,$sk_so);
$out{'sk1_3'} = int(($s1_3 * 0.05) * 100) . ' %';
$out{'sk2_3'} = int(($s2_3 * 0.05) * 100) . ' %';
$out{'s1_7'} = $s1_7;
$out{'s2_7'} = $s2_7;
$out{'s1_5'} = $s1_5;
$out{'s2_5'} = $s2_5;
$out{'s1_6'} = $s1_6;
$out{'s2_6'} = $s2_6;
$out{'s1_4'} = $s1_4;
$out{'s2_4'} = $s2_4;
$out{'s1_7'} = $s1_7;
$out{'s2_7'} = $s2_7;
$out{'s1_8'} = $s1_8;
$out{'s2_8'} = $s2_8;
$out{'bp1'} = $bp1;
$out{'bp2'} = $bp2;
$out{'fa1'} = $fa1;
$out{'sa1'} = $sa1;
$out{'ta1'} = $ta1;
$out{'fa2'} = $fa2;
$out{'sa2'} = $sa2;
$out{'ta2'} = $ta2;
}
else{
$out{'wweight'} = '−';
$out{'wheight'} = '−';
$out{'t1_1'} = '−';
$out{'t1_2'} = '−';
$out{'t1_3'} = '−';
$out{'t2_1'} = '−';
$out{'t2_2'} = '−';
$out{'t2_3'} = '−';
$out{'sk1_1'} = '−';
$out{'sk2_1'} = '−';
$out{'sk1_2'} = '−';
$out{'sk2_2'} = '−';
$out{'sk1_1'} = '−';
$out{'sk2_1'} = '−';
$out{'sk1_2'} = '−';
$out{'sk2_2'} = '−';
$out{'sk1_3'} = '−';
$out{'sk2_3'} = '−';
$out{'s1_7'} = '−';
$out{'s2_7'} = '−';
$out{'s1_5'} = '−';
$out{'s2_5'} = '−';
$out{'s1_6'} = '−';
$out{'s2_6'} = '−';
$out{'s1_4'} = '−';
$out{'s2_4'} = '−';
$out{'s1_7'} = '−';
$out{'s2_7'} = '−';
$out{'s1_8'} = '−';
$out{'s2_8'} = '−';
$out{'bp1'} = '−';
$out{'bp2'} = '−';
$out{'fa1'} = '−';
$out{'sa1'} = '−';
$out{'ta1'} = '−';
$out{'fa2'} = '−';
$out{'sa2'} = '−';
$out{'ta2'} = '−';
}
if (length ($out{'name1'}) > 22){$out{'name1'} = '' . $out{'name1'} . '';}
if (length ($out{'name3'}) > 22){$out{'name3'} = '' . $out{'name3'} . '';}
$pc_lv = &lv_show($out{'exp'});
$out{'lv'} =<<"EOT";
Lv / Exp
| : | $lv / $out{'exp'} |
|
EOT
# #スペシャルステータス
# $sql = "select no,lv,fault from sp_status where pcid = '$out{'pcid'}' and no not in (17,18) order by no;";
# $ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
# foreach(@$ref) {
# ($no,$lv,$fault)=@{$_};
# $spbody .=<<"EOT";
# @sp_status_name[$no]
#EOT
# }
# if ($spbody ne ''){
# $out{'spbody'} =<<"EOT";
#
#
#[スペシャルステータス]
#$spbody
# |
#
#EOT
# }
#自由設定
$sql = "select seq,title from free_set where pcid = '$out{'pcid'}' and title is not null and result in (1,3) order by seq;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($seq,$title)=@{$_};
if ($title ne ''){
$out{'free'} .=<<"EOT";
$title
EOT
}
}
if ($out{'free'} ne ''){
$out{'free'} =<<"EOT";
EOT
}
#欠点
$sql = "select no,lv,fault from sp_status where pcid = '$out{'pcid'}' and fault is not null and fault != '' order by no;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($no,$lv,$fault)=@{$_};
if ($no eq 2){$f_txt = "強化変身の欠点";}
elsif ($no eq 6){$f_txt = "強化戦闘服の欠点";}
elsif ($no eq 8){$f_txt = "強化改造の欠点";}
elsif ($no eq 8){$f_txt = "強化改造の欠点";}
elsif ($no eq 22){$f_txt = "強化変形の欠点";}
elsif ($no eq 25){$f_txt = "強化AIの欠点";}
$fbody .=<<"EOT";
$f_txt
EOT
# $fault
}
if ($fbody ne ''){
$out{'fbody'} =<<"EOT";
EOT
}
#必殺技
$sql = "select seq,original_name,item_seq,item_id from sp_attack where pcid = '$out{'pcid'}' order by seq;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($seq,$original_name,$item_seq,$item_id)=@{$_};
$sql2 = "select seq from tokkun where base_seq = $seq and rest_num > 0;";
$ref2 = $dbh->selectall_arrayref($sql2) or &mypage_err("CODE:NS-01
エラーが発生しました。");
($tmp)=@{$ref2->[0]};
if ($tmp eq ''){
$spskill .=<<"EOT";
$original_name
EOT
}
}
#特訓中必殺技
$sql = "select seq,original_name,item_seq,item_id,base_seq from tokkun where pcid = '$out{'pcid'}' and result = 0 order by seq;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($seq,$original_name,$item_seq,$item_id,$base_seq)=@{$_};
if ($base_seq ne ''){
$sql2 = "select seq,original_name,item_seq,item_id from sp_attack where pcid = '$out{'pcid'}' and seq = $base_seq;";
$ref2 = $dbh->selectall_arrayref($sql2) or &mypage_err("CODE:NS-01
エラーが発生しました。");
(undef,undef,$item_seq,$item_id)=@{$ref2->[0]};
# (undef,$original_name,$item_seq,$item_id)=@{$ref2->[0]};
}
$spskill .=<<"EOT";
※$original_name
EOT
}
if ($spskill ne ''){
$out{'spskill'} .=<<"EOT";
EOT
}
#スキル
$sql = "select a.id,a.lv,b.name,b.base from skill a,skill_master b where pcid = '$out{'pcid'}' and a.id = b.id and b.id > 3 and b.id != 18 order by a.id;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($id,$lv,$name,$base)=@{$_};
if ($base eq '格闘'){
$base_num1 = $s1_1;
$base_num2 = $s2_1;
}
elsif ($base eq '操作'){
$base_num1 = $s1_2;
$base_num2 = $s2_2;
}
elsif ($base eq '心'){
$base_num1 = $t1_1;
$base_num2 = $t2_1;
}
$rk1 = &skill_rank($base_num1,$lv);
$rk2 = &skill_rank($base_num2,$lv);
# &mypage_err("&skill_rank($base_num1,$lv),&skill_rank($base_num2,$lv)");
$tm = "";
# if ($uid eq 4){$tm = " $base_num1,$lv $ptt";}
$skill .=<<"EOT";
$name $rk2 /$rk1$tm
EOT
}
if ($skill ne ''){
$out{'skill'} =<<"EOT";
EOT
}
#超能力
$tmp = '';
$sql = "select a.id,a.lv,b.name,b.base from skill a,skill_master b where pcid = '$out{'pcid'}' and a.id = b.id and (b.id <= 3 or b.id = 18) order by a.id;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($id,$lv,$name,$base)=@{$_};
if ($base eq '格闘'){
$base_num1 = $s1_1;
$base_num2 = $s2_1;
}
elsif ($base eq '操作'){
$base_num1 = $s1_2;
$base_num2 = $s2_2;
}
elsif ($base eq '理力'){
$base_num1 = $s1_3;
$base_num2 = $s2_3;
}
$rk1 = &skill_rank($base_num1,$lv);
$rk2 = &skill_rank($base_num2,$lv);
$rk1_pt = &skill_rank($base_num1,$lv,1);
$rk2_pt = &skill_rank($base_num2,$lv,1);
# if ($uid eq 2){
# $tmp .= <<"EOT";
#lv:$lv
#s1_3:$s1_3,s2_3:$s2_3
#rk1:$rk1,rk2:$rk2
#rk1_pt:$rk1_pt,rk2_pt:$rk2_pt
#$out{'pcid'},$out{'age'},$out{'name1'},$out{'name3'},$training,$sex,$out{'hometown'},$class,$figure,$fame,$out{'height'},$out{'weight'}
#EOT
# }
$espbody .=<<"EOT";
$name $rk2 / $rk1
$tmp
EOT
if ($id eq 18){$ty = 4;}
else{$ty = $id;}
$sql = "select a.type,a.no,b.name,b.txt from esp a,esp_easy_master b where a.pcid = '$out{'pcid'}' and a.no = b.id and b.type = $ty order by a.no;";
$ref2 = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref2) {
($type,$no,$name,$txt)=@{$_};
$espbody .=<<"EOT";
$name
EOT
}
}
if ($espbody ne ''){
$out{'espbody'} =<<"EOT";
EOT
}
#アイテム
%idat = ();
# for ($i=0;$i<4;$i++){
# if ($i eq 0){$cn = 1;}
# elsif ($i eq 1){$cn = 0;}
# elsif ($i eq 2){$cn = 2;}
# elsif ($i eq 3){$cn = 'NULL';}
# %pre = ();
# $pre{'cnt'} = 0;
# $cnt = 1;
# # $sql = "select a.id,a.original_name,a.equip,b.name,b.condition,count(*) from item a,item_master b where a.pcid = '$out{'pcid'}' and a.state = 0 and a.id = b.id and b.condition = $cn group by a.id,a.original_name,a.equip,b.name,b.condition order by a.equip;";
# $sql = "select a.seq,a.id,a.original_name,a.equip,a.form,b.name,b.condition,a.damage_flg from item a,item_master b where a.pcid = '$out{'pcid'}' and a.equip > 0 and equip <= 12 and a.state = 0 and a.id = b.id and ";
# if ($i eq 3){$sql .= "a.form is null ";}
# else{$sql .= "a.form = $cn ";}
# $sql .= "order by a.form,a.equip,a.id;";
# $ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
# foreach(@$ref) {
# ($seq,$id,$original_name,$equip,$form,$name,$condition,$damage_flg)=@{$_};
# #前回のアイテムと同じかチェック
# # if ($id eq $pre{'id'} && $equip eq $pre{'equip'}){
# if ($id eq $pre{'id'} && $equip eq $pre{'equip'} && $damage_flg eq $pre{'damage_flg'}){
# $cnt++;
# # if ($pcid eq 'ja0077' && $cnt > 2){&mypage_err("$id,$cnt");}
# }
# elsif($pre{'id'} ne ''){
# #違っていたならば、前回記憶したアイテムをロード
# if ($pre{'form'} eq 0){$pre{'form'} = '−';}
# elsif ($pre{'form'} eq 1){$pre{'form'} = '変身';}
# elsif ($pre{'form'} eq 2){$pre{'form'} = '人間';}
# else {$pre{'form'} = '−';}
# if ($cnt > 1){
# $numb = '×' . $cnt;
# # if ($pcid eq 'ja0077' && $cnt > 2){&mypage_err("$id,$cnt,$numb");}
# }
# else {$numb = '';}
# if ($pre{'original_name'} ne ''){$pre{'name'} = $pre{'original_name'};}
# if ($pre{'equip'} eq 12){$pre{'form'} = '−';}
# if ($pre{'damage_flg'} eq 1){$pd = '※';}#
# else{$pd = '';}
# # $pd = ' ';
# $out{'itmbody'} .=<<"EOT";
#
#@equip_parts[$pre{'equip'}] |
#$pd$pre{'name'}$numb |
#$pre{'form'} |
#
#EOT
# $idat[$i] .=<<"EOT";
#
#@equip_parts[$pre{'equip'}] |
#$pd$pre{'name'}$numb |
#$pre{'form'} |
#
#EOT
# $cnt = 1;
# }
# #今回のアイテムを記憶
# $pre{'seq'} = $seq;
# $pre{'id'} = $id;
# $pre{'original_name'} = $original_name;
# $pre{'equip'} = $equip;
# $pre{'name'} = $name;
# $pre{'condition'} = $condition;
# $pre{'form'} = $form;
# $pre{'damage_flg'} = $damage_flg;
# }
# #最後のデータをロード
# if ($pre{'seq'} ne ''){
# if ($pre{'form'} eq 0){$pre{'form'} = '−';}
# elsif ($pre{'form'} eq 1){$pre{'form'} = '変身';}
# elsif ($pre{'form'} eq 2){$pre{'form'} = '人間';}
# else {$pre{'form'} = '−';}
# if ($cnt ne '' && $cnt > 1){$numb = '×' . $cnt;}
# else {$numb = '';}
# if ($pre{'original_name'} ne ''){$pre{'name'} = $pre{'original_name'};}
# if ($pre{'equip'} eq 12){$pre{'form'} = '−';}
# $out{'itmbody'} .=<<"EOT";
#
#@equip_parts[$pre{'equip'}] |
#$pre{'name'}$numb |
#$pre{'form'} |
#
#EOT
# $idat[$i] .=<<"EOT";
#
#@equip_parts[$pre{'equip'}] |
#$pre{'name'}$numb |
#$pre{'form'} |
#
#EOT
# }
# }
# for($idat_cnt=0;$idat_cnt<=3;$idat_cnt++){
# $idat_tbl .=<<"EOT";
#
#
#
#部位
# |
# 装備品・アイテム
# |
#条件
# |
#$idat[$idat_cnt]
#
#
#EOT
# }
# $idat_tbl =<<"EOT";
#
#EOT
# $out{'itmbody'} =<<"EOT";
#
#
#部位
# |
# 装備品・アイテム
# |
#条件
# |
#$out{'itmbody'}
#
#EOT
# if ($uid eq 4){$out{'itmbody'} = $idat_tbl;}
#新版アイテム一覧
#if ($uid eq 4){
$idat_tbl = '';
%idat = ();
for ($i=0;$i<3;$i++){
%pre = ();
$idat[$i] = '';
$pre{'cnt'} = 0;
$cnt = 1;
$sql = "select a.seq,a.id,a.original_name,a.equip,a.form,b.name,b.condition,a.damage_flg from item a,item_master b where a.pcid = '$out{'pcid'}' and a.equip > 0 and equip <= 12 and a.state = 0 and a.id = b.id and ";
if ($i eq 0){$sql .= "a.form in (0,1) ";}
elsif ($i eq 1){$sql .= "a.form in (0,2) ";}
elsif ($i eq 2){$sql .= "a.form is null and a.equip = 12 ";}
$sql .= "order by a.equip,a.form,a.id;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($seq,$id,$original_name,$equip,$form,$name,$condition,$damage_flg)=@{$_};
#前回のアイテムと同じかチェック
if ($id eq $pre{'id'} && $equip eq $pre{'equip'} && $original_name eq $pre{'original_name'} && $damage_flg eq $pre{'damage_flg'}){
$cnt++;
}
elsif($pre{'id'} ne ''){
#違っていたならば、前回記憶したアイテムをロード
if ($pre{'form'} eq 0){$pre{'form'} = '−';}
elsif ($pre{'form'} eq 1){$pre{'form'} = '変身';}
elsif ($pre{'form'} eq 2){$pre{'form'} = '人間';}
else {$pre{'form'} = '−';}
if ($cnt > 1){
$numb = '×' . $cnt;
}
else {$numb = '';}
if ($pre{'original_name'} ne ''){$pre{'name'} = $pre{'original_name'};}
if ($pre{'equip'} eq 12){$pre{'form'} = '−';}
if ($pre{'damage_flg'} eq 1){$pd = '※';}#
else{$pd = '';}
$idat[$i] .=<<"EOT";
@equip_parts[$pre{'equip'}] |
$pd$pre{'name'}$numb |
$pre{'form'} |
EOT
if ($i eq 1){
$another_item .=<<"EOT";
@equip_parts[$pre{'equip'}] |
$pd$pre{'name'}$numb |
EOT
}
$cnt = 1;
}
#今回のアイテムを記憶
$pre{'seq'} = $seq;
$pre{'id'} = $id;
$pre{'original_name'} = $original_name;
$pre{'equip'} = $equip;
$pre{'name'} = $name;
$pre{'condition'} = $condition;
$pre{'form'} = $form;
$pre{'damage_flg'} = $damage_flg;
}
#最後のデータをロード
if ($pre{'seq'} ne ''){
if ($pre{'form'} eq 0){$pre{'form'} = '−';}
elsif ($pre{'form'} eq 1){$pre{'form'} = '変身';}
elsif ($pre{'form'} eq 2){$pre{'form'} = '人間';}
else {$pre{'form'} = '−';}
if ($cnt ne '' && $cnt > 1){$numb = '×' . $cnt;}
else {$numb = '';}
if ($pre{'original_name'} ne ''){$pre{'name'} = $pre{'original_name'};}
if ($pre{'equip'} eq 12){$pre{'form'} = '−';}
if ($i eq 2){$pre{'equip'} = '随伴';}
else{$pre{'equip'} = @equip_parts[$pre{'equip'}];}
$idat[$i] .=<<"EOT";
$pre{'equip'} |
$pre{'name'}$numb |
$pre{'form'} |
EOT
if ($i eq 1){
$another_item .=<<"EOT";
$pre{'equip'} |
$pre{'name'}$numb |
EOT
}
}
}
#兵器
$sql = "select d.name,c.seq,c.base_seq from sally_list a,scenario b,base_item c,item_master d where a.pcid = '$out{'pcid'}' and a.sally_apply_state = 1 and a.scenario_seq = b.seq and b.reserve_close <= now() and (b.playing_close + '2 days') >= now() and b.state = 0 and a.item_seq = c.seq and c.state = 0 and c.equip = 1 and c.id = d.id;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($f_name,$f_seq,$base_seq)=@{$_};
$f_list .=<<"EOT";
$pre{'equip'} |
$f_name |
$pre{'form'} |
EOT
}
for($idat_cnt=0;$idat_cnt<=2;$idat_cnt++){
$idat_tbl .=<<"EOT";
部位 |
装備品・アイテム |
条件 |
$idat[$idat_cnt]
EOT
if ($idat_cnt eq 2 && $f_list ne ''){
$idat_tbl .=<<"EOT";
$f_list
EOT
}
$idat_tbl .=<<"EOT";
EOT
}
$idat_tbl =<<"EOT";
EOT
$out{'itmbody'} = $idat_tbl;
if ($in{'type'} eq 'another'){
$out{'itmbody'} =<<"EOT";
部位 |
装備品・アイテム |
$another_item
EOT
}
#}
#CP
# $out{'cp'} = 0;
#特訓/作戦
if ($attribute eq 1){
$out{'tkop'} = '特訓';
$pt = $tokkun;
}
elsif ($attribute eq 2){
$out{'tkop'} = '作戦';
$pt = $sakusen;
}
$out{'tkop_per'} = $pt . ' %';
#秘密基地
$k = 0;
$sql = "select b.seq,b.name,b.leader from base_member a,base b where a.pcid = '$out{'pcid'}' and a.state = 0 and a.base_seq = b.seq and b.state = 0 order by b.seq;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
foreach(@$ref) {
($base_seq,$base_name,$base_leader)=@{$_};
if ($k eq 0){
$sb .=<<"EOT";
: | $base_name |
EOT
}
else{
$sb .=<<"EOT";
: | $base_name |
EOT
}
$k++;
}
if ($sb ne ''){
$out{'secret_base'} = <<"EOT";
EOT
}
#下段表示
if (substr($out{'pcid'},0,2) ne 'jz'){
$out{'kadan'} =<<"EOT";
生年月日 | : | $out{'birth'} |
出身 | : | $out{'hometown'} |
立場 | : | $out{'position'} |
|
一人称 | : | $out{'first'} |
二人称 | : | $out{'second'} |
口調 | : | $out{'tone'} |
|
$out{'secret_base'}
|
現在のLv | : | $pc_lv |
経験値 | : | $out{'exp'}(next$out{'nexp'}) |
名声値 | : | $out{'fame'}($out{'famestr'}) |
SP / CP | : | $out{'sp'} / $out{'cp'} |
$out{'tkop'} | : | $out{'tkop_per'} |
|
|
|
$out{'fbody'} |
$out{'spskill'} |
$out{'skill'} |
$out{'espbody'} |
$out{'free'}
|
|
|
|
|
$out{'itmbody'}
|
EOT
}
else{
$npc_info =~ s/\n/
/g;
$out{'npc_info'} = $npc_info;
}
&out_enc;
if ($in{'data_mode'} eq 1){
$myfile = $file_other;
$myhist = $hist_other;
$out{'pcid'} = $in{'pcid'};
$pcdat = '';
open FILE,$myfile;
while(){
s/!(\w+)!/$out{$1}/g;
$pcdat .= $_;
}
close FILE;
return $pcdat;
}
else{
open FILE,$myfile;
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
}
#---------------------------------------
# ヘルプ
#---------------------------------------
sub help {
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
open FILE,"mypage_help.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# ヒストリー
#---------------------------------------
sub history {
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
&com_bt($in{'mode'},$out{'pcid'},$flg_mode);
$hcnt = 1;
$date = substr($ins_date,2,2) . '/' . substr($ins_date,5,2) . '/' . substr($ins_date,8,2);
$history =<<"EOT";
$date | 第1話 | $out{'name1'}誕生 |
EOT
$sql = "select b.seq,b.title,substr(b.playing_close,3,8),c.name,b.playing_close from scenario_member a,scenario b,master c where a.pcid = '$out{'pcid'}' and (a.entry_state = 1) and a.scenario_seq = b.seq and b.scenario_state >= 2 and b.state = 0 and a.msid = c.id order by b.playing_close asc;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
foreach(@$ref) {
$hcnt++;
($sseq,$title,$playing_close,$msname,$playing_close2)=@{$_};
$link = "";
$sdate = &calDate(substr($playing_close2,0,4),substr($playing_close2,5,7),substr($playing_close2,8,2),-1);
$sdate =~ s/\-/\//g;
$sdate = substr($sdate,2);
$history =<<"EOT";
$sdate | 第$hcnt話 | $title | $msname |
$history
EOT
}
$out{'history'} = $history;
&out_enc;
open FILE,$myhist;
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 絆設定
#---------------------------------------
sub kizuna {
print "Location: ./mypage_kizuna.cgi?mode=kizuna_show&pcid=$out{'pcid'}\n\n";
exit;
# if ($pcid ne $out{'pcid'}){
# print "Location: ./mypage_kizuna.cgi?mode=kizuna_show&pcid=$out{'pcid'}\n\n";
# exit;
# }
# else{
# print "Location: ./mypage_kizuna.cgi?mode=kizuna_show&pcid=$out{'pcid'}\n\n";
# exit;
# }
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
&com_bt($in{'mode'},$out{'pcid'},$flg_mode);
&out_enc;
if (($sex eq 1 && $out{'age'} >= 18) || ($sex eq 2 && $out{'age'} >= 16)){
$out{'ma'} =<<"EOT";
●婚姻承認 |
このキャラクターに申請された婚姻の承認/却下を行います。 | |
●特殊婚姻申請 |
このキャラクターの特殊な婚姻を申請します。 | |
●特殊婚姻承認 |
このキャラクターに申請された特殊な婚姻の承認/却下を行います。 | |
EOT
}
&out_enc;
open FILE,"mypage_kizuna.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 設定
#---------------------------------------
sub setup {
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
&com_bt($in{'mode'},$out{'pcid'},$flg_mode);
&death_check($pcid,undef,1,1);
#スキル修得表示
# if ($out{'sp'} > 0){
$out{'skill'} =<<"EOT";
●スキルを修得する |
SPを消費して、新たなスキルを修得したり、レベルを上昇させます。 | |
EOT
# }
#必殺技
$flg = 0;
$sql = "select sa_flg,lv from sp_status where pcid = '$pcid' and no = 17;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($sa_flg1,$slv1)=@{$ref->[0]};
if ($sa_flg1 eq ''){$sa_flg = 0;}
if ($slv1 eq ''){$slv1 = 0;}
$sql = "select sa_flg,lv from sp_status where pcid = '$pcid' and no = 18;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($sa_flg2,$slv2)=@{$ref->[0]};
if ($sa_flg2 eq ''){$sa_flg = 0;}
if ($slv2 eq ''){$slv2 = 0;}
if ($slv1 eq 0 && $slv2 eq 0){$flg = 1;}
# if ($slv1 <= $sa_flg1 && $slv2 <= $sa_flg2){$flg = 1;}
if (int($slv1 - $sa_flg1) + int($slv2 - $sa_flg2) <= 0){$flg = 1;}
if ($flg eq 0){
$out{'hissatsu'} =<<"EOT";
●必殺技を修得する |
アイテムなどと連動した必殺技を修得します。 | |
EOT
}
else{
#特訓
$out{'hissatsu'} =<<"EOT";
EOT
}
#超能力
$sql = "select count(*) from skill where pcid = '$pcid' and id in (1,2,3,18);";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($esp_cnt)=@{$ref->[0]};
if ($esp_cnt > 0){
$out{'esp_va'} =<<"EOT";
●超能力の技を修得する |
SPを消費して、新たな超能力の技を修得します。 | |
EOT
}
#NPC用設定
if (substr($pcid,0,2) eq 'jz'){
$out{'npcsettei'} =<<"EOT";
●NPC設定 |
Myページに表示されるNPC情報を編集します。 | |
EOT
}
&out_enc;
if (substr($pcid,0,2) eq 'jz'){
$ofname = "mypage_setup_npc.html";
}
else{
$ofname = "mypage_setup.html";
}
open FILE,"mypage_setup.html";
print $header;
while(
){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# アイテム
#---------------------------------------
sub item {
$death_flg = &death_check($pcid);
$sql = "select sv_flg,lv from sp_status where pcid = '$pcid' and no = 11;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($sv_flg,$lv)=@{$ref->[0]};
if ($sv_flg ne '' && $sv_flg eq 0 && $death_flg eq 0){
$out{'sv'} =<<"EOT";
EOT
}
$sql = "select sw_flg,lv from sp_status where pcid = '$pcid' and no = 9;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($sw_flg,$lv)=@{$ref->[0]};
if ($sw_flg ne '' && $death_flg eq 0){
$pt = $lv - $sw_flg;
if ($pt > 0){
$out{'sw'} =<<"EOT";
EOT
}
}
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
&com_bt($in{'mode'},$out{'pcid'},$flg_mode);
&out_enc;
open FILE,"mypage_soubi.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# ギャラリー設定
#---------------------------------------
sub gallery_setting {
&com_data($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
&com_bt($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
&out_enc;
open FILE,"mypage_gallery_setting.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 一覧
#---------------------------------------
sub gallery {
if ($in{'pcid'} eq ''){$in{'pcid'} = $pcid;}
$sql = "select pdname,crname,file_name,substr(reg_date,1,10),comment from stars_data where pcid = '$in{'pcid'}' order by reg_date desc;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
$out{'list'} =<<"EOT";
EOT
$i = 1;
foreach(@$ref) {
($pdname,$crname,$file_name,$reg_date,$comment)=@{$_};
($format,$width,$height) = &GetImageSize("/home/rexi-jp/public_html/stars/data/jj/$file_name");
$comment =~ s/\n/
/g;
if (($width < 100 && $height < 100)){
$th_file = "http://rexi.jp/stars/data/jj/$file_name";
($format,$w,$h) = &GetImageSize("/home/rexi-jp/public_html/stars/data/jj/$file_name");
}
elsif (!-e "/home/rexi-jp/public_html/stars/data/jj_thumbnail/$file_name"){
$th_file = "http://rexi.jp/stars/data/jj/$file_name";
$h = 100;
}
else{
$th_file = "http://rexi.jp/stars/data/jj_thumbnail/$file_name";
($format,$w,$h) = &GetImageSize("/home/rexi-jp/public_html/stars/data/jj_thumbnail/$file_name");
}
if ($i eq 0){
$out{'list'} .=<<"EOT";
EOT
}
if ($comment ne ''){$pdname = "" . $comment . "
";}
if ($pcid eq $in{'pcid'}){
$pdname .=<<"EOT";
EOT
}
$out{'list'} .=<<"EOT";
|
$crname |
$reg_date |
$pdname |
|
EOT
if ($i eq 4){
$out{'list'} .=<<"EOT";
EOT
$i = 0;
}
$i++;
}
$out{'list'} .=<<"EOT";
EOT
&com_data($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
&com_bt($in{'mode'},$out{'pcid'},$flg_mode,$in{'type'});
&out_enc;
open FILE,"mypage_gallery02.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# リプレイ表示
#---------------------------------------
sub replay {
require '/home/rexi-jp/public_html/jj/lib/scenario.pl';
if ($in{'seq'} eq ''){&err("不正なパラメータ");}
$sql = "select a.type,a.title,a.text,a.comment,op_illust,a.difficulty,a.source,a.attribute1,a.attribute2,a.reserve_close,a.playing_close,a.member_max,b.name,a.replay from scenario a,master b where a.seq = $in{'seq'} and open_date <= now() and a.state = 0 and a.msid = b.id;";
$ref = $dbh->selectall_arrayref($sql) or &opening_err("エラーが発生しました。");
($type,$out{'title'},$out{'text'},$out{'ms_comment'},$out{'op_illust'},$difficulty,$source,$attribute1,$attribute2,$reserve_close,$playing_close,$out{'member_max'},$out{'msname'},$out{'replay_str'})=@{$ref->[0]};
if ($out{'title'} eq ''){&mypage_err("該当シナリオが見つかりませんでした。");}
$out{'type'} = @sc_type_icon[$type];
$out{'source'} = @source_list[$source];
$out{'difficulty'} = @dif[$difficulty];
if ($attribute1 eq 100){$t = 1;}
elsif ($attribute1 eq 70){$t = 2;}
elsif ($attribute1 eq 50){$t = 3;}
elsif ($attribute1 eq 30){$t = 4;}
elsif ($attribute1 eq 0){$t = 5;}
$out{'a_atb'} = @atb_str[$t];
$out{'b_atb'} = @atb_icon[$t];
$out{'text'} =~ s/\n/
/g;
$out{'ms_comment'} =~ s/\n/
/g;
# $out{'replay_str'} =~ s/\n/
/g;
#参加者一覧
$out{'mem_num'} = 0;
$sql = "select b.pcid,b.name1,b.name3,b.sex,b.birth,b.attribute from scenario_member a,character b where a.scenario_seq = $in{'seq'} and a.entry_state = 1 and a.pcid = b.pcid order by a.pcid;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
foreach(@$ref) {
($m_pcid,$m_name1,$m_name2,$m_sex,$m_birth,$m_attribute)=@{$_};
push member_pcid,$m_pcid;
$m_age = &calcAge($m_birth);
if ($m_sex eq 1){$m_sex = '♂';}
elsif ($m_sex eq 2){$m_sex = '♀';}
if ($m_attribute eq 1){$m_attribute = '善';}
elsif ($m_attribute eq 2){$m_attribute = '悪';}
$out{'member'} .=<<"EOT";
($m_pcid)$m_name1($m_name2)・$m_attribute・$m_sex・$m_age
EOT
$out{'mem_num'}++;
}
@rep_dat = split(/\n/,$out{'replay_str'});
$out{'replay_str'} =~ s/\n/
/g;
$out{'replay_str'} = '';
$i = 0;
$sql = "select a.pcid,a.file,a.url,b.name1,b.name3,c.crname,a.replay_row,a.left_right from scenario_pinup a,character b,stars_data c where a.scenario_seq = $in{'seq'} and a.pcid = b.pcid and a.file = c.file_name order by a.reg_date desc;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。");
%rep_pin = ();
%rep_pin_lr = ();
%rep_pin_pcid = ();
foreach(@$ref) {
($p_pcid,$file,$url,$p_name1,$p_name2,$crname,$replay_row,$left_right)=@{$_};
$rep_pin{$replay_row} = $file;
$rep_pin_lr{$replay_row} = $left_right;
$rep_pin_pcid{$replay_row} = $p_pcid;
}
$r = 1;
foreach(@rep_dat){
$r_tmp = $_;
foreach(@member_pcid){
$mem_pcid = $_;
$mem_pcid2 = "(" . $mem_pcid . ')';
$r_tmp =~ s/($mem_pcid)/$mem_pcid2/g;
}
# if ($uid eq 2 && $r eq 70){&mypage_err($rep_pin{$r});}
# if ($rep_pin{$r} ne '' && $pcid eq 'ja1313'){
if ($rep_pin{$r} ne ''){
#Myページリプレイ用サイズチェック
$myp_file1 = "/home/rexi-jp/public_html/stars/data/jj/" . $rep_pin{$r};
$myp_file2 = "/home/rexi-jp/public_html/jj/scenario/sum/" . $rep_pin{$r};
if (!-e $myp_file2){
system "convert -resize 200 +profile iptc -quality 100% $myp_file1 $myp_file2";
}
if ($rep_pin_lr{$r} eq 1){
$out{'replay_str'} .=<<"EOT";
$r_tmp
EOT
}
elsif ($rep_pin_lr{$r} eq 2){
$out{'replay_str'} .=<<"EOT";
$r_tmp
EOT
}
else{$out{'replay_str'} .= $r_tmp . '
';}
}
else{
$out{'replay_str'} .= $r_tmp . '
';
}
$r++;
}
if ($rep_pin{0} ne 0){
#Myページリプレイ用サイズチェック
$myp_file1 = "/home/rexi-jp/public_html/stars/data/jj/" . $rep_pin{0};
$myp_file2 = "/home/rexi-jp/public_html/jj/scenario/sum/" . $rep_pin{0};
if (!-e $myp_file2){
system "convert -resize 200 +profile iptc -quality 100% $myp_file1 $myp_file2";
}
if ($rep_pin_lr{0} eq 1){$out{'replay_str'} .= "" . '
';}
elsif ($rep_pin_lr{0} eq 2){$out{'replay_str'} .= "" . '
';}
}
# if ($uid eq 2){&mypage_err($r);}
&com_data($in{'mode'},$out{'pcid'},$flg_mode);
&com_bt($in{'mode'},$out{'pcid'},$flg_mode);
&out_enc;
open FILE,"mypage_replay01.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 夢の世界PC情報編集
#---------------------------------------
sub another_info_correct {
if ($in{'pcid'} ne $pcid && $in{'pcid'} ne ''){&mypage_err("ログインしているキャラクターと、編集しようとしているキャラクターが一致しません。");}
if ($in{'no'} eq ''){$in{'no'} = 1;}
$sql = "select pc_data,change_number from character_another where no = $in{'no'} and pcid = '$pcid' and state = 0;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($out{'pc_data'},$change_number)=@{$ref->[0]};
if ($out{'pc_data'} eq ''){&mypage_err("コンバートされていないため、編集を行えません。");}
if ($change_number > 2){&mypage_err("編集可能回数を超えているため、編集を行えません。");}
$out{'no'} = $in{'no'};
&out_enc;
open FILE,"mypage_another_info01.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 夢の世界PC情報編集確認
#---------------------------------------
sub another_info_correct_conf {
&in_enc;
if ($in{'pcdata'} eq ''){&mypage_err("「キャラクター情報」が入力されていません。");}
$temp = $in{'pcdata'};
$temp =~ s/\n//g;
$len = length ($temp);
if ($len > 800){&mypage_err("「キャラクター情報」は全角400字までです。");}
if ($temp =~ /\x8E/) {&mypage_err("「キャラクター情報」に半角カナ文字が含まれています。");}
$chk = &hnkaku_chk($temp);
if ($chk ne ''){&mypage_err("「キャラクター情報」に使用できない文字「$chk」が入力されています。");}
$out{'pcdata'} = $in{'pcdata'};
$out{'pcdata2'} = $in{'pcdata'};
$out{'pcdata2'} =~ s/\n/
/g;
$out{'no'} = $in{'no'};
&out_enc;
open FILE,"mypage_another_info02.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 夢の世界PC情報編集実行
#---------------------------------------
sub another_info_correct_reg {
&in_enc;
if ($in{'pcdata'} eq ''){&mypage_err("「キャラクター情報」が入力されていません。");}
$temp = $in{'pcdata'};
$temp =~ s/\n//g;
$len = length ($temp);
if ($len > 800){&mypage_err("「キャラクター情報」は全角400字までです。");}
if ($temp =~ /\x8E/) {&mypage_err("「キャラクター情報」に半角カナ文字が含まれています。");}
$chk = &hnkaku_chk($temp);
if ($chk ne ''){&mypage_err("「キャラクター情報」に使用できない文字「$chk」が入力されています。");}
$out{'no'} = $in{'no'};
$sql = "select pc_data,change_number from character_another where no = $in{'no'} and pcid = '$pcid' and state = 0;";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($out{'pc_data'},$change_number)=@{$ref->[0]};
if ($out{'pc_data'} eq ''){&mypage_err("コンバートされていないため、編集を行えません。");}
if ($change_number > 2){&mypage_err("編集可能回数を超えているため、編集を行えません。");}
$sql = "update character_another set pc_data = '$in{'pcdata'}',change_number = change_number + 1 where no = $in{'no'} and pcid = '$pcid';";
$dbh->do($sql) or &err("エラーが発生しました。");
&out_enc;
open FILE,"mypage_another_info_end.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
# print "Location: ./mypage_another_info_end.html\n\n";
}
#---------------------------------------
# 夢の世界バストアップ変更
#---------------------------------------
sub another_bustup {
if ($in{'no'} eq ''){$in{'no'} = 1;}
$out{'no'} = $in{'no'};
$sql = "select bustup from character_another where no = $in{'no'} and pcid = '$pcid';";
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
($out{'bustup'})=@{$ref->[0]};
if ($out{'bustup'} eq '' || $out{'bustup'} eq "http://rexi.jp/jj/images/mypage_bu_defalt.gif"){$out{'bustup'} = "http://rexi.jp/jj/images/mypage_bu_defalt.gif";}
else{
@a = ();
@a = split(/\//, $out{'bustup'});
$max_a = $#a;
$out{'bustup'} = "http://rexi.jp/jj/bustup_thumbnail/" . @a[$max_a];
}
$out{'list'} =<<"EOT";
|
EOT
$sql = "select crname,url from stars_data where pcid = '$pcid' and pdid in ('C01','C10','J04') order by reg_date;";
if ($in{'no'} eq 3){
$sql = "select crname,url from stars_data where pcid = '$pcid' and pdid in ('C01','C10') order by reg_date;";
}
$ref = $dbh->selectall_arrayref($sql) or &mypage_err("エラーが発生しました。");
$i = 1;
foreach(@$ref) {
($crname,$url)=@{$_};
@a = ();
@a = split(/\//, $url);
$max_a = $#a;
$thm = "http://rexi.jp/stars/data/jj_thumbnail/" . @a[$max_a];
if ($i eq 0){
$out{'list'} .=<<"EOT";
EOT
}
$out{'list'} .=<<"EOT";
|
EOT
$i++;
if ($i eq 7){
$out{'list'} .=<<"EOT";
EOT
$i = 0;
}
}
$out{'list'} .=<<"EOT";
EOT
&out_enc;
open FILE,"mypage_another_bustup01.html";
print $header;
while(){
s/!(\w+)!/$out{$1}/g;
print;
}
close FILE;
}
#---------------------------------------
# 夢の世界バストアップ変更
#---------------------------------------
sub another_bustup_set {
if ($in{'no'} eq ''){$in{'no'} = 1;}
if ($in{'setbust'} eq ''){
#&mypage_err("バストアップイラストが選択されていません。");
$sql = "update character_another set bustup = NULL where no = $in{'no'} and pcid = '$pcid';";
}
else{
$sql = "update character_another set bustup = '$in{'setbust'}' where no = $in{'no'} and pcid = '$pcid';";
}
$dbh->do($sql) or &mypage_err("エラーが発生しました。");
print "Location: ./mypage.cgi?type=another&no=$in{'no'}\n\n";
}