#!/usr/bin/perl
$lib_db_flg = 1;
require '/home/rexi-jp/public_html/gx/lib/lib.pl';
require '/home/rexi-jp/public_html/gx/lib/scenario.pl';
require '/home/rexi-jp/public_html/jj/lib/mobile.pl';
$mycgi = 'replay.cgi';
$mid = $uid;
$uid = '';
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'};
$uid = &get_usr_cookie;
$pcid = &get_pcid_cookie;
$query = CGI->new;
my @params = $query->param();#全てのパラメータ名を取得 なのでこれを$inにしてしまえば$inで使用可能
foreach my $param (@params) {
$in{$param} = $query->param($param);
}
$dbh = &connectDB($mainDB);
#PC情報取得
#$death_flg = &death_check($pcid,$dbh);
$death_flg = 0;
($out{'name1'},$pcclass,$pcsex,$pcbirth) = &get_pcdata_cookie;
if ($out{'name1'} eq ''){
$sql = "select name,class,sex,birth,zensin,lumina from character where pcid = '$pcid';";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:C-01
エラーが発生しました。");
($out{'name1'},$pcclass,$pcsex,$pcbirth,$zensin,$lumina)=@{$ref->[0]};
}
$out{'pcid'} = $pcid;
$pcicon = &def_icon($pcclass);
$sql = "select a.type,a.title,a.text,a.comment,op_illust,a.difficulty,a.reserve_close,a.playing_close,a.member_max,b.name,a.npc,a.option1,a.option2,a.option3,a.main_id,a.open_date,";
$sql .= "a.club_seq,a.category,a.replay_open_date + '7 days',a.replay,a.apply_effect,substr(a.playing_close + '2days',1,10),a.apply_replay,a.mvp,a.monster,a.monster2,a.another,a.cmid,a.comic_open,a.npc_zensin1,a.npc_zensin2,a.show_img from scenario a,master b ";
$sql .= "where a.seq = $in{'seq'}";
if (($uid ne 2) and ($uid ne 1717) and ($uid ne 2729)){$sql .= " and a.apply_state = 5 and a.replay_open_date <= now() and a.replay_open_date is not null";}
if (($uid ne 2) and ($uid ne 1717) and ($uid ne 2729)){$sql .= " and a.msid != 'system'";}
$sql .= " and a.state = 0 and a.msid = b.id;";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:C-02
エラーが発生しました。");
($type,$out{'title'},$out{'text'},$out{'comment'},$out{'op_illust'},$difficulty,$reserve_close,$playing_close,$out{'member_max'},$out{'ms_name'},$npc,$option1,$option2,$option3,$main_id,$open_date,$club_seq,$category,$replay_open_date,$out{'replay_str'},$effect,$playing_close2,$apply_replay,$mvp,$monster,$monster2,$another,$cmid,$comic_open,$npc_zensin1,$npc_zensin2,$show_img)=@{$ref->[0]};
if ($out{'title'} eq ''){&err("指定されたリプレイはありません。");}
if ($another ne ''){
$d_err = 0;
$sql_d = "select name from master where id = '$another';";
$ref_d = $dbh->selectall_arrayref($sql_d) or $err_d=1;
($d_name)=@{$ref_d->[0]};
if ($d_err eq 0 && $d_name ne ''){$out{'ms_name'} = $out{'ms_name'} . "(代筆:$d_name)";}
}
if ($cmid ne ''){
$sql = "select name from master where id = '$cmid';";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:C-02
エラーが発生しました。");
($cmname)=@{$ref->[0]};
$out{'ms_name'} .= '&' . $cmname;
}
if ($in{'mode'} eq ''){
⊤
}
elsif ($in{'mode'} eq 'comic'){
&comic;
}
else{
&err("不正なパラメータ");
}
&disconDB($dbh);
exit;
#---------------------------------------
# COMIC表示
#---------------------------------------
sub comic {
$out{'replay_str'} = '';
if ($in{'seq'} eq 965){
$out{'replay_str'} =<<"EOT";
EOT
}
elsif ($type >= 8){
$dir_name = "/home/rexi-jp/public_html/gx/scenario/comic/" . $in{'seq'} . "/";
if (-d $dir_name){
opendir(DIR,$dir_name);
@dirfile = readdir(DIR);
closedir(DIR);
foreach my $file (sort @dirfile){
next if( $file =~ /^\.{1,2}$/ ); # '.' と '..' はスキップ
if(-e "$dir_name/$file" && (substr($file,-3) eq 'jpg' || substr($file,-3) eq 'png')){
push ary,$file;
}
}
@sortedarray = sort { $a cmp $b } @ary;
foreach (@sortedarray){
$f_name = $_;
($format,$width,$height) = &GetImageSize("$dir_name$f_name");
$out{'replay_str'} .=<<"EOT";
EOT
}
}
}
&out_enc;
&html_out("scenario_replay_comic.html");
}
#---------------------------------------
# TOP表示
#---------------------------------------
sub top {
&date_rtn;
if ($in{'seq'} eq ''){&err("不正なパラメータ");}
$death_flg = 0;
# if ($uid eq 2){
# if ($out{'replay_str'} eq ''){$out{'replay_str'} = $apply_replay;}
# if ($monster2 ne ''){
# $mon_id = $monster2;
# if (int($mon_id) < 10){$mon_id = 'xm000' . $mon_id;}
# elsif (int($mon_id) < 100){$mon_id = 'xm00' . $mon_id;}
# elsif (int($mon_id) < 1000){$mon_id = 'xm0' . $mon_id;}
# else{$mon_id = 'xm' . $mon_id;}
# $sql2 = "select url from monster_image where mon_id = '$mon_id' order by reg_date desc limit 1;";
# $ref2 = $dbh->selectall_arrayref($sql2) or &err("CODE:C-02A
エラーが発生しました。");
# ($mon_url)=@{$ref2->[0]};
# }
# elsif ($mon_id eq '' && $monster ne ''){
# @m_ary = split(/\,/,$monster);
# foreach(@m_ary){
# $mon_id = $_;
# if (int($mon_id) < 10){$mon_id = 'xm000' . $mon_id;}
# elsif (int($mon_id) < 100){$mon_id = 'xm00' . $mon_id;}
# elsif (int($mon_id) < 1000){$mon_id = 'xm0' . $mon_id;}
# else{$mon_id = 'xm' . $mon_id;}
# $sql2 = "select url from monster_image where mon_id = '$mon_id' order by reg_date desc limit 1;";
# $ref2 = $dbh->selectall_arrayref($sql2) or &err("CODE:C-02A
エラーが発生しました。");
# ($mon_url)=@{$ref2->[0]};
# if ($mon_url ne ''){last;}
# }
# }
# if ($mon_url ne ''){
# $out{'mon_image'} =<<"EOT";
#
#EOT
# }
# }
if ($effect eq ''){$effect = 3;}
$out{'ms_name'} = &chr_rtn($out{'ms_name'});
$out{'scc'} = @sc_category_str2[$category];
$out{'type'} = @sc_type_icon[$type];
$out{'type_str'} = @scenario_type[$type];
if ($type eq 4){$out{'beginer'} = '(ビギナー)';}
$out{'difficulty'} = @dif[$difficulty];
$tmp_start = &calDate(substr($playing_close,0,4),substr($playing_close,5,2),substr($playing_close,8,2),-1);
$out{'start'} = substr($tmp_start,2,8) . ' 24:00';
$out{'start'} =~ s/\-/\//g;
$out{'cost'} = @cost[$type];
if ($option2 eq 1){$out{'cost'} = $out{'cost'} + 300;}
$out{'text'} =~ s/\n/
/g;
$out{'text'} =~ s/\<\/H2>
/\<\/H2>/g;
$out{'text'} =~ s/\<\/H1>
/\<\/H1>/g;
$out{'comment'} =~ s/\n/
/g;
$open_date = substr($open_date,0,10);
$open_date =~ s/\-//g;
$open_date =~ s/\://g;
$open_date =~ s/\ //g;
$playing_close2 =~ s/\-//g;
$playing_close2 =~ s/\://g;
$playing_close2 =~ s/\ //g;
if (($type eq 5 || $type eq 12) && $mvp ne ''){
@ary_mvp = split(/\,/,$mvp);
}
#成否
if ($playing_close2 <= "$g_year$g_mon$g_mday"){
$out{'effect'} = '../images/scenario/hanamaru_' . $effect . '.png';
}
else{
$out{'effect'} = '../images/00_click.gif';
}
#オプション
if ($option1 > 0 || $option2 eq 1){
$out{'opt'} .=<<"EOT";
■オプション
EOT
}
if ($option1 > 0){
$out{'opt'} .=<<"EOT";
@option1_list[$option1]
EOT
}
if ($option2 eq 1){
$out{'opt'} .=<<"EOT";
リアルタイム
EOT
}
if ($option3 eq 1){
$sql = "select name from club where seq = $club_seq;";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:O-01A
エラーが発生しました。");
($club_name)=@{$ref->[0]};
$out{'club'} =<<"EOT";
部活 | $club_name |
EOT
$sql = "select count(*) from club_member where pcid = '$pcid' and club_seq = $club_seq and state = 0;";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:O-01B
エラーが発生しました。");
($club_member_flg)=@{$ref->[0]};
if ($club_member_flg eq ''){$club_member_flg = 0;}
}
#リアルタイム
if ($option2 eq 1){
$opt .= '';
}
#おまかせ
if ($option1 eq 1){
$opt .= '';
}
elsif ($option1 eq 2){
#お任せ&プレイング非公開
$opt .= '';
}
if ($opt ne ''){
$out{'opt_list'} =<<"EOT";
オプション |
$opt
|
EOT
}
if ($npc ne ''){
@ary_npc = split(/\,/,$npc);
$out{'npc'} .=<<"EOT";
■登場NPC
EOT
$n = 0;
foreach (@ary_npc){
$npcid = $_;
chomp $npcid;
$sql = "select pcid,name,sex,birth,class,lumina,zensin,race from character where pcid = '$npcid';";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:O-01
エラーが発生しました。");
($n_pcid,$n_name1,$n_sex,$n_birth,$n_class,$n_lumina,$n_zensin,$n_race)=@{$ref->[0]};
if ($show_img eq ''){
if ($n eq 0 && $npc_zensin1 ne ''){$n_zensin = $npc_zensin1;}
elsif ($n eq 1 && $npc_zensin2 ne ''){$n_zensin = $npc_zensin2;}
# if ($n eq 0 && $n_zensin ne ''){
if ($n_zensin ne '' && ($#ary_npc < 2 || $out{'zensin'} eq '')){
$n_file = "/home/rexi-jp/public_html/" . substr($n_zensin,15);
($format,$width,$height) = &GetImageSize($n_file);
$out{'zensin'} =<<"EOT";
EOT
}
}
if($n_race ne 6){
if ($n_birth ne ''){
$n_age = &calcAge($n_birth);
}
}else{
$n_age = '?';
}
if ($n_age eq ''){$n_age = '?';}
if ($n_sex eq 1){$n_sex = '♂';}
elsif ($n_sex eq 2){$n_sex = '♀';}
$npc_url =<<"EOT";
$n_name1($npcid)・$n_sex・$n_age歳・@class_str[$n_class]・@lumina_str[$n_lumina]
EOT
$out{'npc'} .=<<"EOT";
$npc_url
EOT
$n++;
}
}
if ($npc_zensin1 eq '' && $npc_zensin2 eq '' && $show_img eq ''){$out{'zensin'} = '';}
if ($show_img ne ''){
$n_file = "/home/rexi-jp/public_html/" . substr($show_img,15);
($format,$width,$height) = &GetImageSize($n_file);
$out{'zensin'} =<<"EOT";
EOT
}
if ($in{'seq'} eq 390){
$out{'zensin'} =<<"EOT";
EOT
}
elsif ($in{'seq'} eq 1554){
$out{'zensin'} =<<"EOT";
EOT
}
$sql = "select count(*) from scenario_member where scenario_seq = $in{'seq'} and (entry_state = 1 and reserve != 1);";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:O-01A
エラーが発生しました。");
($mcnt)=@{$ref->[0]};
if ($mcnt eq ''){$mcnt = 0;}
$out{'now_member_num'} = $mcnt;
$out{'sup_num'} = 0;
if ($type eq 5 || $type eq 12){
$out{'member_max'} = '―';
}
$sql = "select b.pcid,b.name,b.sex,b.birth,b.class,b.lumina,b.race 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 &err("エラーが発生しました。");
$i = 0;
$total_i = 0;
foreach(@$ref) {
($m_pcid,$m_name1,$m_sex,$m_birth,$m_class,$m_lumina,$m_race)=@{$_};
if($m_race ne 6){
$m_age = &calcAge($m_birth);
}else{
$m_age = '?';
}
if ($m_sex eq 1){$m_sex = '♂';}
elsif ($m_sex eq 2){$m_sex = '♀';}
$out{'reserve_member'} .=<<"EOT";
$m_name1($m_pcid) |
EOT
}
if ($main_id ne '' && $main_id ne $in{'seq'}){
$out{'series'} .=<<"EOT";
EOT
}
if ($in{'seq'} eq 965){
# if ($uid eq 2){&err($ENV{'HTTP_USER_AGENT'});}
if (index($ENV{'HTTP_USER_AGENT'},'Safari') < 0 || index($ENV{'HTTP_USER_AGENT'},'Chrome') > 0){
$out{'series'} .=<<"EOT";
EOT
}
else{
$out{'series'} .=<<"EOT";
EOT
}
}
if ($type >= 8 && $comic_open ne ''){
# if (index($ENV{'HTTP_USER_AGENT'},'Safari') < 0 || index($ENV{'HTTP_USER_AGENT'},'Chrome') > 0){
if (index($ENV{'HTTP_USER_AGENT'},'iPhone') < 0){
$out{'series'} .=<<"EOT";
EOT
}
else{
$out{'series'} .=<<"EOT";
EOT
}
}
$out{'text'} =~ s/\n/
/g;
$out{'ms_comment'} =~ s/\n/
/g;
@rep_dat = split(/\n/,$out{'replay_str'});
$out{'replay_str'} =~ s/\n/
/g;
&date_rtn;
$replay_open_date =~ s/\-//g;
$replay_open_date = substr($replay_open_date,0,8);
$playing_flg = 0;
if ($replay_open_date >= "$g_year$g_mon$g_mday"){$playing_flg = 1;}
#参加者一覧
$out{'mem_num'} = 0;
@member_pcid = ();
$m_i = 0;
$sql = "select b.pcid,b.name,b.sex,b.birth,b.lumina,b.class,b.race 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 &err("CODE:R-01
エラーが発生しました。");
foreach(@$ref) {
($m_pcid,$m_name1,$m_sex,$m_birth,$m_lumina,$m_class,$m_race)=@{$_};
push member_pcid,$m_pcid;
if($m_race ne 6){
$m_age = &calcAge($m_birth);
}else{
$m_age = '?';
}
if ($m_sex eq 1){$m_sex = '♂';}
elsif ($m_sex eq 2){$m_sex = '♀';}
if ($type eq 5 || $type eq 12){
$mvp_flg = 0;
foreach(@ary_mvp){
$mvp_pc = $_;
if ($m_pcid eq $mvp_pc){
$mvp_flg = 1;
last;
}
}
}
if (($option1 ne 2 && $type ne 3 && $type ne 5 && $type ne 12 && $type ne 14) || (($type eq 5 || $type eq 12) && $mvp_flg eq 1)){
$pfile = "/home/rexi-jp/public_html/gx/scenario/playing/$in{'seq'}/$m_pcid.dat";
$playing = "";
if (-e $pfile){
open FILE,$pfile;
while(){
$playing .= $_;
}
close FILE;
$playing =~ s/\x0D\x0A|\x0D|\x0A/
/g;
}
}
$out{'member'} .=<<"EOT";
$m_name1($m_pcid)・$m_sex・$m_age
EOT
if ($playing_flg eq 1 && $type ne 5 && $type ne 12 && $type ne 14 && $type ne 3 && $option1 ne 2){
$out{'member'} .=<<"EOT";
$playing
EOT
}
if (($type eq 5 || $type eq 12) && $mvp_flg eq 1){
$out{'playing'} .=<<"EOT";
$m_name1($m_pcid)・$m_sex・$m_age
$playing
EOT
}
if ($type eq 5 || $type eq 12){
$out{'rt_entry_member'} .=<<"EOT";
$m_name1($m_pcid)@class_str2[$m_class]@lumina_str[$m_lumina]/
EOT
$m_i++;
if ($m_i eq 4){
chomp $out{'rt_entry_member'};
$out{'rt_entry_member'} = substr($out{'rt_entry_member'},0,-2);
$out{'rt_entry_member'} .= "
";
$m_i = 0;
}
}
$out{'mem_num'}++;
if (($pcid eq $m_pcid) or ($uid eq 1717) ){ ##test
$out{'btn'} =<<"EOT";
EOT
$out{'ebtn'} =<<"EOT";
EOT
$out{'ebtn'} .=<<"EOT";
EOT
}
}
##サポート参加者のピンナップ、ボイス設定
if($out{'btn'} eq ''){
$sql = "select count(*) from scenario_member where scenario_seq = $in{'seq'} and pcid = '$pcid' and entry_state=11;";
$ref = $dbh->selectall_arrayref($sql) or &err("CODE:R-018
エラーが発生しました。");
($sp_flg)=@{$ref->[0]};
if($sp_flg > 0){
$out{'btn'} =<<"EOT";
EOT
$out{'ebtn'} =<<"EOT";
EOT
$out{'ebtn'} .=<<"EOT";
EOT
}
}
if ($playing_flg eq 1 && $type ne 5 && $type ne 12 && $type ne 14 && $type ne 3 && $option1 ne 2){
$out{'playing'} =<<"EOT";
|
|
|
|
EOT
}
##ボイスデータ取得
@row_v = ();
@row_flg = ();
$sql = "select replay_row,replay_col,pcid,url from scenario_voice where scenario_seq = $in{'seq'} and part is NULL;";
$ref = $dbh->selectall_arrayref($sql) or &err("エラーが発生しました。5");
foreach(@$ref) {
($replay_row,$replay_col,$v_pcid,$v_url)=@{$_};
if($replay_col ne ''){
$row_v[$replay_row][$replay_col][0]=$v_pcid;
$row_v[$replay_row][$replay_col][1]=$v_url;
$row_flg[$replay_row] = 1;
}
}
$row_cnt = 0;
$i = 0;
$sql = "select a.pcid,a.file,a.url,b.name,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,$crname,$replay_row,$left_right)=@{$_};
$rep_pin{$replay_row} = $file;
$rep_pin_lr{$replay_row} = $left_right;
$rep_pin_pcid{$replay_row} = $p_pcid;
}
$out{'pin'} = '';
$r = 1;
$out{'replay_str'} = '';
foreach(@rep_dat){
$r_tmp = $_;
##ボイス組み込み
if($row_flg[$row_cnt] ne ''){
$row_len = length($r_tmp);
$row_line = '';
for($col_cnt=0;$col_cnt < $row_len-1 ;$col_cnt++){
if($row_v[$row_cnt][$col_cnt][0] ne ''){
$row_line .=<<"EOT";
EOT
}
$t_char = '';
#とりあえず1バイト取得する
$w_chr = substr( $r_tmp, $col_cnt, 1);
if($w_chr eq ']' || $w_chr eq '[' || $w_chr eq '(' || $w_chr eq ')' || $w_chr eq '%' || $w_chr eq '$' || $w_chr eq '&' || $w_chr eq "\\" || $w_chr eq '!' || $w_chr eq '~'|| $w_chr eq '/' || $w_chr eq '<' || $w_chr eq '>' || $w_chr eq '?' || $w_chr eq '_' || $w_chr eq '{' || $w_chr eq '}' || $w_chr eq ':'|| $w_chr eq ';' || $w_chr eq '.' || $w_chr eq ',' || $w_chr eq '@'|| $w_chr eq '#' || $w_chr eq '*'|| $w_chr eq '-' || $w_chr eq '+' ) {
$f_chr ='';
$t_chr = substr( $r_tmp, $col_cnt, 1 );
}else{
#unpackして全角半角を認識する
$w_chr =~ s/([^0-9A-Za-z_ ])/'%'.unpack('H2',$1)/ge;
$f_chr = substr( $w_chr, 0, 1 );
#半角の場合
if ($f_chr eq '%'){
$t_chr = substr( $r_tmp, $col_cnt, 2 );
}else{
$t_chr = substr( $r_tmp, $col_cnt, 1 );
}
}
$row_line .= $t_chr;
if ($f_chr eq '%'){
$col_cnt ++;
}
}
##行フッタ
if($row_v[$row_cnt][$col_cnt][0] ne ''){
$row_line .=<<"EOT";
EOT
}
$r_tmp = $row_line;
}
foreach(@member_pcid){
$mem_pcid = $_;
$mem_pcid2 = "(" . $mem_pcid . ')';
$r_tmp =~ s/($mem_pcid)/$mem_pcid2/g;
}
if ($rep_pin{$r} ne ''){
if (($rep_pin_pcid{$r} eq $pcid) or ($uid eq 1717)){
$delbtn =<<"EOT";
EOT
}
else{$delbtn = '';}
if ($rep_pin_lr{$r} eq 1){
$rep_p = &rep_pin_size($rep_pin{$r});
$out{'replay_str'} .=<<"EOT";
$r_tmp
EOT
}
elsif ($rep_pin_lr{$r} eq 2){
$rep_p = &rep_pin_size($rep_pin{$r});
$out{'replay_str'} .=<<"EOT";
$r_tmp
EOT
}
else{$out{'replay_str'} .= $r_tmp . '
';}
}
else{$out{'replay_str'} .= $r_tmp . '
';}
$r++;
$row_cnt ++;
}
if ($rep_pin{0} ne 0){
$rep_p = &rep_pin_size($rep_pin{0});
if ($rep_pin_lr{0} eq 1){$out{'replay_str'} .= "" . '
';}
elsif ($rep_pin_lr{0} eq 2){$out{'replay_str'} .= "" . '
';}
}
$index_flg = 0;
$find = 0;
$find2 = 0;
while ($index_flg eq 0){
$find = index($out{'replay_str'},'(x',$find);
$find2 = index($out{'replay_str'},')',$find);
if ($find >= 0 && $find2 >= 0){
$a = substr($out{'replay_str'},$find+3,1);
#if ($uid eq 2){&err($a);}
if ($a eq 'p' && int(substr($out{'replay_str'},$find+4,4) ne '')){
$xpid_str = substr($out{'replay_str'},$find+2,6);
$base_str = '(' . $xpid_str;
$change_str = "($xpid_str";
$out{'replay_str'} =~ s/$base_str/$change_str/g;
}
else{
$index_flg = 1;
last;
}
}
else{
$index_flg = 1;
last;
}
}
$out{'replay_str'} =<<"EOT";
$out{'replay_str'}
EOT
if ($mid eq ''){
if ($type eq 5){
$out{'no'} = substr($out{'title'},4,2);
$html_file = 'scenario_replay_gh' . substr($out{'title'},4,2) . '.html';
if( -f $html_file ) {
}else{
$html_file = 'scenario_replay_ghXX.html';
}
if($in{'seq'} eq 1374){$html_file = 'scenario_replay_gh10_2.html';}
if($in{'seq'} eq 2937){$html_file = 'scenario_replay_gh18_1.html';}
if($in{'seq'} eq 2938){$html_file = 'scenario_replay_gh18_2.html';}
if($in{'seq'} eq 2939){$html_file = 'scenario_replay_gh18_3.html';}
if($in{'seq'} eq 3611){$html_file = 'scenario_replay_gh24_2.html';}
# elsif($in{'seq'} eq 126){$html_file = 'scenario_replay_gh01.html';}
# elsif($in{'seq'} eq 281){$html_file = 'scenario_replay_gh02.html';}
}
elsif ($type eq 12){
$html_file = 'scenario_replay_gh' . substr($out{'title'},4,2) . '.html';
}
elsif ($type eq 7){
$html_file = 'scenario_replay_extra.html';
}
elsif ($type eq 10 || $type eq 11){
$html_file = 'scenario_replay_comic01.html';
}
else{
$html_file = 'scenario_replay.html';
}
}
else{
if ($type eq 5){
$html_file = 'scenario_replay_m_gh.html';
}
elsif ($type eq 12){
$html_file = 'scenario_replay_m_gh.html';
}
else{
$html_file = 'scenario_replay_m.html';
}
}
# $html_file = 'scenario_replay.html';
&out_enc;
&html_out($html_file);
}
#---------------------------------------
# ピンナップサイズ調整
#---------------------------------------
sub rep_pin_size {
my $rep_p_file = $_[0];
$p_file1 = "/home/rexi-jp/public_html/stars/data/gx/" . $rep_p_file;
$p_file2 = "/home/rexi-jp/public_html/gx/scenario/rep_pin_sum/" . $rep_p_file;
$rtn_file = "http://rexi.jp/stars/data/gx/$rep_p_file";
($format,$width,$height) = &GetImageSize($p_file1);
if ($width > 350){
if (!-e $p_file2){
system "convert -resize 350 +profile iptc -quality 100% $p_file1 $p_file2";
}
$rtn_file = "http://rexi.jp/gx/scenario/rep_pin_sum/$rep_p_file";
}
return $rtn_file;
}