function kboard_content_list() { include_once 'class/KBContentListTable.class.php'; $table = new KBContentListTable(); $action = $table->current_action(); if (isset($_POST['uid'])) { $content = new KBContent(); if ($action == 'board_change') { foreach ($_POST['uid'] as $key => $value) { $board_id = $_POST['board_id_' . $value]; if ($board_id) { $content->initWithUID($value); $content->board_id = $board_id; $content->updateContent(); } } } else { if ($action == 'delete') { foreach ($_POST['uid'] as $key => $value) { $content->initWithUID($value); $content->remove(); } } } } $table->prepare_items(); include_once 'pages/kboard_content_list.php'; }
/** * 게시물 삭제 페이지를 생성한다. (완료 후 바로 리다이렉션) */ public function builderRemove() { if (!stristr($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) { echo '<script>alert("KBoard : ' . __('This page is restricted from external access.', 'kboard') . '");</script>'; return; } $url = new KBUrl(); $content = new KBContent($this->board_id); $content->initWithUID($this->uid); if (!$this->board->isEditor($content->member_uid)) { if ($this->board->permission_write == 'all') { if (!$this->board->isConfirm($content->password, $content->uid)) { $confirm_view = true; } } else { die('<script>alert("' . __('You do not have permission.', 'kboard') . '");history.go(-1);</script>'); } } if ($confirm_view) { $skin_path = KBOARD_URL_PATH . "/skin/{$this->skin}"; $board = $this->board; include KBOARD_DIR_PATH . "/skin/{$this->skin}/confirm.php"; } else { $content->remove(); // 삭제뒤 게시판 리스트로 이동한다. $next = $url->set('mod', 'list')->toString(); die("<script>location.href='{$next}';</script>"); } }