";
}
#############################
sub eee_cal {
# À½¼º¸àÆ®
# asx ÆÄÀϸíÀÌ ¿À´Ã ³¯Â¥ÀÎ °æ¿ì, À½¼º¸àÆ® »ý¼º·çƾÀ» ½ÇÇàÇÏÁö ¾ÊÀ½
if (( $FORM{'menu'} eq "" ) && ( $FORM{'action'} eq "" ) && ( $FORM{'unisec'} eq "" )) { # ¸ÞÀÎ ÆäÀÌÁö¿¡¼¸¸ °ËÅä
@subst=('200(\d{5})');
foreach $item(@subst){ $today_media=~s/$item/$1/gi; }
$media_file = "$today_media.asx";
unless (-e "$media_file") {
# ¿À´ÃÀ» À½·ÂÀ¸·Î ȯ»ê
$eee_cnt = 0;
$eee_target = 50;
$offset = 0;
until (( $eee_cnt == $eee_target ) || ( $sp_event_cnt > 1 )) {
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+$offset);
@months = ("01","02","03","04","05","06","07","08","09","10","11","12");
if ( $mday < 10 ) { $mday = "0$mday" }
$year=$year-100;
$eee_nd = "$year@months[$mon]$mday";
$substract ="";
&lunar;
# DB ¿¾î¼ °Ë»ö
$event_cnt = 0;
$same_day_flag =0;
$database_file = "../cgi-dir/holidays.txt";
unless(open(MYFILE,"$database_file")){
print "cannot open input before file : $source_file_name
";
}
@db_file=;
$db_num = @db_file;
$db_cnt = 0;
$holiday_flag = 0;
until ( $db_cnt == $db_num ) {
$db_line = "@db_file[$db_cnt]";
($thedate,$ls,$country,$event,$hw,$em,$sp,$imgg) = split(/\|\|/,$db_line);
if ( $em ne "1" ) {$em = 0 ;}
@subst=('20(\d{6})');
foreach $item(@subst){ $thedate=~s/$item/$1/gi; }
if (( $ls eq "l" ) && ( $nd_lunar eq $thedate ) && ( $em eq $ext_month )) {
##### Special Event Lunar
if (( $sp eq "sp" ) && ( $nd_lunar eq $thedate )) {
@ment_con[$sp_event_cnt]= "0|||$eee_cnt|||$eee_nd|||$nd_lunar|||$sp_event_cnt|||" ;
$sp_event_cnt ++;
$same_day_flag ++;
}
}
if ((( $sp eq "hc_0" ) || ( $sp eq "hc_1" ) || ( $sp eq "hc_2" ) || ( $sp eq "hc_3" )) && ( $eee_nd eq $thedate )) {
if ( $same_day_flag eq "0" ) { $evt_ty = "1" }
if ( $same_day_flag eq "1" ) { $evt_ty = "2"; $sp_event_cnt = $sp_event_cnt - 1; }
@ment_con[$sp_event_cnt]= "$evt_ty|||$eee_cnt|||$eee_nd|||$nd_lunar|||$sp_event_cnt|||" ;
$sp_event_cnt ++;
}
$db_cnt ++;
}
$offset = $offset+86400;
$eee_cnt++;
$same_day_flag = 0;
}
#print "Content-type: text/html\n\n";
$ment_done = 0;
#Àλ縻 ¹× ù À̺¥Æ® ó¸®
($evt_type_0,$evt_ft_0,$evt_sol_0,$evt_lun_0,$evt_ccnt_0) = split(/\|\|\|/, @ment_con[0]);
if ( $evt_ft_0 > 10 ) { # ù À̺¥Æ®°¡ 11ÀÏ ÀÌ»ó ÀÌÈÄÀÎ °æ¿ì, Àλ縻·Î ¸¶°¨
$ment_file_contents = qq~
~;
$ment_done = 1;
}
if (( $evt_ft_0 < 11 ) && ( $ment_done eq "0" )) { # ù À̺¥Æ®°¡ 11ÀÏ À̳»ÀÎ °æ¿ì, ¸àÆ®Ãâ·Â
$ment_file_pre_0 = $evt_ft_0 ;
if ( $ment_file_pre_0 < 10 ) { $ment_file_pre_0 = "0$ment_file_pre_0"; }
if ( $evt_type_0 eq "0" ) { $ment_file_post_0 = "bimonthly"; }
if ( $evt_type_0 eq "1" ) { $ment_file_post_0 = "seasonal"; }
if ( $evt_type_0 eq "2" ) { $ment_file_post_0 = "bimonnseason"; }
$ment_file_name_0 = "$ment_file_pre_0\_$ment_file_post_0.wma";
$ment_file_contents .= qq~
~;
}
# µÎ¹ø° À̺¥Æ® ó¸®
if ( $ment_done eq "0" ) {
($evt_type_1,$evt_ft_1,$evt_sol_1,$evt_lun_1,$evt_ccnt_1) = split(/\|\|\|/, @ment_con[1]);
if (( $evt_ft_1 - $evt_ft_0 > 10 ) || ( $evt_ft_1 > 10 )) { # µÎ¹ø° À̺¥Æ®°¡ ù À̺¥Æ®º¸´Ù 11ÀÏ ÀÌ»ó ÀÌÈÄÀ̰ųª µÎ¹ø° À̺¥Æ®°¡ 11ÀÏ ÀÌÈÄÀÎ °æ¿ì, ù À̺¥Æ®·Î ¸¶°¨
$ment_file_contents .= qq~
~;
$ment_done = 1;
}
}
if (( $evt_ft_1 - $evt_ft_0 < 11 ) && ( $evt_ft_1 < 11 ) && ( $ment_done eq "0" )) { # µÎ¹ø° À̺¥Æ®°¡ ù À̺¥Æ®º¸´Ù 11ÀÏ À̳»ÀÌ°í µÎ¹ø° À̺¥Æ®°¡ 11ÀÏ À̳»ÀÎ °æ¿ì, Ãß°¡ ¹× ¸¶°¨
$ment_file_pre_1 = $evt_ft_1 ;
if ( $ment_file_pre_1 < 10 ) { $ment_file_pre_1 = "0$ment_file_pre_1"; }
if ( $evt_type_1 eq "0" ) { $ment_file_post_1 = "bimonthly"; }
if ( $evt_type_1 eq "1" ) { $ment_file_post_1 = "seasonal"; }
if ( $evt_type_1 eq "2" ) { $ment_file_post_1 = "bimonnseason"; }
$ment_file_name_1 = "$ment_file_pre_1\_$ment_file_post_1.wma";
$ment_file_contents .= qq~
~;
}
# °ú°Å ¸àÆ® »èÁ¦
opendir(DIR, ".");
@files = readdir(DIR);
closedir(DIR);
$all_file_cnt = 0;
$all_file_num = @files;
until ( $all_file_cnt == $all_file_num ) {
if ( @files[$all_file_cnt]=~/\.asx/i ) {
#print "@files[$all_file_cnt] / $all_file_cnt ";
unlink @files[$all_file_cnt];
}
$all_file_cnt++;
}
# ¸àÆ® ÀúÀå
my $file = "$today_media.asx";
open(REAL, ">$file" ) || die "Oops ! $file ";
binmode(REAL); # If NT server
flock(REAL, 2 ) || die "Could not lock $file $!";
print REAL "$ment_file_contents";
flock(REAL, 8 );
close(REAL);
$ment_save_flag = 1;
$con_stat = 0;
}
if ( $ment_save_flag ne "1" ) {
&con_check;
}
if ( $con_stat eq "0" ) {
$ment = " |