//header("Content-type: text/xml; charset=utf-8"); ########################################################################### ## 주요 인자값 정리 ########################################################################### // id : 게시판 아이디 -board ID // no : 게시물 번호 -board No // pcno : 상위 메뉴 번호 -top Menu NO // mode : 작업모드 -working Mode // cmd : 처리명령 -execute command // page : 페이지 번호-Page No // ... // ... ########################################################################### switch($_POST['mode']) { // 신규 게시물 등록/수정-registe/editr new article case "regist_article": $result = $rankup_board->regist_article($_POST); // 작성후 되돌아갈 링크 설정 - returned link establishment after submission $referer_infos = parse_url($_SERVER['HTTP_REFERER']); parse_str($referer_infos['query'], $referer_infos); unset($referer_infos['mode'], $referer_infos['pano']); // write 모드, 답글시 부모글 번호 제거 -write mode, when writing comment ,this delete parent comment number $board_links = http_build_query($referer_infos); // php5 이상, rankup_basic.class.php 에 정의됨 -over php5 is written in rankup_basic.class.php $rankup_board->popup_msg_js("게시물이 성공적으로 등록되었습니다.", "./index.html?$board_links"); // The content has successfully registered. exit; break; // 댓글 등록-regist comment case "regist_comment": $result = $rankup_board->regist_comment($_POST); $message = "댓글이 성공적으로 등록되었습니다."; // The comment has been succesfully submitted echo " "; exit; break; // 댓글 수정 - 2009.09.09 added-edit comment case "apply_comment": $rankup_board->change_encoding($_POST, "IN"); echo $rankup_board->apply_comment($_POST); exit; break; // 파일 첨부-attached file case "post_attached": //2014-04-17 LSM 해킹방지코드-hacking preventing code $prev_url = explode("/",str_replace(array("http://", "https://"), "",$_SERVER['HTTP_REFERER'])); if ($_SERVER["HTTP_HOST"]!=$prev_url[0]) { exit; } //해킹방지소스끝 -end of hacking preventing code $original_name = $_FILES['attach']['name']; // 파일크기 체크-file size check $file_size = filesize($_FILES['attach']['tmp_name'])/1024; // KB if($file_size==0 || round($file_size)>$rankup_board->sattach['attach_size']) { @unlink($_FILES['attach']['tmp_name']); // 첨부했던 임시파일 제거 -deleting attached temporary file $rankup_board->popup_msg_js("첨부파일의 크기가 제한용량(".number_format($rankup_board->sattach['attach_size'])." KB)을 초과하여 등록이 취소되었습니다.", "VOID"); } // the limited size of the attached file $attached = $rankup_board->post_attached($_FILES['attach'], true); if(!empty($attached['name'])) { list($width, $height, $type, $attr, $size) = $attached['infos']; $on_attached = array_pop(explode("/", $attached['name'])); if($width && $height) $wh_size = "
$width × $height"; $info = strtoupper($type)."
($size)".$wh_size; echo " "; } exit; break; default: // 첨부파일 다운로드-attached file download if($_GET['cmd']=="download") { $rankup_board->download_attach($_GET); // 별도의 리턴값이 없다. -there is no special return price exit; } //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=- // Ajax or GET 방식 처리-Get method //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=- // 인코딩 변환-encoding change if(!empty($_GET['cmd'])) $rankup_board->change_encoding($_GET, "IN"); switch($_GET['cmd']) { case "view_article": // 게시물 보기 -article view $message = $rankup_board->view_article($_GET); $result = !empty($message); break; case "delete_article": // 게시물 삭제 -article delete case "modify_article": // 게시물 수정 -article modify $return_type='text'; $message = $rankup_board->verify_author($_GET); $result = !empty($message); break; case "delete_articles": // 게시물 선택삭제 -delete articles $message = $rankup_board->delete_articles($_GET); $result = !empty($message); break; case "vote_article": // 게시물 추천 -vote article $message = $rankup_board->vote_article($_GET); $result = !empty($message); break; case "load_comment": // 댓글 로드 -comment load $return_type='text'; $_GET['data_type']='json'; $message = $rankup_board->get_comment_articles($_GET); $result = !empty($message); break; case "delete_comment": // 댓글 삭제-delete coment $return_type='text'; $message = $rankup_board->delete_comment($_GET); $result = !empty($message); break; case "modify_comment": // 댓글 수정-comment modify - 2009.09.09 added $return_type='text'; $message = $rankup_board->modify_comment($_GET); $result = !empty($message); break; case "delete_attach": // 첨부파일 삭제 -delete attach file $return_type='text'; $result = $rankup_board->delete_attach($_GET); $message = $result ? "true" : "false"; // "succesfully deleted" : "unable to delete" break; case "load_attach": $message = $rankup_board->load_attach($_GET); $result = !empty($message); header('Content-type: text/xml; charset=utf-8'); echo "\n"; echo "$message"; exit; break; default: global $opengraph; // 페이지 구성 -page compostition if(empty($_GET['id'])) $board_contents = $rankup_board->get_main_contents($_GET['pcno']); // 해당 메뉴의 메인페이지 -main page of the menu else $board_contents = $rankup_board->get_board_contents($_GET); // 게시물목록/상세페이지/등록폼/수정폼 구성 -board content list -specific page -registration form -modification form composition if(!$board_contents) return; // 타이틀, 스타일 출력 / 상단 컨텐츠 -title,style,top contents $rankup_control->print_user_head($rankup_board->subject); // 2009.07.09 fixed include_once $base_dir."include/top.html"; // 좌측 컨텐츠-left contents ob_start(); include_once $base_dir."include/left.html"; $left_contents = ob_get_clean(); // 우측 컨텐츠 -right content check if($rankup_board->board_extension===true && empty($rankup_board->board_id)) { $kind = empty($_GET['pcno']) ? $rankup_board->board_configs['pcno'] : $_GET['pcno']; // 우측컨텐츠 체크 - 꼼수;;-right contents check $rankup_banner = new rankup_banner; if($rankup_control->queryR("select no from $rankup_banner->table where kind='$kind' and position=14 and view='yes' limit 0, 1")) { ob_start(); include_once $base_dir."include/right.html"; $right_contents = ob_get_clean(); $right_contents = "   ".$right_contents.""; } } // 메인 컨텐츠-main contents echo " ".$right_contents."
".$left_contents."   ".$board_contents."
"; // 하단 컨텐츠-bottom contents include_once $base_dir."include/bottom.html"; exit; } if($result) { // 인코딩 변환-encoding change $rankup_board->change_encoding($message, "OUT"); $result = $result ? "success" : "failure"; if($return_type == 'text') { echo $message; } else { header('Content-type: text/xml; charset=utf-8'); echo ''.PHP_EOL; echo ''; } } exit; } ?>