0 and kind=$li_kind"); if (!$dbupdate) { echo ("UPDATE ERROR ÀÔ´Ï´Ù."); exit; } //////////////////////////////////////////////////////////////// // File Á¦¾î //////////////////////////////////////////////////////////////// if ( trim($up_file_name) != '' ) { $lc_file_name = substr( strrchr($up_file_name,"."),1); //file name $up_file_name = ereg_replace(" ","",$up_file_name); //ÀúÀåµÉ file°æ·Î $lc_file_route = "./upload/$lc_system_code$li_kind$li_no$up_file_name"; if(@exec("cp $up_file $lc_file_route ")!=0) { echo ("$lc_file_route ¸¦ ¸¸µé¼ö ¾ø³×¿ä! - check permissions
"); echo(""); } include("./include/file_type.html"); } else { $up_file_name = "none" ; $up_file_size = 0 ; } //TTLSOFT - MySQL // $dbreturn = mysql_query("insert into $lc_using_table_user ( kind, // no, // title, // content, // input_date, // cnt, // email, // homepage, // ip_address, // agent, // name, // password, // html_kind, // secret_kind, // mail_kind, // thread_id, // thread_depth, // thread_info, // file_name, // file_type, // file_size, // file_route ) // values ($li_kind, // $li_no, // '$lc_title', // '$lc_content', // '$ld_input_date', // 0, // '$lc_email', // '$lc_homepage', // '$lc_ip_address', // '$lc_agent', // '$lc_name', // '$lc_password', // $li_html_kind, // $li_secret_kind, // $li_mail_kind, // $li_thread_id, // $li_thread_depth, // $li_thread_info, // '$up_file_name', // '$lc_file_type', // $up_file_size, // '$lc_file_route' )",$connect); //VitalSoft - Postgres $dbreturn = pg_exec($connect, " insert into $lc_using_table_user ( ". " kind, ". " seq, ". " title, ". " content, ". " input_date, ". " cnt, ". " email, ". " homepage, ". " ip_address, ". " agent, ". " name, ". " password, ". " html_kind, ". " secret_kind, ". " mail_kind, ". " thread_id, ". " thread_depth, ". " thread_info, ". " file_name, ". " file_type, ". " file_size, ". " file_route ) ". "values ($li_kind, ". " $li_no, ". " '$lc_title', ". " '$lc_content', ". " '$ld_input_date', ". " 0, ". " '$lc_email', ". " '$lc_homepage', ". " '$lc_ip_address', ". " '$lc_agent', ". " '$lc_name', ". " '$lc_password', ". " $li_html_kind, ". " $li_secret_kind, ". " $li_mail_kind, ". " $li_thread_id, ". " $li_thread_depth, ". " $li_thread_info, ". " '$up_file_name', ". " '$lc_file_type', ". " $up_file_size, ". " '$lc_file_route' )"); } //////////////////////////////////////////////////////////////// // ¼öÁ¤ //////////////////////////////////////////////////////////////// else if ( $lc_mode == modify) { if ( !$li_admin ) { //TTLSOFT - MySQL // $dbcheck = mysql_query("select count(*) as count // from $lc_using_table_user // where kind = $li_kind // and no = $li_no // and password = '$lc_password'",$connect); // // $li_count = mysql_result($dbcheck,0,"count" ); //VitalSoft - Postgres $dbcheck = pg_exec($connect,"select count(*) as count ". " from $lc_using_table_user ". "where kind = $li_kind ". " and seq = $li_no ". " and password = '$lc_password'"); $li_count = pg_result($dbcheck,0,0 ); if ($li_count != 1 ) { echo(""); echo(""); exit; } } //////////////////////////////////////////////////////////////// // File Á¦¾î //////////////////////////////////////////////////////////////// if ( trim($up_file_name) != '' ) { $lc_file_name = substr( strrchr($up_file_name,"."),1); //file name $up_file_name = ereg_replace(" ","",$up_file_name); //ÀúÀåµÉ file°æ·Î $lc_file_route = "./upload/$lc_system_code$li_kind$li_no$up_file_name"; if(@exec("cp $up_file $lc_file_route ")!=0) { echo ("$lc_file_route ¸¦ ¸¸µé¼ö ¾ø³×¿ä! - check permissions
"); echo(""); } include("./include/file_type.html"); //TTLSOFT - MySQL // $dbreturn = mysql_query("update $lc_using_table_user set title ='$lc_title', // content ='$lc_content', // email ='$lc_email', // homepage ='$lc_homepage', // ip_address ='$lc_ip_address', // agent ='$lc_agent', // name ='$lc_name', // html_kind = $li_html_kind, // secret_kind = $li_secret_kind, // mail_kind = $li_mail_kind, // file_name ='$up_file_name', // file_type ='$lc_file_type', // file_size = $up_file_size, // file_route ='$lc_file_route' // where kind = $li_kind // and no = $li_no", $connect); //VitalSoft - Postgres $dbreturn = pg_exec($connect, " update $lc_using_table_user ". " set title ='$lc_title', ". " content ='$lc_content', ". " email ='$lc_email', ". " homepage ='$lc_homepage', ". " ip_address ='$lc_ip_address', ". " agent ='$lc_agent', ". " name ='$lc_name', ". " html_kind = $li_html_kind, ". " secret_kind = $li_secret_kind, ". " mail_kind = $li_mail_kind, ". " file_name ='$up_file_name', ". " file_type ='$lc_file_type', ". " file_size = $up_file_size, ". " file_route ='$lc_file_route' ". " where kind = $li_kind ". " and seq = $li_no"); } else { //TTLSOFT - MySQL // $dbreturn = mysql_query("update $lc_using_table_user set title ='$lc_title', // content ='$lc_content', // email ='$lc_email', // homepage ='$lc_homepage', // ip_address ='$lc_ip_address', // agent ='$lc_agent', // name ='$lc_name', // html_kind = $li_html_kind, // secret_kind = $li_secret_kind, // mail_kind = $li_mail_kind // where kind = $li_kind // and no = $li_no", $connect); //VitalSoft - Postgres $dbreturn = pg_exec($connect,"update $lc_using_table_user set title ='$lc_title',". " content ='$lc_content', ". " email ='$lc_email', ". " homepage ='$lc_homepage', ". " ip_address ='$lc_ip_address', ". " agent ='$lc_agent', ". " name ='$lc_name', ". " html_kind = $li_html_kind, ". " secret_kind = $li_secret_kind, ". " mail_kind = $li_mail_kind ". " where kind = $li_kind ". " and seq = $li_no"); } } //////////////////////////////////////////////////////////////// // ´äº¯ °Ô½ÃÆÇ //////////////////////////////////////////////////////////////// else if ( $lc_mode == rep ) { //TTLSOFT - MySQL // $dbresult = mysql_query("select thread_id,thread_depth,thread_info from $lc_using_table_user // where kind = $li_kind and no = $li_no",$connect); //VitalSoft - Postgres $dbresult = pg_exec($connect,"select thread_id,thread_depth,thread_info from $lc_using_table_user ". " where kind = $li_kind and seq = $li_no"); if (!$dbresult) { echo("QUERY_ERROR ÀÔ´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇ ¹Ù¶ø´Ï´Ù."); exit; } //TTLSOFT - MySQL //$row = mysql_fetch_row($dbresult); //VitalSoft - Postgres $row = pg_fetch_row($dbresult,0); $li_thread_id = $row[0]; $li_thread_depth = $row[1]; $li_thread_depth1 =$row[1]; $li_thread_depth++; $li_thread_info = $row[2]; //TTLSOFT - MySQL // $dbresult1 = mysql_query("select count(*) as count // from $lc_using_table_user // where kind = $li_kind // and thread_id = $li_thread_id // and thread_depth > $li_thread_depth1",$connect); // // $row2 = mysql_fetch_array($dbresult1); //VitalSoft - Postgres $dbresult1 = pg_exec($connect,"select count(*) from $lc_using_table_user ". " where kind = $li_kind and thread_id = $li_thread_id ". " and thread_depth > $li_thread_depth1"); $row2 = pg_fetch_array($dbresult1,0); $plus_info = $row2[0]; $li_thread_info = $li_thread_info + $plus_info + 1; //TTLSOFT - MySQL // $dbupdate1 = mysql_query("update $lc_using_table_user set thread_info = thread_info+1 // where kind = $li_kind and thread_info >= $li_thread_info",$connect); //VitalSoft - Postgres $dbupdate1 = pg_exec($connect,"update $lc_using_table_user set thread_info = thread_info+1 ". " where kind = $li_kind and thread_info >= $li_thread_info"); if (!$dbupdate1) { echo ("UPDATE ERROR ÀÔ´Ï´Ù."); exit; } //°¡Àå Å« seq°ªÀ» °Ë»ö //TTLSOFT - MySQL // $query = mysql_query("select max(no) as no // from $lc_using_table_user // where kind = $li_kind",$connect); //VitalSoft - Postgres $query = pg_exec($connect,"select max(seq) from $lc_using_table_user ". " where kind = $li_kind"); if (!$query) { echo ("QUERY_ERRORÀÔ´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇ ¹Ù¶ø´Ï´Ù."); exit; } //TTLSOFT - MySQL //$new_seq = mysql_result($query,0,0); //VitalSoft - Postgres $new_seq = pg_result($query,0,0); $new_seq = (int)$new_seq + 1; //////////////////////////////////////////////////////////////// //insert //////////////////////////////////////////////////////////////// // File Á¦¾î //////////////////////////////////////////////////////////////// if ( trim($up_file_name) != '' ) { $lc_file_name = substr( strrchr($up_file_name,"."),1); //file name $up_file_name = ereg_replace(" ","",$up_file_name); //ÀúÀåµÉ file°æ·Î $lc_file_route = "./upload/$lc_system_code$li_kind$li_no$up_file_name"; if(@exec("cp $up_file $lc_file_route ")!=0) { echo ("$lc_file_route ¸¦ ¸¸µé¼ö ¾ø³×¿ä! - check permissions
"); echo(""); } include("./include/file_type.html"); } else { $up_file_name = "none" ; $up_file_size = 0 ; } //TTLSOFT - MySQL // $dbreturn = mysql_query("insert into $lc_using_table_user (kind, // no, // title, // content, // input_date, // cnt, // email, // homepage, // ip_address, // agent, // name, // password, // html_kind, // secret_kind, // mail_kind, // thread_id, // thread_depth, // thread_info, // file_name, // file_type, // file_size, // file_route ) // values ($li_kind, // $new_seq, // '$lc_title', // '$lc_content', // '$ld_input_date', // 0, // '$lc_email', // '$lc_homepage', // '$lc_ip_address', // '$lc_agent', // '$lc_name', // '$lc_password', // $li_html_kind, // $li_secret_kind, // $li_mail_kind, // $li_thread_id, // $li_thread_depth, // $li_thread_info, // '$up_file_name', // '$lc_file_type', // $up_file_size, // '$lc_file_route' )",$connect); //VitalSoft - Postgres $dbreturn = pg_exec($connect, " insert into $lc_using_table_user( ". " kind, ". " seq, ". " title, ". " content, ". " input_date, ". " cnt, ". " email, ". " homepage, ". " ip_address, ". " agent, ". " name, ". " password, ". " html_kind, ". " secret_kind, ". " mail_kind, ". " thread_id, ". " thread_depth, ". " thread_info, ". " file_name, ". " file_type, ". " file_size, ". " file_route ) ". "values ($li_kind, ". " $new_seq, ". " '$lc_title', ". " '$lc_content', ". " '$ld_input_date', ". " 0, ". " '$lc_email', ". " '$lc_homepage', ". " '$lc_ip_address', ". " '$lc_agent', ". " '$lc_name', ". " '$lc_password', ". " $li_html_kind, ". " $li_secret_kind, ". " $li_mail_kind, ". " $li_thread_id, ". " $li_thread_depth, ". " $li_thread_info, ". " '$up_file_name', ". " '$lc_file_type', ". " $up_file_size, ". " '$lc_file_route')"); ////////////////////////////////////////////////////////////////////////// // °ü·Ã±Û¿¡ ¸ÞÀÏ ¹ß¼Û ////////////////////////////////////////////////////////////////////////// //TTLSOFT - MySQL // $li_mail_kind_env = mysql_result($dbresult_board_env,0,"mail_kind"); // $lc_admin_email_env = mysql_result($dbresult_board_env,0,"admin_email"); // $lc_name_env = mysql_result($dbresult_board_env,0,"name"); //VitalSoft - Postgres $li_mail_kind_env = pg_result($dbresult_board_env,0,"mail_kind"); $lc_admin_email_env = pg_result($dbresult_board_env,0,"admin_email"); $lc_name_env = pg_result($dbresult_board_env,0,"name"); // °Ô½ÃÆÇ¿¡¼­ ¸ÞÀÏ ±¸ºÐÀ¸·Î ¸ÞÀÏ ¹ÞÀ» ´ë»ó ¼±Åà if ( $li_mail_kind_env == 1 ) { $lv_from = $lc_email ; } //TTLSOFT - MySQL // $dbresult_mail = mysql_query("select email // from $lc_using_table_user // where kind = $li_kind // and thread_id = $li_thread_id // and thread_depth < $li_thread_depth // and html_kind = 0 // group by email",$connect); // // $totalnumber = mysql_num_rows($dbresult_mail); //VitalSoft - Postgres $dbresult_mail = pg_exec($connect, "select email ". " from $lc_using_table_user ". " where kind = $li_kind ". " and thread_id = $li_thread_id ". " and thread_depth < $li_thread_depth ". " and html_kind = 0 ". " group by email"); $totalnumber = pg_NumRows($dbresult_mail); $cline = 0 ; while ( $cline < $totalnumber ): //TTLSOFT - MySQL // $lc_email = mysql_result($dbresult_mail,$cline,"email"); //VitalSoft - Postgres $lc_email = pg_result($dbresult_mail,$cline,"email"); $lv_to = $lv_to.','.$lc_email ; $cline ++ ; endwhile; // ¸ÞÀÏ ±¸ºÐÀÏ °æ¿ì¿¡ Admin¿¡°Ôµµ Mail ºÎ¿©. if ( $li_mail_kind_env == 2 ) $lv_to = $lv_to.','.$lc_admin_email_env ; $lv_title = $lc_title ; // 2000³â 06¿ù 14ÀÏ Àӽà Å×½ºÆ® if ( !$li_html_kind ) $lc_content = nl2br($lc_content) ; ///////////////////////////////////////////////////////////////////////// // ¸ÞÀÏ ¹ß¼Û½Ã HeadÁ¤ÀǺκР///////////////////////////////////////////////////////////////////////// $lc_header = " " ; ///////////////////////////////////////////////////////////////////////// $lv_text = $lc_header.'
'.$lc_content.'
 
TTL°Ô½ÃÆÇÁß '.$lc_name_env.' ¿¡¼­ °ü·Ã±ÛÀÌ µî·ÏµÇ¾ú½À´Ï´Ù.
' ; $lv_from = "From:".$lv_from."\nContent-Type:text/html" ; $result = mail($lv_to,$lv_title,$lv_text,$lv_from); ////////////////////////////////////////////////////////////////////////// } //////////////////////////////////////////////////////////////// // »èÁ¦ - delete //////////////////////////////////////////////////////////////// else { //º¯¼ö $v_password = addslashes($password); $v_thread_id = addslashes($thread_id); $v_thread_depth = addslashes($thread_depth); $v_thread_info = addslashes($thread_info); //»èÁ¦À¯¹«Ã¼Å© $query = "select count(*) from $lc_using_table_user where kind = $li_kind and thread_id = '$v_thread_id' and thread_depth > $v_thread_depth and thread_info > $v_thread_info"; //TTLSOFT - MySQL // $res = mysql_query($query,$connect); //VitalSoft - Postgres $res = pg_exec($connect,$query); if(!$res) { echo ("QUERY_ERROR"); echo(""); exit; } //TTLSOFT - MySQL //$row = mysql_fetch_row($res); //VitalSoft - Postgres $row = pg_fetch_row($res,0); $has_thread = $row[0]; if($has_thread != 0) { echo(""); echo(""); exit; } //ºñ¹Ð¹øÈ£ check //TTLSOFT - MySQL // $dbcheck = mysql_query("select password from $lc_using_table_user where kind = $li_kind and no = $li_no",$connect); // $row = mysql_fetch_row($dbcheck); //VitalSoft - Postgres $dbcheck = pg_exec($connect,"select password from $lc_using_table_user where kind = $li_kind and seq = $li_no"); $row = pg_fetch_row($dbcheck,0); if ($v_password != $row[0] && $li_admin != 1 ) { echo(""); echo(""); exit; } else { //TTLSOFT - MySQL // $dbreturn = mysql_query("delete from $lc_using_table_user where kind = $li_kind and no = $li_no",$connect); //VitalSoft - Postgres $dbreturn = pg_exec($connect,"delete from $lc_using_table_user where kind = $li_kind and seq = $li_no"); echo (""); exit; } } //TTLSOFT //if ($dbreturn == true) //VitalSoft if ($dbreturn) { echo (""); } else { echo("ERROR ÀÔ´Ï´Ù. °ü¸®ÀÚ¿¡°Ô ¹®ÀÇ ¹Ù¶ø´Ï´Ù."); //echo(""); exit; } //db disconnect //TTLSOFT - MySQL //mysql_close($connect); //VitalSoft - Postgres pg_close($connect); ?>