"; exit; //½ºÅ©¸³Æ® Á¾·á } //======================================================// // // // ¹Ù·Î ´Ù¸¥ ÆäÀÌÁö·Î À̵¿ÇÏ´Â ÇÔ¼ö // // // //======================================================// function DoLocation($location_url){ echo " "; exit; //½ºÅ©¸³Æ® Á¾·á } //======================================================// // // // ¸Þ¼¼Áö ¶ç¿îÈÄ ´Ù¸¥ ÆäÀÌÁö·Î À̵¿ÇÏ´Â ÇÔ¼ö // // // //======================================================// function DoMessageLocation($message, $location_url){ echo " "; exit; //½ºÅ©¸³Æ® Á¾·á } //======================================================// // // // »èÁ¦Àü ¹°¾îº¸´Â confirm ÇÔ¼ö // // // //======================================================// function DoConfirmLocation($message, $location_url, $location_return){ echo " "; } //======================================================// // // // DB Á¸ÀçÈ®ÀÎÇÔ¼ö // // // //======================================================// function DbConfirm($db_name){ $result = mysql_query("show databases"); if ($result > 0) { while($row1 = @mysql_fetch_row($result)) { if($row1[0] == $db_name){ return 0; break; } } } return 1; } //======================================================// // // // Ãʱâ ÀνºÅç Å×ÀÌºí »ý¼ºÇÔ¼ö // // // //======================================================// function InstallNewTable($adminid, $adminpw){ $q1 = "CREATE TABLE board_config ( table_code CHAR(20) NOT NULL, table_name CHAR(50) NOT NULL, table_category enum('°Ô½ÃÆÇ','ÀÚ·á½Ç') NOT NULL, table_row char(6) NOT NULL, list_row tinyint unsigned NOT NULL, title_bg char(6) NOT NULL, list_bg char(6) NOT NULL, line_bg char(6) NOT NULL, border char(1) NOT NULL, cellpadding char(1) NOT NULL, cellspacing char(1) NOT NULL, table_admin char(1) NOT NULL, table_member char(1) NOT NULL, cookie_name char(10), page_header text, page_footer text, include_ox char(1) NOT NULL, include_data varchar(255), write_less_time char(5), include_top_data varchar(255), img_ox char(1) NOT NULL, new_icon_date char(2) NOT NULL, html_ox char(1) NOT NULL, primary key(table_code) ) "; $q2 = "CREATE TABLE admin_tb ( admin_id char(10) NOT NULL, pw char(10) NOT NULL, primary key(admin_id) ) "; $q3 = "insert into admin_tb values('$adminid', '$adminpw')"; mysql_query($q1); mysql_query($q2); mysql_query($q3); } //======================================================// // // // Å×ÀÌºí »ý¼ºÇÔ¼ö // // // //======================================================// function MakeNewTable($table, $table_name, $tb_category){ $list_table = $table."_board_tb"; $q1 = " create table $list_table( table_no int(11) auto_increment NOT NULL, table_id int unsigned NOT NULL, depth tinyint unsigned NOT NULL, subject char(80) NOT NULL, write_time datetime NOT NULL, view_count int(11) unsigned NOT NULL, name char(20) NOT NULL, email char(30), pw char(10) NOT NULL, file_format char(4), file_name char(70), file_size char(7), content text NOT NULL, board_html_ox char(1) NOT NULL, primary key(table_no), index(table_id) ) "; $q2 = "insert into board_config VALUES('$table', '$table_name', '$tb_category', '600', '20', 'DEDBDE', 'white', 'white', '0', '0', '0', '0', '0', '', '', '', '0', '', '30', '', '1', '3', '1')"; mysql_query($q1); mysql_query($q2); } //======================================================// // // // Å×À̺í Á¸Àç¿©ºÎ¸¦ ¹¯´Â ÇÔ¼ö // // // //======================================================// function is_table($tn){ $tn = $tn."_board_tb"; $result = @mysql_query("SHOW TABLES LIKE 'test'"); if(!$result){return 1;} else{return 0;} } //======================================================// // // // µð·ºÅ丮 »ý¼ºÇÔ¼ö // // // //======================================================// function MakeNewDataDirectory($b_name){ mkdir("./$b_name", 0777); chmod("./$b_name", 0777); } //======================================================// // // // µð·ºÅ丮 »èÁ¦ÇÔ¼ö // // // //======================================================// function MyDeleteDirectory($dirName){ $opendir = opendir($dirName); while($filelist = readdir($opendir)) { unlink($dir.$filelist); } closedir($dirName); rmdir($dirName); } //======================================================// // // // °Ô½ÃÆÇ ÄÚµå Á¸Àç¿©ºÎ¸¦ ¹¯´Â ÇÔ¼ö // // // //======================================================// function CodeConfirm($table_code){ $result = mysql_query("select table_code from board_config where table_code='$table_code'"); $row = mysql_fetch_row($result); if(empty($row[0])){return 1;} return 0; } //======================================================// // // // °Ô½ÃÆÇ »èÁ¦ÇÏ´Â ÇÔ¼ö // // // //======================================================// function BoardDelMode($code, $table_num, $config_row, $row_file, $page, $start){ if(empty($AdminId_cookie)){BoardDelForm($code, $table_num, $config_row, $row_file, $page, $start);} //ÀϹݻèÁ¦ÀÏ °æ¿ì else{} //Äí۰ª ´Ù½Ã ºñ±³ÈÄ »èÁ¦ } //======================================================// // // // °Ô½ÃÆÇ »èÁ¦ÇÏ´Â ÇÔ¼ö // // // //======================================================// function BoardDelForm($code, $table_num, $config_row, $row_file, $page, $start){ //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_del = ''; //¼öÁ¤Çϱâ À̹ÌÁö $title_password = ''; //ÆÐ½º¿öµå À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_password = 'ÆÐ½º¿öµå'; $title_filesize = 'ÆÄÀÏ»çÀÌÁî'; $title_del = '»èÁ¦ Çϱâ'; } echo("

$title_bg_img_insert$title_del

$title_password

$title_bottom_insert

"); } //======================================================// // // // ȸ¿ø/ºñȸ¿ø ±ÇÇÑÀ» ¹¯´Â ÇÔ¼ö // // // //======================================================// function MemberConfirmAuth($table_code){ $result = mysql_query("select table_member, cookie_name from board_config where table_code='$table_code'"); $row = mysql_fetch_row($result); if(($row[0]=='1') and !empty($row[1])){return 1;} //ȸ¿øÀü¿ëÀÏ °æ¿ì 1°ªÀ» ¸®ÅÏÇÑ´Ù. return 0; } //======================================================// // // // °ü¸®ÀÚ ·Î±×ÀÎ À¯¹«¸¦ ¹¯´Â ÇÔ¼ö // // // //======================================================// function AdminConfirmAuth($table_code){ global $HTTP_COOKIE_VARS; //Äí۰ª Àû¿ëÀ» À§ÇØ ±Û·Î¹ú·Î Àû¿ë $result = mysql_query("select count(*) from admin_tb where admin_id='$HTTP_COOKIE_VARS[cookie_admin_id]' and pw='$HTTP_COOKIE_VARS[cookie_admin_pw]'"); //°Ô½ÃÆÇ °ü¸®ÀÚ ¾ÆÀ̵𰪠ºñ±³ $row = mysql_fetch_row($result); if($row[0] == '0'){return 0;} //°ü¸®ÀÚ°¡ ¾Æ´Ò °æ¿ì 0À» ¸®ÅÏÇÑ´Ù. return 1; } //======================================================// // // // Ä«¿îÆ® ¿Ã¸®´Â ÇÔ¼ö // // // //======================================================// function BoardCountMode($table_code, $table_num){ $table_name = $table_code.'_board_tb'; $count_query = mysql_query("select view_count from $table_name where table_no='$table_num'"); $row = mysql_fetch_row($count_query); $count = $row[0] + 1; mysql_query("update $table_name set view_count='$count' where table_no='$table_num'"); } //======================================================// // // // Á¦¸ñ ÀÚ¸£´Â ÇÔ¼ö // // // //======================================================// function short_str($str, $len){ if( strlen($str) < $len) return $str; else{ // ÀÚ¸¦ ¹®ÀÚ¿­¿¡ Æ÷ÇÔµÈ ¾Æ½ºÅ°¹®ÀÚ°¡ ¾Æ´Ñ ¹®ÀÚÀÇ ¼ö ±¸Çϱâ $kor = 0; for( $i=0 ; $i < $len ; $i++ ) if( ord($str[$i]) > 127 ) $kor++; if(($kor % 2 != 0) && (ord($str[$len-1]) > 127)) $len--; return substr($str,0,$len); } } //======================================================// // // // ÆäÀÌ¡ ÇÔ¼ö // // // //======================================================// function page_nav($total,$scale,$p_num,$page,$query){ global $PHP_SELF; global $page; global $start; $total_page = ceil($total/$scale); if (!$page) $page = 1; $page_list = ceil($page/$p_num)-1; $start = ($page-1) * $scale; // ÆäÀÌÁö ¸®½ºÆ®ÀÇ Ã¹¹øÂ°°¡ ¾Æ´Ñ °æ¿ì¿£ [1]...[prev] ¹öưÀ» »ý¼ºÇÑ´Ù. if ($page_list>0){ $navigation = "[1] ... "; $prev_page = ($page_list-1)*$p_num+1; $start = ($prev_page-1) * $scale; $navigation .= "[prev] "; } else{ $i = 0; } // ÆäÀÌÁö ¸ñ·Ï °¡¿îµ¥ ºÎºÐ Ãâ·Â $page_end=($page_list+1)*$p_num; if ($page_end>$total_page) $page_end=$total_page; for ($setpage=$page_list*$p_num+1;$setpage<=$page_end;$setpage++) { if ($setpage==$page) { $navigation .= "[$setpage] "; } else{ $start = ($setpage-1) * $scale; $navigation .= "[$setpage] "; } } // ÆäÀÌÁö ¸ñ·Ï ¸Ç ³¡ÀÌ $total_page º¸´Ù ÀÛÀ» °æ¿ì¿¡¸¸, [next]...[$total_page] ¹öưÀ» »ý¼ºÇÑ´Ù. if ($page_end<$total_page) { $next_page = ($page_list+1)*$p_num+1; $start = ($next_page-1) * $scale; $navigation .= "[next] "; $start = ($total_page-1) * $scale; $navigation .= "... [$total_page]"; } return array($navigation,$page); } //======================================================// // // // °Ô½ÃÆÇ ¸®½ºÆ® ÇÔ¼ö // // // //======================================================// function BoardToalList($table_code, $search_text, $search_category, $config_row, $start){ $tn = $table_code."_board_tb"; if(empty($search_text)){ $result = mysql_query("select count(*) from $tn"); $total_row = mysql_fetch_row($result); $list_result = mysql_query("select table_no, table_id, depth, subject, write_time, view_count, name, email, file_format, content, board_html_ox from $tn order by table_id desc limit $start, $config_row[list_row];"); } else{ $result = mysql_query("select count(*) from $tn where $search_category like '%$search_text%'"); $total_row = mysql_fetch_row($result); $list_result = mysql_query("select table_no, table_id, depth, subject, write_time, view_count, name, email, file_format, content, board_html_ox from $tn where $search_category like '%$search_text%' order by table_id desc limit $start, $config_row[list_row];"); } $total_num = $total_row[0]; $query='code='.$table_code.'&search_text='.$search_text.'&search_category='.$search_category; //ÆäÀÌ¡¸µÅ©¿¡ º¸³¾ º¯¼ö $total_data=$total_num; //ÃÑ µ¥ÀÌŸ ¼ö $num_per_page=$config_row[list_row]; //¸®½ºÆ® °¹¼ö $page_per_list=10; //º¸¿©ÁÙ ÆäÀÌÁö ¼ö $nav=page_nav($total_data,$num_per_page,$page_per_list,$page,$query); global $HTTP_COOKIE_VARS; //°ü¸®ÀÚ Àü¿ëÀ¯¹« È®ÀÎ if($config_row[table_admin]=='1'){ //°ü¸®ÀÚ Àü¿ëÀÏ °æ¿ì if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ¸µÅ©¸¦ °É¾îÁØ´Ù. $write_button=''; } else{ $write_button=''; } } //ȸ¿ø Àü¿ëÀ¯¹« È®ÀÎ else{ if($config_row[table_member]=='1'){ if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ¸µÅ©¸¦ °É¾îÁØ´Ù. $write_button=''; } else{ //Äí۰ªÀÌ ¾øÀ» °æ¿ì if(empty($HTTP_COOKIE_VARS[$cookie_name])){$write_button='';} else{$write_button='';} } } //ȸ¿ø Àü¿ëÀÌ ¾Æ´Ò °æ¿ì ¹Ù·Î ¸µÅ©¸¦ °É¾îÁØ´Ù. else{$write_button='';} } //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} //°ü¸®ÀÚ ·Î±×ÀÎ È®ÀÎÀ¯¹« if(AdminConfirmAuth($table_code)){$admin_button=' ';} else{$admin_button='';} //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_no = ''; //NO À̹ÌÁö $title_title = ''; //Á¦¸ñ À̹ÌÁö $title_date = ''; //µî·ÏÀÏ À̹ÌÁö $title_count = ''; //Á¶È¸¼ö À̹ÌÁö $title_writer = ''; //±Û¾´ÀÌ À̹ÌÁö $title_file = ''; //ÆÄÀÏ À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_no = 'NO'; $title_title = 'Á¦¸ñ'; $title_date = 'µî·ÏÀÏ'; $title_count = 'Á¶È¸¼ö'; $title_writer = '±Û¾´ÀÌ'; $title_file = 'ÆÄÀÏ'; } echo("

$ox ÃÑ °Ô½Ã¹°¼ö: $total_row[0]

$admin_button $write_button 

"); //======================================================// // // // °Ô½ÃÆÇÀÏ °æ¿ì // // // //======================================================// if($config_row[table_category]=='°Ô½ÃÆÇ'){ echo(" "); if($total_row[0] == 0) { echo(" "); } else { while($row = mysql_fetch_array($list_result)){ $no = $start + 1; $time = substr($row[write_time],0,10); if($row[email]==''){$row[name]=strtr("$row[name]", ";", ""); $row[name] = htmlspecialchars($row[name]); $mail_name=$row[name];} else{$row[name]=strtr("$row[name]", ";", ""); $row[name] = htmlspecialchars($row[name]); $mail_name=''.$row[name].'';} if($row[depth] > 0){ //´ä±ÛÀÏ °æ¿ì ·çÇÁ¸¸Å­ ºóÄ­À» Ãâ·ÂÇÑ´Ù. for($j=0; $j < $row[depth]; $j++){ $blink = '  '.$blink; } $reimg = ''.' '; } else{$reimg = "";} //=====================°Ë»öÇßÀ» °æ¿ì °Ë»ö´Ü¾î »ö±òÁÖ±â=======================// if(!empty($search_text)){ if($search_category == "subject") { $subject = eregi_replace("($search_text)","$search_text",$row[subject]); } } else{$subject = $row[subject];} $subject = short_str($subject, 100); //Á¦¸ñ ÀÚ¸£±â $content = short_str($row[content], 200); //³»¿ë ÀÚ¸£±â $content = htmlspecialchars($content); $content = str_replace(";", "1",$content); $content = str_replace(".", "!",$content); $content = str_replace("'", "1",$content); //NEW¾ÆÀÌÄÜ ºÙÀ̱â $time_stamp = strtotime($row[write_time]); $pre_date = date('Ymd',strtotime("+$config_row[new_icon] day",$time_stamp)); $today_date = date(Ymd); $tre_date = $pre_date - $today_date; if($tre_date > 0){$new_icon=' ';} else{$new_icon='';} echo(" $line "); $blink = ''; $start++; } //while¹® ´Ý±â } //Áß°£ else¹® ´Ý±â } //ù if¹® ´Ý±â //======================================================// // // // ÀÚ·á½ÇÀÏ °æ¿ì // // // //======================================================// else{ echo("

{$title_bg_img_insert}$title_no

$title_title

$title_date

$title_count

$title_writer

µî·ÏµÈ °Ô½Ã¹°ÀÌ ¾ø½À´Ï´Ù.

$no

$blink$reimg$subject$new_icon

$time

$row[view_count]

$mail_name

"); if($total_row[0] == 0) { echo(" "); } else { while($row = mysql_fetch_array($list_result)){ $no = $i + 1; $time = substr($row[write_time],0,10); if($row[email]==''){$mail_name=$row[name];} else{$mail_name=''.$row[name].'';} //=====================°Ë»öÇßÀ» °æ¿ì °Ë»ö´Ü¾î »ö±òÁÖ±â=======================// if(!empty($search_text)){ if($search_category == "subject") { $subject = eregi_replace("($search_text)","$search_text",$row[subject]); } } else{$subject = $row[subject];} $subject = short_str($subject, 100); //Á¦¸ñ ÀÚ¸£±â $content = short_str($row[content], 200); //³»¿ë ÀÚ¸£±â $content = htmlspecialchars($content); //NEW¾ÆÀÌÄÜ ºÙÀ̱â $time_stamp = strtotime($row[write_time]); $pre_date = date('Ymd',strtotime("+$config_row[new_icon] day",$time_stamp)); $today_date = date(Ymd); $tre_date = $pre_date - $today_date; if($tre_date > 0){$new_icon='';} else{$new_icon='';} echo(" $line "); $blink = ''; $i++; } //for¹® ´Ý±â } //Áß°£ else¹® ´Ý±â } //======================================================// // // // °Ë»öÅ×À̺í Ãâ·Â // // // //======================================================// echo("

{$title_bg_img_insert}$title_no

$title_title

$title_file

$title_date

$title_count

$title_writer

µî·ÏµÈ °Ô½Ã¹°ÀÌ ¾ø½À´Ï´Ù.

$no

$blink$subject$new_icon

$row[file_format]

$time

$row[view_count]

$mail_name

{$title_bottom_insert}$nav[0]

"); } //======================================================// // // // °Ô½ÃÆÇ ¾²±âÇÔ¼ö // // // //======================================================// function BoardWriteMode($table_code, $config_row){ global $HTTP_COOKIE_VARS; //°ü¸®ÀÚ Àü¿ëÀ¯¹« È®ÀÎ if($config_row[table_admin]=='1'){ //°ü¸®ÀÚ Àü¿ëÀÏ °æ¿ì if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã } else{ DoHistoryBack("°ü¸®ÀÚ Àü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù."); //°ü¸®ÀÚ°¡ ¾Æ´Ò °æ¿ì µÚ·Î µ¹·Á º¸³½´Ù. } } //ȸ¿ø Àü¿ëÀ¯¹« È®ÀÎ else{ if($config_row[table_member]=='1'){ if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã } else{ //Äí۰ªÀÌ ¾øÀ» °æ¿ì if(empty($HTTP_COOKIE_VARS[$cookie_name])){DoHistoryBack("ȸ¿ø Àü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù.\\n\\n·Î±×ÀÎÇØ Áֽʽÿä.");} else{} } } //ȸ¿ø Àü¿ëÀÌ ¾Æ´Ò °æ¿ì ¹Ù·Î ¸µÅ©¸¦ °É¾îÁØ´Ù. else{} } //±Û ÃÖ¼ÒÀúÀå½Ã°£ $write_less_time = $config_row[write_less_time] * 1000; //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} //htmlÇã¿ëÀ¯¹« if($config_row[html_ox]==1){ //htmlÀ» Çã¿ëÇÒ °æ¿ì $html_ox_txt = $line.'

 

 TXT HTML

'; $content_wrap='wrap=hard'; } else{ //htmlÀ» Çã¿ë¾ÈÇÒ °æ¿ì $html_ox_txt = ''; $content_wrap='wrap=hard'; //°­Á¦ ÁÙ¹Ù²Þ } //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_no = ''; //NO À̹ÌÁö $title_title = ''; //Á¦¸ñ À̹ÌÁö $title_date = ''; //µî·ÏÀÏ À̹ÌÁö $title_count = ''; //Á¶È¸¼ö À̹ÌÁö $title_writer = ''; //±Û¾´ÀÌ À̹ÌÁö $title_file = ''; //ÆÄÀÏ À̹ÌÁö $title_email = ''; //À̸ÞÀÏ À̹ÌÁö $title_content = ''; //³»¿ë À̹ÌÁö $title_filesize = ''; //ÆÄÀÏ»çÀÌÁî À̹ÌÁö $title_newwrite = ''; //»õ±Û¾²±â À̹ÌÁö $title_password = ''; //ÆÐ½º¿öµå À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_no = 'NO'; $title_title = 'Á¦¸ñ'; $title_date = 'µî·ÏÀÏ'; $title_count = 'Á¶È¸¼ö'; $title_writer = '±Û¾´ÀÌ'; $title_file = 'ÆÄÀÏ'; $title_email = 'À̸ÞÀÏ'; $title_content = '³»¿ë'; $title_filesize = 'ÆÄÀÏ»çÀÌÁî'; $title_newwrite = '»õ ±Û¾²±â'; $title_password = 'ÆÐ½º¿öµå'; } //======================================// // // // °Ô½ÃÆÇÀÏ °æ¿ì // // // //======================================// if($config_row[table_category]=='°Ô½ÃÆÇ'){ echo(" $line $line $line $line $html_ox_txt

{$title_bg_img_insert}$title_newwrite

$title_title

 

$title_writer

 

$title_email

 

$title_password

  »èÁ¦ ¼öÁ¤½Ã ÇÊ¿ä

$title_content

 

$title_bottom_insert

"); } //======================================// // // // ÀÚ·á½ÇÀÏ °æ¿ì // // // //======================================// else{ echo(" $line $line $line $line $html_ox_txt $line

{$title_bg_img_insert}$title_newwrite

$title_title

 

$title_writer

 

$title_email

 

$title_password

  »èÁ¦ ¼öÁ¤½Ã ÇÊ¿ä

$title_content

 

$title_file

 

$title_bottom_insert

"); } } //======================================================// // // // °Ô½ÃÆÇ ´ä±Û ¾²±âÇÔ¼ö // // // //======================================================// function BoardReplyWriteMode($table_code, $num, $config_row, $page, $start){ global $HTTP_COOKIE_VARS; //°ü¸®ÀÚ Àü¿ëÀ¯¹« È®ÀÎ if($config_row[table_admin]=='1'){ //°ü¸®ÀÚ Àü¿ëÀÏ °æ¿ì if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã } else{ DoHistoryBack("°ü¸®ÀÚ Àü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù."); //°ü¸®ÀÚ°¡ ¾Æ´Ò °æ¿ì µÚ·Î µ¹·Á º¸³½´Ù. } } //ȸ¿ø Àü¿ëÀ¯¹« È®ÀÎ else{ if($config_row[table_member]=='1'){ if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã } else{ //Äí۰ªÀÌ ¾øÀ» °æ¿ì if(empty($HTTP_COOKIE_VARS[$cookie_name])){DoHistoryBack("ȸ¿ø Àü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù.\\n\\n·Î±×ÀÎÇØ Áֽʽÿä.");} else{} } } //ȸ¿ø Àü¿ëÀÌ ¾Æ´Ò °æ¿ì ¹Ù·Î ¸µÅ©¸¦ °É¾îÁØ´Ù. else{} } $table_name = $table_code.'_board_tb'; $result2 = mysql_query("select table_id, depth, subject, content from $table_name where table_no='$num'"); //°Ô½ÃÆÇ ³»¿ëÄõ¸®¹® Äõ¸®¹®ÇÔ¼ö È£Ãâ $row = mysql_fetch_array($result2); if($row[depth]==0){$depth=1; $first_ok=1;} else{$depth=$row[depth];} for($i=0; $i < $depth; $i++){ $retitle = 'RE'.':'.$retitle; } $retitle = $retitle.$row[subject]; //±Û ÃÖ¼ÒÀúÀå½Ã°£ $write_less_time = $config_row[write_less_time] * 1000; //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} //htmlÇã¿ëÀ¯¹« if($config_row[html_ox]==1){ //htmlÀ» Çã¿ëÇÒ °æ¿ì $html_ox_txt = $line.'

 

 TXT HTML

'; } else{ //htmlÀ» Çã¿ë¾ÈÇÒ °æ¿ì $html_ox_txt = ''; } //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_no = ''; //NO À̹ÌÁö $title_title = ''; //Á¦¸ñ À̹ÌÁö $title_date = ''; //µî·ÏÀÏ À̹ÌÁö $title_count = ''; //Á¶È¸¼ö À̹ÌÁö $title_writer = ''; //±Û¾´ÀÌ À̹ÌÁö $title_file = ''; //ÆÄÀÏ À̹ÌÁö $title_email = ''; //À̸ÞÀÏ À̹ÌÁö $title_content = ''; //³»¿ë À̹ÌÁö $title_filesize = ''; //ÆÄÀÏ»çÀÌÁî À̹ÌÁö $title_reply = ''; //´ä±Û¾²±â À̹ÌÁö $title_password = ''; //ÆÐ½º¿öµå À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_no = 'NO'; $title_title = 'Á¦¸ñ'; $title_date = 'µî·ÏÀÏ'; $title_count = 'Á¶È¸¼ö'; $title_writer = '±Û¾´ÀÌ'; $title_file = 'ÆÄÀÏ'; $title_email = 'À̸ÞÀÏ'; $title_content = '³»¿ë'; $title_filesize = 'ÆÄÀÏ»çÀÌÁî'; $title_reply = '´ä±Û ¾²±â'; } echo(" $line $line $line $line $html_ox_txt

{$title_bg_img_insert}$title_reply

$title_title

 

$title_writer

 

$title_email

 

$title_password

  »èÁ¦ ¼öÁ¤½Ã ÇÊ¿ä

$title_bg_content

 

$title_bottom_insert

"); } //======================================================// // // // °Ô½ÃÆÇ ¼öÁ¤ÇÔ¼ö // // // //======================================================// function BoardEditMode($table_code, $table_num, $config_row, $page, $start){ $table_name = $table_code.'_board_tb'; $result2 = mysql_query("select subject, name, email,content, board_html_ox from $table_name where table_no='$table_num'"); //°Ô½ÃÆÇ ³»¿ëÄõ¸®¹® Äõ¸®¹®ÇÔ¼ö È£Ãâ $row = mysql_fetch_array($result2); //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} //htmlÇã¿ëÀ¯¹« if($row[board_html_ox]=='0'){$board_html_ox1='checked'; $board_html_ox2='';} else{$board_html_ox1=''; $board_html_ox2='checked';} if($config_row[html_ox]==1){ //htmlÀ» Çã¿ëÇÒ °æ¿ì $html_ox_txt = $line.'

 

 TXT HTML

'; } else{ //htmlÀ» Çã¿ë¾ÈÇÒ °æ¿ì $html_ox_txt = ''; } //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_no = ''; //NO À̹ÌÁö $title_title = ''; //Á¦¸ñ À̹ÌÁö $title_date = ''; //µî·ÏÀÏ À̹ÌÁö $title_count = ''; //Á¶È¸¼ö À̹ÌÁö $title_writer = ''; //±Û¾´ÀÌ À̹ÌÁö $title_file = ''; //ÆÄÀÏ À̹ÌÁö $title_email = ''; //À̸ÞÀÏ À̹ÌÁö $title_content = ''; //³»¿ë À̹ÌÁö $title_filesize = ''; //ÆÄÀÏ»çÀÌÁî À̹ÌÁö $title_edit = ''; //¼öÁ¤Çϱâ À̹ÌÁö $title_password = ''; //ÆÐ½º¿öµå À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_no = 'NO'; $title_title = 'Á¦¸ñ'; $title_date = 'µî·ÏÀÏ'; $title_count = 'Á¶È¸¼ö'; $title_writer = '±Û¾´ÀÌ'; $title_file = 'ÆÄÀÏ'; $title_password = 'ÆÐ½º¿öµå'; $title_email = 'À̸ÞÀÏ'; $title_content = '³»¿ë'; $title_filesize = 'ÆÄÀÏ»çÀÌÁî'; $title_edit = '¼öÁ¤ Çϱâ'; } echo(" $line $line $line $line $html_ox_txt

$title_bg_img_insert$title_edit

$title_title

 

$title_writer

 

$title_email

 

$title_password

  ¼öÁ¤È®ÀÎ

$title_content

 

$title_bottom_insert

"); } //======================================================// // // // °Ô½ÃÆÇ ³»¿ë º¸±âÇÔ¼ö // // // //======================================================// function BoardReadMode($table_code, $table_num, $config_row, $search_text, $search_category, $page, $start){ $result = mysql_query("select * from board_config where table_code='$table_code'"); //°Ô½ÃÆÇ ȯ°æ¼³Á¤ Äõ¸®¹®ÇÔ¼ö È£Ãâ $config_row = mysql_fetch_array($result); $table_name = $table_code.'_board_tb'; $result2 = mysql_query("select * from $table_name where table_no='$table_num'"); //°Ô½ÃÆÇ ³»¿ëÄõ¸®¹® Äõ¸®¹®ÇÔ¼ö È£Ãâ $row = mysql_fetch_array($result2); if($config_row[html_ox]=='1'){ if($row[board_html_ox]=='1'){$content=$row[content];} else{$content = strip_tags($row[content]); $content = eregi_replace("\n", "
", stripslashes($content)); $content = LinkAdd($content);} //¼³¸í(Ä­ ³Ñ°ÜÁÖ±âÀ§ÇÑ º¯¼ö ¼³Á¤ } else{$row[content] = htmlspecialchars($row[content]); $content = eregi_replace("\n", "
", stripslashes($row[content])); LinkAdd($content);} global $HTTP_COOKIE_VARS; //°ü¸®ÀÚ Àü¿ëÀ¯¹« È®ÀÎ if($config_row[table_admin]=='1'){ //°ü¸®ÀÚ Àü¿ëÀÏ °æ¿ì if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã } else{ $reply_button = ''; } } //ȸ¿ø Àü¿ëÀ¯¹« È®ÀÎ else{ $del_link = ''; if($config_row[table_member]=='1'){ if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã $reply_button = ''; } else{ //Äí۰ªÀÌ ¾øÀ» °æ¿ì if(empty($HTTP_COOKIE_VARS[$cookie_name])){DoHistoryBack("ȸ¿ø Àü¿ë °Ô½ÃÆÇÀÔ´Ï´Ù.\\n\\n·Î±×ÀÎÇØ Áֽʽÿä.");} else{} $reply_button = ''; } } //ȸ¿ø Àü¿ëÀÌ ¾Æ´Ò °æ¿ì ¹Ù·Î ¸µÅ©¸¦ °É¾îÁØ´Ù. else{ $reply_button = ''; } } if(AdminConfirmAuth(1)!='0'){ //°ü¸®ÀÚÀϰæ¿ì ±×³É ¹«½Ã $del_link = ''; } //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} $write_time = date('Y³â n¿ù dÀÏ A h½Ã iºÐ',strtotime($row[write_time])); $row[name] = htmlspecialchars($row[name]); $row[email] = htmlspecialchars($row[email]); //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_no = ''; //NO À̹ÌÁö $title_title = ''; //Á¦¸ñ À̹ÌÁö $title_date = ''; //µî·ÏÀÏ À̹ÌÁö $title_count = ''; //Á¶È¸¼ö À̹ÌÁö $title_writer = ''; //±Û¾´ÀÌ À̹ÌÁö $title_file = ''; //ÆÄÀÏ À̹ÌÁö $title_email = ''; //À̸ÞÀÏ À̹ÌÁö $title_content = ''; //³»¿ë À̹ÌÁö $title_filesize = ''; //ÆÄÀÏ»çÀÌÁî À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_no = 'NO'; $title_title = 'Á¦¸ñ'; $title_date = 'µî·ÏÀÏ'; $title_count = 'Á¶È¸¼ö'; $title_writer = '±Û¾´ÀÌ'; $title_file = 'ÆÄÀÏ'; $title_email = 'À̸ÞÀÏ'; $title_content = '³»¿ë'; $title_filesize = 'ÆÄÀÏ»çÀÌÁî'; } //======================================// // // // °Ô½ÃÆÇÀÏ °æ¿ì // // // //======================================// if($config_row[table_category]=='°Ô½ÃÆÇ'){ echo(" $line $line

$title_bg_img_insert$row[subject]

$title_date

 $write_time

$title_count

 $row[view_count]

$title_writer

 $row[name]

$title_email

 $row[email]

$title_content

$content

$title_bottom_insert $reply_button $del_link

"); } //======================================// // // // ÀÚ·á½ÇÀÏ °æ¿ì // // // //======================================// else{ //ÆÄÀÏ Á¾·ùº°·Î ´Ù¸¥ ¾ÆÀÌÄÜÀ» »Ñ·ÁÁØ´Ù. if($row[file_format]==mdb || $row[file_format]==bmp || $row[file_format]==doc || $row[file_format]==exe || $row[file_format]==gif || $row[file_format]==hwp || $row[file_format]==jpg || $row[file_format]==asf || $row[file_format]==png || $row[file_format]==ppt || $row[file_format]==txt || $row[file_format]==xls || $row[file_format]==zip){ $file_icon = ''; } else{ $file_icon = ''; } $file_size = number_format($row[file_size], 0); //ÆÄÀÏ»çÀÌÁî if($row[file_size] < 1024){$file_size = number_format($row[file_size], 0); $file_size = $file_size.'Byte';} else{$file_size = $row[file_size] / 1024; $file_size = number_format($file_size, 2); $file_size = $file_size.'KB';} $file_name = strtok($row[file_name], '@'); $file_url = './'.$table_code.'/'.$row[file_name]; //ÆÄÀÏÀÌ À̹ÌÁöÀÏ °æ¿ì ³»¿ëÀ§¿¡ »Ñ·ÁÁØ´Ù. if($row[file_format]==bmp || $row[file_format]==gif || $row[file_format]==jpg || $row[file_format]==BMP || $row[file_format]==GIF || $row[file_format]==JPG){ $img_size = getImageSize("$file_url"); $temp_img_width = (($config_row[table_row] / 100) * 85); //ÁÙÀÏ À̹ÌÁö Å©±â if($img_size[0] >= $temp_img_width){ $temp_img_width = $temp_img_width - 20; //¿©¹éÀ» À§ÇØ ½ÇÁ¦ ¼¿ ³Êºñº¸´Ù ´õ ÁÙ¿©ÁØ´Ù. $content_img = "
"; } else{$content_img = "$temp_img_width
";} } else{$content_img='';} echo(" $line $line $line

$title_bg_img_insert$row[subject]

$title_date

 $write_time

$title_count

 $row[view_count]

$title_writer

 $row[name]

$title_email

 $row[email]

$title_file

 $file_icon $file_name

$title_filesize

 $file_size

$title_content

$content_img$content

$title_bottom_insert $del_link

"); } } //======================================================// // // // °ü¸®ÀÚ ·Î±×ÀÎ ÇÔ¼ö // // // //======================================================// function BoardAdminForm($code, $config_row){ //¶óÀÎ °áÁ¤ if($config_row[border]==0){$line='

';} else{$line='';} //ŸÀÌÆ²À» À̹ÌÁö·Î ÇÒ °æ¿ì if($config_row[img_ox]=='0'){ $title_bg_img = 'background=img/title_bg.gif'; //À̹ÌÁö ¹è°æ $title_bg_img_insert = ''; //³¢¿ö³ÖÀ» À̹ÌÁö(³ôÀÌÁ¶Á¤À» À§ÇØ) $title_adminlogin = ''; //°ü¸®Àڷα×ÀÎ À̹ÌÁö $title_password = ''; //ÆÐ½º¿öµå À̹ÌÁö $title_id = ''; //¾ÆÀ̵ð À̹ÌÁö $title_bottom_insert = ''; //¾Æ·¡ ³¢¿ö³ÖÀ» À̹ÌÁö $title_bottom = 'background=img/title_bottom.gif'; //¾Æ·¡ ¹è°æ } else{ $title_bg_img = ''; $title_bg_img_insert = ''; $title_password = 'ÆÐ½º¿öµå'; $title_id = '¾ÆÀ̵ð'; $title_adminlogin = '°ü¸®ÀÚ ·Î±×ÀÎ'; } echo(" $line

$title_bg_img_insert$title_adminlogin

$title_id

$title_password

$title_bottom_insert

"); } //======================================================// // // // °ü¸®ÀÚ ·Î±×ÀÎ ÇÔ¼ö // // // //======================================================// function BoardAdminLogout($code){ DoLocation("admin_logout.html?code=$code"); } //======================================================// // // // ÀÚµ¿¸µÅ© Á¤±ÔÇ¥Çö½Ä ÇÔ¼ö // // // //======================================================// function LinkAdd($text) { $text = eregi_replace("([^/])www([0-9a-zA-Z./@~?&=_]+)","\\1http://www\\2", $text); //WWW ¸µÅ© $text = eregi_replace("http://([0-9a-zA-Z./@~?&=_]+)", "
http://\\1", $text); //HTTP ¸µÅ© $text = eregi_replace("ftp://([0-9a-zA-Z./@~?&=_]+)", "ftp://\\1", $text); //FTP ¸µÅ© $text = eregi_replace("([_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+)*)@([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)", "\\1@\\3", $text); //EMAIL ¸µÅ© return $text; } //======================================================// // // // ¸ÞÀÎÈ­¸é »ùÇø®½ºÆ® ÇÔ¼ö // // // //======================================================// function BoardSampleList($code, $board_row, $cut_row, $table_width){ $table_name=$code.'_board_tb'; $sample_list_result = mysql_query("select table_no, subject, write_time from $table_name order by table_id desc limit 0, $board_row;"); echo""; $no = 1; while($row = mysql_fetch_array($sample_list_result)){ $time = substr($row[write_time],0,10); $subject = short_str($row[subject], $cut_row); //Á¦¸ñ ÀÚ¸£±â echo(" "); $no++; } echo"

  $subject

$time

"; } ?>