#!/usr/bin/perl #============================================================================# # Program Name - Sepal's SPBOARD v4.0 # # Programer - Kim se youn (madgf@hanmail.net) # # Homepage - http://www.feedtech.co.kr # # Last Modified - 2000.09.02 # # made in Korea # #============================================================================# ############################################################################## $main_dir = "."; #idµð·ºÅ丮°¡ Àִ°÷ÀÇ µð·¢Å丮 Àý´ë °æ·Î $main_url = "."; #idµð·ºÅ丮°¡ Àִ°÷ÀÇ URL $cgi_url = "./board.cgi"; #ÀÌ cgiÆÄÀÏÀÇ URL $img_url = "."; #img URL $sendmail = "/usr/lib/sendmail"; #sendmail À§Ä¡ $NT = "0"; #ÀÚµ¿ Æû¸ÞÀÏ »ç¿ëÇÏÁö ¾ÊÀ»·Á¸é $NT="1"·Î... require "./sp_lib.cgi"; #sp_lib.cgi ÆÄÀÏÀÌ ÀÖ´Â °÷ÀÇ Àý´ë°æ·Î ############################################################################## ############################################################################## #¾Æ·¡ ¼³Á¤Àº °Ô½ÃÆÇ Á¤½Ä±¸ÀÔÀÚ¸¦ À§ÇÑ °ÍÀÔ´Ï´Ù. #±â´É»ó Â÷ÀÌ´Â ¾øÀ¸¸ç °Ô½ÃÆÇ ¾Æ·¡ Ȩ¸µÅ©¸¦ ¹Ù²Ù´Â ¼³Á¤ÀÔ´Ï´Ù... ^.^ ############################################################################## $customer = "1"; #Á¤½Ä±¸ÀÔÀÚ´Â 1·Î... $copyright = "Power rights ¨Ï by BrillAsia. All rights reserved."; #Copyright ############################################################################## umask(000); $img_dir = "$main_dir/img"; &parseArgument; &selectAction; 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{'number'};\r\n"; } sub selectAction { local(@week, $page, $type_url, $face_url, $img_skin); $page = $FORM{'page'} ? "$FORM{'page'}" : "1"; if($FORM{'id'}) { &get_env; $type_url = "$img_url/type"; $face_url = ($img_skin ne "") ? "$img_url/$img_skin/face" : "$img_url/face"; $img_url = "$img_url/$img_skin" if($img_skin ne ""); if($FORM{'action'} eq "") { &display; } elsif($FORM{'action'} eq "form") { &input_form; } elsif($FORM{'action'} eq "write") { if(($FORM{'name'} eq "") || ($FORM{'comments'} eq "")||($FORM{'subject'} eq "")){ &error; } else { &write; } } elsif($FORM{'action'} eq "etc_write"){ &etc_write; } elsif($FORM{'action'} eq "adminwrite") { &adminwrite; } elsif($FORM{'action'} eq "view") { &view; } elsif($FORM{'action'} eq "for_print"){ &for_print; } elsif($FORM{'action'} eq "to_email"){ &to_email; } elsif($FORM{'action'} eq "reply") { &reply_form; } elsif($FORM{'action'} eq "down") { &down_file; } elsif($FORM{'action'} eq "admin_login") { &admin_login; } elsif($FORM{'action'} eq "loginok") { my($pass) = crypt($FORM{'passwd'},"sp"); if(($pass eq "") || ($pass ne $admin)) { &error("pass"); } &loginok; } elsif($FORM{'action'} eq "view_notice"){ &view_notice; } elsif($FORM{'action'} eq "modify"){ &enterpass; } elsif($FORM{'action'} eq "admin_modify"){ &admin_ok; } elsif($FORM{'action'} eq "admin_remove"){ &admin_remove; } elsif($FORM{'action'} eq "etcall_del"){ &etcall_del; } elsif($FORM{'action'} eq "multi_view"){ if($FORM{'mv.x'} ne ""){ &multi_view; } else{ &admin_chkdel; } } elsif($FORM{'action'} eq "multi_del"){ my($pass) = crypt($FORM{'passwd'},"sp"); if(($admin ne $pass)||($pass eq "")) { &error("pass"); } else{ &multi_del; } } elsif($FORM{'action'} eq "admin_act"){ if($FORM{'admin_select'} eq "admin_conf"){ &admin_conf; } elsif($FORM{'admin_select'} eq "html_in"){ &html_in; } elsif($FORM{'admin_select'} eq "notice_form"){ ¬ice_form; } elsif($FORM{'admin_select'} eq "index_repair"){ &index_repair; } } elsif($FORM{'action'} eq "etc_del"){ &etc_del; } elsif($FORM{'action'} eq "delete_etc"){ my($pass) = crypt($FORM{'passwd'},"sp"); if(($admin ne $pass)||($pass eq "")) { &error("pass"); } elsif($admin eq $pass) { &delete_etc; } } elsif($FORM{'action'} eq "html_write"){ &html_write; } elsif($FORM{'action'} eq "repair_idx"){ my($pass) = crypt($FORM{'passwd'},"sp"); if($pass eq $admin){ &repair_idx; } else{ &error("ok_admin"); } } elsif($FORM{'action'} eq "admin_remove_ok"){ my($pass) = crypt($FORM{'passwd'},"sp"); if(($admin ne $pass)||($pass eq "")) { &error("pass"); } elsif($admin eq $pass) { &admin_remove_ok; } } elsif($FORM{'action'} eq "etcdel_ok"){ my($pass) = crypt($FORM{'passwd'},"sp"); if(($admin ne $pass)||($pass eq "")) { &error("pass"); } elsif($admin eq $pass) { &etcdel_ok; } } elsif($FORM{'action'} eq "passok"){ &passok; } elsif($FORM{'action'} eq "modify_ok") { if(($FORM{'name'} eq "") || ($FORM{'comments'} eq "")|| ($FORM{'subject'} eq "")) { &error; } else { &modify;} } elsif($FORM{'action'} eq "admin_ok"){ my($pass) = crypt($FORM{'passwd'},"sp"); if(($admin ne $pass)||($pass eq "")) { &error("pass"); } elsif($admin eq $pass){ &admin_modify_form; } } elsif($FORM{'action'} eq "simple_ok"){ &simple_ok; } elsif($FORM{'action'} eq "point_up"){ &point_up; } elsif($FORM{'action'} eq "send_gul"){ &send_gul; } elsif($FORM{'action'} eq "make_conf"){ &make_conf; } elsif($FORM{'action'} eq "erase") { &erase; } elsif($FORM{'action'} eq "search") { if($FORM{'keyword'} eq ""){ &error("keyword"); } else{ &search; } } elsif($FORM{'action'} eq "display"){ &display; } elsif($FORM{'action'} eq "eraseok") { if($FORM{'passwd'} eq "") { &error("pass"); } &eraseok; } else { &display; } } else{ &error("id"); } } sub get_env{ my(@conf_list, @env); if(open(CONF,"$main_dir/conf.txt")) { @conf_list = ; close(CONF); @env = split(/\|/,$conf_list[0]); @quick = split(/\|/,$conf_list[1]); @q_name = split(/\|/,$conf_list[2]); @lock = split(/\|/,$conf_list[3]); $page_num = $env[1]; $admin_only = $env[2]; $max_data = $env[3]; $admin = $env[4]; $smail = $env[5]; $admin_mail = $env[6]; $home_url = $env[7]; $width = $env[8]; $admin_name = $env[9]; $ncel_color = $env[10]; $head_color = $env[11]; $cel_color1 = $env[12]; $select_color = $env[13]; $num_color = $env[14]; $date_color = $env[15]; $read_color = $env[16]; $bgcolor = $env[17]; $background = $env[18]; $logo_img = $env[19]; $logo_txt = $env[20]; $sub_length = $env[21]; $cel_color2 = $env[22]; $line_length = $env[23]; $view_ip = $env[24]; $pds_ok = $env[25]; $max_size = $env[26]; $down_view = $env[27]; $kind_view = $env[28]; $etc_ok = $env[29]; $img_skin = $env[30] if($env[30] ne "\n");#¾÷±×·¹À̵åÇÏ´Â »ç¶÷µéÀ» À§ÇÏ¿©... $point_ok = $env[31]; $font_kind = $env[33] ? "$env[32]" : "µ¸¿ò";#¾÷±×·¹À̵åÇÏ´Â »ç¶÷µéÀ» À§ÇÏ¿©... $font_size = $env[33] ? "$env[33]" : "9pt";#¾÷±×·¹À̵åÇÏ´Â »ç¶÷µéÀ» À§ÇÏ¿©... $left_right = $env[34] ? "$env[34]" : "center";#¾÷±×·¹À̵åÇÏ´Â »ç¶÷µéÀ» À§ÇÏ¿©... $search_ok = $env[35] ? "$env[35]" : "yes";#¾÷±×·¹À̵åÇÏ´Â »ç¶÷µéÀ» À§ÇÏ¿©... $font_color = $env[36] ? "$env[36]" : "#000000"; $down_color = $env[37] ? "$env[37]" : "#283FCF"; $pnt_cnt = $env[38] ? "$env[38]" : "10"; $name_length = $env[39] ? "$env[39]" : "10"; $i_opt = $env[40] ? "$env[40]" : "no"; $over_color = ($env[41] ne "\n") ? "$env[41]" : "#369cff"; $hfont_color = $env[42] ? "$env[42]" : "$cel_color1"; $speed_up = $env[43]; $quick1 = $quick[1]; $quick2 = $quick[2]; $quick3 = $quick[3]; $quick4 = $quick[4]; $quick5 = $quick[5]; $quick6 = $quick[6]; $quick7 = $quick[7]; $q_name1 = $q_name[1]; $q_name2 = $q_name[2]; $q_name3 = $q_name[3]; $q_name4 = $q_name[4]; $q_name5 = $q_name[5]; $q_name6 = $q_name[6]; $q_name7 = $q_name[7]; } else { mkdir("$main_dir/files",0777); mkdir("$main_dir/idx",0777); $page_num = "10"; $admin_only = "no"; $max_data = "100000"; $admin = "1234"; $smail = "yes"; $admin_mail = "your\@email.net"; $home_url = "http://yourhome.net"; $width = "80%"; $admin_name = "ÁÖÀÎÀå"; $ncel_color = ""; $head_color = ""; $cel_color1 = ""; $select_color= "#C3D6E7"; $num_color = "#1504B9"; $date_color = "#FF6666"; $read_color = "#0A5818"; $bgcolor = "#ffffff"; $background = ""; $logo_img = ""; $logo_txt = "TMR ¹öÀü 02 by Brill"; $sub_length = "47"; $cel_color2 = ""; $line_length = "0"; $view_ip = "yes"; $pds_ok = "no"; $max_size = "4.5"; $down_view = "no"; $kind_view = "yes"; $etc_ok = "no"; $img_skin = ""; $point_ok = "no"; $font_kind = "µ¸¿ò"; $font_size = "9pt"; $left_right = "center"; $search_ok = "yes"; $font_color = "#000000"; $down_color = "#283FCF"; $pnt_cnt = "10"; $name_length = "10"; $i_opt = "yes"; $over_color = "#F5FAFF"; $hfont_color = "#000000"; $speed_up = "yes"; $quick1 = ""; $quick2 = ""; $quick3 = ""; $quick4 = ""; $quick5 = ""; $quick6 = ""; $quick7 = ""; $q_name1 = ""; $q_name2 = ""; $q_name3 = ""; $q_name4 = ""; $q_name5 = ""; $q_name6 = ""; $q_name7 = ""; &save_env; } } sub save_env { $admin = crypt($admin,"sp"); open(CONF,">$main_dir/conf.txt"); print CONF "|$page_num|$admin_only|$max_data|$admin|$smail|$admin_mail|$home_url|$width|$admin_name|$ncel_color|$head_color|$cel_color1|$select_color|$num_color|$date_color|$read_color|$bgcolor|$background|$logo_img|$logo_txt|$sub_length|$cel_color2|$line_length|$view_ip|$pds_ok|$max_size|$down_view|$kind_view|$etc_ok|$img_skin|$point_ok|$font_kind|$font_size|$left_right|$search_ok|$font_color|$down_color|$pnt_cnt|$name_length|$i_opt|$over_color|$hfont_color|$speed_up|\n"; print CONF "|$quick1|$quick2|$quick3|$quick4|$quick5|$quick6|$quick7|\n"; print CONF "|$q_name1|$q_name2|$q_name3|$q_name4|$q_name5|$q_name6|$q_name7|\n"; close(CONF); } #-------------------------------------------------------------- # °Ô½ÃÆÇ ¸®½ºÆ® Ãâ·Â ^.^ - ¸ÞÀÎÈ­¸é µðÀÚÀÎ ¼öÁ¤Àº ÀÌ°÷¿¡¼­... #-------------------------------------------------------------- sub print_list{ my($d, $color_val, $up_td, $bsk_td, $io_td, $zero_col); local($down_col, $pnt_col, $pre_pg, $next_pg); $down_col="" if($down_view eq "yes"); $pnt_col="" if($point_ok eq "yes"); # $scount = (($page-1)*$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($FORM{'action'} 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 = $head_color ? "bgcolor=$head_color": ""; print "\n"; &Tfoot; $up_td = ($kind_view eq "yes")? "  " : ""; $bsk_td = ""; $io_td = ($i_opt eq "yes") ? "" : ""; if($page eq $total_page){ print ""; } &Thead("100%","","$line_length","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"){ $zero_col = "7"; if($down_view eq "yes"){ $zero_col++; } if($point_ok eq "yes"){ $zero_col++; } if($i_opt eq "yes"){ $zero_col++; } my($no_msg) = ("$FORM{'category'}") ? "^.^ ãÀ¸½Ã´Â ±ÛÀÌ ¾ø¾î¿ä!" : "^.^ µî·ÏµÈ ±ÛÀÌ ¾ø½À´Ï´Ù. ^.^"; my($over_msg) = &over("$no_msg"); my($color_val) = ($cel_color1) ? "bgcolor=$cel_color1" : ""; print "$no_msg\n"; } else{ my($start, $end, $no_data); $start = $page_num*($page - 1); $end = $start + $page_num - 1; $no_data = $list_num - (($page-1)*$page_num); my($chk_num) = 0; my(@gubun, $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/$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($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 < $pnt_cnt); $pnt_img = "\"ÃßõÀμö"; } $read_num = $read_num ? "$read_num" : "0"; 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 = "\"$file_name($file_size) "; $down_num = $down_num ? "$down_num" : "0"; } #------------------------------------------------------------------------------ my(@push, $rotate, $w_name, $home_img, $rdate, $gul_icon, $subject, $x_num, $gul_sub, $kword, $mailto, $mail_img); local(@list, $tr_color); $d++; $rotate = $d%2; $tr_color = ($rotate eq "0") ? "$cel_color2" : "$cel_color1"; @list = split(/\|/, $data[1]); $w_name = &cut_len("$list[0]","$name_length"); $home_img = $list[2] ? "\"$list[0]´Ô": ""; $rdate=substr($list[4],5,5); if(-M "$main_dir/$num" < 1.0) { $gul_icon = ($num =~/-/) ? "newans.gif" : "newgul.gif"; } else{ $gul_icon = ($num =~/-/) ? "ans.gif" : "gul.gif"; } $subject = "\"Simple"; @push = split(/-/,$num); shift(@push); #---------------------------------------------------[ Á¦¸ñ±Û ±æÀÌ Á¦ÇÑ ] $x_num = @push; $gul_sub = &cut_len("$list[3]", "$sub_length"); $x_num *=17; #--------------------------------------------------- #---------------------------------------------------[°£´ÜÀÇ°ß °¹¼öÁ¶È¸] if((-e "$main_dir/etc/$num") && ($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($FORM{'action'} eq "search"){ $kword = "$FORM{'keyword'}"; $gul_sub =~ s/$kword/$kword<\/font><\/b>/g if(($FORM{'category'} eq "subject") || ($FORM{'category'} eq "all")); $w_name =~ s/$kword/$kword<\/font><\/b>/g if(($FORM{'category'} eq "name") || ($FORM{'category'} eq "all")); } #-------------------------------------------------------------------------------- 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, $search_option, $mh_td, $chk_td, $over_msg, $color_val); $icon_td = ($kind_view eq "yes") ? "$file_icon" : ""; $num_col = "$down_num" if($down_view eq "yes"); $pnt_kind = "$pnt_img" if($point_ok eq "yes"); if(($num eq $FORM{'number'}) && ($FORM{'action'} ne "modify_ok") && ($FORM{'action'} ne "multi_view")){ $m_subject = "$subject $gul_sub\n"; $tr_color = $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"; } $mh_td = "$mail_img $home_img" if($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"; print "\n"; $chk_num++; #} $no_data--; #last if($d >= $page_num); } } $zero_col = "6"; if($down_view eq "yes"){ $zero_col++; } if($point_ok eq "yes"){ $zero_col++; } if($i_opt eq "yes"){ $zero_col++; } if($kind_view eq "yes"){ $zero_col++; } $color_val = $head_color ? "bgcolor=$head_color": ""; $zero_col -= 2; print ""; &pagemove; print " \n"; &Tfoot; &Ffoot; print "
\n"; } # sub print_list{} ³¡ --------------------------------------------- sub over{ my($msg) = $_[0]; return "onMouseOver=\"this.style.backgroundColor='$over_color';window.status=('$msg');return true;\" onMouseOut=\"this.style.backgroundColor='$tr_color'; window.status=('');return true;\""; } sub display { my(@page_list, @prev, @next, $start, $prev, $next); local(@ary, $list_num, $total_page); if((-e "$main_dir/idx/$page.txt") && ($FORM{'category'} eq "")){ open(NUM, "$main_dir/idx/num.txt"); $list_num = ; close(NUM); if($list_num eq "0" || $list_num eq ""){ #------------------ ±Û»èÁ¦½Ã °Ô½ÃÆÇ¿¡ ±ÛÀÌ Çϳªµµ ³²Áö ¾Ê¾ÆÀ» °æ¿ì... &read_idx; $list_num = @ary; $total_page = int($list_num/$page_num); if(($total_page*$page_num) < $list_num) {$total_page += 1;} } else{ $total_page = int($list_num/$page_num); if(($total_page*$page_num) < $list_num) {$total_page += 1;} open(PAGE, "$main_dir/idx/$page.txt"); @page_list = ; close(PAGE); if($page_list[0] eq "\n"){ #---------- ¸Ç¸¶Áö¸· ÆäÀÌÁö¿¡¼­ ±Û »èÁ¦½Ã ±× ÆäÀÌÁö¿¡ ±ÛÀÌ Çϳªµµ ¾øÀ»°æ¿ì... $page=$page - 1; open(PAGE, "$main_dir/idx/$page.txt"); @page_list = ; close(PAGE); } $start =($page-1)*$page_num; for(1..$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.txt"); @prev = ; close(PREV); chomp($ary[$prev*$page_num - 1] = $prev[$#prev]); } if($page ne "$total_page"){ $next = $page + 1; open(NEXT,"$main_dir/idx/$next.txt"); @next = ; close(NEXT); chomp($ary[$page*$page_num] = $next[0]); } } } else{ #------------------------------------------- À妽º ÆÄÀÏ ÀÌ¿ë &read_idx; $list_num = @ary; $total_page = int($list_num/$page_num); if(($total_page*$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(($FORM{'action'} eq "view") || ($FORM{'action'} eq "etc_write") || ($FORM{'action'} 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)*$page_num..$page*$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)*$page_num-1] eq "$next_num") ? ($page -1) : "$page" ; $next_page = ($ary[$page*$page_num] eq "$prev_num") ? ($page + 1) : "$page"; my(@ndata, @nline, @pdata, @pline, $next_data, $prev_data); open(NEXT, "$main_dir/$next_num"); @ndata = ; @nline = split(/\|/,$ndata[1]); $nline[3] = &cut_len("$nline[3]","$sub_length"); $next_data = " ¡ã $nline[3] - $nline[0]"; close (NEXT); open(PREV, "$main_dir/$prev_num"); @pdata = ; @pline = split(/\|/,$pdata[1]); $pline[3] = &cut_len("$pline[3]","$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($FORM{'action'} eq "multi_view"){ } else{ &head; } if(($FORM{'category'} eq "") && ($FORM{'simple'} ne "yes")){ if($quick1 ne ""){ &quick_btn; } &print_list; &find if($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"){ $read_number++ if(($FORM{'action'} eq "view") || ($FORM{'action'} eq "multi_view")); $down_number++ if($FORM{'action'} eq "down"); &lock if($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($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"))); } 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 mov); @1 = qw(rar arj ace tar gz lzh); #comp.gif ¾ÐÃàÆÄÀÏ @2 = qw(pcx png tif psd ico); #img.gif ±×¸²ÆÄÀÏ @3 = qw(bat com); #exe.gif ½ÇÇàÆÄÀÏ @4 = qw(asp pl pm); #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); #mov.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.txt") && ($FORM{'action'} ne "view")){ open(FILE,"$main_dir/notice.txt"); @gul = ; @notice = split(/\|/,$gul[0]); close (FILE); $subject = "$notice[1]"; #---------------------------------------------------[°£´ÜÀÇ°ß °¹¼öÁ¶È¸] if((-e "$main_dir/etc/notice.txt") && ($etc_ok eq "yes")){ open(ETC, "$main_dir/etc/notice.txt"); my @etc = grep(!/^\s/, ); close(ETC); my $etc_num = $#etc+1; $subject .= (-M "$main_dir/etc/notice.txt" < 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.txt"); $read_num = ; $read_num = $read_num ? "$read_num" : "0"; close(NUM); &get_date; $notice_td = "^.^" if($down_view eq "yes"); if($NT eq "0"){ $href = "javascript:newin(400, 267, 'sendmail.cgi?name=$admin_name&mail=$admin_mail&prog=$sendmail&home_url=$home_url','spmail')"; } else{ $href = "mailto:$admin_mail"; } my($ad_mail, $ad_home, $ad_td, $pnt_td, $colspan, $color_val, $over_msg, $notice_line); $ad_mail = "\"$admin_mail\""; $ad_home = "\"$home_url\""; $ad_td = "$ad_mail $ad_home" if($i_opt eq "yes"); $pnt_td = "\"Smile~" if($point_ok eq "yes"); $colspan = ($kind_view eq "yes")? "colspan=4" : "colspan=3"; $color_val = $ncel_color ? "bgcolor=$ncel_color" : ""; $over_msg = &over(" ¢¹¢¹ °øÁö»çÇ× º¸±â"); $notice_line = " $subject$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.txt") ; unlink ("$main_dir/num/notice.txt"); unlink ("$main_dir/etc/notice.txt"); } else{ print $notice_line; print "\n"; } } else{ if($die_mon < $month){ unlink ("$main_dir/notice.txt") ; unlink ("$main_dir/num/notice.txt"); unlink ("$main_dir/etc/notice.txt"); } else{ print $notice_line; print "\n"; } } } elsif($die_year > $year){ print $notice_line; print "\n"; } else{ unlink ("$main_dir/notice.txt") ; unlink ("$main_dir/num/notice.txt"); unlink ("$main_dir/etc/notice.txt"); } } #========================[ °øÁö»çÇ× Ã¼Å© ³¡]======================================== } 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/$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($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; } } 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; } @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"; my $font_size = $font_size ? "$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); if($FORM{'tmail'} eq ""){ &error("send"); } unless($FORM{'tmail'} =~ /.*\@.*\..*/){ &error("send"); } open(GUL, "$main_dir/$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]; chomp($auto_link = $list[4]); @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; } else{ $seper[1] =~ s/<br>/
/g; $seper[1] =~ s/<p>/

/g; } $seper[1] =~ s/\r\n/
/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; open (MAIL, "|$sendmail -t") || die "È­ÀÏ ¿­±â ½ÇÆÐ!\n"; print MAIL "To: $FORM{'tname'} <$FORM{'tmail'}>\n"; print MAIL "From: $FORM{'fname'} <$FORM{'fmail'}>\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 "
\n"; print MAIL "

This messages form $home_url   

\n"; print MAIL "
\n"; print MAIL "
\n"; close (MAIL); 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); $FORM{'number'} = "$chk_num" if($chk_num ne ""); open(VFILE, "$main_dir/$FORM{'number'}"); @views = ; close(VFILE); @Temp = split(/\|/, $views[1]); @auto = split(/\|/, $views[4]); $auto_link = $auto[0]; $auto_br = $auto[1]; 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($down_view eq "yes"); $w_info = (($ip ne "") && ($domain ne "") && ($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 "all")){ $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; } } 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, $kword, $acou, $ans_number, $subnumber, $kind, $mailto, $link, $sel_point); @apt = split(/-/,$FORM{'number'}); $acou = @apt; if($ans_number eq "") { $subnumber = "$FORM{'number'}-1"; } else { $ans_number++; $subnumber = "$FORM{'number'}-$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=$home_url','spmail')"; } else{ $kind = "mailto:$Temp[1]"; } $mailto = "$Temp[0]
$Temp[1]"; } else{ $mailto = "$Temp[0]"; } if($FORM{'simple'} eq "yes") { $width = "447"; } &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($point_ok eq "yes"); print "

\n"; &Thead("100%","","1","0"); print "ÀÛ¼ºÀÚ [ $mailto $homepage ] - $year³â $month¿ù $sdayÀÏ¿¡ ³²±â½Å ±Û\n"; print "\n"; &Thead("100%","","0","0"); my($color_val) = $head_color ? "bgcolor=$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%", "$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"); 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($point_ok eq "yes"); #---------------------------------------------------------------------- if($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'}"); 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 ""){ $gd = $_ + 1; print "\"$gd¹ø° $etc[$_]\n"; } } } &Tfoot; &Ffoot; } else{ print "
\n"; } #--------------------------------------------------------------- print "\n"; &Tfoot; print "\n"; &Tfoot; &Thead("100%","","0","0"); # my($color_val) = $head_color ? "bgcolor=$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 multi_view{ my(@check, @chk_img, @ndata, @ncgi, @ftype, @view_num, $cnt, $chk_num, $fname, $nnum, $type); $cnt = 0; for (0..$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/$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(@del_num, @ldata, @file_data, @ary, $cnt, $chk_num ); $cnt = 0; for (0..$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/$del_num[$_]"); @ldata = ; @file_data = split(/\|/,$ldata[5]); close (FILE); unlink "$main_dir/$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'}; $etc_num = @etc; $etc_num++; if($etc_num > 9){ $etc_num =9; } if($new_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.txt"){ &view_notice; } else{ &view; } } sub input_form{ my ($name, $email, $homepage, $passwd, $html, $auto_link, $subject, $pre_view, $comments, $file_name, $link_file, $submit, $reset); local($week_val); &get_date; &read_cookie; &head; for(1..7){ #-------------------------- ½¬´Â ¿äÀÏ ^^ if($week_val eq $lock[$_]){ $lock_val = "ok"; } } if($lock_val eq "ok"){ print "

 

 

 


\n"; print "¸ÅÁÖ\n"; my($i) = 0; for(1..7){ if("$lock[$_]"){ $lock_week[$i] = "$lock[$_]"; $i++ if("$lock[$_]"); } } foreach(0..$#lock_week){ print "$lock_week[$_]¿äÀÏ"; print ", " if($_ ne "$#lock_week"); } print "Àº ½±´Ï´Ù...\n"; print "
\n"; print "



\n"; } else{ if($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","1"); $auto_br = &Checkbox("auto_br","1","1"); $subject = &Input("text", "subject", "","","","51",""); $pre_view = &Input("text", "pre_view", "http:\/\/","","","51",""); $comments = &Textarea("50","8","comments"); $file_name = &Input("file", "file_name","","","", "36",""); $link_file = &Input("text", "link_file", "","","","51",""); $submit = &Input("submit",""," ±Û ¿Ã¸² "); $reset = &Input("reset", "", "´Ù½ÃÀÛ¼º"); &Fhead("post","$cgi_url","multipart/form-data"); 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("","$head_color","3","0"); print "¨Ú ±Û ³²±â±â...\n"; print "\n"; &Thead("","$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ÀÚµ¿ÁٹٲÞ\n"; print "Á¦      ¸ñ$subject\n"; print "¹Ì¸®º¸±â$pre_view\n" if($pds_ok eq "yes"); print "
³»      ¿ë\n"; print "$comments\n"; print "ÆÄÀÏ÷ºÎ$file_name\n" if($pds_ok eq "yes"); print "¸µÅ©ÆÄÀÏ$link_file\n" if($pds_ok eq "yes"); print "$submit $reset\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; } print "\"±Û

\n"; &foot; } 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 $admin){ &get_date; $n_mon = $month + 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","","","","40",""); $html = &Checkbox("html","1",""); $auto_link = &Checkbox("auto_link","1","checked"); $auto_br = &Checkbox("auto_br","1","checked"); $comments = &Textarea("75","8","comments"); $ok_btn = &Input("submit", "", " ±Û ¿Ã¸² "); $rs_btn = &Input("reset", "", "´Ù½ÃÀÛ¼º"); &head; print "
\n"; &Fhead("post", "$cgi_url", ""); print &Input("hidden","action","adminwrite"); print &Input("hidden","id","$FORM{'id'}"); &Thead("","$head_color","3","0"); print "¨Ú °øÁö»çÇ× ³²±â±â...\n"; print "\n"; &Thead("","$head_color","3","3"); print "\n"; print "¸¸±âÀÏ\n"; print "$die_year³â\n"; print "$die_mon¿ù\n"; print "$die_dayÀÏ (¿¹: 2002³â 06¿ù 01ÀÏ)\n"; print "Á¦      ¸ñ$subject\n"; print "$htmlhtml\n"; print "$auto_linkÀÚµ¿¸µÅ©\n"; print "$auto_brÀÚµ¿ÁٹٲÞ\n"; print " $comments\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, $link_val, $br_val, $pv_value, $link_value, $file_name, $file_size, $down_num); open(DATA,"$main_dir/$FORM{'number'}"); chomp(@data = ); $pass = $data[0]; my($name, $email, $homepage, $subject, $wdate, $readnum) = split(/\|/,$data[1]); @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; $ansnum=$data[3]; @auto = split(/\|/, $data[4]); $alink = $auto[0]; $abr = $auto[1]; $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, $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"); $sub_val = &Input("text", "subject", "$subject", "","","51",""); $pre_val = &Input("text", "pre_view", "$pv_value", "", "", "51", ""); $com_val = Textarea("51","8","comments","","","$comment"); $link_file = &Input("text", "link_file", "$link_value", "", "", "51", ""); &head; &Fhead("post","$cgi_url"); 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("","$head_color","3","0"); print "¨Ú $name´ÔÀÇ ±ÛÀ» ¼öÁ¤ÇÕ´Ï´Ù.\n"; print "\n"; &Thead("","$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ÀÚµ¿ÁٹٲÞ\n"; print "Á¦      ¸ñ$sub_val\n"; print "¹Ì¸®º¸±â$pre_val\n" if(($file_name ne "") or ($link_value ne "")); print "
³»      ¿ë$com_val   \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(@data, @notice, @auto, $html, $link_val, $br_val, $subject, $comment, $wdate, $read_num, $htmlvalue); open(DATA,"$main_dir/notice.txt"); @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]; $notice[2] =~ s/
/\n/g; $comment = $notice[2]; $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", "", "", "40", ""); $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("75","8","comments","","","$comment"); $ok_btn = &Input("submit", "", " ±Û ¿Ã¸² "); $reset_btn = &Input("reset", "", "´Ù½Ã ÀÛ¼º"); &head; &Fhead("post", "$cgi_url"); print &Input("hidden", "action", "adminwrite"); print &Input("hidden","read_num","$read_num"); print &Input("hidden","id","$FORM{'id'}"); &Thead("","$head_color","3","0"); print "¨Ú °øÁö»çÇ× ¼öÁ¤Çϱâ...\n"; print "\n"; &Thead("", "$head_color", "3", "3"); print "\n"; print "¸¸±âÀÏ $year_val³â\n"; print "$mon_val¿ù $day_valÀÏ (¿¹: 2000³â08¿ù01ÀÏ)\n"; print "Á¦   ¸ñ$sub_val $html_chkhtml $auto_linkÀÚµ¿¸µÅ© $auto_brÀÚµ¿ÁٹٲÞ\n"; print " $text_val\n"; &ok_admin; print "$ok_btn $reset_btn\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } 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; print "

 

 \n"; &Thead("430","$cel_color1","0","0"); print "\n"; &Thead("100%","$head_color","0","0"); print "\n"; &Tfoot; &Thead("100%","$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%","$head_color","0","0"); print "\n"; &Tfoot; print "\n"; &Tfoot; print "

\n"; &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..$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_ok"); &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 enterpass{ &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/$FORM{'number'}"); chomp(@filea = ); close (FILE); if($FORM{'passwd'} eq ""){ &error("pass"); }elsif(($filea[0] eq $pass) || ($admin eq $pass)) { &modify_form; }else{ &error("pass"); } } sub write { 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(($admin_only eq "yes") && ($admin 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; } # $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, $home); if($FORM{'subnumber'} eq "") { &read_idx; $num=$ary[0]; while(-e "$main_dir/$num"){ $num++; } } else{ while(-e "$main_dir/$FORM{'subnumber'}"){ @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/$num"); 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'}|\n"; print WFILE "|$FORM{'ip'}|$FORM{'domain'}|$FORM{'pre_view'}|$FORM{'link_file'}|$org_name|$size|\n"; close(WFILE); &unlock; &index_plus("$num"); } else { open(Sum,"$main_dir/$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); @adata = split(/\|/,$num[0]); $adata[0]++; open(Suma,">$main_dir/num/$FORM{'num'}"); print Suma join("|",@adata); close(Suma); &lock; open(WFILE,">$main_dir/$FORM{'subnumber'}"); 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'}|\n"; print WFILE "|$FORM{'ip'}|$FORM{'domain'}|$FORM{'pre_view'}|$FORM{'link_file'}|$org_name|$size|\n"; close(WFILE); &unlock; &index_plus("$FORM{'subnumber'}"); if(($addr) && ($smail == "yes") && ($FORM{'mail_notice'} ne "1")) { &sendmail if($NT ne "1"); } if(($addr) && ($FORM{'mail_notice'} eq "1")){ &mail_notice if($NT ne "1"); } } if($num > $max_data ) { $count = 0; until($num <= 0) { if (-e "$main_dir/$num") { $count = ($count + 1); } $num = ($num - 1); if($count >= $max_data) { last; } } until($num <=0) { open(FILE,"$main_dir/$num"); @filea = ; close (FILE); unlink ("$main_dir/$num"); unlink ("$main_dir/num/$num"); unlink ("$main_dir/etc/$num"); if($filea[3] > 0) { &auto_erase("$num"); } $num = ($num - 1); } } &load_page; } sub read_idx{ open(INDEX, "$main_dir/idx/index.txt"); chomp(@ary = ); close(INDEX); if($ary[0] eq ""){ mkdir("$main_dir/idx",0777); &make_idx; } } sub index_plus{ my(@idx_list, $plus_num, $start, $num_data); $plus_num = "$_[0]"; open(IDX_DATA,"$main_dir/idx/index.txt"); chomp(@idx_list = ); close(IDX_DATA); unshift(@idx_list,$plus_num); #------------------------------------ ¾´±Û ³Ñ¹ö ¹è¿­¿¡ Ãß°¡... ^.^ @idx_list = sort {($b <=> $a) || ($a cmp $b)}(@idx_list); &lock; open(DATA, ">$main_dir/idx/index.txt"); print DATA join("\n",@idx_list); close(DATA); for(1..10){ open(PAGE,">$main_dir/idx/$_.txt"); $start = ($_ - 1)*$page_num; for(0..$page_num-1){ print PAGE "$idx_list[$start+$_]\n"; } close(PAGE); } $num_data = $#idx_list+1; open(NUM,">$main_dir/idx/num.txt"); print NUM $num_data; close(NUM); &unlock; } sub make_idx{ my(@ary, @num_data, $list_data); #---------------------------À妽º »ý¼º ( Àüü ÆäÀÌÁö)------------------------ opendir(DIR, "$main_dir"); @num_data = readdir(DIR); closedir(DIR); $cou = 0; foreach $list_data (@num_data) { if(($list_data ne "num") && ($list_data ne "etc") && ($list_data ne "idx") && ($list_data ne "notice.txt") && ($list_data ne "files") && ($list_data ne "conf.txt") && ($list_data ne "up.txt") && ($list_data ne "down.txt") && ($list_data ne ".") && ($list_data ne "..")) { $ary[$cou] = $list_data; $cou++; } } @ary = sort {($b <=> $a) || ($a cmp $b)}(@ary); #µ¥ÀÌŸ¸¦ ¹øÈ£¼øÀ¸·Î Á¤·Ä... ^.^ &lock; open (INDEX, ">$main_dir/idx/index.txt"); print INDEX join("\n",@ary); 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"))){ $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 > ($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 { 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/$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'}|\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($admin 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'); &get_date; open(WFILE,">$main_dir/notice.txt"); 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, $link_val, $br_val, $scut, $ford); &read_cookie; &head; open(REPLY, "$main_dir/$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]; $link_val = ($alink eq "1") ? "checked" : ""; $br_val = ($abr eq "1") ? "checked" : ""; @arp = split(/-/,$FORM{'number'}); $scut = @arp; if($scut > 0) { $ford = "¢Ñ ";} if($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]","","","51",""); $preview = &Input("text", "pre_view","http:\/\/","","","51",""); $mail_notice = &Checkbox("mail_notice","1","checked"); $comment = &Textarea("51","8","comments","","","\n\n


[$repla[0]´Ô²²¼­ ¾²½Å ³»¿ë]\n¢°$seper[1]"); $upfile = &Input("file","file_name","","","","36",""); $linkfile = &Input("text", "link_file","","","","51",""); $sub_btn = &Input("submit",""," ±Û ¿Ã¸² "); $reset_btn = &Input("reset","","´Ù½ÃÀû±â "); &Fhead("post","$cgi_url","multipart/form-data"); 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("","$head_color","3",""); print "¨Ú $repla[0]´Ô²²¼­ ³²±â½Å ±Û¿¡´ëÇÑ ´äº¯ ÀÛ¼º\n"; print "\n"; &Thead("","$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ÀÚµ¿ÁٹٲÞ\n"; print "Á¦      ¸ñ$subject\n"; print "¹Ì¸®º¸±â$preview\n" if($pds_ok eq "yes"); print " $mail_notice ´äº¯±Û ¸ÞÀÏ·Î º¸³»±â\n" if(($tomail ne "") && ($NT ne "1")); print "
³»      ¿ë$comment\n"; print "ÆÄÀÏ÷ºÎ$upfile\n" if($pds_ok eq "yes"); print "¸µÅ©ÆÄÀÏ$linkfile\n" if($pds_ok eq "yes"); print "$sub_btn $reset_btn\n"; &Tfoot; print "\n"; &Tfoot; &Ffoot; print "\"±Û

\n"; &foot; } sub get_date { @week = qw(ÀÏ ¿ù È­ ¼ö ¸ñ ±Ý Åä); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $month = ($mon + 1); if ($sec < 10) { $sec = "0$sec"; } if ($min < 10) { $min = "0$min"; } if ($hour < 10) { $hour = "0$hour"; } if ($mday < 10) { $mday = "0$mday"; } if ($month < 10) { $month = "0$month"; } if($year < 2000){ if($year >= 100){ $year=($year-100)+2000; } else{ $year=2000+$year; } } $date = "$year/$month/$mday [$hour:$min]"; $week_val = "$week[$wday]"; } sub load_page{ &head; if($FORM{'simple'} eq "yes"){ my $want_link = ($FORM{'action'} eq "modify_ok") ? "$cgi_url?id=$FORM{'id'}&action=view&number=$FORM{'number'}" : "$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 error { my($err) = $_[0]; &head; if($err eq "id") { print "

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

\n"; print "±ÍÇÏ°¡ ¿ä±¸ÇÏ´Â °Ô½ÃÆÇÀ» ãÀ» ¼ö ¾øÀ¾´Ï´Ù
\n"; print "¹Ýµå½Ã board.cgi?id=db Çü½ÄÀ¸·Î ºÒ·¯¾ß ÇÕ´Ï´Ù.\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 "ÇöÀç ¿Ã¸±¼ö ÀÖ´Â ÃÖ´ë ¿ë·®Àº ÆÄÀÏ´ç $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 "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 "


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

\n"; &foot; } sub search { if($down_view eq "yes"){ $down_col=""; } if($point_ok eq "yes"){ $pnt_col="̵̧"; } &read_idx; local $all_list = @ary; local $cou = 0; my($start_num) = $FORM{'start_num'} ? "$FORM{'start_num'}" : "0"; my($end_num) = $start_num + 999; my(@num_data, @gul_data, @line1, @line2, $search_data, $category); for($start_num..$end_num){ last if($ary[$_] eq ""); $num_data[$_] = $ary[$_]; } @ary = undef; foreach $list_data(@num_data) { open(LIST, "$main_dir/$list_data"); @gul_data = ; @line1 =split(/\|/, $gul_data[1]); @line2 = split(/\|/,$gul_data[2]); close (LIST); if($FORM{'category'} eq "subject") { $search_data=$line1[3]; } elsif($FORM{'category'} eq "comment"){ $search_data=$line2[1]; } elsif($FORM{'category'} eq "name"){ $search_data=$line1[0]; } else{ $category = "all"; } foreach $read_line (@gul_data) { if($category eq "all"){ $search_data=$read_line; } if($search_data =~ /$FORM{'keyword'}/i) { $ary[$cou] = $list_data; $cou++; last; } } } local $total_page = int($cou/$page_num); if(($total_page*$page_num) < $cou) {$total_page += 1; } $page = $total_page if("$FORM{'total_val'}"); &head; local @ary = sort {($b <=> $a) || ($a cmp $b)}(@ary); local $list_num = @ary; if($quick1 ne ""){ &quick_btn; } else{ print "

°Ë»ö¾î $FORM{'keyword'}    °Ë»ö°á°ú $cou°³
\n"; } &print_list; my($resent_num) = $start_num + 1; my($last_num)= $end_num + 1; print "
\"±Û¸ñ·Ï
\n"; print "

ÃÖ±Ù $resent_num°³ºÎÅÍ $last_num°³±îÁöÀÇ °Ô½Ã¹°¿¡¼­ À§¿Í°°Àº µ¥ÀÌŸ°¡ °Ë»öµÇ¾ú½À´Ï´Ù.
´ÙÀ½ 1000°³ÀÇ °Ô½Ã¹°¿¡¼­ ªO±â ¿øÇÏ½Ã¸é ¾Æ·¡ 'search'¹öÆ°À» ´­·¯ÁÖ¼¼¿ä.
" if($all_list > 1000); &find if($search_ok eq "yes"); &foot; } #--------- | ¹®ÀÚ Á¦°Å ÇÔ¼ö... ^.^ sub com124{ my @com_list = @_; foreach $list(@com_list){ $FORM{$list} =~ s/\|/|/g; } } sub find { my($start_num, $all_val, $sub_val, $name_val, $com_val, $keywd); $start_num = $FORM{'start_num'} + 1000 if($FORM{'start_num'} ne ""); $start_num = 0 if($FORM{'start_num'} eq ""); if($all_list > 1000){ if($FORM{'category'} eq "all"){ $all_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"; } $keywd = "$FORM{'keyword'}"; } &Fhead("post","$cgi_url"); &Thead("","","2","0"); print "\n"; print "\n" if(($all_list > 1000) || ($list_num > 1000)); print "\n"; print "\n"; print "\n"; print "\n"; &Tfoot; &Ffoot; } sub quick_btn{ print "\n"; &Thead("100%","","2","0"); if($FORM{'action'} 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%","$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 { my(@filea, @seper, @num_data, @ans_data, $pass, $ans_num, $num); $pass = crypt($FORM{'passwd'},"sp"); open(FILE,"$main_dir/$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) || ($admin eq $pass)) { $num = "$FORM{'number'}"; &lock; if($ans_num > 0) { &auto_erase("$num"); } unlink("$main_dir/$FORM{'number'}"); unlink ("$main_dir/num/$FORM{'number'}"); unlink ("$main_dir/etc/$FORM{'number'}"); #-------------------------------------------- »èÁ¦½Ã À妽º »©±â... my(@idx_list, @data_list, $list, $k, $num_data, $start); open(INDEX, "$main_dir/idx/index.txt"); @idx_list = ; close(INDEX); chomp(@idx_list); open(DATA, ">$main_dir/idx/index.txt"); $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.txt"); print NUM $num_data; close(NUM); #------------------------- ÆäÀÌÁöº° À妽º Á¤¸® for(1..10){ open(PAGE,">$main_dir/idx/$_.txt"); $start = ($_ - 1)*$page_num; for(0..$page_num-1){ print PAGE "$data_list[$start+$_]\n"; } close(PAGE); } &unlock; #----------------------------------------- &load_page; } else { &error("pass"); } } sub admin_remove_ok { unlink("$main_dir/notice.txt"); unlink("$main_dir/num/notice.txt"); unlink("$main_dir/etc/notice.txt"); &load_page; } sub etcdel_ok{ unlink("$main_dir/etc/$FORM{'number'}"); if($FORM{'number'} eq "notice.txt"){ &view_notice; } else{ &view; } } sub delete_etc{ 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.txt"){ $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]; &read_idx; $same_num=length($num)+1; open(DATA, ">$main_dir/idx/index.txt"); 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/$ary[$_]"; unlink "$main_dir/num/$ary[$_]"; unlink "$main_dir/etc/$ary[$_]"; unlink "$main_dir/files/$file_data[5]"; } else{ print DATA "$ary[$_]\n"; } } close(DATA); } #=================================== ÆäÀÌÁö À̵¿ ÇÔ¼ö ^.^ sub pagemove{ my($search_val) = ($FORM{'action'} eq "search") ? "&action=search&category=$FORM{'category'}&keyword=$FORM{'keyword'}&start_num=$FORM{'start_num'}" : ""; my ($interval, $start, $end, $prev, $next, $next_opt, $first, $last); &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; $last; print "...[´ÙÀ½]"; print "[Last]"; } print ""; &Tfoot; } sub loginok { my($pass) = crypt($FORM{'passwd'},"sp"); if($admin eq $pass) { &head; print "

 

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

\n"; print "¿øÇÏ´Â Ç׸ñÀ» ¼±ÅÃÇϽðí \"LET'S GO!!!\"¹öÆ°À» ´­·¯ÁÖ¼¼¿ä!\n"; &Fhead("post", "$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action","admin_act"); 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 $admin){ if($left_right eq "left"){ $board_left = "selected"; $board_center = ""; $board_right = ""; } elsif($left_right eq "center"){ $board_left = ""; $board_center = "selected"; $board_right = ""; } else{ $board_left = ""; $board_center = ""; $board_right = "selected"; } if($admin_only eq "yes"){ $only_yes = "selected"; $only_no = ""; } else{ $only_yes = ""; $only_no = "selected"; } if($view_ip eq "yes"){ $ip_yes = "selected"; $ip_no = ""; } else{ $ip_yes = ""; $ip_no = "selected"; } if($point_ok eq "yes"){ $point_yes = "selected"; $point_no = ""; } else{ $point_yes = ""; $point_no = "selected"; } if($etc_ok eq "yes"){ $etc_yes = "selected"; $etc_no = ""; } else{ $etc_yes = ""; $etc_no = "selected"; } if($i_opt eq "yes"){ $io_yes = "selected"; $io_no = ""; } else{ $io_yes = ""; $io_no = "selected"; } if($pds_ok eq "yes"){ $pds_yes = "selected"; $pds_no = ""; } else{ $pds_yes = ""; $pds_no = "selected"; } if($down_view eq "yes"){ $dv_yes = "selected"; $dv_no = ""; } else{ $dv_yes = ""; $dv_no = "selected"; } if($kind_view eq "yes"){ $kv_yes = "selected"; $kv_no = ""; } else{ $kv_yes = ""; $kv_no = "selected"; } if($smail eq "yes"){ $smail_yes = "selected"; $smail_no = ""; } else{ $smail_yes = ""; $smail_no = "selected"; } if($search_ok eq "yes"){ $search_yes = "selected"; $search_no = ""; } else{ $search_yes = ""; $search_no = "selected"; } if($speed_up eq "no"){ $speed_yes = ""; $speed_no = "selected"; } else{ $speed_yes = "selected"; $speed_no = ""; } my($pass) = &Input("password","pass","","","","13",""); my($pass_eq) = &Input("password","pass_eq","","","","13",""); my($msize_val) = &Input("text","max_size","$max_size","","","10","3"); my($page_val) = &Input("text","page_num","$page_num","","","10","3"); my($mdata_val) = &Input("text","max_data","$max_data","","","10"); my($sublen_val) = &Input("text","sub_length","$sub_length","","","10",""); my($namelen_val) = &Input("text","name_length","$name_length","","","10",""); my($fontkind_val) = &Input("text","font_kind","$font_kind","","","10",""); my($fontsize_val) = &Input("text","font_size","$font_size","","","10",""); my($fontcol_val) = &Input("text","font_color","$font_color","","","10",""); my($width_val) = &Input("text", "width", "$width", "","","10","5"); my($linelen_val) = &Input("text","line_length","$line_length", "","","10","3"); my($adminname_val) = &Input("text","admin_name","$admin_name","","","10",""); my($homeurl_val) = &Input("text","home_url","$home_url","","","40",""); my($adminmail_val) = &Input("text","admin_mail","$admin_mail","","","20",""); my($bgcol_val) = &Input("text","bgcolor","$bgcolor", "", "","8",""); my($background_val) = &Input("text","background","$background","","","25","0"); my($ncel_val) = &Input("text","ncel_color","$ncel_color","","","10",""); my($hfontcol_val) = &Input("text","hfont_color","$hfont_color","","","10",""); my($headcol_val) = &Input("text","head_color","$head_color","","","10",""); my($celcol1_val) = &Input("text","cel_color1","$cel_color1","","","10",""); my($celcol2_val) = &Input("text","cel_color2","$cel_color2","","","10",""); my($overcol_val) = &Input("text","over_color","$over_color","","","10",""); my($selcol_val) = &Input("text","select_color","$select_color","","","10",""); my($numcol_val) = &Input("text","num_color","$num_color","","","10",""); my($datecol_val) = &Input("text","date_color","$date_color","","","10",""); my($readcol_val) = &Input("text","read_color","$read_color","","","10",""); my($downcol_val) = &Input("text","down_color","$down_color","","","10",""); my($logoimg_val) = &Input("text","logo_img","$logo_img","","","42",""); my($txtlogo_val) = &Input("text","logo_txt","$logo_txt","","","42",""); my($pnt_max) = &Input("text","pnt_cnt","$pnt_cnt","","","3",""); &head; &Fhead("post","$cgi_url"); print &Input("hidden","id","$FORM{'id'}"); print &Input("hidden","action","make_conf"); &Thead("500","$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 "$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 "°Ô½ÃÆÇ ³ÐÀÌ $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 "¹è°æ»ö $bgcol_val or ¹è°æ À̹ÌÁö URL $background_val\n"; print "°øÁö»çÇ× °­Á¶»ö $ncel_val\n"; my($hcolor)=($head_color)? "$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 "logo À̹ÌÁö URL $logoimg_val\n"; print "ÅؽºÆ® ·Î°í $txtlogo_val\n"; for(1..7){ print "»¡¸®°¡±â$_. ID ".&Input("text", "quick$_","$quick[$_]","","","17",""); print "NAME ".&Input("text", "q_name$_","$q_name[$_]","","","17","")."\n"; } print " ¼Óµµ ºü¸£°Ô\n"; print "\n"; print " °Ë»öâ º¸À̱â\n"; print "\n"; print "½¬´Â ¿äÀÏ  "; &get_date; my @en_week = qw(sun mon tue wed thu fri sat); for(1..7){ print &Checkbox("$en_week[$_-1]","$week[$_-1]","$lock[$_]"); print "$week[$_-1]  "; } print "\n"; &Tfoot; print "\n"; &Tfoot; print "
"; &ok_admin; print "
"; print &Input("submit","","µî·ÏÇϱâ").&Input("reset","","´Ù½ÃÀû±â"); &Ffoot; &foot; } else{ &error("pass"); } } sub chk_skindir{ my(@skin_data, $list, $cnt); opendir(SKIN_DIR, "$img_dir"); @skin_data = readdir(SKIN_DIR); closedir(SKIN_DIR); $cnt = 0; foreach $list(@skin_data) { if((-d "$img_dir/$list") && ($list ne ".") && ($list ne "..") && ($list ne "face") && ($list ne "type")){ $skin[$cnt] = $list; $cnt++; } } } 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{'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'}$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 $admin){ &head; &Fhead("post","$cgi_url"); print &Input("hidden","action","html_write"); print &Input("hidden", "id", "$FORM{'id'}"); &Thead("600","$head_color","1","0"); print "\n"; &Thead("100%","$cel_color1","3","0"); print "\n"; &Thead("100%","$cel_color2","0","3"); open(UPHTML,"$main_dir/up.txt"); @html_up = ; close(UPHTML); print "

¨Ú °Ô½ÃÆÇ À§¿¡ »ðÀ﵃ htmlÄÚµå <body>...
\n"; open(DOWNHTML,"$main_dir/down.txt"); @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 $admin){ &head; &Fhead("post","$cgi_url"); print &Input("hidden","action","repair_idx"); print &Input("hidden", "id", "$FORM{'id'}"); &Thead("600","$head_color","1","0"); print "\n"; &Thead("100%","$cel_color1","3","0"); print "\n"; &Thead("100%","$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 $admin){ open(UPDATA, ">$main_dir/up.txt"); print UPDATA "$FORM{'html_up'}"; close(UPDATA); open(DOWNDATA, ">$main_dir/down.txt"); print DOWNDATA "$FORM{'html_down'}"; close(DOWNDATA); &load_page; } else{ &error("ok_admin"); } } sub repair_idx{ for(1..10){ unlink "$main_dir/idx/$_.txt"; } unlink "$main_dir/idx/index.txt"; &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"); unless(-e "$main_dir/files"){ #--------- ÀÌÀü ¾÷±×·¹À̵åÀÚ¸¦ À§Çؼ­... mkdir("$main_dir/files",0777); } if($pass eq $admin){ if($FORM{'pass'} eq ""){ $passwd = $admin; } elsif($FORM{'pass'} eq $FORM{'pass_eq'}){ $pass = crypt($FORM{'pass'},"sp"); $passwd = $pass; } else{ &error("pass"); } open(SAVE,">$main_dir/conf.txt"); print SAVE "|$FORM{'page_num'}|$FORM{'admin_only'}|$FORM{'max_data'}|$passwd|$FORM{'admin_select'}|$FORM{'admin_mail'}|$FORM{'home_url'}|$FORM{'width'}|$FORM{'admin_name'}|$FORM{'ncel_color'}|$FORM{'head_color'}|$FORM{'cel_color1'}|$FORM{'select_color'}|$FORM{'num_color'}|$FORM{'date_color'}|$FORM{'read_color'}|$FORM{'bgcolor'}|$FORM{'background'}|$FORM{'logo_img'}|$FORM{'logo_txt'}|$FORM{'sub_length'}|$FORM{'cel_color2'}|$FORM{'line_length'}|$FORM{'view_ip'}|$FORM{'pds_ok'}|$FORM{'max_size'}|$FORM{'down_view'}|$FORM{'kind_view'}|$FORM{'etc_ok'}|$FORM{'img_skin'}|$FORM{'point_ok'}|$FORM{'font_kind'}|$FORM{'font_size'}|$FORM{'left_right'}|$FORM{'search_ok'}|$FORM{'font_color'}|$FORM{'down_color'}|$FORM{'pnt_cnt'}|$FORM{'name_length'}|$FORM{'i_opt'}|$FORM{'over_color'}|$FORM{'hfont_color'}|$FORM{'speed_up'}|\n"; print SAVE "|$FORM{'quick1'}|$FORM{'quick2'}|$FORM{'quick3'}|$FORM{'quick4'}|$FORM{'quick5'}|$FORM{'quick6'}|$FORM{'quick7'}|\n"; print SAVE "|$FORM{'q_name1'}|$FORM{'q_name2'}|$FORM{'q_name3'}|$FORM{'q_name4'}|$FORM{'q_name5'}|$FORM{'q_name6'}|$FORM{'q_name7'}|\n"; print SAVE "|$FORM{'sun'}|$FORM{'mon'}|$FORM{'tue'}|$FORM{'wed'}|$FORM{'thu'}|$FORM{'fri'}|$FORM{'sat'}|\n"; close(SAVE); #------------------------- ÆäÀÌÁöº° À妽º Á¤¸® my $page_num = $FORM{'page_num'}; &read_idx; my $num_data = @ary; unless($num_data eq "0"){ &lock; open(NUM,">$main_dir/idx/num.txt"); print NUM $num_data; close(NUM); for(1..10){ open(PAGE,">$main_dir/idx/$_.txt"); my $start = ($_ - 1)*$page_num; for(0..$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.txt"); @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.txt"); $read_num = ; close(NUM); $plus_num = ($FORM{'cnt'} ne "no") ? $read_num + 1 : $read_num; if($FORM{'cnt'} ne "no"){ &lock if($speed_up eq "no"); open(NFI,">$main_dir/num/notice.txt"); print NFI "$plus_num"; close(NFI); &unlock if($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; } } &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%","$cel_color1","3","0"); print "

$comments

"; #--------------------------------------------------------------------------------- if($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.txt"); 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.txt"){ open (ETC, "$main_dir/etc/notice.txt"); @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 ""){ $gd = $_ + 1; print "\"$gd¹ø° $etc[$_]\n"; } } } &Tfoot; &Ffoot; } #---------------------------------------------- print "\n"; &Tfoot; &Thead("100%","","0","0"); $color_val = $head_color ? "bgcolor=$head_color": ""; print "\n"; &Tfoot; print "\n"; &Tfoot; print "

\"±Û

\n"; &foot; } 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"; $left_right = "center"; } else{ print "TMR \n"; } my $font_size = $font_size ? "$font_size" : "9pt"; print "\n"; print "\n"; print "\n"; print "\n"; my($back, $color_val); if($background ne ""){ $back="background=$background"; } else{ $back="bgcolor=$bgcolor"; } print "\n"; #------------------------------------------------------ À­ºÎºÐ htmlÅ×±× ³Ö±â if((-e "$main_dir/up.txt") && ($FORM{'simple'} ne "yes")){ open(UPDATA,"$main_dir/up.txt"); my @html_up = ; close(UPDATA); foreach $_(@html_up) { print "$_"; } print "
\n" if($html_up[0] ne ""); } #---------------------------------------------------------------- #---------------------------------------------- È­¸é ¹è¿­ Á¤¿­ ¿À¸¥ÂÊ ¿ÞÂÊ Áß°£... $left_right="center" if($left_right eq ""); &Thead("100%","","10","0"); print "\n"; print "\n"; print "\n"; &Tfoot; &Thead("100%","$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(($quick1 eq "") || ($FORM{'action'} eq "form")){ print "

\n"; } } sub foot { print "

\"°ü¸®ÀÚ
\n" if($FORM{'simple'} ne "yes"); if($customer eq "0"){ if($img_skin ne ""){ open(SKIN,"$img_dir/$img_skin/$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.0
\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($logo_img ne ""){ print "\"°ü¸®ÀÚ\n"; } elsif($logo_txt ne ""){ &Thead("","$cel_color1","0","0"); print "
\n"; &Thead("100%","","0","0"); $color_val = $head_color ? "bgcolor=$head_color": ""; print "
  "; print "$logo_txt  
\n"; print "\n"; &Tfoot; #----------------------------------------------- ¹ØºÎºÐ htmlÅ×±× ³Ö±â if((-e "$main_dir/down.txt") && ($FORM{'simple'} ne "yes")){ open(DOWNDATA,"$main_dir/down.txt"); 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/<hr>/


/g; } else{ $FORM{'comments'} =~ s/<br>/
/g; $FORM{'comments'} =~ s/<p>/

/g; } $FORM{'comments'} =~ s/\r\n/
/g; $FORM{'comment'} =~ s/\r\n/
/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 "====================================================================
\n"; print MAIL "

This messages form $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: $admin_name<$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 form $home_url\n"; print MAIL "¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß¡ß\n\n"; close (MAIL); }