#!/usr/local/perl #============================================================================# # Program Name - Sepal's SPBOARD v4.5 # # Programer - Kim se youn (madgf@hanmail.net, sepal@spfamily.com) # # Homepage - http://sepal.woorizip.com or http://www.spfamily.com # # Last Modified - 2000.11.14 # # made in Korea # #============================================================================# ############################################################################## $main_dir = "."; #idµð·ºÅ丮°¡ Àִ°÷ÀÇ µð·¢Å丮 Àý´ë °æ·Î $main_url = "."; #idµð·ºÅ丮°¡ Àִ°÷ÀÇ URL $cgi_url = "./board.cgi"; #ÀÌ cgiÆÄÀÏÀÇ URL $img_url = "./img"; #img URL $sendmail = "/usr/lib/sendmail"; #sendmail À§Ä¡ $NT = "0"; #ÀÚµ¿ Æû¸ÞÀÏ »ç¿ëÇÏÁö ¾ÊÀ»·Á¸é $NT="1"·Î... ############################################################################## ############################################################################## #¾Æ·¡ ¼³Á¤Àº °Ô½ÃÆÇ Á¤½Ä±¸ÀÔÀÚ¸¦ À§ÇÑ °ÍÀÔ´Ï´Ù. #±â´É»ó Â÷ÀÌ´Â ¾øÀ¸¸ç °Ô½ÃÆÇ ¾Æ·¡ Ȩ¸µÅ©¸¦ ¹Ù²Ù´Â ¼³Á¤ÀÔ´Ï´Ù... ^.^ ############################################################################## $customer = "1"; #Á¤½Ä±¸ÀÔÀÚ´Â 1·Î... $copyright = "Copyright ¨Ï BrillAsia. All rights reserved."; #Copyright ############################################################################## umask(000); $tpl_dir = $main_dir; $img_dir = "$main_dir/img"; &parseArgument; &selectAction; sub parseArgument { my($name,$value,$content_type,$content_length,$buffer,$dump,$boundary,$line,$array_value); my(@pairs,@column,%CGI); if($ENV{'QUERY_STRING'}) { @pairs = split(/&/,$ENV{'QUERY_STRING'}); foreach (@pairs) { ($name, $value) = split(/=/,$_); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $FORM{$name} = $value; } } else { $content_type = $ENV{'CONTENT_TYPE'}; $content_length = $ENV{'CONTENT_LENGTH'}; binmode STDIN; read(STDIN,$buffer,$content_length); if((!$content_type) || ($content_type eq 'application/x-www-form-urlencoded')) { @pairs = split(/&/, $buffer); foreach (@pairs) { ($name, $value) = split(/=/,$_); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $FORM{$name} = $value; } } elsif($content_type =~ m#^multipart/form-data#) { ($boundary = $content_type) =~ s/^.*boundary=(.*)$/$1/; @pairs = split(/--$boundary/, $buffer); @pairs = splice(@pairs,1,$#pairs-1); foreach (@pairs) { ($dump,$line,$value) = split(/\r\n/,$_,3); if($line =~ /filename/) { $real_file = $line; } next if $line =~ /filename=\"\"/; $line =~ s/^Content-Disposition: form-data; //; (@column) = split(/;\s+/, $line); ($name = $column[0]) =~ s/^name="([^"]+)"$/$1/g; if($#column > 0) { if($value =~ /^Content-Type:/) { ($dump,$dump,$value) = split(/\r\n/,$value,3); } else { ($dump,$value) = split(/\r\n/,$value,2); } } else { ($dump,$value) = split(/\r\n/,$value,2); if(grep(/^$name$/, keys(%CGI))) { if(@{$FORM{$name}} > 0) { push(@{$FORM{$name}}, $value); } else { $array_value = $FORM{$name}; undef $FORM{$name}; $FORM{$name}[0] = $array_value; push(@{$FORM{$name}}, $value); } } else { next if $value =~ /^\s*$/; $FORM{$name} = $value; chop($FORM{$name}); chop($FORM{$name}); } next; } $FORM{$name} = $value; } } else { print "Invalid content type!\n"; exit(1); } } $main_dir = "$main_dir/id/$FORM{'id'}"; $main_url = "$main_url/id/$FORM{'id'}"; } sub cookie{ my(@cookies); if($ENV{'HTTP_COOKIE'}) { @cookies = split(/; /,$ENV{'HTTP_COOKIE'}); foreach(@cookies) { my ($name,$value) = split(/=/,$_); $COOKIE{$name} = $value; } } print "Set-Cookie: $cook=$ENV{'REMOTE_ADDR'}$FORM{'action'}$FORM{'number'};\r\n"; } sub selectAction { local($page, $type_url, $face_url, %CONF, @week, @quick_id, @quick_name, @lock_week); $page = $FORM{'page'} ? "$FORM{'page'}" : "1"; if((-d "$main_dir") && ($FORM{'id'} ne "")) { &get_env; my(@page_list, @prev, @next, $start, $prev, $next); local(@ary, @gr_color, $act, $list_num, $total_page); if($CONF{'templet'} ne ""){ #=========================== # ±×¶óµ¥ÀÌ¼Ç »ý¼º... ^.^ #=========================== open(TPL, "$tpl_dir/tpl/$CONF{'templet'}"); $tpl_col = ; close(TPL); @col_list = split(/\|/,$tpl_col); my($r_val, $g_val, $b_val, $mr, $mg, $mb); $r_val = $col_list[1]; $g_val = $col_list[2]; $b_val = $col_list[3]; $mr = $col_list[4]; $mg = $col_list[5]; $mb = $col_list[6]; for(0..$CONF{'page_num'}+1){ $gr_color[$_] = &color_man($r_val,$g_val,$b_val); if($_ eq $CONF{'page_num'}) { $mr *= 21; $mg *= 21; $mb *= 21; } $r_val = (($r_val - $mr) <= 0) ? 1 : int($r_val - $mr); $g_val = (($g_val - $mg) <= 0) ? 1 : int($g_val - $mg); $b_val = (($b_val - $mb) <= 0) ? 1 : int($b_val - $mb); } $CONF{'head_color'} = $gr_color[$#gr_color]; #$CONF{'hfont_color'} = $gr_color[0]; $CONF{'ncel_color'} = $gr_color[int($CONF{'page_num'}/2)]; $CONF{'cel_color1'} = $gr_color[1]; $CONF{'cel_color2'} = $gr_color[2]; } $type_url = "$img_url/type"; $dongury_url = "$img_url/dongury"; $face_url = "$img_url/face"; $img_url =($CONF{'img_skin'} ne "") ? "$img_url/skin/$CONF{'img_skin'}" : "$img_url/skin/default"; $act = $FORM{'action'}; if($act eq "") { &display; } else{ &{$act}; } } else{ $CONF{'font_size'} = "9pt"; $CONF{'bgcolor'} = "#FFFFFF"; $img_url = "$img_url/skin/mori"; if($FORM{'id'} eq ""){ &error("id"); } else{ &error("no_dir"); } } } sub get_env{ if(open(CONF,"$main_dir/conf.cgi")) { foreach (){ if (/(\w+)\s*=\s*(.*?)\s*$/){ $CONF{$1} = $2; } } close(CONF); #======================================= # ¾÷±×·¹À̵åÀÚ¸¦ À§ÇÏ¿©... ^.^ #======================================= $CONF{'link_color'} ||= "#283FCF"; $CONF{'find_interval'} ||= 1000; #======================================= @quick_id = split(/\|/,$CONF{'quick_id'}); @quick_name = split(/\|/,$CONF{'quick_name'}); @lock_week = split(/\|/, $CONF{'lock_week'}); } else { mkdir("$main_dir/data",0777); mkdir("$main_dir/files",0777); mkdir("$main_dir/idx",0777); $CONF{'admin_pwd'} = "1234"; $CONF{'admin_only'} = "no"; $CONF{'page_num'} = "10"; $CONF{'max_data'} = "100000"; $CONF{'sendmail_ok'} = "yes"; $CONF{'admin_sender'} = "no"; $CONF{'admin_mail'} = "your\@email.net"; $CONF{'home_url'} = "http://yourhome.net"; $CONF{'tbl_width'} = "90%"; $CONF{'admin_name'} = "ÁÖÀÎÀå"; $CONF{'font_color'} = "#000000"; $CONF{'link_color'} = "#283FCF"; $CONF{'ncel_color'} = "#C3D6E7"; $CONF{'head_color'} = "#2962D5"; $CONF{'hfont_color'} = "#ffffff"; $CONF{'cel_color1'} = "#FAFCFD"; $CONF{'cel_color2'} = "#EDF4FA"; $CONF{'select_color'}= "#C3D6E7"; $CONF{'num_color'} = "#1504B9"; $CONF{'date_color'} = "#FF6666"; $CONF{'read_color'} = "#0A5818"; $CONF{'down_color'} = "#283FCF"; $CONF{'over_color'} = "#E9E9E9"; $CONF{'bgcolor'} = "#ffffff"; $CONF{'background'} = ""; $CONF{'logo_txt'} = "Ȱ¦~ ¿­¸° °Ô½ÃÆÇ ^.^"; $CONF{'logo_img'} = ""; $CONF{'sub_length'} = "47"; $CONF{'name_length'} = "10"; $CONF{'line_length'} = "1"; $CONF{'view_ip'} = "yes"; $CONF{'pds_ok'} = "no"; $CONF{'max_size'} = "4.5"; $CONF{'down_view'} = "no"; $CONF{'kind_view'} = "yes"; $CONF{'etc_ok'} = "no"; $CONF{'scr_opt'} = "no"; $CONF{'img_skin'} = "mori"; $CONF{'point_ok'} = "no"; $CONF{'font_kind'} = "µ¸¿ò"; $CONF{'font_size'} = "9pt"; $CONF{'left_right'} = "center"; $CONF{'search_ok'} = "yes"; $CONF{'find_interval'} = "1000"; $CONF{'pnt_cnt'} = "10"; $CONF{'i_opt'} = "no"; $CONF{'speed_up'} = "yes"; $CONF{'templet'} = "ocean_blue.txt"; $CONF{'dgr_ok'} = "no"; $CONF{'quick_id'} = "|"x7; $CONF{'quick_name'} = "|"x7; $CONF{'lock_week'} = "|"x7; &save_env; } } sub save_env { $CONF{'admin_pwd'} = crypt($CONF{'admin_pwd'},"sp"); open(CONF,">$main_dir/conf.cgi"); foreach (sort keys %CONF) { print CONF "$_ = $CONF{$_}\n"; } close(CONF); } #-------------------------------------------------------------- # °Ô½ÃÆÇ ¸®½ºÆ® Ãâ·Â ^.^ - ¸ÞÀÎÈ­¸é µðÀÚÀÎ ¼öÁ¤Àº ÀÌ°÷¿¡¼­... #-------------------------------------------------------------- sub print_list{ my($d, $color_val, $up_td, $bsk_td, $io_td, $zero_col, $search_option, $view_option); local($down_col, $pnt_col, $pre_pg, $next_pg); $down_col="´Ù¿î" if($CONF{'down_view'} eq "yes"); $pnt_col="Ãßõ" if($CONF{'point_ok'} eq "yes"); # $scount = (($page-1)*$CONF{'page_num'}); # $icount = 0; $d = 0; $pre_pg= $page - 1; $next_pg = $page + 1; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action","multi_view"); print &Input("hidden","page","$page"); if($act eq "search"){ print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); print &Input("hidden","start_num","$FORM{'start_num'}"); } &top_btn; &Thead("100%","","0","0"); $color_val = $CONF{'head_color'} ? "bgcolor=$CONF{'head_color'}": ""; print "\n"; &Tfoot; $up_td = ($CONF{'kind_view'} eq "yes")? "  " : ""; $bsk_td = ""; $io_td = ($CONF{'i_opt'} eq "yes") ? "¨Õ" : ""; if($page eq $total_page){ print ""; } &Thead("100%","","1","0"); print "$bsk_td¨Ú$up_td±Û Á¦ ¸ñÀÛ¼ºÀÚ$io_tdÀÛ¼ºÀÏÁ¶È¸$down_col $pnt_col\n"; &read_notice if(($page eq "1") && ($FORM{'category'} eq "")); if($cou eq "0" || (($page eq "1") && ($ary[0] eq ""))){ $zero_col = "7"; if($CONF{'down_view'} eq "yes"){ $zero_col++; } if($CONF{'point_ok'} eq "yes"){ $zero_col++; } if($CONF{'i_opt'} eq "yes"){ $zero_col++; } my($no_msg) = ("$FORM{'category'}") ? "^.^ ãÀ¸½Ã´Â ±ÛÀÌ ¾ø¾î¿ä!" : "^.^ µî·ÏµÈ ±ÛÀÌ ¾ø½À´Ï´Ù. ^.^"; my($over_msg) = &over("$no_msg"); my($color_val) = ($CONF{'cel_color1'}) ? "bgcolor=$CONF{'cel_color1'}" : ""; print "$no_msg\n"; } else{ my($start, $end, $no_data); $start = $CONF{'page_num'}*($page - 1); $end = $start + $CONF{'page_num'} - 1; $no_data = $list_num - (($page-1)*$CONF{'page_num'}); my($chk_num) = 0; my(@gubun, @open, $open_val, $eval, $num, $read_num, $down_num, $man_cnt, $pnt_val, $e_val, $pnt_gif, $pnt_img); local(@down_data, $file_name, $file_size, $type); for($start..$end) { last if($ary[$_] eq ""); $num = $ary[$_]; #$icount++; #if($icount > $scount) { open(FILE,"$main_dir/data/$num"); local @data = ; close (FILE); &file_type; open(NUM, "$main_dir/num/$num"); $num_data = ; close(NUM); @gubun = split(/\|/,"$num_data"); my($read_num) = $gubun[1]; my($down_num) = $gubun[2]; if($CONF{'point_ok'} eq "yes"){ $man_cnt = $gubun[3] ? "$gubun[3]" : "0"; $pnt_val = $gubun[4] ? "$gubun[4]" : "0"; $e_val = $man_cnt ? ($pnt_val/$man_cnt) : "0"; $e_val = ($e_val eq "100")? 100 : substr($e_val,0,2); if(($e_val > 90) && ($e_val <= 100)){ $pnt_gif = "100.gif"; } elsif(($e_val > 70) && ($e_val <= 90)){ $pnt_gif = "80.gif"; } elsif(($e_val > 50) && ($e_val <= 70)){ $pnt_gif = "60.gif"; } elsif(($e_val > 30) && ($e_val <= 50)){ $pnt_gif = "40.gif"; } elsif(($e_val > 10) && ($e_val <= 30)){ $pnt_gif = "20.gif"; } else{ $pnt_gif = "0.gif"; } $pnt_gif = "gray/$pnt_gif" if($man_cnt < $CONF{'pnt_cnt'}); $pnt_img = "\"ÃßõÀμö"; } $read_num = $read_num ? "$read_num" : "0"; #------------------------------------------------------------------------------ my(@push, $rotate, $w_name, $home_img, $rdate, $gul_icon, $subject, $x_num, $gul_sub, $kword, $mailto, $mail_img, $read_val); local(@list, $tr_color); $d++; if($CONF{'templet'} ne ""){ $tr_color = $gr_color[$d-1]; } else{ $rotate = $d%2; $tr_color = ($rotate eq "0") ? "$CONF{'cel_color2'}" : "$CONF{'cel_color1'}"; } @list = split(/\|/, $data[1]); @open = split(/\|/, $data[4]); $open_val = $open[2]; if(($down_data[5] eq "") && ($down_data[4] eq "")) { $file_icon = "\"¿·¿¡ "; $down_num = "*"; $img_ok = "no"; } else{ $type = &file_icon("$type"); $img_ok = (($type eq "gif.gif") || ($type eq "jpg.gif") || ($type eq "jpeg.gif")) ? "ok" : "no"; $file_icon = ($open_val ne "no") ? "\"$file_name($file_size) " : "\"ÀÌÆÄÀÏÀº"; $down_num = $down_num ? "$down_num" : "0"; } $w_name = &cut_len("$list[0]","$CONF{'name_length'}"); $home_img = $list[2] ? "\"$list[0]´Ô": ""; $rdate=substr($list[4],5,5); if(-M "$main_dir/data/$num" < 1.0) { $gul_icon = ($num =~/-/) ? "newans.gif" : "newgul.gif"; $gul_icon = "new_lock.gif" if($open_val eq "no"); } else{ $gul_icon = ($num =~/-/) ? "ans.gif" : "gul.gif"; $gul_icon = "lock.gif" if($open_val eq "no"); } $subject = "\"Simple "; @push = split(/-/,$num); shift(@push); #---------------------------------------------------[ Á¦¸ñ±Û ±æÀÌ Á¦ÇÑ ] $x_num = @push; $gul_sub = &cut_len("$list[3]", "$CONF{'sub_length'}"); $x_num *=17; #--------------------------------------------------- #---------------------------------------------------[°£´ÜÀÇ°ß °¹¼öÁ¶È¸] if((-e "$main_dir/etc/$num") && ($CONF{'etc_ok'} eq "yes")){ open(ETC, "$main_dir/etc/$num"); my @etc = grep(!/^\s/, ); close(ETC); my $etc_num = $#etc+1; $gul_sub .= (-M "$main_dir/etc/$num" < 1.0) ? " [$etc_num]" : " [$etc_num]" if($etc_num > 0); } #--------------------------------------------------- #---------------------------------------------------[°Ë»ö½Ã °Ë»ö¾î ±¸º°] if($act eq "search"){ $kword = "$FORM{'keyword'}"; $gul_sub =~ s/$kword/$kword<\/font><\/b>/g if(($FORM{'category'} eq "subject") || ($FORM{'category'} eq "sub_cmt")); $w_name =~ s/$kword/$kword<\/font><\/b>/g if($FORM{'category'} eq "name"); } #-------------------------------------------------------------------------------- if($list[1]) { if($NT eq "1"){ $mailto = "$w_name"; $mail_img = "\"$list[0]´Ô¿¡°Ô"; } else{ $mailto = "$w_name"; $mail_img = "\"$list[0]´Ô¿¡°Ô"; } } else { $mailto = "$w_name"; $mail_img= ""; } my($icon_td, $num_col, $pnt_kind, $m_subject, $mh_td, $chk_td, $over_msg, $color_val); $icon_td = ($CONF{'kind_view'} eq "yes") ? "$file_icon" : ""; $num_col = "$down_num" if($CONF{'down_view'} eq "yes"); $pnt_kind = "$pnt_img" if($CONF{'point_ok'} eq "yes"); if(($num eq $FORM{'number'}) && ($act ne "modify_ok") && ($act ne "multi_view")){ $m_subject = "$subject $gul_sub\n"; $tr_color = $CONF{'select_color'}; } else{ $search_option = "&category=$FORM{'category'}&keyword=$FORM{'keyword'}&start_num=$FORM{'start_num'}" if($FORM{'category'} ne ""); $m_subject = " $subject $gul_sub\n"; #¿©·¯±Û º¸±â¿¡¼­ ÀаíÀÖ´Â±Û ¼±ÅûöÀ¸·Î µÇ°Ô... ^.^ if($act eq "multi_view"){ for(0..$#view_num){ if($view_num[$_] eq "$num"){ $tr_color = $CONF{'select_color'}; last; } } } } $mh_td = "$mail_img $home_img" if($CONF{'i_opt'} eq "yes"); $chk_td = ""; $over_msg = &over(" ¢¹¢¹ $no_data ¹ø ±Û Àбâ ^.^ "); $color_val = ($tr_color) ? "bgcolor=$tr_color" : ""; print "$chk_td$no_data$icon_td $m_subject$mailto$mh_td$rdate$read_num$num_col $pnt_kind\n"; $chk_num++; #} $no_data--; #last if($d >= $CONF{'page_num'}); } } $zero_col = "6"; if($CONF{'down_view'} eq "yes"){ $zero_col++; } if($CONF{'point_ok'} eq "yes"){ $zero_col++; } if($CONF{'i_opt'} eq "yes"){ $zero_col++; } if($CONF{'kind_view'} eq "yes"){ $zero_col++; } $zero_col -= 2; print "\n"; print ""; &pagemove; $search_option .= "&action=search" if($act eq "search"); $view_option = "&action=view&number=$FORM{'number'}&img=$FORM{'img'}" if($act eq "view"); print "\"reload\"\n"; &Tfoot; &Ffoot; print "
\n"; } # sub print_list{} ³¡ --------------------------------------------- sub over{ my($msg) = $_[0]; return "onMouseOver=\"this.style.backgroundColor='$CONF{'over_color'}';window.status=('$msg');return true;\" onMouseOut=\"this.style.backgroundColor='$tr_color'; window.status=('');return true;\""; } sub display { if((-e "$main_dir/idx/$page.cgi") && ($FORM{'category'} eq "")){ open(NUM, "$main_dir/idx/num.cgi"); $list_num = ; close(NUM); if($list_num eq "0" || $list_num eq ""){ #------------------ ±Û»èÁ¦½Ã °Ô½ÃÆÇ¿¡ ±ÛÀÌ Çϳªµµ ³²Áö ¾Ê¾ÆÀ» °æ¿ì... &read_idx; $list_num = @ary; $total_page = int($list_num/$CONF{'page_num'}); if(($total_page*$CONF{'page_num'}) < $list_num) {$total_page += 1;} } else{ $total_page = int($list_num/$CONF{'page_num'}); if(($total_page*$CONF{'page_num'}) < $list_num) {$total_page += 1;} open(PAGE, "$main_dir/idx/$page.cgi"); @page_list = ; close(PAGE); if($page_list[0] eq "\n"){ #---------- ¸Ç¸¶Áö¸· ÆäÀÌÁö¿¡¼­ ±Û »èÁ¦½Ã ±× ÆäÀÌÁö¿¡ ±ÛÀÌ Çϳªµµ ¾øÀ»°æ¿ì... $page=$page - 1; open(PAGE, "$main_dir/idx/$page.cgi"); @page_list = ; close(PAGE); } $start =($page-1)*$CONF{'page_num'}; for(1..$CONF{'page_num'}){ chomp($ary[$start+$_-1] = $page_list[$_-1]); if($page_list[$_] eq "\n"){ last; } } if($page ne "1"){ $prev = $page - 1; open(PREV,"$main_dir/idx/$prev.cgi"); @prev = ; close(PREV); chomp($ary[$prev*$CONF{'page_num'} - 1] = $prev[$#prev]); } if($page ne "$total_page"){ $next = $page + 1; open(NEXT,"$main_dir/idx/$next.cgi"); @next = ; close(NEXT); chomp($ary[$page*$CONF{'page_num'}] = $next[0]); } } } else{ #------------------------------------------- À妽º ÆÄÀÏ ÀÌ¿ë &read_idx; $list_num = @ary; $total_page = int($list_num/$CONF{'page_num'}); if(($total_page*$CONF{'page_num'}) < $list_num) {$total_page += 1; } $page = $total_page if("$FORM{'total_val'}"); } #--------------------------------------------------------- $total_page = 1 if($total_page == 0); my($next_num, $prev_num, $prev_page, $next_page, $category, $keyword, $start_num, $simple); if(($act eq "view") || ($act eq "etc_write") || ($act eq "etcdel_ok")){ unless($FORM{'category'} eq ""){ for(0..$list_num){ if($FORM{'number'} eq $ary[$_]){ $next_num = $ary[$_-1]; $prev_num = $ary[$_+1]; last; } } } else{ for(($page-1)*$CONF{'page_num'}..$page*$CONF{'page_num'}-1){ if($FORM{'number'} eq $ary[$_]){ $next_num = $ary[$_-1]; $prev_num = $ary[$_+1]; last; } } } $category = $FORM{'category'} ? "&category=$FORM{'category'}" : ""; $keyword = $FORM{'keyword'} ? "&keyword=$FORM{'keyword'}" : ""; $start_num = $FORM{'start_num'} ? "&start_num=$FORM{'start_num'}" : ""; $simple = $FORM{'simple'} ? "&simple=yes" : ""; $prev_page = (($ary[($page-1)*$CONF{'page_num'}-1] eq "$next_num") && ($category eq "")) ? ($page -1) : "$page" ; $next_page = (($ary[$page*$CONF{'page_num'}] eq "$prev_num") && ($category eq "")) ? ($page + 1) : "$page"; my(@ndata, @nline, @pdata, @pline, $next_data, $prev_data); open(NEXT, "$main_dir/data/$next_num"); @ndata = ; @nline = split(/\|/,$ndata[1]); $nline[3] = &cut_len("$nline[3]","$CONF{'sub_length'}"); $next_data = "
¡ã $nline[3] - $nline[0]"; close (NEXT); open(PREV, "$main_dir/data/$prev_num"); @pdata = ; @pline = split(/\|/,$pdata[1]); $pline[3] = &cut_len("$pline[3]","$CONF{'sub_length'}"); $prev_data = " ¡å $pline[3] - $pline[0]"; close (PREV); &Thead("100%","","3","0"); print "\n"; print "     $next_data
" if($FORM{'number'} ne $ary[0]); print "     $prev_data" if($FORM{'number'} ne $ary[$list_num-1]); print ""; &Tfoot; print "
\n"; } elsif($act eq "multi_view"){ } else{ &head; } if(($FORM{'category'} eq "") && ($FORM{'simple'} ne "yes")){ if(@quick_id){ &quick_btn; } &print_list; &find if($CONF{'search_ok'} eq "yes"); } &foot; } sub down_file { my($t_file); &plus_num; if(($FORM{'file'}=~ /http:\/\/.+/) || ($FORM{'file'}=~ /ftp:\/\/.+/)){ print "Location:$FORM{'file'}\n\n"; } else { ($t_file = $FORM{'file'}) =~ s{^.+/(.+)$}{$1}g; print "Content-type: application/octet-stream\n"; print "Content-disposition: attachment; filename=$t_file\n"; print "Content-Transfer-Encoding: binary\n\n"; open( DOWN, "$main_dir/files/$FORM{'file'}" ); binmode DOWN; binmode STDOUT; binmode STDERR; print ; close DOWN; } exit; } sub plus_num{ my(@num_gubun, $number_data, $ans_number); open(NUM, "$main_dir/num/$FORM{'number'}"); $number_data = ; close(NUM); @num_gubun = split(/\|/,"$number_data"); $ans_number = $num_gubun[0]; $read_number = $num_gubun[1]; $down_number = $num_gubun[2]; $man_cnt = $num_gubun[3] ? "$num_gubun[3]" : "0"; $pnt_val = $num_gubun[4] ? "$num_gubun[4]" : "0"; $e_val = $man_cnt ? ($pnt_val/$man_cnt) : "0"; if($e_val > 90 && $e_val <= 100){ $face_val = "\"¿ì¿Õ~"; } elsif($e_val > 70 && $e_val <= 90){ $face_val = "\"À½~"; } elsif($e_val > 50 && $e_val <= 70){ $face_val = "\"ÂÖ¸Å"; } elsif($e_val > 30 && $e_val <= 50){ $face_val = "\"À½~"; } elsif($e_val > 10 && $e_val <= 30){ $face_val = "\"ÀÌ°Ô"; } else{ $face_val = "\"ÃßõÁ»"; } $e_val = ($e_val eq "100")? 100 : substr($e_val,0,2); mkdir("$main_dir/num",0777) unless(-e "$main_dir/num"); if($FORM{'cnt'} ne "no"){ $cook = "$FORM{'action'}"; &cookie; if($COOKIE{$cook} ne "$ENV{'REMOTE_ADDR'}$FORM{'action'}$FORM{'number'}"){ $read_number++ if(($act eq "view") || ($act eq "multi_view")); $down_number++ if($act eq "down_file"); } &lock if($CONF{'speed_up'} eq "no"); open(NFI,">$main_dir/num/$FORM{'number'}"); print NFI "$ans_number|$read_number|$down_number|$man_cnt|$pnt_val|"; close(NFI); &unlock if($CONF{'speed_up'} eq "no"); } } sub file_type{ my(@name_data, @cgi, @file_type, $n_num); #-------------------------------------- [ ÆÄÀÏÁ¾·ù ¾ÆÀÌÄÜ ]--------------------------- @down_data = split(/\|/,$data[5]); $file_name = "$down_data[5]"; if($down_data[4] ne ""){ @name_data = split(/\//,$down_data[4]); $n_num = @name_data - 1; if($name_data[$n_num] =~/\?/){ @cgi = split(/\?/,"$name_data[$n_num]"); $file_name = $cgi[1]; } else{ $file_name = "$name_data[$n_num]"; } $f_name = "$down_data[4]"; $file_size = "¸µÅ©ÆÄÀÏ"; } else{ $f_name = $file_name; $file_size = "$down_data[6]"; } @file_type = split(/\./,$file_name); $type = $file_type[$#file_type]; $type = "cgi" if(($NT && ($file_type[$#file_type] eq "txt") && (($file_type[$#file_type-1] eq "cgi") || ($file_type[$#file_type-1] eq "pl") || ($file_type[$#file_type-1] eq "asp"))) || (($file_type[$#file_type] eq "txt") && (($file_type[$#file_type-1] =~ "php")))); } sub file_icon{ # ¾ÆÀÌÄÜ À̸§ ÃßÃâ ÇÔ¼ö... ^.^ ¿øÇϽô Á¾·ù¸¦ Ãß°¡ÇÏ½Ã¸é µË´Ï´Ù... my(@icon, @quick_img); my($type, $type_ok); $type = $_[0]; $type_ok = "0"; @icon = qw(unknown comp img exe cgi ra html mpeg); @1 = qw(rar arj ace tar gz lzh tgz iso); #comp.gif ¾ÐÃàÆÄÀÏ @2 = qw(pcx png tif psd ico); #img.gif ±×¸²ÆÄÀÏ @3 = qw(bat com); #exe.gif ½ÇÇàÆÄÀÏ @4 = qw(asp pl pm php php3 php4); #cgi.gif ¹®¼­ÆÄÀÏ @5 = qw(ram); #ra.gif ¸®¾ó¿Àµð¿À @6 = qw(shtml swf fla css); #htm.gif html ÆÄÀÏ @7 = qw(mpg mov avi rm asx asf wma); #mpeg.gif µ¿¿µ»óÆÄÀÏ @quick_img = qw(zip hwp mp3 htm html ra wav mid gif jpg jpeg bmp exe cgi doc ppt xls mpeg txt pdf); #quick_img¿¡´Â °¡Àå ¸¹ÀÌ »ç¿ëÇÏ´Â È®ÀåÀÚ À̹ÌÁö¸¦ typeµð·º¿¡ ³ÖÀ¸½Ã°í ¹è¿­¿¡ Ãß°¡½ÃÅ°¼Å¸é µË´Ï´Ù... for(0..$#quick_img){ if(lc($type) eq "$quick_img[$_]"){ $type = "$quick_img[$_].gif"; $type_ok = "1"; last; } } if($type_ok ne "1"){ EXIT: for(1..$#icon){ for $key(@$_){ if(lc($type) eq $key){ $type = "$icon[$_].gif"; $type_ok = "1"; last EXIT; } } } } if($type_ok ne "1"){ $type = "$icon[0].gif"; } return "$type"; } sub read_notice{ my(@gul, @notice, $subject, $comment, $wdate, $die_year, $die_mon, $die_day, $notice_td, $href); #========================[ °øÁö»çÇ× Ã¼Å© ]======================================== if((-e "$main_dir/notice.cgi") && ($act ne "view")){ open(FILE,"$main_dir/notice.cgi"); @gul = ; @notice = split(/\|/,$gul[0]); close (FILE); $subject = "$notice[1]"; #---------------------------------------------------[°£´ÜÀÇ°ß °¹¼öÁ¶È¸] if((-e "$main_dir/etc/notice.cgi") && ($CONF{'etc_ok'} eq "yes")){ open(ETC, "$main_dir/etc/notice.cgi"); my @etc = grep(!/^\s/, ); close(ETC); my $etc_num = $#etc+1; $subject .= (-M "$main_dir/etc/notice.cgi" < 1.0) ? " [$etc_num]" : " [$etc_num]" if($etc_num > 0); } #--------------------------------------------------- $comment = $notice[2]; $wdate = substr($notice[3],5,5); ($die_year, $die_mon, $die_day) = split(/:/, $notice[4]); open(NUM,"$main_dir/num/notice.cgi"); $read_num = ; $read_num = $read_num ? "$read_num" : "0"; close(NUM); &get_date; $notice_td = "^.^" if($CONF{'down_view'} eq "yes"); if($NT eq "0"){ $href = "javascript:newin(400, 267, 'sendmail.cgi?name=$CONF{'admin_name'}&mail=$CONF{'admin_mail'}&prog=$sendmail&home_url=$CONF{'home_url'}','spmail')"; } else{ $href = "mailto:$CONF{'admin_mail'}"; } my($ad_mail, $ad_home, $ad_td, $pnt_td, $colspan, $color_val, $over_msg, $notice_line); $ad_mail = "\"$CONF{'admin_mail'}\""; $ad_home = "\"$CONF{'home_url'}\""; $ad_td = "$ad_mail $ad_home" if($CONF{'i_opt'} eq "yes"); $pnt_td = "\"Smile~" if($CONF{'point_ok'} eq "yes"); $colspan = ($CONF{'kind_view'} eq "yes")? "colspan=4" : "colspan=3"; $color_val = $CONF{'ncel_color'} ? "bgcolor=$CONF{'ncel_color'}" : ""; $over_msg = &over(" ¢¹¢¹ °øÁö»çÇ× º¸±â"); $notice_line = " $subject$CONF{'admin_name'}$ad_td$wdate$read_num$notice_td $pnt_td\n"; if($die_year eq $year){ if($die_day < $mday){ if($die_mon <= $month){ unlink ("$main_dir/notice.cgi") ; unlink ("$main_dir/num/notice.cgi"); unlink ("$main_dir/etc/notice.cgi"); } else{ print $notice_line; } } else{ if($die_mon < $month){ unlink ("$main_dir/notice.cgi") ; unlink ("$main_dir/num/notice.cgi"); unlink ("$main_dir/etc/notice.cgi"); } else{ print $notice_line; } } } elsif($die_year > $year){ print $notice_line; } else{ unlink ("$main_dir/notice.cgi") ; unlink ("$main_dir/num/notice.cgi"); unlink ("$main_dir/etc/notice.cgi"); } } #========================[ °øÁö»çÇ× Ã¼Å© ³¡]======================================== } sub for_print { my(@gul_list, @gul_data, @cmt_data, @auto, @etc_data, $name, $mail, $mail_val, $home, $home_val, $auto_br, $auto_link, $subject, $wdate); open(GUL, "$main_dir/data/$FORM{'number'}"); @gul_list = ; close(GUL); @gul_data = split(/\|/, $gul_list[1]); $name = $gul_data[0]; $mail = $gul_data[1]; $mail_val = "
ÀüÀÚ¿ìÆí: $mail" if($mail); $home = $gul_data[2]; $home_val = "
ȨÆäÀÌÁö: $home" if($home); $subject= $gul_data[3]; $wdate = $gul_data[4]; @cmt_data = split(/\|/,$gul_list[2]); @auto = split(/\|/, $gul_list[4]); $auto_link = $auto[0]; $auto_br = $auto[1]; if ($cmt_data[0] ne "1") { $cmt_data[1] =~ s/
/\r\n/g; $cmt_data[1] =~ s//>/g; $cmt_data[1] =~ s/"/"/g; # $cmt_data[1] =~ s/<hr>/
/g; $cmt_data[1] =~ s/\r?\n/
/g; $cmt_data[1] =~ s/
/\r\n/g if($auto_br ne "1"); } else{ $cmt_data[1] =~ s/
/\r\n/g if($auto_br ne "1"); $cmt_data[1] =~ s/<br>/
/g; $cmt_data[1] =~ s/<p>/

/g; } if($auto_link eq "1"){ $cmt_data[1] =~ s/(http:\/\/)([\w\+\-\/\=\?\.\~\&]+)/ $1$2<\/font><\/a>/g; if($NT eq "1"){ $cmt_data[1] =~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } else{ $cmt_data[1] =~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } } $cmt_data[1] = &view_dongury("$cmt_data[1]") if($CONF{'dgr_ok'} eq "yes"); @etc_data = split(/\|/,$gul_list[5]); my(@name_data, @cgi, @file_type, $file_name, $n_num, $type, $img_view); if($etc_data[5] ne ""){ $file_name = $etc_data[5]; } else{ @name_data = split(/\//,$etc_data[4]); $n_num = @name_data - 1; if($name_data[$n_num] =~/\?/){ @cgi = split(/\?/,"$name_data[$n_num]"); $file_name = $cgi[1]; } else{ $file_name = "$name_data[$n_num]"; } } @file_type = split(/\./,$file_name); $type = $file_type[1]; $type = lc($type); if(($type eq "gif") || ($type eq "jpg") || ($type eq "jpeg")){ if($etc_data[4] ne ""){ $img_view = "

"; } else{ $img_view = "

"; } } my($os_data) = $ENV{'HTTP_USER_AGENT'}; print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n\n"; print "\n"; print "$subject\n"; # $CONF{'font_size'} ||= "9pt"; print "\n"; print "\n"; print "\n"; print "\n"; &Thead("100%","","3",""); print "\n"; print "Á¦¸ñ: $subject

\n"; print "ÀÛ¼ºÀÚ: $name
ÀÛ¼ºÀÏ: $wdate\n"; print "$mail_val $home_val

\n"; print "$cmt_data[1]\n"; print "$img_view\n" if($img_view); print "\n"; &Tfoot; print "\n"; exit; } sub to_email{ my($num, $fname, $fmail, $tname, $tmail, $comment, $send_it, $cls_win); $num = $FORM{'number'}; $fname = &Input("text","fname","","","","19",""); $fmail = &Input("text","fmail","","","","19",""); $tname = &Input("text","tname","","","","19",""); $tmail = &Input("text","tmail","","","","19",""); $comment = &Textarea("30","3","comment","","",""); $send_it = &Input("submit","","º¸³»±â"); $cls_win = "

\n"; print "Content-type: text/html\n\n"; print "°Ô½Ã¹° e-mail·Î º¸³»±â\n"; print "\n"; print "\n"; print "\n"; print "
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","action","send_gul"); print &Input("hidden","number","$num"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","simple","yes"); print "\n"; &Thead("315","","3","0",); print "¢Ã°Ô½Ã¹° e-mail·Î º¸³»±â ¢Ã\n"; print "º¸³»´ÂÀÌ À̸§$fname\n"; print "º¸³»´ÂÀÌ e-mail$fmail\n"; print "¹Þ´ÂÀÌ À̸§$tname\n"; print "¹Þ´ÂÀÌ e-mail$tmail\n"; print "Message$comment\n"; print "\n"; print "$send_it $cls_win\n"; print "\n"; &Tfoot; print "\n"; &Ffoot; print "
\n"; } sub send_gul{ my(@list, @sub_list, @seper, @etc_data, $name, $mail, $wmail_to, $home, $subject, $wdate, $pre_view, $file_name, $mailto, $auto_link, $auto_br); $mail_addr = $_[0]; if($mail_addr ne ""){ $FORM{'tmail'} = $mail_addr; $FORM{'tname'} = $CONF{'admin_name'}; $FORM{'number'} = $_[1]; } if($FORM{'tmail'} eq ""){ &error("send"); } unless($FORM{'tmail'} =~ /.*\@.*\..*/){ &error("send"); } open(GUL, "$main_dir/data/$FORM{'number'}"); @list = ; close(GUL); @sub_list = split(/\|/, $list[1]); $name = $sub_list[0]; $mail = $sub_list[1]; $wmail_to = $mail ? "
$name" : "$name"; $home = $sub_list[2]; $subject = $sub_list[3]; $wdate = $sub_list[4]; @auto = split(/\|/, $list[4]); $auto_link = $auto[0]; $auto_br = $auto[1]; @etc_data = split(/\|/,$list[5]); $pre_view = $etc_data[3]; $file_name = (($etc_data[5] eq "") && ($etc_data[4] eq ""))? "" : "$etc_data[5]"; @seper = split(/\|/,$list[2]); if ($seper[0] ne "1") { $seper[1] =~ s/
/\r\n/g; $seper[1] =~ s//>/g; $seper[1] =~ s/"/"/g; # $seper[1] =~ s/<hr>/
/g; $seper[1] =~ s/\r?\n/
/g; $seper[1] =~ s/
/\r\n/g if($auto_br ne "1"); } else{ $seper[1] =~ s/
/\r\n/g if($auto_br ne "1"); $seper[1] =~ s/<br>/
/g; $seper[1] =~ s/<p>/

/g; } # if($auto_link eq "1"){ # $seper[1]=~ s/(http:\/\/)([\w\+\-\/\=\?\.\~\&]+)/$1$2<\/font><\/a>/g; # $seper[1]=~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/$1<\/font><\/a>/g; # } $mailto = ($FORM{'fmail'}) ? "$FORM{'fname'}" : "$FORM{'fname'}"; $FORM{'comment'} =~ s/\r\n/
/g; &get_date; if($mail_addr ne ""){ $FORM{'fname'} = $sub_list[0]; $FORM{'fmail'} = $sub_list[1]; } my $to_mail = "$FORM{'tname'} <$FORM{'tmail'}>"; my $from_mail = "$FORM{'fname'} <$FORM{'fmail'}>"; open (MAIL, "|$sendmail -t") || die "È­ÀÏ ¿­±â ½ÇÆÐ!\n"; print MAIL "To: $to_mail\n"; print MAIL "From: $from_mail\n"; print MAIL "Subject: °Ô½Ã¹°ÀÌ ¹è´Þ µÇ¾ú½À´Ï´Ù.\n"; print MAIL "Content-Type: text/html; charset=euc-kr\n"; print MAIL "\n"; print MAIL "

\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "
¢Ã$subject¢Ã
\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "
\n"; print MAIL "º¸³½ ³¯Â¥: $date
\n"; print MAIL "º¸³½ »ç¶÷:$mailto
\n" if($mailto); print MAIL "Message: $FORM{'comment'}\n" if($FORM{'comment'}); print MAIL "
\n"; print MAIL "\n"; print MAIL "°Ô½ÃÆÇ DB¸í: $FORM{'id'}
\n"; print MAIL "ÀÛ¼ºÀÚ: $wmail_to
\n"; print MAIL "Ȩ URL: $home
\n" if($home); print MAIL "Á¦¸ñ:$subject
\n"; print MAIL "
\n"; print MAIL "$seper[1]\n"; print MAIL "

This message from $CONF{'home_url'}   

\n"; print MAIL "
\n"; print MAIL "
\n"; close (MAIL); if($mail_addr eq ""){ local $send_end = "1"; &load_page; } } sub view { my($chk_num, $dis_opt) = @_; my(@views, @Temp, @auto, @etc_data, @cgi, @file_type, @md, @tm, @seper, $auto_link, $auto_br, $domain, $ip, $pre_view, $file_name, $n_num, $f_name, $file_size, $type, $down_msg, $img_view, $file_down, $down_count, $w_info, $pdate, $year, $month, $sday, $stime, $smin, $mod_date, $homepage); local($read_number, $down_number, $man_cnt, $pnt_val, $e_val, $wpass, $pass); $FORM{'number'} = "$chk_num" if($chk_num ne ""); open(VFILE, "$main_dir/data/$FORM{'number'}"); @views = ; close(VFILE); chomp($wpass = $views[0]); @Temp = split(/\|/, $views[1]); @auto = split(/\|/, $views[4]); $auto_link = $auto[0]; $auto_br = $auto[1]; $open_val = $auto[2]; if($open_val eq "no"){ if($FORM{'passwd'} eq ""){ &open_login("$Temp[3]"); next if($act eq "multi_view"); } else{ $pass = crypt($FORM{'passwd'},"sp"); if($FORM{'number'} =~ /-/){ my @org = split(/-/,$FORM{'number'}); my($org_num) = $org[0]; open(ORG, "$main_dir/data/$org_num.cgi"); my @org_data = ; close(ORG); my @open = split(/\|/,$org_data[4]); my $open_ok = $open[2]; chomp($wpass = $org_data[0]) if($open_ok eq "no"); } unless(($pass eq $CONF{'admin_pwd'}) || ($pass eq $wpass)){ &error("pass"); } } } unless($views[4] =~ /\|/) { #3Â÷ ¾÷±×·¹À̵å ÀÚ¸¦ À§ÇØ... ³ªÁß¿¡ »èÁ¦???? $auto_br = "1"; $auto_link = "1" if(chomp($views[4]) eq "1"); } &plus_num; @etc_data = split(/\|/,$views[5]); $ip=$etc_data[1]; $domain=$etc_data[2]; if(($etc_data[5] eq "") && ($etc_data[4] eq "")) { $down_number = "*"; $img_view = ""; $file_down = ""; $pre_view = ""; } else{ $down_number = $down_number? "$down_number" : "0"; #----------------------------------------- $file_name = "$etc_data[5]"; if($etc_data[4] ne ""){ @name_data = split(/\//,$etc_data[4]); $n_num = @name_data - 1; if($name_data[$n_num] =~/\?/){ @cgi = split(/\?/,"$name_data[$n_num]"); $file_name = $cgi[1]; } else{ $file_name = "$name_data[$n_num]"; } $f_name = "$etc_data[4]"; $file_size = "¸µÅ©ÆÄÀÏ"; } else{ $f_name = $file_name; $file_size = "$etc_data[6]"; } @file_type = split(/\./,$file_name); $type = $file_type[$#file_type]; $type = lc($type); if(($type eq "gif") || ($type eq "jpg") || ($type eq "jpeg")){ $down_msg = "´Ù¿î¹ÞÀ¸½Ã·Á¸é ±×¸² À§¿¡¼­ ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» ´©¸£½ÅµÚ ´Ù¸¥À̸§À¸·Î ±×¸²ÀúÀå(ÀͽºÇ÷η¯).. Save Images As(³Ý½ºÄÉÀÌÇÁ)¸¦ ¼±ÅÃÇϼ¼¿ä..."; if($etc_data[4] ne ""){ $img_view = "

\"$down_msg\"

"; } else{ $img_view = "

\"$down_msg\"

"; } } else{ $img_view=""; } #------------------------------------------------- } $down_count = "  ´Ù¿î¼ö [ $down_number ]" if($CONF{'down_view'} eq "yes"); $w_info = (($ip ne "") && ($domain ne "") && ($CONF{'view_ip'} eq "yes"))? "

$ip - $domain" : "
"; $pdate = substr($Temp[4],0,10); @md = split(/\//,$pdate); $year=$md[0]; $month=$md[1]; $sday=$md[2]; @tm = split(/:/,substr($Temp[4],12,5)); $stime = $tm[0]; if($stime <= 11){ $stime = "¿ÀÀü $stime"; } elsif($stime == 12){ $stime = "¿ÀÈÄ $stime"; } else{ $stime -= 12; $stime = "¿ÀÈÄ $stime"; } $smin = $tm[1]; $mod_date = $Temp[5] if(($Temp[5] ne "\n") && ($Temp[5] ne "")); $homepage = ($Temp[2] ne "") ? "\"$Temp[2]\"" : ""; @seper = split(/\|/,$views[2]); if ($seper[0] ne "1") { $seper[1] =~ s/
/\r\n/g; $seper[1] =~ s//>/g; $seper[1] =~ s/"/"/g; # $seper[1] =~ s/<hr>/


/g; $seper[1] =~ s/\r?\n/
/g; $seper[1] =~ s/
/\r\n/g if($auto_br ne "1"); } else{ $seper[1] =~ s/
/\r\n/g if($auto_br ne "1"); $seper[1] =~ s/<br>/
/g; $seper[1] =~ s/<p>/

/g; } #------------------------------------------| °Ë»ö¾î ±¸ºÐ... ^.^ if(($FORM{'category'} eq "comment") || ($FORM{'category'} eq "sub_cmt")){ $kword = "$FORM{'keyword'}"; $seper[1] =~ s/$kword/$kword<\/font><\/b>/g; } #$seper[1] =~ s/\r\n/
/g; if($auto_link eq "1"){ $seper[1]=~ s/(http:\/\/)([\w\+\-\/\=\?\.\~\&]+)/ $1$2<\/font><\/a>/g; if($NT eq "1"){ $seper[1]=~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } else{ $seper[1]=~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } } $seper[1] = &view_dongury("$seper[1]") if($CONF{'dgr_ok'} eq "yes"); if($etc_data[5] ne ""){ $file_down = "
\"´Ù¿î·Îµå\"$etc_data[5] [ $etc_data[6] ]
"; $pre_view = "
\"¹Ì¸®º¸±â\"¹Ì¸®º¸±â
" if(($etc_data[3] ne "") && ($etc_data[3] ne "http://")); } elsif($etc_data[4] ne ""){ $file_down = "
\"$file_name [ ¸µÅ©ÆÄÀÏ ]
"; $pre_view = "
\"¹Ì¸®º¸±â\"¹Ì¸®º¸±â
" if(($etc_data[3] ne "") && ($etc_data[3] ne "http://")); } my(@apt, @sub_data, $kword, $acou, $ans_number, $subnumber, $kind, $mailto, $link, $sel_point); @apt = split(/-/,$FORM{'number'}); $acou = @apt; @sub_data = split(/\./,$FORM{'number'}); $num_data = $sub_data[0]; if($ans_number eq "") { $subnumber = "$num_data-1"; } else { $ans_number++; $subnumber = "$num_data-$ans_number"; } if($Temp[1]) { if($NT eq "0"){ $kind = "javascript:newin(400, 267, 'sendmail.cgi?name=$Temp[0]&mail=$Temp[1]&prog=$sendmail&home_url=$CONF{'home_url'}','spmail')"; } else{ $kind = "mailto:$Temp[1]"; } $mailto = "$Temp[0]
$Temp[1]"; } else{ $mailto = "$Temp[0]"; } if($FORM{'simple'} eq "yes") { $CONF{'tbl_width'} = "520"; } &head if($dis_opt eq ""); $link = "
$file_down$pre_view
\n"; $sel_point = "
¢º¢ºÃßõÇϱâ 20Á¡\"ÀÌ°Ô40Á¡\"¿¡À×~º°·ç´Ù~\"60Á¡\"ÂظÅ80Á¡\"À½~100Á¡\"¿ì¿Í~ 
ÃßõÀμö[$man_cnt¸í] Æò±ÕÁ¡¼ö[$e_valÁ¡] ÃÑÁ¡¼ö[$pnt_valÁ¡] Æò°¡ $face_val
\n" if($CONF{'point_ok'} eq "yes"); print "

\n"; &Thead("100%","","1","0"); print "ÀÛ¼ºÀÚ [ $mailto $homepage ] - $year³â $month¿ù $sdayÀÏ $stime½Ã $sminºÐ¿¡ ³²±â½Å ±Û\n"; print "\n"; &Thead("100%","","0","0"); my($color_val) = $CONF{'head_color'} ? "bgcolor=$CONF{'head_color'}": ""; print "\n"; &Tfoot; &Thead("100%", "", "0","0"); print "¨Ú $Temp[3]\n"; print ""; my($basic_height, $sim_val); if($FORM{'simple'} ne "yes"){ print "Á¶È¸¼ö [ $read_number ] $down_count\n"; $basic_height = "220"; } else{ $basic_height = "170"; $sim_val = "&simple=yes"; } print "\"¼öÁ¤\n"; print "\"»èÁ¦  \n"; &Tfoot; print "\n"; print "\n"; &Thead("100%", "$CONF{'cel_color1'}", "5","0"); print "

\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action","point_up"); print &Input("hidden","number","$FORM{'number'}"); print &Input("hidden","img","$FORM{'img'}"); print &Input("hidden","page","$page"); print &Input("hidden","simple","$FORM{'simple'}"); if($FORM{'category'}){ print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); } print "$link$sel_point
$seper[1] $img_view\n"; print "\n" unless($NT); print "
"; print "À̸ÞÀÏ·Î º¸³»±â...\"°Ô½Ã¹°À»    ÇÁ¸°Æ®¹öÁ¯ º¸±â...\"ÇÁ¸°Æ®   
$w_info  
"; print "Last modified - $mod_date  
\n" if(($mod_date ne "") && (length($mod_date) > 10)); &Ffoot if($CONF{'point_ok'} eq "yes"); #---------------------------------------------------------------------- if($CONF{'etc_ok'} eq "yes"){ print "\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","action","etc_write"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","page","$page"); print &Input("hidden","img","$FORM{'img'}"); print &Input("hidden","number","$FORM{'number'}"); print &Input("hidden","simple","$FORM{'simple'}"); if($FORM{'category'}){ print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); } &Thead("100%","","3","0"); print "\n"; print &Input("submit","", "³²±â±â"); print "  \"°£´ÜÀÇ°ß\n"; my(@etc, $end_num, $search_opt, $gd); if(-e "$main_dir/etc/$FORM{'number'}"){ open (ETC, "$main_dir/etc/$FORM{'number'}"); @etc = ; close (ETC); chop(@etc); $end_num = @etc; $search_opt = "&category=$FORM{'category'}&keyword=$FORM{'keyword'}" if($FORM{'category'} ne ""); @color = ('#FF0000', '#FF0000', '#FF9F47', '#FF9F47', '#009900', '#009900', '#0C2099', '#0C2099', '#991098', '#991098'); for(0..$end_num-1){ if($etc[$_] ne ""){ my @gubun = split(/\|/,$etc[$_]); $gd = $_ + 1; print "\"$gd¹ø° $gubun[0]\n"; } } } &Tfoot; &Ffoot; } else{ print "
\n"; } #--------------------------------------------------------------- print "\n"; &Tfoot; print "\n"; &Tfoot; &Thead("100%","","0","0"); # my($color_val) = $CONF{'head_color'} ? "bgcolor=$CONF{'head_color'}": ""; print "\n"; &Tfoot; &Thead("100%", "", "1", ""); print "\n"; if($FORM{'simple'} eq "yes"){ print "

\n"; } else{ if($FORM{'category'} eq ""){ print "\"´äº¯ÀÛ¼º\"" if($acou <= 8); print "\"¸ñ·Ïº¸±â\"\n"; } else{ print "\"°Ë»ö\"±Û

\n"; } } print "\n"; &Tfoot; &display if($dis_opt eq ""); } sub view_dongury{ my $input = $_[0]; my %DGR = ( 'dong1' => 'ļ~', 'dong2' => '½¡´óÀÌ~', 'dong3' => 'À̾¾~', 'dong4' => 'µÎÅë~', 'dong5' => '¾û¾û~', 'dong6' => '³È³È~', 'dong7' => '¼¼¿ø~', 'dong8' => '°æ¸²~', 'dong9' => '½Ó¹ÚÁú~', 'dong10' => '¿¡~', 'dong11' => '¸Þ·Õ~', 'dong12' => '°¨±â~', 'dong13' => '¿ò~', 'dong14' => 'Èì~', 'dong15' => 'Çູ~', 'dong16' => '½Å»ç~', 'dong17' => '°£È£»ç~', 'dong18' => 'ÀÇ»ç~', 'dong19' => 'ÄðÄð~', 'dong20' => '±Ã±Ý~', 'dong21' => '¹æ±ß~', 'dong22' => '¹Ì¼Ò~', 'dong23' => '¿í~', 'dong24' => 'ÀÌ·±~', 'dong25' => '»±ÄÚ~', 'dong26' => '¶ß¾Ç~', 'dong27' => 'Á¹·Á~', 'dong28' => '»ç¶û~', 'dong29' => 'ÀÌÈ÷~', 'dong30' => '²ô¾Æ¾Ç~', 'dong31' => '½º¸¶ÀÏ~', 'dong32' => 'Çì~', 'dong33' => '¸ÚÀïÀÌ~', 'dong34' => '±ºÀÎ~', 'dong35' => '±«¹°~', 'dong36' => '¸ÀÀÖ´ç~', 'dong37' => 'À×~', 'dong38' => 'ºÎµé~', 'dong39' => '¿ì~', 'dong40' => 'ÇÏÇÏ~', 'dong41' => 'ºÎ»ó~', 'dong42' => '¸¶¸§~', # 'dong43' => 'Åõ´ú~', # 'dong44' => 'ÀǽÉ~', # 'dong45' => '¿Õµû~', # 'dong46' => '¿Í¿ì~', # 'dong47' => '¿¨~', # 'dong48' => '¾È°æ~', # 'dong49' => '¸ðÀÚ1~', # 'dong50' => '¸ðÀÚ2~', # 'dong51' => '¿Ë~', # 'dong52' => '±ò±ò~', # 'dong53' => 'Èï~', # 'dong54' => '¿¡ÈÞ~', # 'dong55' => 'È­³²~', # 'dong56' => 'Èå¹Ì~', # 'dong57' => 'Èǽ~', # 'dong58' => '½ã±Û·¯½º~', ); foreach (keys(%DGR)) { $input =~ s/$DGR{$_}/\"$DGR{$_}\"/g; } return $input; } sub multi_view{ if($FORM{'mv.x'} eq ""){ &admin_chkdel; } my(@check, @chk_img, @ndata, @ncgi, @ftype, $cnt, $chk_num, $fname, $nnum, $type); local(@view_num); $cnt = 0; for (0..$CONF{'page_num'}-1){ $chk_num = "num_val$_"; if($FORM{$chk_num}){ $view_num[$cnt] = "$FORM{$chk_num}"; $cnt++; } } if($view_num[0] eq ""){ &error("no_select"); } CUT: for(0..$#view_num){ #--- ³Ý½º¿¡¼­ À̹ÌÁö¸¦ ºÃÀ»¶§ ¶óÀÎÇìÀÌÆ® ¿É¼Ç ¾ø¾Ö±â... open (IMGOK, "$main_dir/data/$view_num[$_]"); @check = ; close(IMGOK); @chk_img = split(/\|/,$check[5]); if(($chk_img[5] ne "") || ($chk_img[4] ne "")) { $fname = "$chk_img[5]"; if($chk_img[4] ne ""){ @ndata = split(/\//,$chk_img[4]); $nnum = @ndata - 1; if($ndata[$nnum] =~/\?/){ @ncgi = split(/\?/,"$ndata[$nnum]"); $fname = $ncgi[1]; } else{ $fname = "$ndata[$nnum]"; } } @ftype = split(/\./,$fname); $type = $ftype[1]; $type = lc($type); $FORM{'img'} = (($type eq "gif") || ($type eq "jpg") || ($type eq "jpeg")) ? "ok" : "no"; last CUT if($FORM{'img'} eq "ok"); } } &head; for(0..$#view_num){ &view("$view_num[$_]","0"); } print "

"; &display; &foot; } sub multi_del{ my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} ne $pass) { &error("pass"); } my(@del_num, @ldata, @file_data, @ary, $cnt, $chk_num ); $cnt = 0; for (0..$CONF{'page_num'}-1){ $chk_num = "num_val$_"; if($FORM{$chk_num}){ $del_num[$cnt] = "$FORM{$chk_num}"; $cnt++; } } for(0..$#del_num){ open(FILE,"$main_dir/data/$del_num[$_]"); @ldata = ; @file_data = split(/\|/,$ldata[5]); close (FILE); unlink "$main_dir/data/$del_num[$_]"; unlink "$main_dir/num/$del_num[$_]"; unlink "$main_dir/etc/$del_num[$_]"; unlink "$main_dir/files/$file_data[5]"; &auto_erase("$del_num[$_]"); } &repair_idx; } sub etc_write{ my(@etc, $new_etc, $etc_num); mkdir("$main_dir/etc",0777) unless(-e "$main_dir/etc"); open (DATA, "<$main_dir/etc/$FORM{'number'}"); @etc = ; chop(@etc); close (DATA); $new_etc = "$FORM{'etc'}|$ENV{'REMOTE_ADDR'}"; $etc_num = @etc; $etc_num++; if($etc_num > 9){ $etc_num =9; } if($FORM{'etc'} ne ( "" || "¡Ø °£´ÜÀÇ°ß ³²±â±â" )){ open (ETC, ">$main_dir/etc/$FORM{'number'}"); print ETC "$new_etc\n"; for(0..$etc_num-1){ print ETC "$etc[$_]\n"; } close (DATA); } if($FORM{'number'} eq "notice.cgi"){ &view_notice; } else{ &view; } } sub input_form{ my ($name, $email, $homepage, $passwd, $html, $auto_link, $auto_br, $open_val,$subject, $pre_view, $comments, $file_name, $link_file, $submit, $reset); local($week_val); &get_date; &read_cookie; &head; for(0..6){ #-------------------------- ½¬´Â ¿äÀÏ ^^ if($week_val eq $lock_week[$_]){ $lock_val = "ok"; } } if($lock_val eq "ok"){ print "

 

 

 


\n"; print "¸ÅÁÖ\n"; foreach(0..$#lock_week){ print "$lock_week[$_]¿äÀÏ" if($lock_week[$_] ne ""); print ", " if(($_ ne "$#lock_week") && ($lock_week[$_] ne "")); } print "Àº ½±´Ï´Ù...\n"; print "
\n"; print "



\n"; } else{ if($CONF{'admin_only'} eq "yes"){ print "[¾Ë¸²!!!] ÀÌ °Ô½ÃÆÇÀº ÇöÀç °ü¸®ÀÚ¸¸ ±ÛÀ» ¾µ¼ö ÀÖ°Ô ¼³Á¤µÇ¾ú½À´Ï´Ù.\n"; } $name = &Input("text","name","$COOKIE{'UN'}","","","14","30"); $email = &Input("text","email","$COOKIE{'UM'}","","","26",""); $home_val = $COOKIE{'UH'} ? "$COOKIE{'UH'}" : "http:\/\/"; $homepage = &Input("text","homepage", "$home_val","","","51",""); $passwd = &Input("password","passwd","","","","10",""); $html = &Checkbox("html","1",""); $auto_link = &Checkbox("auto_link","1",""); $auto_br = &Checkbox("auto_br","1","1"); $open_val = "" if($CONF{'scr_opt'} eq "yes"); $subject = &Input("text", "subject", "","","","70",""); $pre_view = &Input("text", "pre_view", "http:\/\/","","","70",""); $comments = &Textarea("70","8","comments"); $file_name = &Input("file", "file_name","","","", "54",""); $link_file = &Input("text", "link_file", "","","","54",""); $submit = &Input("submit",""," ±Û ¿Ã¸² "); $reset = &Input("reset", "", "´Ù½ÃÀÛ¼º"); # &Fhead("POST","$cgi_url","multipart/form-data","form"); &input_java; print "
"; print &Input("hidden","action","write"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","ip","$ENV{'REMOTE_ADDR'}"); print &Input("hidden","domain","$ENV{'HTTP_USER_AGENT'}"); &Thead("","$CONF{'head_color'}","3","0"); print "¨Ú ±Û ³²±â±â...\n"; print "\n"; &Thead("","$CONF{'head_color'}","2","3"); print "ÀÌ      ¸§$name\n"; print "   e-mail $email\n"; print "ȨÆäÀÌÁö\n"; print "$homepage\n"; print "ºñ¹Ð¹øÈ£$passwd"; print "$htmlhtmlÇã¿ë $auto_linkÀÚµ¿¸µÅ© $auto_brÀÚµ¿ÁÙ¹Ù²Þ     $open_val\n"; print "Á¦      ¸ñ$subject\n"; print "¹Ì¸®º¸±â$pre_view\n" if($CONF{'pds_ok'} eq "yes"); print "
³»      ¿ë\n"; print "$comments\n"; &call_dgr; print "
µ¿ ±Û ÀÌ$dongury_tbl\n" if($CONF{'dgr_ok'} eq "yes"); print "
Ư¼ö¹®ÀÚ$chr_tbl\n"; print "ÆÄÀÏ÷ºÎ$file_name\n" if($CONF{'pds_ok'} eq "yes"); print "¸µÅ©ÆÄÀÏ$link_file [ ÃÖ´ë $CONF{'max_size'} MB ]\n" if($CONF{'pds_ok'} eq "yes"); print "$submit $reset\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; } print "\"±Û

\n"; &foot; } sub input_java{ print <<__JAVA__; __JAVA__ } sub ok_admin{ print <<__OK__;

°ü¸®ÀÚ Password

__OK__ } sub notice_form{ my($n_mon, $die_year, $die_mon, $die_day, $subject, $html, $auto_link, $comments, $ok_btn, $rs_btn); if($FORM{'passwd'} eq $CONF{'admin_pwd'}){ &get_date; $n_mon = $mon + 1; $n_mon = "0$n_mon" if($n_mon < 10); $die_year = &Input("text","die_year","$year","","","4","4"); $die_mon = &Input("text","die_mon","$n_mon","","","2","2"); $die_day = &Input("text","die_day","","","","2","2"); $subject = &Input("text","subject","","","","70",""); $html = &Checkbox("html","1",""); $auto_link = &Checkbox("auto_link","1","checked"); $auto_br = &Checkbox("auto_br","1","checked"); $comments = &Textarea("70","8","comments"); $ok_btn = &Input("submit", "", " ±Û ¿Ã¸² "); $rs_btn = &Input("reset", "", "´Ù½ÃÀÛ¼º"); &head; print "
\n"; &Fhead("POST", "$cgi_url", "", "form"); print &Input("hidden","action","adminwrite"); print &Input("hidden","id","$FORM{'id'}"); &Thead("","$CONF{'head_color'}","3","0"); print "¨Ú °øÁö»çÇ× ³²±â±â...\n"; print "\n"; &Thead("","$CONF{'head_color'}","3","3"); print "\n"; print "¸¸ ±â ÀÏ\n"; print "$die_year³â\n"; print "$die_mon¿ù\n"; print "$die_dayÀÏ (¿¹: 2002³â 06¿ù 01ÀÏ)\n"; print "³»¿ë¿É¼Ç$htmlhtmlÇã¿ë\n"; print "$auto_linkÀÚµ¿¸µÅ©\n"; print "$auto_brÀÚµ¿ÁٹٲÞ\n"; print "Á¦      ¸ñ$subject\n"; print " $comments\n"; &call_dgr; print "
µ¿ ±Û ÀÌ$dongury_tbl\n" if($CONF{'dgr_ok'} eq "yes"); print "
Ư¼ö¹®ÀÚ$chr_tbl\n"; print " "; &ok_admin; print "\n"; print "$ok_btn $rs_btn\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } else{ &error("pass"); } } sub modify_form { my(@data, @seper, @auto, @pds_data, $pass, $html, $htmlvalue, $comment, $ansnum, $alink, $abr, $open_ok, $org_open, $open_yes, $open_no, $link_val, $br_val, $pv_value, $link_value, $file_name, $file_size, $down_num); open(DATA,"$main_dir/data/$FORM{'number'}"); chomp(@data = ); $pass = $data[0]; my($name, $email, $homepage, $subject, $wdate, $readnum) = split(/\|/,$data[1]); $name =~ s/\"/"/g; # ¼öÁ¤½Ã " Ç¥½Ã »ì¸²... $subject =~ s/\"/"/g; @seper= split(/\|/,$data[2]); $html=$seper[0]; $htmlvalue = ($html eq "1") ? "checked" : ""; $seper[1] =~ s/
/\n/g; $comment=$seper[1]; $comment =~ s/<br>/
/g; $comment =~ s/&/&/g; $comment =~ s//>/g; $ansnum=$data[3]; @auto = split(/\|/, $data[4]); $alink = $auto[0]; $abr = $auto[1]; $open_ok = $auto[2]; if($open_ok ne "no"){ $open_yes = "selected"; } else{ $open_no = "selected"; if($FORM{'number'} =~ /-/){ my @org = split(/-/,$FORM{'number'}); my($org_num) = $org[0]; open(ORG, "$main_dir/data/$org_num.cgi"); my @org_data = ; close(ORG); my @org_val = split(/\|/, $org_data[4]); $org_open = $org_val[2]; } } $link_val = ($alink eq "1") ? "checked" : ""; $br_val = ($abr eq "1") ? "checked" : ""; @pds_data = split(/\|/,$data[5]); $pv_value = $pds_data[3]; $link_value = $pds_data[4]; $file_name = $pds_data[5]; $file_size = $pds_data[6]; $down_num = $pds_data[7]; close (DATA); my($name_val, $email_val, $home_val, $home_chk, $auto_link, $auto_br, $open_val, $sub_val, $pre_val, $com_val, $link_file); $name_val = &Input("text","name","$name","","","14","30"); $email_val = &Input("text","email","$email","","","26",""); $home_val = &Input("text","homepage","$homepage","","","51",""); $home_chk = &Checkbox("html","1","$htmlvalue"); $auto_link = &Checkbox("auto_link", "1", "$link_val"); $auto_br = &Checkbox("auto_br", "1", "$br_val"); $open_val = ($org_open eq "no") ? &Input("hidden","open","no") : "" if($CONF{'scr_opt'} eq "yes"); $sub_val = &Input("text", "subject", "$subject", "","","70",""); $pre_val = &Input("text", "pre_view", "$pv_value", "", "", "70", ""); $com_val = Textarea("70","8","comments","","","$comment"); $link_file = &Input("text", "link_file", "$link_value", "", "", "70", ""); &head; &input_java; #&Fhead("POST","$cgi_url","","form"); print ""; print &Input("hidden","action","modify_ok"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","page","$page"); print &Input("hidden","number","$FORM{'number'}"); print &Input("hidden","ansnum","$ansnum"); print &Input("hidden","date","$wdate"); print &Input("hidden","file_name","$file_name"); print &Input("hidden","file_size","$file_size"); print &Input("hidden","ip","$ENV{'REMOTE_ADDR'}"); print &Input("hidden","domain","$ENV{'HTTP_USER_AGENT'}"); print &Input("hidden","down_num","$down_num"); print &Input("hidden","simple","$FORM{'simple'}"); &Thead("","$CONF{'head_color'}","3","0"); print "¨Ú $name´ÔÀÇ ±ÛÀ» ¼öÁ¤ÇÕ´Ï´Ù.\n"; print "\n"; &Thead("","$CONF{'head_color'}","3","0"); print "ÀÌ      ¸§\n"; print "$name_val    e-mail $email_val\n"; print "ȨÆäÀÌÁö$home_val\n"; print &Input("hidden","passwd","$pass"); print "³»¿ë¿É¼Ç$home_chkhtmlÇã¿ë\n"; print "$auto_linkÀÚµ¿¸µÅ©\n"; print "$auto_brÀÚµ¿ÁÙ¹Ù²Þ     $open_val\n"; print "Á¦      ¸ñ$sub_val\n"; print "¹Ì¸®º¸±â$pre_val\n" if(($file_name ne "") or ($link_value ne "")); print "
³»      ¿ë$com_val   \n"; &call_dgr; print "
µ¿ ±Û ÀÌ$dongury_tbl\n" if($CONF{'dgr_ok'} eq "yes"); print "
Ư¼ö¹®ÀÚ$chr_tbl\n"; print "¸µÅ©ÆÄÀÏ$link_file" if($link_value ne ""); my($submit_btn) = &Input("submit","","¼öÁ¤Çϱâ"); my($reset_btn) = &Input("reset", "", "´Ù½ÃÀÛ¼º"); print "$submit_btn $reset_btn\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } sub admin_modify_form { my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} ne $pass) { &error("pass"); } my(@data, @notice, @auto, $html, $link_val, $br_val, $subject, $comment, $wdate, $read_num, $htmlvalue); open(DATA,"$main_dir/notice.cgi"); @data = ; @notice = split(/\|/,$data[0]); $html=$notice[0]; @auto = split(/\|/,$data[1]); $link_val = ($auto[0] eq "1") ? "checked" : ""; $br_val = ($auto[1] eq "1") ? "checked" : ""; $subject = $notice[1]; $comment = $notice[2]; $comment =~ s/
/\n/g; $comment =~ s/&/&/g; $comment =~ s//>/g; $wdate = $notice[3]; my ($die_year, $die_mon, $die_day) = split(/:/,$notice[4]); $read_num = $notice[5]; $htmlvalue = ($html eq "1") ? "checked" : ""; close (DATA); my($year_val, $mon_val, $day_val, $sub_val, $html_chk, $auto_link, $auto_br, $text_val, $ok_btn, $reset_btn); $year_val = &Input("text", "die_year", "$die_year","","","4","4"); $mon_val = &Input("text", "die_mon", "$die_mon", "","","2","2"); $day_val = &Input("text", "die_day", "$die_day", "","","2","2"); $sub_val = &Input("text", "subject", "$subject", "", "", "70", ""); $html_chk = &Checkbox("html", "1" , "$htmlvalue"); $auto_link = &Checkbox("auto_link", "1", "$link_val"); $auto_br = &Checkbox("auto_br", "1", "$br_val"); $text_val = &Textarea("70","8","comments","","","$comment"); $ok_btn = &Input("submit", "", " ±Û ¿Ã¸² "); $reset_btn = &Input("reset", "", "´Ù½Ã ÀÛ¼º"); &head; &Fhead("POST", "$cgi_url","","form"); print &Input("hidden", "action", "adminwrite"); print &Input("hidden","read_num","$read_num"); print &Input("hidden","id","$FORM{'id'}"); &Thead("","$CONF{'head_color'}","3","0"); print "¨Ú °øÁö»çÇ× ¼öÁ¤Çϱâ...\n"; print "\n"; &Thead("", "$CONF{'head_color'}", "3", "3"); print "\n"; print "¸¸ ±â ÀÏ $year_val³â\n"; print "$mon_val¿ù $day_valÀÏ (¿¹: 2000³â08¿ù01ÀÏ)\n"; print "³»¿ë¿É¼Ç$html_chkhtmlÇã¿ë $auto_linkÀÚµ¿¸µÅ© $auto_brÀÚµ¿ÁٹٲÞ\n"; print "Á¦      ¸ñ$sub_val\n"; print " $text_val\n"; &call_dgr; print "
µ¿ ±Û ÀÌ$dongury_tbl\n" if($CONF{'dgr_ok'} eq "yes"); print "
Ư¼ö¹®ÀÚ$chr_tbl\n"; &ok_admin; print "$ok_btn $reset_btn\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } sub call_dgr{ if($CONF{'dgr_ok'} eq "yes"){ my %DGR = ( 'dong1' => 'ļ~', 'dong2' => '½¡´óÀÌ~', 'dong3' => 'À̾¾~', 'dong4' => 'µÎÅë~', 'dong5' => '¾û¾û~', 'dong6' => '³È³È~', 'dong7' => '¼¼¿ø~', 'dong8' => '°æ¸²~', 'dong9' => '½Ó¹ÚÁú~', 'dong10' => '¿¡~', 'dong11' => '¸Þ·Õ~', 'dong12' => '°¨±â~', 'dong13' => '¿ò~', 'dong14' => 'Èì~', 'dong15' => 'Çູ~', 'dong16' => '½Å»ç~', 'dong17' => '°£È£»ç~', 'dong18' => 'ÀÇ»ç~', 'dong19' => 'ÄðÄð~', 'dong20' => '±Ã±Ý~', 'dong21' => '¹æ±ß~', 'dong22' => '¹Ì¼Ò~', 'dong23' => '¿í~', 'dong24' => 'ÀÌ·±~', 'dong25' => '»±ÄÚ~', 'dong26' => '¶ß¾Ç~', 'dong27' => 'Á¹·Á~', 'dong28' => '»ç¶û~', 'dong29' => 'ÀÌÈ÷~', 'dong30' => '²ô¾Æ¾Ç~', 'dong31' => '½º¸¶ÀÏ~', 'dong32' => 'Çì~', 'dong33' => '¸ÚÀïÀÌ~', 'dong34' => '±ºÀÎ~', 'dong35' => '±«¹°~', 'dong36' => '¸ÀÀÖ´ç~', 'dong37' => 'À×~', 'dong38' => 'ºÎµé~', 'dong39' => '¿ì~', 'dong40' => 'ÇÏÇÏ~', 'dong41' => 'ºÎ»ó~', 'dong42' => '¸¶¸§~', # 'dong43' => 'Åõ´ú~', # 'dong44' => 'ÀǽÉ~', # 'dong45' => '¿Õµû~', # 'dong46' => '¿Í¿ì~', # 'dong47' => '¿¨~', # 'dong48' => '¾È°æ~', # 'dong49' => '¸ðÀÚ1~', # 'dong50' => '¸ðÀÚ2~', # 'dong51' => '¿Ë~', # 'dong52' => '±ò±ò~', # 'dong53' => 'Èï~', # 'dong54' => '¿¡ÈÞ~', # 'dong55' => 'È­³²~', # 'dong56' => 'Èå¹Ì~', # 'dong57' => 'Èǽ~', # 'dong58' => '½ã±Û·¯½º~', ); my $tbl = ""; for(1..42){ $tbl .= "" if(($_-1)%7 == 0); $tbl .= "\n" if(($_-1)%7 == 6); } $tbl .= "
".$DGR{"dong$_"}.""; $tbl .= "
"; $dongury_tbl = $tbl; } my(@chr, $c_tbl, $tbl_cnt); @chr = qw(¡º ¡» ¡¼ ¡½ ¡¾ ¡¿ ¡À ¡Å ¡Î ¡Ï ¡Ö ¡Ø ¡Ù ¡Ú ¡Û ¡Ü ¡Ý ¡Þ ¡ß ¡à ¡á ¡â ¡ã ¡ä ¡å ¡æ ¡ç ¡è ¡é ¡ì ¡í ¡ñ ¢¡ ¢¢ ¢² ¢³ ¢´ ¢· ¢¸ ¢¹ ¢º ¢» ¢¼ ¢½ ¢¾ ¢¿ ¢À ¢Á ¢Â ¢Ã ¢Ä ¢Å ¢Æ ¢Ç ¢È ¢É ¢Ê ¢Ë ¢Ì ¢Í ¢Î ¢Ï ¢Ð ¢Ñ ¢Ó ¢Ö ¢× ¢Ø ¢Ù ¢Û ¢Ü ¢Ý ¥á ¥â); $c_tbl = "\n"; $tbl_cnt = 0; foreach (@chr) { $c_tbl .= "" if($tbl_cnt%37 == 0); $c_tbl .= ""; $c_tbl .= "\n" if($tbl_cnt%37 == 36); $tbl_cnt++; } $c_tbl .= "
$_
\n"; $chr_tbl = $c_tbl; } sub read_cookie{ if($ENV{'HTTP_COOKIE'}) { my @cookies = split(/; /,$ENV{'HTTP_COOKIE'}); foreach(@cookies) { my($name,$value) = split(/=/,$_); $COOKIE{$name} = $value; } } } sub login_head{ &head unless(($act eq "multi_view") && ($FORM{'mv.x'} ne "")); print "

 

 \n"; &Thead("430","$CONF{'cel_color1'}","0","0"); print "\n"; &Thead("100%","$CONF{'head_color'}","0","0"); print "\n"; &Tfoot; &Thead("100%","$CONF{'cel_color1'}","2","0"); } sub login_foot{ &Thead("","","2","0"); print "ºñ¹Ð¹øÈ£\n"; print &Input("password","passwd","","","","10",""); print "\n"; print &Input("submit",""," È® ÀÎ "); print "\n"; &Tfoot; &Ffoot; print "\n"; &Tfoot; &Thead("100%","$CONF{'head_color'}","0","0"); print "\n"; &Tfoot; print "\n"; &Tfoot; print "

\"±Û

\n"; print "



\n"; &foot unless(($act eq "multi_view") && ($FORM{'mv.x'} ne "")); } sub open_login { my $subject = $_[0]; &login_head; print "

ºñ°ø°³±Û '$subject'(À»)¸¦ ÀнÀ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "view"); print &Input("hidden","page", "$FORM{'page'}"); print &Input("hidden","number", "$FORM{'number'}"); print &Input("hidden","simple", "$FORM{'simple'}"); print &Input("hidden","img", "$FORM{'img'}"); print &Input("hidden","category", "$FORM{'category'}"); print &Input("hidden","keyword", "$FORM{'keyword'}"); print &Input("hidden","start_num", "$FORM{'start_num'}"); &login_foot; } sub admin_login { &login_head; print "

°ü¸®ÀÚ ¸ðµå·Î Á¢¼ÓÇÕ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "loginok"); &login_foot; } sub admin_chkdel { my(@del_num); &login_head; print "

üũµÈ Ç׸ñÀ» »èÁ¦ÇÕ´Ï´Ù.
°ü¸®ÀÚ ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.\n"; &Fhead("POST","$cgi_url"); my $cnt = 0; for (0..$CONF{'page_num'}-1){ my($chk_num) = "num_val$_"; if($FORM{$chk_num}){ $del_num[$cnt] = "$FORM{$chk_num}"; print &Input("hidden","$chk_num","$del_num[$cnt]"); $cnt++; } } print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "multi_del"); print &Input("hidden","page","$page"); print &Input("hidden","total_val","$FORM{'total_val'}"); print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); print &Input("hidden","start_num","$FORM{'start_num'}"); &login_foot; } sub admin_ok { &login_head; print "

°øÁö»çÇ×À» ¼öÁ¤ÇÕ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "admin_modify_form"); &login_foot; } sub etc_del { &login_head; print "

°£´ÜÀÇ°ßÀ» »èÁ¦ÇÕ´Ï´Ù.
°ü¸®ÀÚ ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","page","$page"); print &Input("hidden","img","$FORM{'img'}"); print &Input("hidden","number","$FORM{'number'}"); print &Input("hidden","sun","$FORM{'sun'}"); if($FORM{'category'} ne ""){ print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); } print &Input("hidden","action", "delete_etc"); &login_foot; } sub admin_remove { &login_head; print "

°øÁö»çÇ×À» »èÁ¦ÇÕ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "admin_remove_ok"); &login_foot; } sub etcall_del{ &login_head; print "

°£´ÜÀÇ°ßÀ» »èÁ¦ÇÕ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "etcdel_ok"); print &Input("hidden","number","$FORM{'num'}"); print &Input("hidden","page", "$FORM{'page'}"); &login_foot; } sub modify{ &login_head; print "

±ÛÀ» ¼öÁ¤ÇÕ´Ï´Ù.
ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action", "passok"); print &Input("hidden","page","$page"); print &Input("hidden","number", "$FORM{'number'}"); print &Input("hidden","simple","$FORM{'simple'}"); &login_foot; } sub passok{ my(@filea, $pass); $pass = crypt($FORM{'passwd'},"sp"); open(FILE,"$main_dir/data/$FORM{'number'}"); chomp(@filea = ); close (FILE); if($FORM{'passwd'} eq ""){ &error("pass"); }elsif(($filea[0] eq $pass) || ($CONF{'admin_pwd'} eq $pass)) { &modify_form; }else{ &error("pass"); } } sub write { if(($FORM{'name'} eq "") || ($FORM{'comments'} eq "")||($FORM{'subject'} eq "")){ &error; } print "Set-Cookie: UN=$FORM{'name'}; expires=Sunday, 12-Dec-2002 12:12:12 GMT;\r\n"; print "Set-Cookie: UM=$FORM{'email'}; expires=Sunday, 12-Dec-2002 12:12:12 GMT;\r\n"; print "Set-Cookie: UH=$FORM{'homepage'}; expires=Sunday, 12-Dec-2002 12:12:12 GMT;\r\n"; my($pass) = crypt($FORM{'passwd'},"sp"); if(($CONF{'admin_only'} eq "yes") && ($CONF{'admin_pwd'} ne $pass)){ &error("admin"); } local($org_name, $size); if($FORM{'file_name'} ne ""){ if($FORM{'link_file'} eq ""){ &upload_file; } else{ &error("double"); } } elsif($FORM{'link_file'} ne ""){ unless(($FORM{'link_file'} =~ /^http:\/\//) || ($FORM{'link_file'}=~ /^ftp:\/\//)) { &error("link"); } } unless(($FORM{'email'} eq "") || ($FORM{'email'} =~ /.*\@.*\..*/)){ &error("email"); } my @not_tag = qw(name email homepage subject pre_view link_file); for (@not_tag) { $FORM{$_} =~ s/<([^>]|\n)*>//g; } #----------------------------- µ¿±ÛÀÌ ¸¹ÀÌ ¾µ½Ã ¿¡·¯¸Þ¼¼Áö º¸³»±â... ^^ if($CONF{'dgr_ok'} eq "yes"){ my $chk_cnt = 0; while($FORM{'comments'} =~ /[\xA1-\xFE][^~]~/g){ $chk_cnt++; } &error("dgr") if($chk_cnt > 50); } #------------------------------------------------------------------- #$FORM{'comments'} =~ s/&/&amp;/g; $FORM{'comments'} =~ s/
/<br>/g; $FORM{'comments'} =~ s/\r\n/
/g; &com124('name', 'email', 'homepage', 'subject', 'comments', 'pre_view', 'link_file'); ####################################################### my(@sub_data, @num, $num, $home); if($FORM{'subnumber'} eq "") { &read_idx; @num_data = split(/\./,$ary[0]); $num = $num_data[0] || "1"; while(-e "$main_dir/data/$num.cgi"){ $num++; } } else{ while(-e "$main_dir/data/$FORM{'subnumber'}.cgi"){ @sub_data = split(/-/,"$FORM{'subnumber'}"); $sub_data[$#sub_data]++; $FORM{'subnumber'} = join("-",@sub_data); } } ####################################################### $home = (($FORM{'homepage'} ne "") && ($FORM{'homepage'} ne "http://")) ? "$FORM{'homepage'}" : ""; &get_date; my(@est, @mail, @adata, @filea, $count); if($FORM{'subnumber'} eq "") { &lock; open(WFILE,">$main_dir/data/$num.cgi"); print WFILE "$pass\n"; print WFILE "$FORM{'name'}|$FORM{'email'}|$home|$FORM{'subject'}|$date||\n"; print WFILE "$FORM{'html'}|$FORM{'comments'}\n"; print WFILE "|||||\n"; print WFILE "$FORM{'auto_link'}|$FORM{'auto_br'}|$FORM{'open'}|\n"; print WFILE "|$FORM{'ip'}|$FORM{'domain'}|$FORM{'pre_view'}|$FORM{'link_file'}|$org_name|$size|\n"; close(WFILE); &unlock; &index_plus("$num.cgi"); } else { open(Sum,"$main_dir/data/$FORM{'num'}"); chomp(@est = ); close(Sum); @mail = split(/\|/,$est[1]); local $addr = $mail[1]; open(NUM,"$main_dir/num/$FORM{'num'}"); chomp(@num = ); close(NUM); @ans_data = split(/\|/,$num[0]); $ans_data[0]++; open(Suma,">$main_dir/num/$FORM{'num'}"); print Suma join("|",@ans_data); close(Suma); &lock; open(WFILE,">$main_dir/data/$FORM{'subnumber'}.cgi"); print WFILE "$pass\n"; print WFILE "$FORM{'name'}|$FORM{'email'}|$home|$FORM{'subject'}|$date||\n"; print WFILE "$FORM{'html'}|$FORM{'comments'}\n"; print WFILE "0\n"; print WFILE "$FORM{'auto_link'}|$FORM{'auto_br'}|$FORM{'open'}|\n"; print WFILE "|$FORM{'ip'}|$FORM{'domain'}|$FORM{'pre_view'}|$FORM{'link_file'}|$org_name|$size|\n"; close(WFILE); &unlock; &index_plus("$FORM{'subnumber'}.cgi"); if(($addr) && ($CONF{'sendmail_ok'} == "yes") && ($FORM{'mail_notice'} ne "1")) { &sendmail if($NT ne "1"); } if(($addr) && ($FORM{'mail_notice'} eq "1")){ &mail_notice if($NT ne "1"); } } my $num_data = ($FORM{'subnumber'} ne "") ? "$FORM{'subnumber'}.cgi" : "$num.cgi"; &send_gul("$CONF{'admin_mail'}", "$num_data") if(($CONF{'admin_sender'} eq "yes") && ($NT ne "1")); &load_page; } sub read_idx{ open(INDEX, "$main_dir/idx/index.cgi"); chomp(@ary = ); close(INDEX); if($ary[0] eq ""){ mkdir("$main_dir/idx",0777); &make_idx; } } sub index_plus{ my(@idx_list, $plus_num, $cnt, $list, $start, $num_data); $plus_num = "$_[0]"; open(IDX_DATA,"$main_dir/idx/index.cgi"); chomp(@idx_list = ); close(IDX_DATA); unshift(@idx_list,$plus_num); #------------------------------------ ¾´±Û ³Ñ¹ö ¹è¿­¿¡ Ãß°¡... ^.^ $cnt = 0; foreach $list(@idx_list) { $list =~ s/.cgi//g; $idx[$cnt] = $list; $cnt++; } @idx = sort {($b <=> $a) || ($a cmp $b)}(@idx); $num_data = $#idx_list+1; if($num_data > $CONF{'max_data'}){ #ÃÖ´ë µ¥ÀÌŸ·® ÃÊ°ú½Ã ÆÄÀÏ »èÁ¦... ^^ while($num_data > $CONF{'max_data'}){ open(DEL,"$main_dir/data/$idx[$#idx_list]"); my @del = ; close(DEL); my @del_file = split(/\|/,$del[5]); unlink("$main_dir/files/$del_file[5].cgi"); unlink("$main_dir/data/$idx[$#idx_list].cgi"); unlink("$main_dir/num/$idx[$#idx_list].cgi"); unlink("$main_dir/etc/$idx[$#idx_list].cgi"); pop(@idx); $num_data--; } } &lock; open(DATA, ">$main_dir/idx/index.cgi"); print DATA join(".cgi\n",@idx).".cgi"; close(DATA); for(1..10){ open(PAGE,">$main_dir/idx/$_.cgi"); $start = ($_ - 1)*$CONF{'page_num'}; for(0..$CONF{'page_num'}-1){ last if($idx[$start+$_] eq ""); print PAGE "$idx[$start+$_].cgi\n"; } close(PAGE); } open(NUM,">$main_dir/idx/num.cgi"); print NUM $num_data; close(NUM); &unlock; } sub make_idx{ my(@num_data, @ary, $list_data, $cnt); #---------------------------À妽º »ý¼º ( Àüü ÆäÀÌÁö)------------------------ opendir(DIR, "$main_dir/data"); @num_data = grep(!/^\.{1,2}$/, readdir(DIR)); #µ¥ÀÌŸ¸¦ ¹øÈ£¼øÀ¸·Î Á¤·Ä... ^.^ closedir(DIR); $cnt = 0; foreach $list_data(@num_data) { $list_data =~ s/.cgi//g; $ary[$cnt] = $list_data; $cnt++; } @ary = sort {($b <=> $a) || ($a cmp $b)} @ary; &lock; open (INDEX, ">$main_dir/idx/index.cgi"); print INDEX join(".cgi\n",@ary).".cgi" if($ary[0] ne ""); close(INDEX); &unlock; #---------------------------À妽º »ý¼º ³¡ --------------------------------------------------- } sub upload_file { my(@a, @b, @fname_chk, $upfile, $t, $filename); $upfile = $FORM{'file_name'}; chop($upfile); chop($upfile); @a = split(/\"/,$real_file); @b = split(/\\/,$a[3]); $t = @b; $org_name = ($b[$t-1]); $org_name =~ tr/ /_/; #ÆÄÀÏ¿¡ ºóÄ­ÀÌ Á¸Àç½Ã.... $filename = "$main_dir/files/".$org_name; @fname_chk = split(/\./,$org_name); if(($NT && (($fname_chk[$#file_chk] eq "cgi") || ($fname_chk[$#file_chk] eq "pl") || ($fname_chk[$#file_chk] eq "asp") || $fname_chk[$#file_chk] =~ "php")) || ($fname_chk[$#file_chk] =~ "php")){ $filename .= ".txt"; $org_name .= ".txt"; } if(-e $filename){ &error("exist"); } open(FILE, ">$filename"); binmode FILE; print FILE $upfile; close FILE; $size = (-s "$main_dir/files/$org_name"); if($size > ($CONF{'max_size'}*1048576)){ unlink("$main_dir/files/$org_name"); &error("size"); } if($size >= 1048576) { $size = substr(($size/1048576),0,3); @dot=split(/\./,$size); $size = $dot[1] ? "$size MB" : "$dot[0] MB"; } elsif($size >= 1024) { $size = substr(($size/1024),0,3); @dot=split(/\./,$size); $size = $dot[1] ? "$size KB" : "$dot[0] KB"; } else{ $size = "$size byte"; } } sub modify_ok { if(($FORM{'name'} eq "") || ($FORM{'comments'} eq "")|| ($FORM{'subject'} eq "")) { &error; } my(@not_tag, $mod_date); @not_tag = qw(name email homepage subject pre_view link_file); for (@not_tag) { $FORM{$_} =~ s/<([^>]|\n)*>//g; } # $FORM{'comments'} =~ s/&/&/g; $FORM{'comments'} =~ s/
/<br>/g; $FORM{'comments'} =~ s/\r\n/
/g; &com124('name', 'email', 'homepage', 'subject', 'comments', 'pre_view', 'link_file'); &get_date; $mod_date = $date; &lock; open(WFILE,">$main_dir/data/$FORM{'number'}"); print WFILE "$FORM{'passwd'}\n"; print WFILE "$FORM{'name'}|$FORM{'email'}|$FORM{'homepage'}|$FORM{'subject'}|$FORM{'date'}|$mod_date|\n"; print WFILE "$FORM{'html'}|$FORM{'comments'}\n"; print WFILE "$FORM{'ansnum'}\n"; print WFILE "$FORM{'auto_link'}|$FORM{'auto_br'}|$FORM{'open'}||\n"; print WFILE "|$FORM{'ip'}|$FORM{'domain'}|$FORM{'pre_view'}|$FORM{'link_file'}|$FORM{'file_name'}|$FORM{'file_size'}|$FORM{'down_num'}|\n"; close(WFILE); &unlock; &load_page; } sub adminwrite { my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} eq "$pass"){ if(($FORM{'die_year'} ne "") && ($FORM{'die_mon'} ne "") && ($FORM{'die_day'} ne "")){ if(($FORM{'subject'} ne "") && ($FORM{'comments'} ne "")) { $FORM{'subject'} =~ s/<([^>]|\n)*>//g; # $FORM{'comments'} =~ s/&/&/g; $FORM{'comments'} =~ s/
/<br>/g; $FORM{'comments'} =~ s/\r\n/
/g; &com124('subject', 'comments', 'die_year', 'die_mon', 'die_day'); open (NOTICE, "$main_dir/notice.cgi"); $notice_data = ; close (NOTICE); if(($notice_data ne "") && ($FORM{'read_num'} eq "")){ unlink("$main_dir/notice.cgi"); unlink("$main_dir/num/notice.cgi"); unlink("$main_dir/etc/notice.cgi"); } &get_date; open(WFILE,">$main_dir/notice.cgi"); print WFILE "$FORM{'html'}|$FORM{'subject'}|$FORM{'comments'}|$date|$FORM{'die_year'}:$FORM{'die_mon'}:$FORM{'die_day'}|\n"; print WFILE "$FORM{'auto_link'}|$FORM{'auto_br'}|\n"; close(WFILE); &load_page; } else{ &error("notice"); } } else{ &error("date"); } } else{ &error("ok_admin"); } } sub reply_form { my(@repl, @repla, @seper, @arp, $tomail, $html_val, $alink, $abr, $open_ok, $open_val, $link_val, $br_val, $scut, $ford); &read_cookie; &head; open(REPLY, "$main_dir/data/$FORM{'number'}"); @repl = ; close(REPLY); @repla = split(/\|/, $repl[1]); $tomail = "$repla[1]"; @seper = split(/\|/, $repl[2]); $seper[1] =~ s/
/\n¢°/g; # $seper[1] =~ s/\n¢°


/\n
/g; $seper[1] =~ s/&/&/g; chomp($seper[1]); $repla[3] =~ s/\"/ /g; $html_val = ($seper[0] eq "1") ? "checked" : ""; @auto = split(/\|/,$repl[4]); $alink = $auto[0]; $abr = $auto[1]; $open_ok = $auto[2]; if($open_ok eq "no"){ $open_val = &Input("hidden","open","no");; } else{ $open_val = "" if($CONF{'scr_opt'} eq "yes"); } $link_val = ($alink eq "1") ? "checked" : ""; $br_val = ($abr eq "1") ? "checked" : ""; @arp = split(/-/,$FORM{'number'}); $scut = @arp; if($scut > 0) { $ford = "¢Ñ ";} if($CONF{'admin_only'} eq "yes"){ print "

[¾Ë¸²!!!] ÀÌ °Ô½ÃÆÇÀº ÇöÀç °ü¸®ÀÚ¸¸ ±ÛÀ» ¾µ¼ö ÀÖ°Ô ¼³Á¤µÇ¾ú½À´Ï´Ù.\n"; } my($name, $email, $home_val, $password, $html_chk, $auto_link, $auto_br, $subject, $preview, $mail_notiece, $comment, $upfile, $linkfile, $sub_btn, $reset_btn); $name = &Input("text","name","$COOKIE{'UN'}","","","14","30"); $email = &Input("text","email","$COOKIE{'UM'}","","","26",""); $home_val = $COOKIE{'UH'} ? "$COOKIE{'UH'}" : "http:\/\/"; $password = &Input("password","passwd","","","","10",""); $html_chk = &Checkbox("html", "1", "$html_val"); $auto_link = &Checkbox("auto_link", "1", "$link_val"); $auto_br = &Checkbox("auto_br", "1", "$br_val"); $subject = &Input("text", "subject","$ford$repla[3]","","","70",""); $preview = &Input("text", "pre_view","http:\/\/","","","70",""); $mail_notice = &Checkbox("mail_notice","1","checked"); $comment = &Textarea("70","8","comments","","","¢°[$repla[0]´Ô²²¼­ ³²±ä ³»¿ë]\n¢°$seper[1]\n\n"); $upfile = &Input("file","file_name","","","","54",""); $linkfile = &Input("text", "link_file","","","","54",""); $sub_btn = &Input("submit",""," ±Û ¿Ã¸² "); $reset_btn = &Input("reset","","´Ù½ÃÀû±â "); &input_java; # &Fhead("POST","$cgi_url","multipart/form-data","form"); print ""; print &Input("hidden","subnumber","$FORM{'subnumber'}"); print &Input("hidden","action","write"); print &Input("hidden","num","$FORM{'number'}"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","page","$page"); print &Input("hidden","ip","$ENV{'REMOTE_ADDR'}"); print &Input("hidden","domain","$ENV{'HTTP_USER_AGENT'}"); &Thead("","$CONF{'head_color'}","3",""); print "¨Ú $repla[0]´Ô²²¼­ ³²±â½Å ±Û¿¡´ëÇÑ ´äº¯ ÀÛ¼º\n"; print "\n"; &Thead("","$CONF{'head_color'}","2","2"); print "ÀÌ      ¸§$name\n"; print "   e-mail $email\n"; print "ȨÆäÀÌÁö\n"; print &Input("text","homepage","$home_val","","","51",""); print "\n"; print "ºñ¹Ð¹øÈ£$password $html_chkhtmlÇã¿ë $auto_linkÀÚµ¿¸µÅ© $auto_brÀÚµ¿ÁÙ¹Ù²Þ     $open_val\n"; print "Á¦      ¸ñ$subject\n"; print "¹Ì¸®º¸±â$preview\n" if($CONF{'pds_ok'} eq "yes"); print " $mail_notice ´äº¯±Û ¸ÞÀÏ·Î º¸³»±â\n" if(($tomail ne "") && ($NT ne "1")); print "
³»      ¿ë$comment\n"; &call_dgr; print "
µ¿ ±Û ÀÌ$dongury_tbl\n" if($CONF{'dgr_ok'} eq "yes"); print "
Ư¼ö¹®ÀÚ$chr_tbl\n"; print "ÆÄÀÏ÷ºÎ$upfile\n" if($CONF{'pds_ok'} eq "yes"); print "¸µÅ©ÆÄÀÏ$linkfile [ ÃÖ´ë $CONF{'max_size'} MB ]\n" if($CONF{'pds_ok'} eq "yes"); print "$sub_btn $reset_btn\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } sub get_date { @week = qw(ÀÏ ¿ù È­ ¼ö ¸ñ ±Ý Åä); ($min,$hour,$mday,$mon,$year,$wday) = (localtime)[1,2,3,4,5,6]; $mon++; $year += 1900; $date = sprintf("%04d/%02d/%02d [%02d:%02d]", $year,$mon, $mday, $hour, $min); $week_val = "$week[$wday]"; } sub load_page{ &head; if($FORM{'simple'} eq "yes"){ my $want_link = ($act eq "modify_ok") ? "$cgi_url?id=$FORM{'id'}&action=view&number=$FORM{'number'}&simple=yes" : "$cgi_url?id=$FORM{'id'}&action=simple_ok"; $want_link = "$cgi_url?id=$FORM{'id'}&action=simple_ok&kind=send" if($send_end); print "\n"; } else{ my $ttv = "&total_val=$FORM{'total_val'}" if("$FORM{'total_val'}"); my $shr_val = "&action=search&category=$FORM{'category'}&keyword=$FORM{'keyword'}&start_num=$FORM{'start_num'}" if("$FORM{'category'}"); print "\n"; } print "

 

 

 


\n"; print "Loading ......\n"; print "
\n"; print "

¢¸¢¸ ¹æ¸í·ÏÀ¸·Î µ¹¾Æ°¡±â

\n" if($FORM{'simple'} ne "yes"); &foot; } sub simple_ok{ &head; print "

\n"; &Thead("","","0","0",); print "\n"; my($msg) = ($FORM{'kind'} eq "send") ? "Ã漺! ¹è´Þ ¿Ï·á ÇÏ¿´½À´Ï´Ù!" : "»èÁ¦¸¦ ¿Ï·áÇß±¸¸ÕÀ¯~"; print "$msg\n"; print "



\n"; &Tfoot; print "

\n"; &foot; } sub search { if($FORM{'keyword'} eq ""){ &error("keyword"); } my(@gul_data, @line1, @line2, @line3, @search_list, $search_data, $category, $resent_num, $last_num); local(@ary, $down_col, $pnt_col, $all_list, $cou, $list_num, $total_page); if($CONF{'down_view'} eq "yes"){ $down_col="´Ù¿î"; } if($CONF{'point_ok'} eq "yes"){ $pnt_col="Ãßõ"; } &read_idx; $all_list = @ary; $cou = 0; $start_num = $FORM{'start_num'} ? "$FORM{'start_num'}" : "0"; $end_num = $start_num + $CONF{'find_interval'} - 1; if($start_num > $all_list){ &head; print "





\n"; print "$all_list°³ÀÇ ¸ðµç±ÛÀ» °Ë»öÇÏ¿´½À´Ï´Ù...

°Ë»öÇÒ µ¥ÀÌŸ°¡ ÀÌÁ¦ ´õÀÌ»ó ¾ø½À´Ï´Ù....



"; print "
\"±Û¸ñ·Ï
\n"; print "



\n"; &foot; } for($start_num..$end_num){ last if($ary[$_] eq ""); open(LIST, "$main_dir/data/$ary[$_]"); @gul_data = ; @line1 = split(/\|/, $gul_data[1]); @line2 = split(/\|/, $gul_data[2]); @line3 = split(/\|/, $gul_data[5]); close (LIST); if($FORM{'category'} eq "sub_cmt"){ $search_data = $line1[3]." ". $line2[1]; } else{ if($FORM{'category'} eq "name") { $search_data =$line1[0]; #À̸§°Ë»ö } elsif($FORM{'category'} eq "subject") { $search_data=$line1[3]; #Á¦¸ñ°Ë»ö } elsif($FORM{'category'} eq "comment") { $search_data =$line2[1]; #³»¿ë°Ë»ö } elsif($FORM{'category'} eq "ip") { $search_data = $line3[1]; } } if($search_data =~ /$FORM{'keyword'}/io) { $search_list[$cou] = $ary[$_]; $cou++; } } #--------------------------------------------------------------------------------------------------- @ary = undef; @ary = @search_list; $total_page = int($cou/$CONF{'page_num'}); if(($total_page*$CONF{'page_num'}) < $cou) {$total_page += 1; } $page = $total_page if("$FORM{'total_val'}"); $total_page = 1 if($total_page == 0); &head; $list_num = @ary; if(@quick_id){ &quick_btn; } else{ print "
°Ë»ö¾î $FORM{'keyword'}    °Ë»ö°á°ú $cou°³
\n"; } &print_list; $resent_num = $start_num + 1; $last_num= $end_num + 1; print "
\"±Û¸ñ·Ï
\n"; print "

ÃÖ±Ù $resent_num°³ºÎÅÍ $last_num°³±îÁöÀÇ °Ô½Ã¹°¿¡¼­ À§¿Í°°Àº µ¥ÀÌŸ°¡ °Ë»öµÇ¾ú½À´Ï´Ù.
´ÙÀ½ $CONF{'find_interval'}°³ÀÇ °Ô½Ã¹°¿¡¼­ ªO±â ¿øÇÏ½Ã¸é ¾Æ·¡ 'search'¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.
" if($all_list > $CONF{'find_interval'}); &find if($CONF{'search_ok'} eq "yes"); &foot; } #--------- | ¹®ÀÚ Á¦°Å ÇÔ¼ö... ^.^ sub com124{ my @com_list = @_; foreach $list(@com_list){ $FORM{$list} =~ s/\|/|/g; } } sub find { my($start_num, $sc_val, $sub_val, $name_val, $com_val, $ip_val, $keywd); $start_num = $FORM{'start_num'} + $CONF{'find_interval'} if($FORM{'start_num'} ne ""); $start_num = 0 if($FORM{'start_num'} eq ""); if($all_list > $CONF{'find_interval'}){ if($FORM{'category'} eq "sub_cmt"){ $sc_val = "selected"; } elsif($FORM{'category'} eq "subject"){ $sub_val = "selected"; } elsif($FORM{'category'} eq "name"){ $name_val = "selected"; } elsif($FORM{'category'} eq "comment"){ $com_val = "selected"; } elsif($FORM{'category'} eq "ip"){ $ip_val = "selected"; } $keywd = "$FORM{'keyword'}"; } &Fhead("POST","$cgi_url"); &Thead("","","2","0"); print "\n"; print "\n" if(($all_list > $CONF{'find_interval'}) || ($list_num > $CONF{'find_interval'})); print "\n"; print "\n"; print "\n"; print "\n"; &Tfoot; &Ffoot; } sub quick_btn{ print "\n"; &Thead("100%","","2","0"); if($act ne "search"){ print "\n"; } else{ print " \n"; print "°Ë»ö¾î $FORM{'keyword'}    °Ë»ö°á°ú $cou°³\n"; print "\n"; } print "
\n"; print "\n"; &Tfoot; } sub top_btn{ my($kind, $total_data, $search_val, $prev_img, $next_img, $prev_link, $next_link); $kind = $_[0]; $total_data = $FORM{'category'} ? "$cou" : "$list_num"; $search_val = $FORM{'category'} ? "&action=search&category=$FORM{'category'}&keyword=$FORM{'keyword'}&start_num=$FORM{'start_num'}" : ""; $prev_img = "\"ÀÌÀü"; $next_img = "\"´ÙÀ½"; $prev_link = ($page eq "1") ? "$prev_img" : "$prev_img"; $next_link = ($page eq "$total_page") ? "$next_img" : "$next_img"; #---------------------------- ±Û¾²±â, ÀÌÀü ÆäÀÌÁö, ´ÙÀ½ÆäÀÌÁö ³ª¿À´Â °÷... &Thead("100%","","1","0"); print "\"±ÛTotal $total_dataarticles [ $page/$total_page page ]$prev_link$next_link\n"; &Tfoot; &Thead("100%","$CONF{'head_color'}","0","0"); print "\n"; &Tfoot; } sub erase { &login_head; print "

ºñ¹Ð¹øÈ£¸¦ Àû¾î Áֽðí È®ÀÎ ¹öÆ°À» ´­·¯ ÁÖ¼¼¿ä.

\n"; print "
  • ±Û $FORM{'subject'}¸¦ »èÁ¦ÇÕ´Ï´Ù.\n"; print "
  • À̱ÛÀÇ ´äº¯ ±Û±îÁö ¸ðµÎ »èÁ¦µË´Ï´Ù
\n"; &Fhead("POST","$cgi_url"); print &Input("hidden", "action", "eraseok"); print &Input("hidden", "page","$FORM{'page'}"); print &Input("hidden", "id","$FORM{'id'}"); print &Input("hidden", "number","$FORM{'number'}"); print &Input("hidden", "simple","$FORM{'simple'}"); &login_foot; } sub eraseok { if($FORM{'passwd'} eq "") { &error("pass"); } my(@filea, @seper, @num_data, @ans_data, $pass, $ans_num, $num); $pass = crypt($FORM{'passwd'},"sp"); open(FILE,"$main_dir/data/$FORM{'number'}"); @filea = ; @seper = split(/\|/,$filea[5]); close (FILE); unlink ("$main_dir/files/$seper[5]"); chop($filea[0]); open(FILE,"$main_dir/num/$FORM{'number'}"); @num_data = ; @ans_data = split(/\|/,$num_data[0]); close (FILE); $ans_num = $ans_data[0]; if(($filea[0] eq $pass) || ($CONF{'admin_pwd'} eq $pass)) { $num = "$FORM{'number'}"; &lock; if($ans_num > 0) { &auto_erase("$num"); } unlink("$main_dir/data/$num"); unlink ("$main_dir/num/$num"); unlink ("$main_dir/etc/$num"); #-------------------------------------------- »èÁ¦½Ã À妽º »©±â... my(@idx_list, @data_list, $list, $k, $num_data, $start); open(INDEX, "$main_dir/idx/index.cgi"); @idx_list = ; close(INDEX); chomp(@idx_list); open(DATA, ">$main_dir/idx/index.cgi"); $k = 0; foreach $list(@idx_list) { if($list ne "$FORM{'number'}"){ print DATA "$list\n"; $data_list[$k] = $list; $k++; } } close(DATA); #------------------------------------------------ $num_data = $#data_list+1; open(NUM,">$main_dir/idx/num.cgi"); print NUM $num_data; close(NUM); #------------------------- ÆäÀÌÁöº° À妽º Á¤¸® for(1..10){ open(PAGE,">$main_dir/idx/$_.cgi"); $start = ($_ - 1)*$CONF{'page_num'}; for(0..$CONF{'page_num'}-1){ print PAGE "$data_list[$start+$_]\n"; } close(PAGE); } &unlock; #----------------------------------------- &load_page; } else { &error("pass"); } } sub admin_remove_ok { my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} ne $pass) { &error("pass"); } unlink("$main_dir/notice.cgi"); unlink("$main_dir/num/notice.cgi"); unlink("$main_dir/etc/notice.cgi"); &load_page; } sub etcdel_ok{ my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} ne $pass) { &error("pass"); } unlink("$main_dir/etc/$FORM{'number'}"); if($FORM{'number'} eq "notice.cgi"){ &view_notice; } else{ &view; } } sub delete_etc{ my($pass) = crypt($FORM{'passwd'},"sp"); if($CONF{'admin_pwd'} ne $pass) { &error("pass"); } my(@etc_data, $cnt, $search_opt, $goto_url); open(ETC, "$main_dir/etc/$FORM{'number'}"); @etc_data = ; close(ETC); $cnt = 0; open(WRITE, ">$main_dir/etc/$FORM{'number'}"); for(0..$#etc_data){ print WRITE "$etc_data[$_]" unless($cnt eq "$FORM{'sun'}"); $cnt++; } close(WRITE); if($FORM{'number'} ne "notice.cgi"){ $search_opt = $FORM{'category'} ? "&category=$FORM{'category'}&keyword=$FORM{'keyword'}" : ""; $goto_url = "$cgi_url?id=$FORM{'id'}&page=$FORM{'page'}&action=view&number=$FORM{'number'}&cnt=no&img=$FORM{'img'}$search_opt"; } else{ $goto_url = "$cgi_url?id=$FORM{'id'}&action=view_notice&cnt=no"; } &head; print "\n"; print "

 

 

 


\n"; print "Loading ......\n"; print "
\n"; print "

¢¸¢¸ °Ô½ÃÆÇÀ¸·Î µ¹¾Æ°¡±â

\n" if($FORM{'simple'} ne "yes"); &foot; } sub auto_erase{ #°ü·Ã±Û ÀÚµ¿ »èÁ¦ ÇÔ¼ö ^.^ my(@ldata, @file_data, $num, $same_num, $find_same); $num = $_[0]; $num =~ s/.cgi//g; &read_idx; $same_num=length($num)+1; open(DATA, ">$main_dir/idx/index.cgi"); for(0..$#ary){ $find_same=substr($ary[$_],0,$same_num); if("$num-" eq $find_same){ open(FILE,"$main_dir/$ary[$_]"); @ldata = ; @file_data = split(/\|/,$ldata[5]); close (FILE); unlink "$main_dir/data/$ary[$_]"; unlink "$main_dir/num/$ary[$_]"; unlink "$main_dir/etc/$ary[$_]"; } else{ print DATA "$ary[$_]\n"; } } close(DATA); } #=================================== ÆäÀÌÁö À̵¿ ÇÔ¼ö ^.^ sub pagemove{ my($search_val) = ($act eq "search") ? "&action=search&category=$FORM{'category'}&keyword=$FORM{'keyword'}&start_num=$FORM{'start_num'}" : ""; my ($interval, $start, $end, $prev, $next, $next_opt); &Thead("","","2","0"); print ""; $interval = 10; $start = (int(($page-1)/$interval))*$interval + 1; $end = $start + $interval -1; if($total_page <= $end){ $end = $total_page; $next_opt = "no" } if($start == 1){ print "[ÀÌÀü]..."; } else{ $prev = $start - 1; print "[First]"; print "[ÀÌÀü]..."; } for($start..$end){ if($page eq $_){ print "[$_]"; } else{ print "[$_]"; } } if($next_opt eq "no"){ print "...[´ÙÀ½]"; } else{ $next = $end + 1; print "...[´ÙÀ½]"; print "[Last]"; } print ""; &Tfoot; } sub loginok { my($pass) = crypt($FORM{'passwd'},"sp"); if($pass eq $CONF{'admin_pwd'}) { &head; print "

 

 \n"; print "°ü¸®ÀÚ ¸ðµå·Î Á¢¼ÓÇÏ¿´½À´Ï´Ù.

\n"; print "¿øÇÏ´Â Ç׸ñÀ» ¼±ÅÃÇϽðí \"LET'S GO!!!\"¹öÆ°À» ´­·¯ÁÖ¼¼¿ä!\n"; &Fhead("POST", "$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","passwd","$pass"); print "\n"; print &Input("submit","","LET'S GO!!!"); &Ffoot; print "

 

 \n"; &foot; } else { &error("pass"); } } sub admin_conf { my($board_left, $board_center, $board_right, $only_yes, $only_no, $ip_yes, $ip_no, $point_yes, $point_no, $etc_yes, $etc_no, $io_yes, $io_no, $pds_yes, $pds_no, $dv_yes, $dv_no, $kv_yes, $kv_no, $smail_yes, $smail_no, $search_yes, $search_no, $speed_yes, $speed_on); if($FORM{'passwd'} eq $CONF{'admin_pwd'}){ if($CONF{'left_right'} eq "left"){ $board_left = "selected"; $board_center = ""; $board_right = ""; } elsif($CONF{'left_right'} eq "center"){ $board_left = ""; $board_center = "selected"; $board_right = ""; } else{ $board_left = ""; $board_center = ""; $board_right = "selected"; } if($CONF{'admin_only'} eq "yes"){ $only_yes = "selected"; $only_no = ""; } else{ $only_yes = ""; $only_no = "selected"; } if($CONF{'view_ip'} eq "yes"){ $ip_yes = "selected"; $ip_no = ""; } else{ $ip_yes = ""; $ip_no = "selected"; } if($CONF{'point_ok'} eq "yes"){ $point_yes = "selected"; $point_no = ""; } else{ $point_yes = ""; $point_no = "selected"; } if($CONF{'etc_ok'} eq "yes"){ $etc_yes = "selected"; $etc_no = ""; } else{ $etc_yes = ""; $etc_no = "selected"; } if($CONF{'dgr_ok'} eq "yes"){ $dgr_yes = "selected"; $dgr_no = ""; } else{ $dgr_yes = ""; $dgr_no = "selected"; } if($CONF{'i_opt'} eq "yes"){ $io_yes = "selected"; $io_no = ""; } else{ $io_yes = ""; $io_no = "selected"; } if($CONF{'scr_opt'} eq "yes"){ $scr_yes = "selected"; $scr_no = ""; } else{ $scr_yes = ""; $scr_no = "selected"; } if($CONF{'pds_ok'} eq "yes"){ $pds_yes = "selected"; $pds_no = ""; } else{ $pds_yes = ""; $pds_no = "selected"; } if($CONF{'down_view'} eq "yes"){ $dv_yes = "selected"; $dv_no = ""; } else{ $dv_yes = ""; $dv_no = "selected"; } if($CONF{'kind_view'} eq "yes"){ $kv_yes = "selected"; $kv_no = ""; } else{ $kv_yes = ""; $kv_no = "selected"; } if($CONF{'sendmail_ok'} eq "yes"){ $smail_yes = "selected"; $smail_no = ""; } else{ $smail_yes = ""; $smail_no = "selected"; } if($CONF{'admin_sender'} eq "yes"){ $asender_yes = "selected"; $asender_no = ""; } else{ $asender_yes = ""; $asender_no = "selected"; } if($CONF{'search_ok'} eq "yes"){ $search_yes = "selected"; $search_no = ""; } else{ $search_yes = ""; $search_no = "selected"; } if($CONF{'speed_up'} eq "no"){ $speed_yes = ""; $speed_no = "selected"; } else{ $speed_yes = "selected"; $speed_no = ""; } my($pass) = &Input("password","admin_pwd","","","","13",""); my($pass_eq) = &Input("password","admin_pwd_eq","","","","13",""); my($msize_val) = &Input("text","max_size","$CONF{'max_size'}","","","10","3"); my($page_val) = &Input("text","page_num","$CONF{'page_num'}","","","10","3"); my($mdata_val) = &Input("text","max_data","$CONF{'max_data'}","","","10"); my($sublen_val) = &Input("text","sub_length","$CONF{'sub_length'}","","","10",""); my($namelen_val) = &Input("text","name_length","$CONF{'name_length'}","","","10",""); my($fontkind_val) = &Input("text","font_kind","$CONF{'font_kind'}","","","10",""); my($fontsize_val) = &Input("text","font_size","$CONF{'font_size'}","","","10",""); my($fontcol_val) = &Input("text","font_color","$CONF{'font_color'}","","","10",""); my($linkcol_val) = &Input("text","link_color","$CONF{'link_color'}","","","10",""); my($width_val) = &Input("text", "tbl_width", "$CONF{'tbl_width'}", "","","10","5"); my($linelen_val) = &Input("text","line_length","$CONF{'line_length'}", "","","10","3"); my($adminname_val) = &Input("text","admin_name","$CONF{'admin_name'}","","","10",""); my($homeurl_val) = &Input("text","home_url","$CONF{'home_url'}","","","40",""); my($adminmail_val) = &Input("text","admin_mail","$CONF{'admin_mail'}","","","20",""); my($bgcol_val) = &Input("text","bgcolor","$CONF{'bgcolor'}", "", "","8",""); my($background_val) = &Input("text","background","$CONF{'background'}","","","25","0"); my($ncel_val) = &Input("text","ncel_color","$CONF{'ncel_color'}","","","10",""); my($hfontcol_val) = &Input("text","hfont_color","$CONF{'hfont_color'}","","","10",""); my($headcol_val) = &Input("text","head_color","$CONF{'head_color'}","","","10",""); my($celcol1_val) = &Input("text","cel_color1","$CONF{'cel_color1'}","","","10",""); my($celcol2_val) = &Input("text","cel_color2","$CONF{'cel_color2'}","","","10",""); my($overcol_val) = &Input("text","over_color","$CONF{'over_color'}","","","10",""); my($selcol_val) = &Input("text","select_color","$CONF{'select_color'}","","","10",""); my($numcol_val) = &Input("text","num_color","$CONF{'num_color'}","","","10",""); my($datecol_val) = &Input("text","date_color","$CONF{'date_color'}","","","10",""); my($readcol_val) = &Input("text","read_color","$CONF{'read_color'}","","","10",""); my($downcol_val) = &Input("text","down_color","$CONF{'down_color'}","","","10",""); my($logoimg_val) = &Input("text","logo_img","$CONF{'logo_img'}","","","42",""); my($txtlogo_val) = &Input("text","logo_txt","$CONF{'logo_txt'}","","","42",""); my($pnt_max) = &Input("text","pnt_cnt","$CONF{'pnt_cnt'}","","","3",""); my($find_interval) = &Input("text","find_interval","$CONF{'find_interval'}","","","4","4"); &head; &Fhead("POST","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action","make_conf"); &Thead("500","$CONF{'head_color'}","1","0"); print "ȯ°æ ¼³Á¤\n"; print "\n"; &Thead("100%","","1","0"); print "[ºñ¹Ð¹øÈ£ º¯°æ½Ã: ºóÄ­ ±×´ë·Î µÎ½Ã¸é ÀÌÀü ºñ¹Ð¹øÈ£ Àû¿ëµÊ]\n"; print "
ºñ¹Ð¹øÈ£ $pass  ´Ù½ÃÈ®ÀÎ $pass_eq\n"; #--------------------------- À̹ÌÁö ½ºÅ² ȯ°æ¼³Á¤ ºÎºÐ -------------------------------------------- &chk_skindir; print "À̹ÌÁö ½ºÅ² \n"; #----------------------------------------------------------------------------------------------- print " °Ô½ÃÆÇ À§Ä¡Á¤¿­\n"; print "\n"; print " °ü¸®ÀÚ¸¸ ±Û¾²±â\n"; print "\n"; print " IPÁ¤º¸ º¸±â\n"; print "\n"; print " °£´ÜÀÇ°ß ³²±â±â »ç¿ë\n"; print "\n"; print " ºñ°ø°³ ±Û ³²±â±â Çã¿ë\n"; print "\n"; print " ÀÔ·ÂÆû¿¡¼­ µ¿±ÛÀÌ»ç¿ë\n"; print "\n"; print " ¸®½ºÆ® È­¸é¿¡¼­ Ȩ,¸ÞÀÏ Á¤º¸ º¸À̱â\n"; print "\n"; print "$pnt_max ¸íÀÌ»ó Ãßõ½Ã ¾ÆÀÌÄÜ Ä®¶óÈ­       ÃßõÁ¡¼öÁ¦ »ç¿ë\n"; print "\n"; print " ÀÚ·á½Ç·Î »ç¿ëÇϱâ\n"; print "\n"; print " ÆÄÀÏŸÀÔ º¸À̱â\n"; print "\n"; print " ´Ù¿î¼ö º¸À̱â\n"; print "\n"; print "ÆÄÀÏ´ç ¿Ã¸±¼ö ÀÖ´Â ÃÖ´ë ¿ë·®(MB) $msize_val\n"; print "ÇÑÆäÀÌÁö´ç ³ªÅ¸³¯ ±Û °¹¼ö $page_val\n"; print "µ¥ÀÌŸ ÃÖ´ë ÀúÀå °¹¼ö $mdata_val\n"; print "Á¦¸ñ ÃÖ´ë±æÀÌ $sublen_val\n"; print "À̸§ ÃÖ´ë±æÀÌ $namelen_val\n"; print "±âº» ±Û²Ã Á¾·ù $fontkind_val\n"; print "±âº» ±ÛÀÚ Å©±â $fontsize_val\n"; print "±âº» ±ÛÀÚ »ö±ò $fontcol_val\n"; print "¸µÅ© ±ÛÀÚ »ö±ò $linkcol_val\n"; print "°Ô½ÃÆÇ ³ÐÀÌ $width_val\n"; # print "½©°£°Ý $linelen_val\n"; print "°ü¸®ÀÚ À̸§ $adminname_val\n"; print "ȨÆäÀÌÁö URL $homeurl_val\n"; print "°ü¸®ÀÚ À̸ÞÀÏ ÁÖ¼Ò $adminmail_val\n"; if($NT ne "1"){ print "±Ûµî·Ï½Ã °ü¸®ÀÚ¿¡°Ô ¸ÞÀÏ·Î ³²±ä±Û º¸³»±â\n"; print "\n"; print "´äº¯µî·Ï½Ã ±Û¾´ÀÌ¿¡°Ô ¸ÞÀÏ·Î ´äº¯±Û º¸³»±â\n"; print "\n"; } print "¹è°æ»ö $bgcol_val or ¹è°æ À̹ÌÁö URL $background_val\n"; print "°øÁö»çÇ× °­Á¶»ö $ncel_val\n"; my($hcolor)=($CONF{'head_color'})? "$CONF{'head_color'}" : "#ffffff"; print "Çìµå ±ÛÀÚ»ö±ò $hfontcol_val\n"; print "Çìµå »ö±ò(ÂðÇÑ»ö) $headcol_val\n"; print "½© »ö±ò1(¿¬ÇÑ»ö) $celcol1_val\n"; print "½© »ö±ò2(¿¬ÇÑ»ö) $celcol2_val\n"; print "Ä¿¼­À§Ä¡½Ã ½©»ö $overcol_val\n"; print "Àаí ÀÖ´Â ±Û Ç¥½Ã»ö $selcol_val\n"; print "¼ýÀÚ Ç¥½Ã»ö $numcol_val\n"; print "³¯Â¥ Ç¥½Ã»ö $datecol_val\n"; print "ÀÐÀº¼ö Ç¥½Ã»ö $readcol_val\n"; print "´Ù¿î¼ö Ç¥½Ã»ö $downcol_val\n"; #--------------------------- ±×¶óµ¥ÀÌ¼Ç È¯°æ¼³Á¤ ºÎºÐ -------------------------------------------- print "±×¶óµ¥ÀÌ¼Ç »ç¿ë\n"; print "\n"; print "ÅÛÇø´ Á¦ÀÛÀÚ Á¤º¸ - $tpl_maker   $tpl_where\n" if($CONF{'templet'} ne ""); #----------------------------------------------------------------------------------------------- print "logo À̹ÌÁö URL $logoimg_val\n"; print "ÅؽºÆ® ·Î°í $txtlogo_val\n"; for(0..6){ my $sun = $_ + 1; print "»¡¸®°¡±â$sun. ID ".&Input("text", "quick_id$_","$quick_id[$_]","","","17",""); print "NAME ".&Input("text", "quick_name$_","$quick_name[$_]","","","17","")."\n"; } print "°Ë»ö µ¥ÀÌŸ°£°Ý(1000°³ ÀÌÇÏ) $find_interval\n"; print " °Ë»öâ º¸À̱â\n"; print "\n"; print " ¼Óµµ ºü¸£°Ô\n"; print "\n"; print "½¬´Â ¿äÀÏ  "; &get_date; my @en_week = qw(sun mon tue wed thu fri sat); for(0..6){ print &Checkbox("$en_week[$_]","$week[$_]","$lock_week[$_]"); print "$week[$_]  "; } print "\n"; &Tfoot; print "\n"; &Tfoot; print "
"; &ok_admin; print "
"; print &Input("submit","","µî·ÏÇϱâ").&Input("reset","","´Ù½ÃÀû±â"); &Ffoot; &foot; } else{ &error("pass"); } } sub chk_skindir{ opendir(SKIN_DIR, "$img_dir/skin"); @skin = sort grep (!/^\.{1,2}$/,readdir(SKIN_DIR)); closedir(SKIN_DIR); } sub point_up{ my(@num_list, @pnt_data, $man_num, $all_pnt, $search_opt, $goto_url); local $cook = "$FORM{'number'}"; &cookie; if($COOKIE{$cook} ne "$ENV{'REMOTE_ADDR'}$FORM{'action'}$FORM{'number'}"){ open(POINT,"$main_dir/num/$FORM{'number'}"); @num_list = ; close(POINT); @pnt_data = split(/\|/,"$num_list[0]"); $man_num = $pnt_data[3]; $all_pnt = $pnt_data[4]; $man_num++; $all_pnt += $FORM{'point_val'}; open(DATA,">$main_dir/num/$FORM{'number'}"); print DATA "|$pnt_data[1]|$pnt_data[2]|$man_num|$all_pnt|"; close(DATA); $search_opt = $FORM{'category'} ? "&category=$FORM{'category'}&keyword=$FORM{'keyword'}" : ""; $goto_url = "$cgi_url?id=$FORM{'id'}&page=$FORM{'page'}&action=view&number=$FORM{'number'}&cnt=no&img=$FORM{'img'}&simple=$FORM{'simple'}$search_opt"; &head; print "\n"; print "

 

 

 


\n"; print "Loading ......\n"; print "
\n"; print "

¢¸
¢¸ °Ô½ÃÆÇÀ¸·Î µ¹¾Æ°¡±â

\n" if($FORM{'simple'} ne "yes"); &foot; } else{ &error("ip"); } } sub html_in{ my(@html_up, @html_down); if($FORM{'passwd'} eq $CONF{'admin_pwd'}){ &head; &Fhead("POST","$cgi_url"); print &Input("hidden","action","html_write"); print &Input("hidden", "id", "$FORM{'id'}"); &Thead("600","$CONF{'head_color'}","1","0"); print "\n"; &Thead("100%","$CONF{'cel_color1'}","3","0"); print "\n"; &Thead("100%","$CONF{'cel_color2'}","0","3"); open(UPHTML,"$main_dir/up.htm"); @html_up = ; close(UPHTML); print "

¨Ú °Ô½ÃÆÇ À§¿¡ »ðÀ﵃ htmlÄÚµå <body>...
\n"; open(DOWNHTML,"$main_dir/down.htm"); @html_down = ; close(DOWNHTML); print "

¨Ú °Ô½ÃÆÇ ¾Æ·¡¿¡ »ðÀ﵃ htmlÄÚµå ...</body>
\n"; print "\n"; &ok_admin; print "\n"; print "\n"; print &Input("submit", "", " ¿Ï ·á "); print &Input("reset", "", "´Ù½ÃÀû±â"); print "\n"; &Tfoot; print "\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; &foot; } else{ &error("pass"); } } sub index_repair{ if($FORM{'passwd'} eq $CONF{'admin_pwd'}){ &head; &Fhead("POST","$cgi_url"); print &Input("hidden","action","repair_idx"); print &Input("hidden", "id", "$FORM{'id'}"); &Thead("600","$CONF{'head_color'}","1","0"); print "\n"; &Thead("100%","$CONF{'cel_color1'}","3","0"); print "\n"; &Thead("100%","$CONF{'cel_color2'}","0","3"); print "

À妽ºÆÄÀÏÀ» ÀÚµ¿º¹±¸ ÇÕ´Ï´Ù....

°ü¸®ÀÚ ºñ¹Ð¹øÈ£¸¦ ÀûÀ¸½Ã°í 'º¹±¸Çϱâ' ¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.


\n"; print "(¡Ø ÀÌ ¼­ºñ½º´Â °Ô½ÃÆÇ¿¡ ¿Ã¸° °Ô½Ã¹° ¼ö¿Í ³ªÅ¸³ª´Â ±Û¼ö°¡
ÀÏÄ¡ÇÏÁö ¾ÊÀ»¶§ »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.)




"; print "\n"; print "\n"; &ok_admin; print "\n"; print "\n"; print &Input("submit", "", "º¹±¸Çϱâ"); print &Input("reset", "", "´Ù½ÃÀû±â"); print "

\n"; &Tfoot; print "\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; &foot; } else{ &error("pass"); } } sub html_write{ my $pass = crypt($FORM{'passwd'},"sp"); if($pass eq $CONF{'admin_pwd'}){ open(UPDATA, ">$main_dir/up.htm"); print UPDATA "$FORM{'html_up'}"; close(UPDATA); open(DOWNDATA, ">$main_dir/down.htm"); print DOWNDATA "$FORM{'html_down'}"; close(DOWNDATA); &load_page; } else{ &error("ok_admin"); } } sub repair_idx{ my($pass) = crypt($FORM{'passwd'},"sp"); if($pass ne $CONF{'admin_pwd'}){ &error("ok_admin"); } for(1..10){ unlink "$main_dir/idx/$_.cgi"; } unlink "$main_dir/idx/index.cgi"; &make_idx; &load_page; } #µ¥ÀÌŸ ±æÀÌ Á¦ÇÑ ÇÔ¼ö ---------------------------------------------------------- sub cut_len{ my($val, $cut_len) = @_; if(length($val) > $cut_len){ $val = substr($val,0,$cut_len); chop $val if(($val =~ tr/[\xA1-\xFE]//)%2 != 0); $val = "$val..."; } return $val; } sub make_conf{ my($pass) = crypt($FORM{'passwd'},"sp"); if($pass eq $CONF{'admin_pwd'}){ if($FORM{'admin_pwd'} eq ""){ $FORM{'admin_pwd'} = $CONF{'admin_pwd'}; } elsif($FORM{'admin_pwd'} eq $FORM{'admin_pwd_eq'}){ $FORM{'admin_pwd'} = crypt($FORM{'admin_pwd'},"sp"); } else{ &error("pass"); } for(0..6){ my $qid_val = "quick_id$_"; my $qname_val = "quick_name$_"; $FORM{'quick_id'} .= "$FORM{$qid_val}|"; $FORM{'quick_name'} .= "$FORM{$qname_val}|"; } $FORM{'lock_week'} = "$FORM{'sun'}|$FORM{'mon'}|$FORM{'tue'}|$FORM{'wed'}|$FORM{'thu'}|$FORM{'fri'}|$FORM{'sat'}|"; open(SAVE,">$main_dir/conf.cgi"); $CONF{'scr_opt'} = $FORM{'scr_opt'}; #¾÷±×·¹À̵åÀÚ¸¦ À§ÇØ... $CONF{'admin_sender'} = $FORM{'admin_sender'}; #¾÷±×·¹À̵åÀÚ¸¦ À§ÇØ... $CONF{'link_color'} = $FORM{'link_color'}; #¾÷±×·¹À̵åÀÚ¸¦ À§ÇØ... foreach (sort keys %CONF) { print SAVE "$_ = $FORM{$_}\n"; } close(SAVE); #------------------------- ÆäÀÌÁöº° À妽º Á¤¸® $CONF{'page_num'} = $FORM{'page_num'}; &read_idx; my $num_data = @ary; unless($num_data eq "0"){ &lock; open(NUM,">$main_dir/idx/num.cgi"); print NUM $num_data; close(NUM); for(1..10){ open(PAGE,">$main_dir/idx/$_.cgi"); my $start = ($_ - 1)*$CONF{'page_num'}; for(0..$CONF{'page_num'}-1){ print PAGE "$ary[$start+$_]\n"; } close(PAGE); } &unlock; } #----------------------------------------- &load_page; } else{ &error("ok_admin"); } } sub view_notice{ my(@views, @notice, @auto, $html, $subject, $comments, $rdate, $auto_link, $auto_br, $read_num, $plus_num); open(VFILE,"$main_dir/notice.cgi"); @views = ; close(VFILE); @notice = split(/\|/,$views[0]); $html = $notice[0]; $subject = $notice[1]; $comments = $notice[2]; $rdate=substr($notice[3],0,18); @auto = split(/\|/, $views[1]); $auto_link = $auto[0]; $auto_br = $auto[1]; unless($views[1] =~ /\|/) { #3Â÷ ¾÷±×·¹À̵å ÀÚ¸¦ À§ÇØ... ³ªÁß¿¡ »èÁ¦???? $auto_br = "1"; $auto_link = "1" if(chomp($views[1]) eq "1"); } open(NUM,"$main_dir/num/notice.cgi"); $read_num = ; close(NUM); $cook = "$FORM{'action'}"; &cookie; if($COOKIE{$cook} ne "$ENV{'REMOTE_ADDR'}$FORM{'action'}"){ $plus_num = ($FORM{'cnt'} ne "no") ? $read_num + 1 : $read_num; } else{ $plus_num = $read_num; } if($FORM{'cnt'} ne "no"){ &lock if($CONF{'speed_up'} eq "no"); open(NFI,">$main_dir/num/notice.cgi"); print NFI "$plus_num"; close(NFI); &unlock if($CONF{'speed_up'} eq "no"); } if ($html ne "1") { $comments =~ s/
/\r\n/g; $comments =~ s//>/g; $comments =~ s/"/"/g; # $comments =~ s/<hr>/


/g; $comments =~ s/\r?\n/
/g; } else{ $comments =~ s/<br>/
/g; $comments =~ s/<p>/

/g; } $comments =~ s/
/\r\n/g if($auto_br ne "1"); if($auto_link eq "1"){ $comments =~ s/(http:\/\/)([\w\+\-\/\=\?\.\~\&]+)/ $1$2<\/font><\/a>/g; if($NT eq "1"){ $comments =~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } else{ $comments=~ s/([\w\-]+\@[\w\-+\.]+[\w\-]+)/ $1<\/font><\/a>/g; } } $comments = &view_dongury("$comments") if($CONF{'dgr_ok'} eq "yes"); &head; print "

\n"; &Thead("100%","","1","0"); print "ÀÛ¼ºÀÏÀÚ - $rdate\n"; print "\n"; &Thead("100%","0","2","0"); print "¨Ú $subject\n"; print "Á¶È¸¼ö [ $plus_num ]\n"; print "\"¼öÁ¤Çϱâ\"\n"; print "\"»èÁ¦Çϱâ\"  \n"; &Tfoot; print "\n"; print "\n"; &Thead("100%","$CONF{'cel_color1'}","3","0"); print "

$comments

"; print "\n"; print ""; #--------------------------------------------------------------------------------- if($CONF{'etc_ok'} eq "yes"){ print "\n"; &Fhead("POST","$cgi_url"); print &Input("hidden","action","etc_write"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","page","$FORM{'page'}"); print &Input("hidden","cnt","no"); print &Input("hidden","number","notice.cgi"); print &Input("hidden","simple","$FORM{'simple'}"); if($FORM{'category'}){ print &Input("hidden","category","$FORM{'category'}"); print &Input("hidden","keyword","$FORM{'keyword'}"); } &Thead("100%","","3","0"); print "\n"; print &Input("submit","", "³²±â±â"); print "  \"°£´ÜÀÇ°ß\n"; my(@etc, @color, $end_num, $gd, $color_val); if(-e "$main_dir/etc/notice.cgi"){ open (ETC, "$main_dir/etc/notice.cgi"); @etc = ; close (ETC); chop(@etc); $end_num = @etc; @color= ('#FF0000', '#FF0000', '#FF9F47', '#FF9F47', '#009900', '#009900', '#0C2099', '#0C2099', '#991098', '#991098'); for(0..$end_num-1){ if($etc[$_] ne ""){ my @gubun = split(/\|/, $etc[$_]); $gd = $_ + 1; print "\"$gd¹ø° $gubun[0]\n"; } } } &Tfoot; &Ffoot; } #---------------------------------------------- print "\n"; &Tfoot; &Thead("100%","","0","0"); print "\n"; &Tfoot; print "\n"; &Tfoot; print "

\"±Û

\n"; &foot; } sub color_man{ my ($R, $G, $B) = @_; $R = &unhex($R); $G = &unhex($G); $B = &unhex($B); return '#'.$R.$G.$B; } sub unhex{ my(@hex, %HEX, $num, $val); $num = shift; for(1..5){ $hex[$_] = $num%16; last if($num < 16); $num = ($num-$hex[$_])/16; } %HEX = (15 => F, 14 => E, 13 => D, 12 => C, 11 => B, 10 => A); foreach (reverse @hex){ $val .= ($_ >= 10 ) ? $HEX{$_} : $_; } $val = "0$val" if(length($val) == 1); return $val; } sub error { local($err) = $_[0]; &head; print "



"; print ""; if($err eq "id") { print "

°Ô½ÃÆÇÀ̸§ ¿¡·¯

\n"; print "±ÍÇÏ°¡ ¿ä±¸ÇÏ´Â °Ô½ÃÆÇÀ» ãÀ» ¼ö ¾øÀ¾´Ï´Ù
\n"; print "¹Ýµå½Ã board.cgi?id=db Çü½ÄÀ¸·Î ºÒ·¯¾ß ÇÕ´Ï´Ù.\n"; } elsif($err eq "no_dir"){ print "

°Ô½ÃÆÇ ¾ÆÀ̵𠿡·¯

\n"; print "±ÍÇÏ°¡ ¿ä±¸ÇÏ´Â °Ô½ÃÆÇÀÇ ¾ÆÀ̵ð µð·ºÅ丮¸¦ ãÀ» ¼ö ¾øÀ¾´Ï´Ù
\n"; print "
spboardµð·ºÅ丮¼ÓÀÇ idµð·ºÅ丮 ¼Ó¿¡´Ù°¡
\n"; print "$FORM{'id'} µð·ºÅ丮¸¦ ¸¸µå½Ã°í Æ۹̼ÇÀ» 777·Î ÁÖ¼Å¾ß ÇÕ´Ï´Ù.\n"; } elsif($err eq "ip") { print "

Áߺ¹Ãßõ ¿¡·¯

\n"; print "Áߺ¹ÃßõÀº »ï°¡ÇØ ÁÖ¼¼¿ä...\n"; } elsif($err eq "pass") { print "

ºñ¹Ð¹øÈ£ ¿¡·¯

\n"; print "ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\n"; } elsif($err eq "ok_admin") { print "

ºñ¹Ð¹øÈ£ ¿¡·¯

\n"; print "°ü¸®ÀÚ ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\n"; } elsif($err eq "admin") { print "

ºñ¹Ð¹øÈ£ ¿¡·¯

\n"; print "ÇöÀç ÀÌ °Ô½ÃÆÇÀº °ü¸®ÀÚ¸¸ ±ÛÀ» ³²±â½Ç ¼ö ÀÖ½À´Ï´Ù.
°ü¸®ÀÚ ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.\n"; } elsif($err eq "email") { print "

email ¿¡·¯

\n"; print "À̸ÞÀÏ Çü½ÄÀÌ À߸øµÇ¾ú³×¿ä...\n"; } elsif($err eq "exist") { print "

°°Àº À̸§ÀÇ ÆÄÀÏÀÌ Á¸ÀçÇÕ´Ï´Ù.

\n"; print "ÆÄÀÏÀ̸§À» ¹Ù²Ù½ÅÈÄ ¿Ã·ÁÁÖ¼¼¿ä...\n"; } elsif($err eq "keyword") { print "

°Ë»ö¾î ÀÔ·Â ¿¡·¯

\n"; print "°Ë»ö¾î¸¦ ÀÔ·ÂÇϽÃÁö ¾ÊÀ¸¼Ì¾î¿ä
°Ë»öÇÏ·Á¸é °Ë»ö¾î¸¦ ÀÔ·ÂÇϼ¼¿ä\n"; } elsif($err eq "size") { print "

ÆÄÀÏÀÇ »çÀÌÁî°¡ ³Ê¹« Ä¿¿ä...

\n"; print "ÇöÀç ¿Ã¸±¼ö ÀÖ´Â ÃÖ´ë ¿ë·®Àº ÆÄÀÏ´ç $CONF{'max_size'} MB ÀÔ´Ï´Ù.
ÀÚ·á½ÇÀÇ ¿ë·®°ü°è·Î »çÀÌÁî°¡ ÃÖ´ë¿ë·®º¸´Ù ÀÛÀº ÆÄÀÏÀ» ¿Ã·ÁÁÖ¼¼¿ä.\n"; } elsif($err eq "double") { print "

µÑÁß Çϳª¸¸ °¡´ÉÇÕ´Ï´Ù.

\n"; print "ÆÄÀϸµÅ©³ª ÆÄÀϾ÷·Îµå µÑÁß Çϳª¸¸ ¼±ÅÃÇØ ÁÖ¼¼¿ä...\n"; } elsif($err eq "link") { print "

ÆÄÀÏ ¸µÅ©´Â http:\/\/ ¶Ç´Â ftp:\/\/ ·Î ½ÃÀÛ ÇØ¾ß ÇÕ´Ï´Ù.

"; } elsif($err eq "notice") { print "

°øÁö»çÇ× ÀÔ·Â ¿¡·¯!!!

\n"; print "Á¦¸ñÀ̳ª ³»¿ëÀ» ²À Àû¾î ÁÖ¼¼¿ä...\n"; } elsif($err eq "dgr"){ print "

µ¿±ÛÀ̸¦ ³Ê¹« ¸¹ÀÌ »ç¿ëÇ߳׿ä...

\n"; print "µ¿±ÛÀÌ´Â ÃÖ´ë 50°³±îÁö »ç¿ë°¡´ÉÇÕ´Ï´Ù...\n"; } elsif($err eq "date") { print "

³¯Â¥ ÀÔ·Â ¿¡·¯!!!

\n"; print "³¯Â¥°¡ Àç´ë·Î ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù...\n"; } elsif($err eq "send"){ print "

¸ÞÀÏ ÀÔ·Â ¿¡·¯!!!

\n"; print "¹Þ´ÂÀÌ À̸ÞÀÏÀÌ Àç´ë·Î ÀԷµÇÁö ¾Ê¾Ò½À´Ï´Ù...\n"; } elsif($err eq "no_select"){ print "

¼±ÅÃÇϽŠ±ÛÀÌ ¾ø³×¿ä!!!

\n"; print "Àå¹Ù±¸´Ï¿¡ ´ã¾Æ º¸±â ¿øÇϽô ±ÛµéÀ» üũÇØ ÁÖ¼¼¿ä...\n"; } else{ print "

°Ô½ÃÆÇ ÀÛ¼º ¿¡·¯

\n"; print "À̸§, Á¦¸ñ, ³»¿ë¶õÀº ¹Ýµå½Ã ä¿ì¼Å¾ß ÇÕ´Ï´Ù\n"; } print "
"; print "


\n"; print "¢¸µ¹¾Æ°¡±â(BACK)

\n"; &foot; } sub Input{ my($type, $name, $value, $back_color, $solid_color, $size, $maxlength) = @_; $back_color = "#FAFAFA" if($back_color eq ""); $solid_color = "#333333" if($solid_color eq ""); my($name_val) = $name ? "name=$name" : ''; my($value_val) = ($value ne "") ? "value=\"$value\"" : ''; my($size_val) = $size ? "size=$size" : ''; my($max_len) = $maxlength ? "maxlength=$maxlength" : ''; my($input_style) = "style='background-color:$back_color;border:1 solid $solid_color;height:20'" if($type ne "hidden"); return "\n"; } sub Textarea{ my($cols, $rows, $name, $back_color, $solid_color,$comment) = @_; my($textarea_style); $back_color = "#FAFAFA" if($back_color eq ""); $solid_color = "#333333" if($solid_color eq ""); $textarea_style = "style='background-color:$back_color;border:1 solid $solid_color'"; return "\n"; } sub Checkbox{ my($name, $value, $check_val) = @_; $check_val = $check_val ? "checked" : ""; return "\n"; } #Å×ÀÌºí °ü·Ã ÇÔ¼ö--------------------------------------------------------------- sub Thead{ my($width, $bgcolor, $cellpadding, $cellspacing) = @_; my($wid_val) = $width ? "width=$width" : ''; my($bgcolor_val) = $bgcolor ? "bgcolor=$bgcolor" : ''; print "

"; } sub Tfoot{ print "
\n"; } #form °ü·Ã ÇÔ¼ö ---------------------------------------------------------------- sub Fhead{ my($method, $action, $enctype, $name) = @_; my($enc_val) = $enctype ? "enctype=$enctype" : ''; my($name_val) = $name ? "name=$name" : ''; print "\n"; } sub Ffoot{ print "\n"; } sub head { my($os_data) = $ENV{'HTTP_USER_AGENT'}; print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n\n"; print "\n"; print "\n"; if($FORM{'simple'} eq "yes"){ print "Simple view window ^.^\n"; $CONF{'left_right'} = "center"; } else{ print "SPBOARD v4.5\n"; } # my $CONF{'font_size'} = $CONF{'font_size'} ? "$CONF{'font_size'}" : "9pt"; print "\n"; print "\n"; print "\n"; print "\n"; my($back, $color_val); if($CONF{'background'} ne ""){ $back="background=$CONF{'background'}"; } else{ $back="bgcolor=$CONF{'bgcolor'}"; } print "\n"; #------------------------------------------------------ À­ºÎºÐ htmlÅ×±× ³Ö±â if((-e "$main_dir/up.htm") && ($FORM{'simple'} ne "yes")){ open(UPDATA,"$main_dir/up.htm"); my @html_up = ; close(UPDATA); foreach $_(@html_up) { print "$_"; } print "
\n" if($html_up[0] ne ""); } #---------------------------------------------------------------- #---------------------------------------------- È­¸é ¹è¿­ Á¤¿­ ¿À¸¥ÂÊ ¿ÞÂÊ Áß°£... $CONF{'left_right'} ||= "center"; $CONF{'tbl_width'} = "98%" if($FORM{'simple'} eq "yes"); &Thead("100%","","10","0"); print "\n"; print "\n"; print "\n"; &Tfoot; &Thead("100%","$CONF{'cel_color1'}","0","0"); print "\n"; &Tfoot; &Thead("100%","","3","0"); print "\n"; &Tfoot; &Thead("100%","","0","0"); print "\n"; &Tfoot; print "\n"; &Tfoot; } } if(($quick_name[0] eq "") || ($act eq "input_form")){ print "

\n"; } } sub foot { print "

\"°ü¸®ÀÚ
\n" if(($FORM{'simple'} ne "yes") && ($err eq "")); if($customer eq "0"){ if($CONF{'img_skin'} ne ""){ open(SKIN,"$img_dir/skin/$CONF{'img_skin'}/$CONF{'img_skin'}.txt"); my @skin_data = ; close(SKIN); my @skin = split(/\|/, "$skin_data[0]"); my($name) = $skin[1]; my($home) = $skin[2]; print "
Powered by sepal / Designed by $name
\n" if($FORM{'simple'} ne "yes"); } else{ print "
POWERED BY SEPAL - SPBOARD v4.5
\n" if($FORM{'simple'} ne "yes"); } } else{ print "
$copyright
\n" if($FORM{'simple'} ne "yes"); } print "\n"; print "
\n"; #--------------------------------------------- if($FORM{'simple'} ne "yes"){ if($CONF{'logo_img'} ne ""){ print "\"°ü¸®ÀÚ\n"; } elsif($CONF{'logo_txt'} ne ""){ &Thead("","$CONF{'cel_color1'}","0","0"); print "
\n"; &Thead("100%","","0","0"); $color_val = $CONF{'head_color'} ? "bgcolor=$CONF{'head_color'}": ""; print "
  "; print "$CONF{'logo_txt'}  
\n"; print "\n"; &Tfoot; #----------------------------------------------- ¹ØºÎºÐ htmlÅ×±× ³Ö±â if((-e "$main_dir/down.htm") && ($FORM{'simple'} ne "yes")){ open(DOWNDATA,"$main_dir/down.htm"); my @html_down = ; close(DOWNDATA); foreach $_(@html_down) { print "$_"; } } #---------------------------------------------------------------- print "

\n"; print "\n"; exit; } sub lock{ my($lock_file, $lock_sec, $chk_cnt, $sleep_sec); $lock_file = "locking"; $lock_sec = 2; #lock°Å´Â ½Ã°£(ÃÊ) $chk_cnt = $lock_sec*10; $sleep_sec = 0.1; while ($chk_cnt--){ if(-e "$main_dir/idx/$lock_file"){ select (undef,undef,undef,$sleep_sec); } else{ open (LOCK,">$main_dir/idx/$lock_file"); close (LOCK); return 1; } } return 0; } sub unlock{ my ($lock_file) = "locking"; unlink ("$main_dir/idx/$lock_file"); } sub mail_notice{ my $from_man = $FORM{'email'} ? "$FORM{'name'}" : "$FORM{'name'}"; if ($FORM{'html'} ne "1") { $FORM{'comments'} =~ s/
/\r\n/g; $FORM{'comments'} =~ s//>/g; $FORM{'comments'} =~ s/"/"/g; $FORM{'comments'} =~ s/\r?\n/
/g; $FORM{'comments'} =~ s/
/\r\n/g if($FORM{'auto_br'} ne "1"); } else{ $FORM{'comments'} =~ s/
/\r\n/g if($FORM{'auto_br'} ne "1"); $FORM{'comments'} =~ s/<br>/
/g; $FORM{'comments'} =~ s/<p>/

/g; } open (MAIL, "|$sendmail -t") || die "È­ÀÏ ¿­±â ½ÇÆÐ!\n"; print MAIL "To: $addr\n"; print MAIL "From: $FORM{'name'}<$FORM{'email'}>\n"; print MAIL "Subject: $FORM{'name'}´Ô²²¼­ º¸³»´Â ´äº¯±Û...\n"; print MAIL "Content-Type: text/html; charset=euc-kr\n"; print MAIL "\n"; print MAIL "

\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "
¢Ã$FORM{'name'}´ÔÀÌ ³²±â½Å ´äº¯±ÛÀÔ´Ï´Ù.¢Ã
\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "
\n"; print MAIL "
\n"; print MAIL "\n"; print MAIL "°Ô½ÃÆÇ DB¸í: $FORM{'id'}
\n"; print MAIL "ÀÛ¼ºÀÚ: $from_man
\n"; print MAIL "ÀÛ¼ºÀϽÃ: $date
\n"; print MAIL "Ȩ URL: $FORM{'homepage'}
\n" if($FORM{'homepage'}); print MAIL "Á¦¸ñ:$FORM{'subject'}
\n"; print MAIL "
\n"; print MAIL "$FORM{'comments'}\n"; print MAIL "

This message from $CONF{'home_url'}   

\n"; print MAIL "
\n"; print MAIL "
\n"; close (MAIL); } sub sendmail { open (MAIL, "|$sendmail -t"); print MAIL "To: $addr\n"; print MAIL "From: $CONF{'admin_name'}<$CONF{'admin_mail'}>\n"; print MAIL "Subject: ´äº¯ÀÌ µî·ÏµÇ¾ú½À´Ï´Ù.\n\n"; print MAIL "\n\n$FORM{'name'}´Ô²²¼­ ±ÍÇÏÀÇ ±Û¿¡´ëÇÑ ´äº¯À» µî·ÏÇÏ¿´À¾´Ï´Ù.\n"; print MAIL "¾Æ·¡ Ȩ¿¡ ¹æ¹®ÇϽþî È®ÀÎÇϽñ⠹ٶø´Ï´Ù.\n\n"; print MAIL "¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß\n"; print MAIL "\t This message from $CONF{'home_url'}\n"; print MAIL "¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß\n\n"; close (MAIL); }