You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

588 lines
25 KiB

7 years ago
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Board extends WB_Controller
  4. {
  5. /**
  6. * 게시판 목록
  7. */
  8. public function lists()
  9. {
  10. $this->load->model('board_model');
  11. $this->data['board_list'] = $this->board_model->board_list();
  12. // 메타태그 설정
  13. $this->site->meta_title = "게시판 관리";
  14. // 레이아웃 & 뷰파일 설정
  15. $this->theme = "admin";
  16. $this->view = "board/lists";
  17. $this->active = "board/lists";
  18. }
  19. /**
  20. * 게시판 등록/수정
  21. * @param string $brd_key
  22. */
  23. public function form($brd_key="")
  24. {
  25. $this->load->model('board_model');
  26. $this->load->library('form_validation');
  27. $this->form_validation->set_rules('brd_key','게시판 고유 키',"required|trim|min_length[3]|max_length[20]". (empty($brd_key)?"|callback_brd_key_check":""));
  28. if( $this->form_validation->run() != FALSE )
  29. {
  30. $data['brd_key'] = $this->input->post('brd_key', TRUE);
  31. $data['brd_title'] = $this->input->post('brd_title', TRUE);
  32. $data['brd_title_m'] = $this->input->post('brd_title_m', TRUE);
  33. $data['brd_keywords'] = $this->input->post('brd_keywords', TRUE);
  34. $data['brd_description'] = $this->input->post('brd_description', TRUE);
  35. $data['brd_skin'] = $this->input->post('brd_skin', TRUE);
  36. $data['brd_skin_m'] = $this->input->post('brd_skin_m', TRUE);
  37. $data['brd_search'] = $this->input->post('brd_search', TRUE, "N");
  38. $data['brd_sort'] = $this->input->post('brd_sort', TRUE);
  39. $data['brd_use_category'] = $this->input->post('brd_use_category', TRUE, "N");
  40. $data['brd_lv_list'] = $this->input->post('brd_lv_list', TRUE);
  41. $data['brd_lv_read'] = $this->input->post('brd_lv_read', TRUE);
  42. $data['brd_lv_write'] = $this->input->post('brd_lv_write', TRUE);
  43. $data['brd_lv_reply'] = $this->input->post('brd_lv_reply', TRUE);
  44. $data['brd_lv_comment'] = $this->input->post('brd_lv_comment', TRUE);
  45. $data['brd_lv_download'] = $this->input->post('brd_lv_download', TRUE);
  46. $data['brd_lv_upload'] = $this->input->post('brd_lv_upload', TRUE);
  47. $data['brd_use_list_thumbnail'] = $this->input->post('brd_use_list_thumbnail', TRUE);
  48. $data['brd_use_list_file'] = $this->input->post('brd_use_list_file', TRUE);
  49. $data['brd_use_view_list'] = $this->input->post('brd_use_view_list', TRUE);
  50. $data['brd_thumb_width'] = $this->input->post('brd_thumb_width', TRUE);
  51. $data['brd_thumb_height'] = $this->input->post('brd_thumb_height', TRUE);
  52. $data['brd_time_new'] = $this->input->post('brd_time_new', TRUE);
  53. $data['brd_hit_count'] = $this->input->post('brd_hit_count', TRUE);
  54. $data['brd_page_limit'] = $this->input->post('brd_page_limit', TRUE);
  55. $data['brd_page_rows'] = $this->input->post('brd_page_rows', TRUE);
  56. $data['brd_page_rows_m'] = $this->input->post('brd_page_rows_m', TRUE);
  57. $data['brd_fixed_num'] = $this->input->post('brd_fixed_num', TRUE);
  58. $data['brd_fixed_num_m'] = $this->input->post('brd_fixed_num_m', TRUE);
  59. $data['brd_display_time'] = $this->input->post('brd_display_time', TRUE);
  60. $data['brd_use_anonymous'] = $this->input->post('brd_use_anonymous', TRUE);
  61. $data['brd_use_secret'] = $this->input->post('brd_use_secret', TRUE);
  62. $data['brd_use_reply'] = $this->input->post('brd_use_reply', TRUE);
  63. $data['brd_use_comment'] = $this->input->post('brd_use_comment', TRUE);
  64. $data['brd_use_wysiwyg'] = $this->input->post('brd_use_wysiwyg', TRUE);
  65. $data['brd_use_attach'] = $this->input->post('brd_use_attach', TRUE);
  66. $data['brd_use_assign'] = $this->input->post('brd_use_assign', TRUE, 'N') == 'Y' ? 'Y' : 'N';
  67. $data['brd_point_read'] = $this->input->post('brd_point_read', TRUE);
  68. $data['brd_point_write'] = $this->input->post('brd_point_write', TRUE);
  69. $data['brd_point_comment'] = $this->input->post('brd_point_comment', TRUE);
  70. $data['brd_point_download'] = $this->input->post('brd_point_download', TRUE);
  71. $data['brd_point_reply'] = $this->input->post('brd_point_reply', TRUE);
  72. $data['brd_use_total_rss'] = $this->input->post('brd_use_total_rss', TRUE);
  73. $data['brd_use_rss'] = $this->input->post('brd_use_rss', TRUE);
  74. $data['brd_use_sitemap'] = $this->input->post('brd_use_sitemap', TRUE);
  75. $data['brd_use_naver_syndi'] = $this->input->post('brd_use_naver_syndi', TRUE, 'Y');
  76. if(empty($brd_key))
  77. {
  78. $tmp = (int)$this->db->select_max('brd_sort',"max")->from('board')->get()->row(0)->max;
  79. $data['brd_sort'] = $tmp +1;
  80. $data['brd_count_post'] = 0;
  81. if( $this->db->insert('board', $data) )
  82. {
  83. alert('게시판 생성이 완료되었습니다.',base_url('/admin/board/lists'));
  84. exit;
  85. }
  86. }
  87. else
  88. {
  89. $this->db->where('brd_key', $brd_key);
  90. if( $this->db->update('board', $data) ) {
  91. $this->board_model->delete_cache($brd_key);
  92. alert('게시판 정보 수정이 완료되었습니다.',base_url('/admin/board/lists'));
  93. exit;
  94. }
  95. }
  96. alert('DB입력도중 오류가 발생하였습니다.');
  97. exit;
  98. }
  99. else
  100. {
  101. $this->data['view'] = (empty($brd_key)) ? array() : $this->board_model->get_board($brd_key, TRUE);
  102. $this->data['brd_key'] = $brd_key;
  103. $this->data['skin_list'] = get_skin_list('board');
  104. // 메타태그 설정
  105. $this->site->meta_title = "게시판 관리";
  106. // 레이아웃 & 뷰파일 설정
  107. $this->theme = "admin";
  108. $this->view = "board/form";
  109. $this->active = "board/lists";
  110. }
  111. }
  112. /**
  113. * 게시판 삭제
  114. */
  115. public function remove($brd_key)
  116. {
  117. if(empty($brd_key))
  118. {
  119. alert('잘못된 접근입니다.');
  120. exit;
  121. }
  122. $this->db->where('brd_key', $brd_key)->delete('board');
  123. alert('게시판이 삭제되었습니다.');
  124. exit;
  125. }
  126. /**
  127. * 게시판 복사
  128. */
  129. public function board_copy($brd_key)
  130. {
  131. $this->load->model('board_model');
  132. $this->load->library('form_validation');
  133. $this->form_validation->set_rules('original', "원본 게시판", "required|trim");
  134. $this->form_validation->set_rules('brd_key','게시판 고유 키',"required|trim|min_length[3]|max_length[20]|callback_brd_key_check");
  135. if( $this->form_validation->run() != FALSE )
  136. {
  137. $data = $this->board_model->get_board( $this->input->post('original', TRUE) , TRUE);
  138. if(! $data || !isset($data['brd_key']) || !$data['brd_key'])
  139. {
  140. alert_modal_close('원본 게시판 설정을 찾을수 없습니다.');
  141. exit;
  142. }
  143. $data['brd_key'] = $this->input->post('brd_key', TRUE);
  144. $data['brd_title'] = $this->input->post('brd_title', TRUE);
  145. $data['brd_title_m'] = "";
  146. $tmp = (int)$this->db->select_max('brd_sort',"max")->from('board')->get()->row(0)->max;
  147. $data['brd_sort'] = $tmp +1;
  148. $data['brd_count_post'] = 0;
  149. $this->db->insert('board', $data);
  150. alert_modal_close('게시판 복사가 완료되었습니다.');
  151. exit;
  152. }
  153. else
  154. {
  155. $this->data['view'] = $this->board_model->get_board($brd_key, TRUE);
  156. if(! $this->data['view'] || !isset($this->data['view']['brd_key']) || ! $this->data['view']['brd_key'])
  157. {
  158. alert_modal_close('원본 게시판 설정을 찾을수 없습니다.');
  159. exit;
  160. }
  161. $this->data['brd_key'] = $brd_key;
  162. $this->data['skin_list'] = get_skin_list('board');
  163. $this->theme = "admin";
  164. $this->theme_file = "iframe";
  165. $this->view = "board/board_copy";
  166. }
  167. }
  168. /**
  169. * 게시판 중복여부 확인
  170. */
  171. function brd_key_check($str)
  172. {
  173. $this->load->model('board_model');
  174. if(! preg_match("/^[a-z][a-z0-9_]{2,19}$/", $str))
  175. {
  176. $this->form_validation->set_message('brd_key_check', "게시판 고유키는 영어 소문자로 시작하는 3~20 글자로 영어와 숫자만 사용가능합니다. : {$str}");
  177. return FALSE;
  178. }
  179. if( $board = $this->board_model->get_board($str, TRUE) ) {
  180. $this->form_validation->set_message('brd_key_check', "이미 사용중인 {field} 입니다 : {$str}");
  181. return FALSE;
  182. }
  183. return TRUE;
  184. }
  185. /**
  186. * 게시판 카테고리 관리
  187. * @param string $brd_key
  188. */
  189. function category($brd_key="")
  190. {
  191. $this->load->model('board_model');
  192. if(empty($brd_key))
  193. {
  194. alert('잘못된 접근입니다.');
  195. exit;
  196. }
  197. $this->data['board'] = $this->board_model->get_board($brd_key, FALSE);
  198. if( $this->data['board']['brd_use_category'] != 'Y' )
  199. {
  200. alert('게시판 카테고리 사용설정이 되어있지 않습니다.');
  201. exit;
  202. }
  203. // 메타태그 설정
  204. $this->site->meta_title = "게시판 관리";
  205. // 레이아웃 & 뷰파일 설정
  206. $this->theme = "admin";
  207. $this->view = "board/category";
  208. $this->active = "board/lists";
  209. }
  210. /**
  211. * 카테고리 등록/수정
  212. */
  213. function category_form()
  214. {
  215. $this->load->library('form_validation');
  216. $this->load->model('board_model');
  217. $this->form_validation->set_rules('brd_key', "게시판 고유키","required|trim");
  218. $this->form_validation->set_rules('bca_name', "카테고리 이름","required|trim");
  219. if( $this->form_validation->run() != FALSE )
  220. {
  221. $data['bca_idx'] = $this->input->post('bca_idx', TRUE);
  222. $data['bca_parent'] = $this->input->post('bca_parent', TRUE);
  223. $data['brd_key'] = $this->input->post('brd_key', TRUE);
  224. $data['bca_name'] = $this->input->post('bca_name', TRUE);
  225. if( empty($data['bca_idx']) )
  226. {
  227. $tmp = (int)$this->db->select_max('bca_sort','max')->where('brd_key',$data['brd_key'])->where('bca_parent', $data['bca_parent'])->get('board_category')->row(0)->max;
  228. $data['bca_sort'] = $tmp+1;
  229. if( $this->db->insert("board_category", $data) )
  230. {
  231. $this->board_model->delete_cache($data['brd_key']);
  232. alert_modal_close('새로운 카테고리가 추가되었습니다.');
  233. exit;
  234. }
  235. }
  236. else
  237. {
  238. $this->db->where('bca_idx', $data['bca_idx']);
  239. $this->db->where('bca_parent', $data['bca_parent']);
  240. $this->db->where('brd_key', $data['brd_key']);
  241. $this->db->set('bca_name', $data['bca_name']);
  242. if( $this->db->update('board_category') )
  243. {
  244. $this->board_model->delete_cache($data['brd_key']);
  245. alert_modal_close('카테고리 이름을 변경하었습니다.');
  246. exit;
  247. }
  248. }
  249. alert('DB 입력에 실패하였습니다');
  250. exit;
  251. }
  252. else
  253. {
  254. $this->data['brd_key'] = $this->input->get('brd_key', TRUE);
  255. $this->data['bca_parent'] = $this->input->get('bca_parent', TRUE);
  256. $this->data['bca_idx'] = $this->input->get('bca_idx', TRUE);
  257. $this->data['view'] = empty($this->data['bca_idx']) ? array() : $this->board_model->get_category($this->data['bca_idx']);
  258. $this->theme = "admin";
  259. $this->theme_file = "iframe";
  260. $this->view = "board/category_form";
  261. }
  262. }
  263. function board_common($brd_key)
  264. {
  265. $this->load->model('board_model');
  266. $this->data['board'] = $this->board_model->get_board($brd_key, FALSE);
  267. if(empty($this->data['board']) OR ! isset($this->data['board']['brd_key']) )
  268. {
  269. alert('존재하지 않는 게시판 또는 삭제된 게시판입니다.');
  270. exit;
  271. }
  272. $this->param['page'] = $this->data['page'] = (int)$this->input->get('page', TRUE) >= 1 ? $this->input->get('page', TRUE) : 1;
  273. $this->param['scol'] = $this->data['scol'] = $this->input->get('scol', TRUE);
  274. $this->param['stxt'] = $this->data['stxt'] = $this->input->get('stxt', TRUE);
  275. $this->param['category'] = $this->data['category'] = $this->input->get('category', TRUE);
  276. $this->data['use_wysiwyg'] = ($this->data['board']['brd_use_wysiwyg'] == 'Y');
  277. $this->data['use_secret'] = ($this->member->is_login() && $this->data['board']['brd_use_secret'] == 'Y');
  278. $this->data['use_notice'] = TRUE;
  279. $this->data['use_category'] = (($this->data['board']['brd_use_category'] == 'Y') && (count($this->data['board']['category']) > 0));
  280. $this->data['use_attach'] = ($this->data['board']['brd_use_attach'] == 'Y');
  281. }
  282. /**
  283. * 게시판 목록
  284. */
  285. function posts($brd_key)
  286. {
  287. $this->board_common($brd_key);
  288. $this->data['list'] = $this->board_model->post_list($this->data['board'], $this->param);
  289. $paging['page'] = $this->param['page'];
  290. $paging['page_rows'] = 20;
  291. $paging['total_rows'] = $this->data['list']['total_count'];
  292. $this->load->library('paging', $paging);
  293. $this->data['pagination'] = $this->paging->create();
  294. $this->active = "board/" . $brd_key;
  295. $this->theme = "admin";
  296. $this->view = "board/posts";
  297. }
  298. function read($brd_key, $post_idx="")
  299. {
  300. $this->board_common($brd_key);
  301. $this->data['view'] = $this->board_model->get_post($brd_key, $post_idx, FALSE);
  302. $this->active = "board/" . $brd_key;
  303. $this->theme = "admin";
  304. $this->view = "board/read";
  305. }
  306. function write($brd_key, $post_idx="")
  307. {
  308. $this->load->library('form_validation');
  309. $this->board_common($brd_key);
  310. $this->form_validation->set_rules('post_title', langs('게시판/form/post_title') ,'required|trim');
  311. $this->form_validation->set_rules('post_content', langs('게시판/form/post_content'),'required|trim');
  312. if( $this->form_validation->run() != FALSE)
  313. {
  314. $this->load->library('upload');
  315. // 받아온 값을 정리한다.
  316. $data['post_title'] = $this->input->post('post_title', TRUE);
  317. $data['bca_idx'] = (int) $this->input->post('bca_idx', TRUE);
  318. $data['post_parent'] = $this->input->post('post_parent', TRUE, 0);
  319. $data['post_secret'] = $this->input->post('post_secret', TRUE, 'N') == 'Y' ? "Y":'N';
  320. $data['post_content'] = $this->input->post('post_content', FALSE);
  321. $data['brd_key'] = $brd_key;
  322. $data['post_modtime'] = date('Y-m-d H:i:s');
  323. $data['post_html'] = $this->data['use_wysiwyg'] ? 'Y' : 'N';
  324. $data['post_notice'] = $this->input->post('post_notice', TRUE) == 'Y' ? 'Y' : 'N';
  325. $data['post_ip'] = ip2long( $this->input->ip_address() );
  326. $data['post_mobile'] = $this->site->viewmode == DEVICE_MOBILE ? 'Y' : 'N';
  327. $data['post_keywords'] = $this->input->post('post_keywords', TRUE);
  328. for($i=1; $i<=9; $i++)
  329. {
  330. $data['post_ext'.$i] = $this->input->post('post_ext'.$i, TRUE,'');
  331. }
  332. $parent = array();
  333. if(! empty( $data['post_parent'] ) )
  334. {
  335. $parent = $this->board_model->get_post($brd_key, $data['post_parent'], FALSE);
  336. }
  337. // 게시판 설정을 이용해서 값 정리
  338. if( $this->data['board']['brd_use_secret'] == 'N' ) $data['post_secret'] = 'N';
  339. else if ( $this->data['board']['brd_use_secret'] == 'A' ) $data['post_secret'] = 'Y';
  340. // 답글인경우 원글이 비밀글이면 답글도 비밀글
  341. else if ( ! empty($data['post_parent']) && $parent['post_secret'] == 'Y' ) $data['post_secret'] = 'Y';
  342. // 파일 업로드가 있다면
  343. if( isset($_FILES) && isset($_FILES['userfile']) && count($_FILES['userfile']) > 0 )
  344. {
  345. $dir_path = DIR_UPLOAD . "/board/{$brd_key}/".date('Y')."/".date('m');
  346. make_dir($dir_path,FALSE);
  347. $upload_config['upload_path'] = "./".$dir_path;
  348. $upload_config['file_ext_tolower'] = TRUE;
  349. $upload_config['allowed_types'] = FILE_UPLOAD_ALLOW;
  350. $upload_config['encrypt_name'] = TRUE;
  351. $this->load->library("upload", $upload_config);
  352. $this->data['upload_array'] = array();
  353. // FOR문으로 업로드하기 위해 돌리기
  354. $files = NULL;
  355. foreach ($_FILES['userfile'] as $key => $value) {
  356. foreach ($value as $noKey => $noValue) {
  357. $files[$noKey][$key] = $noValue;
  358. }
  359. }
  360. unset($_FILES);
  361. // FOR 문 돌면서 정리
  362. foreach ($files as $file) {
  363. $_FILES['userfile'] = $file;
  364. $this->upload->initialize($upload_config);
  365. if( ! isset($_FILES['userfile']['tmp_name']) OR ! $_FILES['userfile']['tmp_name']) continue;
  366. if (! $this->upload->do_upload('userfile') )
  367. {
  368. alert('파일 업로드에 실패하였습니다.\\n'.$this->upload->display_errors(' ',' '));
  369. exit;
  370. }
  371. else
  372. {
  373. $filedata = $this->upload->data();
  374. $this->data['upload_array'][] = array(
  375. "brd_key" => $brd_key,
  376. "att_origin" => $filedata['orig_name'],
  377. "att_filename" => $dir_path . "/" . $filedata['file_name'],
  378. "att_caption" => $filedata['orig_name'],
  379. "att_downloads" => 0,
  380. "att_filesize" => $filedata['file_size'] * 1024,
  381. "att_image_width" => $filedata['image_width'] ? $filedata['image_width'] : 0,
  382. "att_image_height" => $filedata['image_height'] ? $filedata['image_height'] : 0,
  383. "att_ext" => $filedata['file_ext'],
  384. "att_is_image" => ($filedata['is_image'] == 1) ? 'Y' : 'N',
  385. "att_regtime" => date('Y-m-d H:i:s')
  386. );
  387. }
  388. }
  389. }
  390. // 첨부파일 삭제가 있다면 삭제한다.
  391. $del_file = $this->input->post("del_file", TRUE);
  392. if( $del_file && count($del_file) > 0 )
  393. {
  394. foreach($del_file as $att_idx) {
  395. $this->board_model->attach_remove($att_idx);
  396. }
  397. }
  398. // 수정이냐 신규냐에 따라 값 설정
  399. if( empty($post_idx) )
  400. {
  401. $data['mem_userid'] = $this->member->info('userid');
  402. $data['mem_nickname'] = $this->member->info('nickname');
  403. $data['mem_password'] = $this->member->info('password');
  404. $data['post_regtime'] = date('Y-m-d H:i:s');
  405. $data['post_status'] = 'Y';
  406. $data['post_count_comment'] = 0;
  407. $data['post_hit'] = 0;
  408. // 답글인경우
  409. if(! empty($data['post_parent']))
  410. {
  411. if( strlen($parent['post_reply']) >= 10 )
  412. {
  413. alert('더 이상 답변하실 수 없습니다.\\n답변은 10단계 까지만 가능합니다.');
  414. exit;
  415. }
  416. $reply_len = strlen($parent['post_reply']) + 1;
  417. $begin_reply_char = 'A';
  418. $end_reply_char = 'Z';
  419. $reply_number = +1;
  420. $reply_char = "";
  421. $this->db->select("MAX(SUBSTRING(post_reply, {$reply_len}, 1)) AS reply")->from('board_post')->where('post_num', $parent['post_num'])->where('brd_key', $brd_key)->where("SUBSTRING(post_reply, {$reply_len}, 1) <>", '');
  422. if($parent['post_reply']) $this->db->like('post_reply', $parent['post_reply'],'after');
  423. $row = $this->db->get()->row_array();
  424. if(! $row['reply']) {
  425. $reply_char = $begin_reply_char;
  426. }
  427. else if ($row['reply'] == $end_reply_char) {
  428. alert("더 이상 답변하실 수 없습니다.\\n답변은 26개 까지만 가능합니다.");
  429. exit;
  430. }
  431. else {
  432. $reply_char = chr(ord($row['reply']) + $reply_number);
  433. }
  434. $data['post_reply'] = $parent['post_reply'] . $reply_char;
  435. // 답변의 원글이 비밀글이라면, 비밀번호는 원글과 동일하게 넣는다.
  436. if( $parent['post_secret'] == 'Y' ) {
  437. $data['mem_password'] = $parent['mem_password'];
  438. }
  439. $data['post_num'] = $parent['post_num'];
  440. }
  441. else {
  442. $tmp = (int)$this->db->select_max('post_num','max')->from('board_post')->where('brd_key',$brd_key)->get()->row(0)->max;
  443. $data['post_reply'] = "";
  444. $data['post_num'] = $tmp+1;
  445. }
  446. if(! $this->db->insert('board_post', $data) )
  447. {
  448. alert(langs('게시판/msg/write_failed'));
  449. exit;
  450. }
  451. $post_idx = $this->db->insert_id();
  452. }
  453. else {
  454. $this->db->where('brd_key', $brd_key);
  455. $this->db->where('post_idx', $post_idx);
  456. if(! $this->db->update('board_post', $data))
  457. {
  458. alert(langs('게시판/msg/write_failed'));
  459. exit;
  460. }
  461. }
  462. // 업로드된 데이타가 있을경우에 DB에 기록
  463. if(isset($this->data['upload_array']) && count($this->data['upload_array']) >0 )
  464. {
  465. foreach($this->data['upload_array'] as &$arr) {
  466. $arr['post_idx'] = $post_idx;
  467. }
  468. $this->db->insert_batch("board_attach", $this->data['upload_array']);
  469. }
  470. alert(langs('게시판/msg/write_success'), base_url("admin/board/read/{$brd_key}/{$post_idx}"));
  471. exit;
  472. }
  473. else {
  474. // 수정일경우를 대비해서 글 고유 pk 넘김
  475. $this->data['post_idx'] = (int)$post_idx;
  476. $this->data['post_parent'] = $this->input->get('post_parent', TRUE);
  477. $this->data['view'] = empty($post_idx) ? array() : $this->board_model->get_post($brd_key, $post_idx, FALSE);
  478. $this->data['parent'] = empty($this->data['post_parent']) ? array() : $this->board_model->get_post($brd_key, $this->data['post_parent'], FALSE);
  479. if( $this->data['post_idx'] && (! $this->data['view'] OR ! isset($this->data['view']['post_idx']) OR !$this->data['view']['post_idx'] ) )
  480. {
  481. alert('잘못된 접근입니다.');
  482. exit;
  483. }
  484. $hidden = array();
  485. // 답글작성일경우 부모 번호 넘겨주기
  486. if($this->data['post_parent']) {
  487. $hidden['post_parent'] = $this->data['post_parent'];
  488. $this->data['view']['post_title'] = "RE : ". $this->data['parent']['post_title'];
  489. }
  490. $write_url = base_url("admin/board/write/{$brd_key}" . ($post_idx ? '/'.$post_idx : ''), SSL_VERFIY ? "https":'http');
  491. $this->data['form_open'] = form_open_multipart($write_url, array("autocomplete"=>"off"), $hidden);
  492. $this->data['form_close'] = form_close();
  493. // 레이아웃 & 뷰파일 설정
  494. $this->active = "board/".$brd_key;
  495. $this->theme = "admin";
  496. $this->view = "board/write";
  497. }
  498. }
  499. }