Browse Source

휘파람보드 1.2.0

- 대규모 업데이트
master
장선근 6 years ago
parent
commit
fa910d7bae
  1. 4
      _src/common/scss/_utility.scss
  2. 2
      public_html/assets/css/admin.min.css
  3. 2
      public_html/assets/css/admin.min.css.map
  4. 2
      public_html/assets/css/desktop.min.css
  5. 2
      public_html/assets/css/desktop.min.css.map
  6. 2
      public_html/assets/css/mobile.min.css
  7. 2
      public_html/assets/css/mobile.min.css.map
  8. 79
      wheeparam/application/controllers/Board.php
  9. 217
      wheeparam/application/controllers/admin/Board.php
  10. 2
      wheeparam/application/core/WB_Controller.php
  11. 44
      wheeparam/application/helpers/widgets_helper.php
  12. 419
      wheeparam/application/libraries/Boardlib.php
  13. 396
      wheeparam/application/models/Board_model.php
  14. 28
      wheeparam/config/wheeparam.sql
  15. 2
      wheeparam/views/skins/board/comment/basic/c_list.php
  16. 15
      wheeparam/views/skins/board/list/basic/list.php
  17. 69
      wheeparam/views/skins/board/view/basic/view.php
  18. 30
      wheeparam/views/skins/board/write/basic/write.php
  19. 72
      wheeparam/views/themes/admin/board/category.php
  20. 15
      wheeparam/views/themes/admin/board/category_form.php
  21. 875
      wheeparam/views/themes/admin/board/form.php
  22. 154
      wheeparam/views/themes/admin/board/posts.php
  23. 63
      wheeparam/views/themes/admin/board/read.php
  24. 125
      wheeparam/views/themes/admin/board/write.php
  25. 1
      wheeparam/views/themes/admin/members/login.php

4
_src/common/scss/_utility.scss

@ -93,6 +93,6 @@
} }
.margin-auto { .margin-auto {
margin-left:auto;
margin-right:auto;
margin-left:auto !important;
margin-right:auto !important;
} }

2
public_html/assets/css/admin.min.css
File diff suppressed because it is too large
View File

2
public_html/assets/css/admin.min.css.map
File diff suppressed because it is too large
View File

2
public_html/assets/css/desktop.min.css
File diff suppressed because it is too large
View File

2
public_html/assets/css/desktop.min.css.map
File diff suppressed because it is too large
View File

2
public_html/assets/css/mobile.min.css
File diff suppressed because it is too large
View File

2
public_html/assets/css/mobile.min.css.map
File diff suppressed because it is too large
View File

79
wheeparam/application/controllers/Board.php

@ -7,7 +7,7 @@ class Board extends WB_Controller {
{ {
parent::__construct(); parent::__construct();
$this->load->model('board_model');
$this->load->library('boardlib');
} }
/** /**
@ -26,7 +26,7 @@ class Board extends WB_Controller {
public function view($brd_key, $post_idx) public function view($brd_key, $post_idx)
{ {
$this->board_common($brd_key, 'read'); $this->board_common($brd_key, 'read');
$this->data['view'] = $this->board_model->get_post($brd_key, $post_idx, FALSE);
$this->data['view'] = $this->boardlib->get_post($brd_key, $post_idx, FALSE);
if(! in_array( $this->data['view']['post_status'], array("Y","B"))) if(! in_array( $this->data['view']['post_status'], array("Y","B")))
{ {
@ -39,7 +39,7 @@ class Board extends WB_Controller {
{ {
$is_auth = FALSE; $is_auth = FALSE;
if( !empty($this->data['view']['mem_userid']) && $this->data['view']['mem_userid'] == $this->member->info('userid') )
if( !empty($this->data['view']['reg_user']) && $this->data['view']['reg_user'] == $this->member->info('idx') )
{ {
$is_auth = TRUE; $is_auth = TRUE;
} }
@ -55,7 +55,7 @@ class Board extends WB_Controller {
$tmp = $this->db->where('post_num', $this->data['view']['post_num'])->where('brd_key', $brd_key)->get('board_post')->result_array(); $tmp = $this->db->where('post_num', $this->data['view']['post_num'])->where('brd_key', $brd_key)->get('board_post')->result_array();
foreach($tmp as $t) foreach($tmp as $t)
{ {
if( $t['mem_userid'] && $t['mem_userid'] == $this->member->info('userid') )
if( $t['reg_user'] && $t['reg_user'] == $this->member->info('idx') )
{ {
$is_auth = TRUE; $is_auth = TRUE;
break; break;
@ -81,7 +81,7 @@ class Board extends WB_Controller {
} }
// 포인트 관련 프로세스 // 포인트 관련 프로세스
$this->point_process('brd_point_read', 'POST_READ', '게시글 읽기', $post_idx, ($this->data['view']['mem_userid'] == $this->member->info('userid')) );
$this->point_process('brd_point_read', 'POST_READ', '게시글 읽기', $post_idx, ($this->data['view']['reg_user'] == $this->member->info('idx')) );
// 링크 추가 // 링크 추가
$this->data['board']['link']['reply'] = base_url("board/{$brd_key}/write/?post_parent={$post_idx}"); $this->data['board']['link']['reply'] = base_url("board/{$brd_key}/write/?post_parent={$post_idx}");
@ -108,8 +108,8 @@ class Board extends WB_Controller {
$list_skin_path = DIR_SKIN . "/board/comment/" . $this->data['board']['brd_skin_c'] . "/c_list"; $list_skin_path = DIR_SKIN . "/board/comment/" . $this->data['board']['brd_skin_c'] . "/c_list";
if( $this->data['board']['brd_use_comment'] == 'Y' ) if( $this->data['board']['brd_use_comment'] == 'Y' )
{ {
$mem_userid = ($this->member->is_login()) ? $this->member->info('userid') : '';
$tmp2['comment_list'] = $this->board_model->comment_list($brd_key, $post_idx, $this->data['board']['auth']['admin'], $mem_userid);
$mem_userid = ($this->member->is_login()) ? $this->member->is_login() : '';
$tmp2['comment_list'] = $this->boardlib->comment_list($brd_key, $post_idx, $this->data['board']['auth']['admin'], $mem_userid);
// 각 댓글마다 대댓글 폼을 만든다. // 각 댓글마다 대댓글 폼을 만든다.
foreach($tmp2['comment_list']['list'] as &$row) foreach($tmp2['comment_list']['list'] as &$row)
{ {
@ -892,9 +892,9 @@ class Board extends WB_Controller {
exit; exit;
} }
$post = $this->board_model->get_post($brd_key, $post_idx, TRUE);
$post = $this->boardlib->get_post($brd_key, $post_idx, TRUE);
$this->point_process('brd_point_download', "POST_ATTACH_DOWNLOAD", "첨부파일 다운로드", $post_idx, ($post['mem_userid'] == $this->member->info('userid')) );
$this->point_process('brd_point_download', "POST_ATTACH_DOWNLOAD", "첨부파일 다운로드", $post_idx, ($post['reg_user'] == $this->member->info('idx')) );
$this->db->where('att_idx', $att['att_idx'])->set('att_downloads', 'att_downloads + 1', FALSE)->update('attach'); $this->db->where('att_idx', $att['att_idx'])->set('att_downloads', 'att_downloads + 1', FALSE)->update('attach');
@ -1025,14 +1025,7 @@ class Board extends WB_Controller {
{ {
$return = array(); $return = array();
$return['admin'] = ( ( $this->member->is_super() ) OR ( $this->board_model->is_admin($this->data['board']['brd_key'], $this->member->is_login())) );
$return['read'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_read']) );
$return['list'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_list']) );
$return['write'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_write']) );
$return['upload'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_upload']) );
$return['download'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_download']) );
$return['comment'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_comment']) );
$return['reply'] = ( $return['admin'] OR ($this->member->level() >= $this->data['board']['brd_lv_reply']) );
return $return; return $return;
} }
@ -1044,45 +1037,7 @@ class Board extends WB_Controller {
*/ */
private function board_common($brd_key, $check_type="") private function board_common($brd_key, $check_type="")
{ {
$this->param = array();
// 넘어온 값을 정리
$this->data['board'] = $this->board_model->get_board($brd_key, FALSE);
if(empty($this->data['board']) OR ! isset($this->data['board']['brd_key']) )
{
alert('존재하지 않는 게시판 또는 삭제된 게시판입니다.');
exit;
}
$this->data['board']['auth'] = $this->check_auth();
$this->data['board']['link'] = $this->board_model->get_link($brd_key);
// front-end 에서 알아보기쉽게 값을 정리
$this->data['use_wysiwyg'] = ($this->data['board']['brd_use_wysiwyg'] == 'Y');
$this->data['use_secret'] = ($this->member->is_login() && $this->data['board']['brd_use_secret'] == 'Y');
$this->data['use_notice'] = ($this->data['board']['auth']['admin']);
$this->data['use_category'] = (($this->data['board']['brd_use_category'] == 'Y') && (count($this->data['board']['category']) > 0));
$this->data['use_attach'] = ($this->data['board']['brd_use_attach'] == 'Y' && $this->data['board']['auth']['upload']);
// 접속한 기기에 따라 설정을 바꾼다.
$this->data['board']['brd_skin_l'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_skin_l_m'] : $this->data['board']['brd_skin_l'];
$this->data['board']['brd_skin_w'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_skin_w_m'] : $this->data['board']['brd_skin_w'];
$this->data['board']['brd_skin_c'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_skin_c_m'] : $this->data['board']['brd_skin_c'];
$this->data['board']['brd_skin_v'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_skin_v_m'] : $this->data['board']['brd_skin_v'];
$this->data['board']['brd_title'] = ($this->site->viewmode == DEVICE_MOBILE) ? ($this->data['board']['brd_title_m']?$this->data['board']['brd_title_m']:$this->data['board']['brd_title']) : $this->data['board']['brd_title'];
$this->data['board']['brd_page_rows'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_page_rows_m'] : $this->data['board']['brd_page_rows'];
$this->data['board']['brd_fixed_num'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_fixed_num_m'] : $this->data['board']['brd_fixed_num'];
unset($this->data['board']['brd_skin_m'], $this->data['board']['brd_title_m'], $this->data['board']['brd_page_rows_m'], $this->data['board']['brd_fixed_num_m']);
$this->data['category_list'] = ( $this->data['use_category'] && count($this->data['board']['category']) > 0 ) ? $this->data['board']['category'] : NULL;
// 리스트 불러오기
$this->param['page'] = $this->data['page'] = (int)$this->input->get('page', TRUE) >= 1 ? $this->input->get('page', TRUE) : 1;
$this->param['scol'] = $this->data['scol'] = $this->input->get('scol', TRUE);
$this->param['stxt'] = $this->data['stxt'] = $this->input->get('stxt', TRUE);
$this->param['category'] = $this->data['category'] = $this->input->get('category', TRUE);
$this->boardlib->common_data($brd_key);
if( $check_type && ! $this->data['board']['auth'][$check_type] ) if( $check_type && ! $this->data['board']['auth'][$check_type] )
{ {
@ -1097,15 +1052,7 @@ class Board extends WB_Controller {
exit; exit;
} }
$use_list = TRUE;
if( $check_type == 'download' OR $check_type == 'comment' OR $check_type == 'write' OR $check_type == 'reply' )
{
$use_list = FALSE;
}
else if( ($check_type == "view" OR $check_type == "read" ) && $this->data['board']['brd_use_view_list'] == 'N' )
{
$use_list = FALSE;
}
$use_list = $check_type == 'list';
$this->data['list'] = array( $this->data['list'] = array(
"list"=>array(), "list"=>array(),
@ -1116,7 +1063,7 @@ class Board extends WB_Controller {
if( $use_list ) if( $use_list )
{ {
// 게시글 목록 가져오기 // 게시글 목록 가져오기
$this->data['list'] = $this->board_model->post_list($this->data['board'], $this->param);
$this->data['list'] = $this->boardlib->post_list($this->data['board'], $this->param);
// 페이지네이션 세팅 // 페이지네이션 세팅
$paging['page'] = $this->param['page']; $paging['page'] = $this->param['page'];

217
wheeparam/application/controllers/admin/Board.php

@ -3,18 +3,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Board extends WB_Controller class Board extends WB_Controller
{ {
/**
public function __construct()
{
parent::__construct();
$this->theme = 'admin';
$this->load->library('boardlib');
}
/******************************************************************************************************
* 게시판 목록 * 게시판 목록
*/
******************************************************************************************************/
public function lists() public function lists()
{ {
// 메타태그 설정 // 메타태그 설정
$this->site->meta_title = "게시판 관리"; $this->site->meta_title = "게시판 관리";
// 레이아웃 & 뷰파일 설정 // 레이아웃 & 뷰파일 설정
$this->theme = "admin";
$this->view = "board/lists";
$this->active = "board/lists";
$this->view = $this->active = "board/lists";
} }
/** /**
@ -31,8 +38,7 @@ class Board extends WB_Controller
if( $this->form_validation->run() != FALSE ) if( $this->form_validation->run() != FALSE )
{ {
$data['brd_key'] = $this->input->post('brd_key', TRUE); $data['brd_key'] = $this->input->post('brd_key', TRUE);
$data['brd_title'] = $this->input->post('brd_title', TRUE);
$data['brd_title_m'] = $this->input->post('brd_title_m', TRUE);
$data['brd_title'] = $this->input->post('brd_title', TRUE,'');
$data['brd_keywords'] = $this->input->post('brd_keywords', TRUE); $data['brd_keywords'] = $this->input->post('brd_keywords', TRUE);
$data['brd_description'] = $this->input->post('brd_description', TRUE); $data['brd_description'] = $this->input->post('brd_description', TRUE);
$data['brd_skin_l'] = $this->input->post('brd_skin_l', TRUE); $data['brd_skin_l'] = $this->input->post('brd_skin_l', TRUE);
@ -43,23 +49,14 @@ class Board extends WB_Controller
$data['brd_skin_v_m'] = $this->input->post('brd_skin_v_m', TRUE); $data['brd_skin_v_m'] = $this->input->post('brd_skin_v_m', TRUE);
$data['brd_skin_c'] = $this->input->post('brd_skin_c', TRUE); $data['brd_skin_c'] = $this->input->post('brd_skin_c', TRUE);
$data['brd_skin_c_m'] = $this->input->post('brd_skin_c_m', TRUE); $data['brd_skin_c_m'] = $this->input->post('brd_skin_c_m', TRUE);
$data['brd_search'] = $this->input->post('brd_search', TRUE, "N");
$data['brd_sort'] = $this->input->post('brd_sort', TRUE);
$data['brd_use_category'] = $this->input->post('brd_use_category', TRUE, "N"); $data['brd_use_category'] = $this->input->post('brd_use_category', TRUE, "N");
$data['brd_category'] = rtrim(trim($this->input->post('brd_category', TRUE, '')), ';');
$data['brd_lv_list'] = $this->input->post('brd_lv_list', TRUE); $data['brd_lv_list'] = $this->input->post('brd_lv_list', TRUE);
$data['brd_lv_read'] = $this->input->post('brd_lv_read', TRUE); $data['brd_lv_read'] = $this->input->post('brd_lv_read', TRUE);
$data['brd_lv_write'] = $this->input->post('brd_lv_write', TRUE); $data['brd_lv_write'] = $this->input->post('brd_lv_write', TRUE);
$data['brd_lv_reply'] = $this->input->post('brd_lv_reply', TRUE); $data['brd_lv_reply'] = $this->input->post('brd_lv_reply', TRUE);
$data['brd_lv_comment'] = $this->input->post('brd_lv_comment', TRUE); $data['brd_lv_comment'] = $this->input->post('brd_lv_comment', TRUE);
$data['brd_lv_download'] = $this->input->post('brd_lv_download', TRUE); $data['brd_lv_download'] = $this->input->post('brd_lv_download', TRUE);
$data['brd_lv_upload'] = $this->input->post('brd_lv_upload', TRUE);
$data['brd_use_list_thumbnail'] = $this->input->post('brd_use_list_thumbnail', TRUE);
$data['brd_use_list_file'] = $this->input->post('brd_use_list_file', TRUE);
$data['brd_use_view_list'] = $this->input->post('brd_use_view_list', TRUE);
$data['brd_thumb_width'] = $this->input->post('brd_thumb_width', TRUE);
$data['brd_thumb_height'] = $this->input->post('brd_thumb_height', TRUE);
$data['brd_time_new'] = $this->input->post('brd_time_new', TRUE);
$data['brd_hit_count'] = $this->input->post('brd_hit_count', TRUE);
$data['brd_page_limit'] = $this->input->post('brd_page_limit', TRUE); $data['brd_page_limit'] = $this->input->post('brd_page_limit', TRUE);
$data['brd_page_rows'] = $this->input->post('brd_page_rows', TRUE); $data['brd_page_rows'] = $this->input->post('brd_page_rows', TRUE);
$data['brd_page_rows_m'] = $this->input->post('brd_page_rows_m', TRUE); $data['brd_page_rows_m'] = $this->input->post('brd_page_rows_m', TRUE);
@ -70,27 +67,28 @@ class Board extends WB_Controller
$data['brd_use_secret'] = $this->input->post('brd_use_secret', TRUE); $data['brd_use_secret'] = $this->input->post('brd_use_secret', TRUE);
$data['brd_use_reply'] = $this->input->post('brd_use_reply', TRUE); $data['brd_use_reply'] = $this->input->post('brd_use_reply', TRUE);
$data['brd_use_comment'] = $this->input->post('brd_use_comment', TRUE); $data['brd_use_comment'] = $this->input->post('brd_use_comment', TRUE);
$data['brd_use_wysiwyg'] = $this->input->post('brd_use_wysiwyg', TRUE);
$data['brd_use_attach'] = $this->input->post('brd_use_attach', TRUE);
$data['brd_use_assign'] = $this->input->post('brd_use_assign', TRUE, 'N') == 'Y' ? 'Y' : 'N';
$data['brd_point_read'] = $this->input->post('brd_point_read', TRUE);
$data['brd_point_write'] = $this->input->post('brd_point_write', TRUE);
$data['brd_point_comment'] = $this->input->post('brd_point_comment', TRUE);
$data['brd_point_download'] = $this->input->post('brd_point_download', TRUE);
$data['brd_point_reply'] = $this->input->post('brd_point_reply', TRUE);
$data['brd_use_total_rss'] = $this->input->post('brd_use_total_rss', TRUE);
$data['brd_use_rss'] = $this->input->post('brd_use_rss', TRUE);
$data['brd_use_sitemap'] = $this->input->post('brd_use_sitemap', TRUE);
$data['brd_point_read'] = $this->input->post('brd_point_read', TRUE, 0);
$data['brd_point_write'] = $this->input->post('brd_point_write', TRUE, 0);
$data['brd_point_comment'] = $this->input->post('brd_point_comment', TRUE, 0);
$data['brd_point_download'] = $this->input->post('brd_point_download', TRUE, 0);
$data['brd_point_reply'] = $this->input->post('brd_point_reply', TRUE, 0);
$data['brd_point_read_flag'] = $this->input->post('brd_point_read_flag', TRUE, -1);
$data['brd_point_write_flag'] = $this->input->post('brd_point_write_flag', TRUE, 1);
$data['brd_point_comment_flag'] = $this->input->post('brd_point_comment_flag', TRUE, 1);
$data['brd_point_download_flag'] = $this->input->post('brd_point_download_flag', TRUE, -1);
$data['brd_point_reply_flag'] = $this->input->post('brd_point_reply_flag', TRUE, 1);
$data['upd_user'] = $this->member->is_login();
$data['upd_datetime'] = date('Y-m-d H:i:s');
if(empty($brd_key)) if(empty($brd_key))
{ {
$tmp = (int)$this->db->select_max('brd_sort',"max")->from('board')->get()->row(0)->max;
$data['brd_sort'] = $tmp +1;
$data['reg_user'] = $data['upd_user'];
$data['reg_datetime'] = $data['upd_datetime'];
$data['brd_count_post'] = 0; $data['brd_count_post'] = 0;
if( $this->db->insert('board', $data) ) if( $this->db->insert('board', $data) )
{ {
alert('게시판 생성이 완료되었습니다.',base_url('/admin/board/lists'));
alert_modal_close('게시판 생성이 완료되었습니다.');
exit; exit;
} }
} }
@ -98,8 +96,8 @@ class Board extends WB_Controller
{ {
$this->db->where('brd_key', $brd_key); $this->db->where('brd_key', $brd_key);
if( $this->db->update('board', $data) ) { if( $this->db->update('board', $data) ) {
$this->board_model->delete_cache($brd_key);
alert('게시판 정보 수정이 완료되었습니다.',base_url('/admin/board/lists'));
$this->boardlib->delete_cache($brd_key);
alert_modal_close('게시판 정보 수정이 완료되었습니다.');
exit; exit;
} }
} }
@ -109,7 +107,7 @@ class Board extends WB_Controller
} }
else else
{ {
$this->data['view'] = (empty($brd_key)) ? array() : $this->board_model->get_board($brd_key, TRUE);
$this->data['view'] = (empty($brd_key)) ? array() : $this->boardlib->get($brd_key, TRUE);
$this->data['brd_key'] = $brd_key; $this->data['brd_key'] = $brd_key;
$this->data['skin_list_l'] = get_skin_list('board/list'); $this->data['skin_list_l'] = get_skin_list('board/list');
$this->data['skin_list_w'] = get_skin_list('board/write'); $this->data['skin_list_w'] = get_skin_list('board/write');
@ -120,9 +118,8 @@ class Board extends WB_Controller
$this->site->meta_title = "게시판 관리"; $this->site->meta_title = "게시판 관리";
// 레이아웃 & 뷰파일 설정 // 레이아웃 & 뷰파일 설정
$this->theme = "admin";
$this->view = "board/form"; $this->view = "board/form";
$this->active = "board/lists";
$this->theme_file = 'iframe';
} }
} }
@ -155,7 +152,7 @@ class Board extends WB_Controller
if( $this->form_validation->run() != FALSE ) if( $this->form_validation->run() != FALSE )
{ {
$data = $this->board_model->get_board( $this->input->post('original', TRUE) , TRUE);
$data = $this->boardlib->get( $this->input->post('original', TRUE) , TRUE);
if(! $data || !isset($data['brd_key']) || !$data['brd_key']) if(! $data || !isset($data['brd_key']) || !$data['brd_key'])
{ {
@ -165,10 +162,9 @@ class Board extends WB_Controller
$data['brd_key'] = $this->input->post('brd_key', TRUE); $data['brd_key'] = $this->input->post('brd_key', TRUE);
$data['brd_title'] = $this->input->post('brd_title', TRUE); $data['brd_title'] = $this->input->post('brd_title', TRUE);
$data['brd_title_m'] = "";
$tmp = (int)$this->db->select_max('brd_sort',"max")->from('board')->get()->row(0)->max;
$data['brd_sort'] = $tmp +1;
$data['brd_count_post'] = 0; $data['brd_count_post'] = 0;
$data['upd_user'] = $data['reg_user'] = $this->member->is_login();
$data['upd_datetime'] = $data['reg_datetime'] = date('Y-m-d H:i:s');
$this->db->insert('board', $data); $this->db->insert('board', $data);
@ -178,7 +174,7 @@ class Board extends WB_Controller
} }
else else
{ {
$this->data['view'] = $this->board_model->get_board($brd_key, TRUE);
$this->data['view'] = $this->boardlib->get($brd_key, TRUE);
if(! $this->data['view'] || !isset($this->data['view']['brd_key']) || ! $this->data['view']['brd_key']) if(! $this->data['view'] || !isset($this->data['view']['brd_key']) || ! $this->data['view']['brd_key'])
{ {
alert_modal_close('원본 게시판 설정을 찾을수 없습니다.'); alert_modal_close('원본 게시판 설정을 찾을수 없습니다.');
@ -206,7 +202,7 @@ class Board extends WB_Controller
return FALSE; return FALSE;
} }
if( $board = $this->board_model->get_board($str, TRUE) ) {
if( $board = $this->boardlib->get($str, TRUE) ) {
$this->form_validation->set_message('brd_key_check', "이미 사용중인 {field} 입니다 : {$str}"); $this->form_validation->set_message('brd_key_check', "이미 사용중인 {field} 입니다 : {$str}");
return FALSE; return FALSE;
} }
@ -214,131 +210,14 @@ class Board extends WB_Controller
return TRUE; return TRUE;
} }
/**
* 게시판 카테고리 관리
* @param string $brd_key
*/
function category($brd_key="")
{
$this->load->model('board_model');
if(empty($brd_key))
{
alert('잘못된 접근입니다.');
exit;
}
$this->data['board'] = $this->board_model->get_board($brd_key, FALSE);
if( $this->data['board']['brd_use_category'] != 'Y' )
{
alert('게시판 카테고리 사용설정이 되어있지 않습니다.');
exit;
}
// 메타태그 설정
$this->site->meta_title = "게시판 관리";
// 레이아웃 & 뷰파일 설정
$this->theme = "admin";
$this->view = "board/category";
$this->active = "board/lists";
}
/**
* 카테고리 등록/수정
*/
function category_form()
{
$this->load->library('form_validation');
$this->load->model('board_model');
$this->form_validation->set_rules('brd_key', "게시판 고유키","required|trim");
$this->form_validation->set_rules('bca_name', "카테고리 이름","required|trim");
if( $this->form_validation->run() != FALSE )
{
$data['bca_idx'] = $this->input->post('bca_idx', TRUE);
$data['bca_parent'] = $this->input->post('bca_parent', TRUE);
$data['brd_key'] = $this->input->post('brd_key', TRUE);
$data['bca_name'] = $this->input->post('bca_name', TRUE);
if( empty($data['bca_idx']) )
{
$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;
$data['bca_sort'] = $tmp+1;
if( $this->db->insert("board_category", $data) )
{
$this->board_model->delete_cache($data['brd_key']);
alert_modal_close('새로운 카테고리가 추가되었습니다.');
exit;
}
}
else
{
$this->db->where('bca_idx', $data['bca_idx']);
$this->db->where('bca_parent', $data['bca_parent']);
$this->db->where('brd_key', $data['brd_key']);
$this->db->set('bca_name', $data['bca_name']);
if( $this->db->update('board_category') )
{
$this->board_model->delete_cache($data['brd_key']);
alert_modal_close('카테고리 이름을 변경하었습니다.');
exit;
}
}
alert('DB 입력에 실패하였습니다');
exit;
}
else
{
$this->data['brd_key'] = $this->input->get('brd_key', TRUE);
$this->data['bca_parent'] = $this->input->get('bca_parent', TRUE);
$this->data['bca_idx'] = $this->input->get('bca_idx', TRUE);
$this->data['view'] = empty($this->data['bca_idx']) ? array() : $this->board_model->get_category($this->data['bca_idx']);
$this->theme = "admin";
$this->theme_file = "iframe";
$this->view = "board/category_form";
}
}
function board_common($brd_key)
{
$this->load->model('board_model');
$this->data['board'] = $this->board_model->get_board($brd_key, FALSE);
if(empty($this->data['board']) OR ! isset($this->data['board']['brd_key']) )
{
alert('존재하지 않는 게시판 또는 삭제된 게시판입니다.');
exit;
}
$this->param['page'] = $this->data['page'] = (int)$this->input->get('page', TRUE) >= 1 ? $this->input->get('page', TRUE) : 1;
$this->param['scol'] = $this->data['scol'] = $this->input->get('scol', TRUE);
$this->param['stxt'] = $this->data['stxt'] = $this->input->get('stxt', TRUE);
$this->param['category'] = $this->data['category'] = $this->input->get('category', TRUE);
$this->data['use_wysiwyg'] = ($this->data['board']['brd_use_wysiwyg'] == 'Y');
$this->data['use_secret'] = ($this->member->is_login() && $this->data['board']['brd_use_secret'] == 'Y');
$this->data['use_notice'] = TRUE;
$this->data['use_category'] = (($this->data['board']['brd_use_category'] == 'Y') && (count($this->data['board']['category']) > 0));
$this->data['use_attach'] = ($this->data['board']['brd_use_attach'] == 'Y');
}
/** /**
* 게시판 목록 * 게시판 목록
*/ */
function posts($brd_key) function posts($brd_key)
{ {
$this->board_common($brd_key);
$this->boardlib->common_data($brd_key);
$this->data['list'] = $this->board_model->post_list($this->data['board'], $this->param);
$this->data['list'] = $this->boardlib->post_list($this->data['board'], $this->param);
$paging['page'] = $this->param['page']; $paging['page'] = $this->param['page'];
$paging['page_rows'] = 20; $paging['page_rows'] = 20;
@ -354,9 +233,9 @@ class Board extends WB_Controller
function read($brd_key, $post_idx="") function read($brd_key, $post_idx="")
{ {
$this->board_common($brd_key);
$this->boardlib->common_data($brd_key);
$this->data['view'] = $this->board_model->get_post($brd_key, $post_idx, FALSE);
$this->data['view'] = $this->boardlib->get_post($brd_key, $post_idx, FALSE);
$this->active = "board/" . $brd_key; $this->active = "board/" . $brd_key;
$this->theme = "admin"; $this->theme = "admin";
@ -366,7 +245,7 @@ class Board extends WB_Controller
function write($brd_key, $post_idx="") function write($brd_key, $post_idx="")
{ {
$this->load->library('form_validation'); $this->load->library('form_validation');
$this->board_common($brd_key);
$this->boardlib->common_data($brd_key);
$this->form_validation->set_rules('post_title', langs('게시판/form/post_title') ,'required|trim'); $this->form_validation->set_rules('post_title', langs('게시판/form/post_title') ,'required|trim');
$this->form_validation->set_rules('post_content', langs('게시판/form/post_content'),'required|trim'); $this->form_validation->set_rules('post_content', langs('게시판/form/post_content'),'required|trim');
@ -377,13 +256,13 @@ class Board extends WB_Controller
// 받아온 값을 정리한다. // 받아온 값을 정리한다.
$data['post_title'] = $this->input->post('post_title', TRUE); $data['post_title'] = $this->input->post('post_title', TRUE);
$data['bca_idx'] = (int) $this->input->post('bca_idx', TRUE);
$data['post_category'] = $this->input->post('post_category', TRUE, '');
$data['post_parent'] = $this->input->post('post_parent', TRUE, 0); $data['post_parent'] = $this->input->post('post_parent', TRUE, 0);
$data['post_secret'] = $this->input->post('post_secret', TRUE, 'N') == 'Y' ? "Y":'N'; $data['post_secret'] = $this->input->post('post_secret', TRUE, 'N') == 'Y' ? "Y":'N';
$data['post_content'] = $this->input->post('post_content', FALSE); $data['post_content'] = $this->input->post('post_content', FALSE);
$data['brd_key'] = $brd_key; $data['brd_key'] = $brd_key;
$data['post_modtime'] = date('Y-m-d H:i:s');
$data['post_html'] = $this->data['use_wysiwyg'] ? 'Y' : 'N';
$data['upd_datetime'] = date('Y-m-d H:i:s');
$data['upd_user'] = $this->member->is_login();
$data['post_notice'] = $this->input->post('post_notice', TRUE) == 'Y' ? 'Y' : 'N'; $data['post_notice'] = $this->input->post('post_notice', TRUE) == 'Y' ? 'Y' : 'N';
$data['post_ip'] = ip2long( $this->input->ip_address() ); $data['post_ip'] = ip2long( $this->input->ip_address() );
$data['post_mobile'] = $this->site->viewmode == DEVICE_MOBILE ? 'Y' : 'N'; $data['post_mobile'] = $this->site->viewmode == DEVICE_MOBILE ? 'Y' : 'N';
@ -562,8 +441,8 @@ class Board extends WB_Controller
// 수정일경우를 대비해서 글 고유 pk 넘김 // 수정일경우를 대비해서 글 고유 pk 넘김
$this->data['post_idx'] = (int)$post_idx; $this->data['post_idx'] = (int)$post_idx;
$this->data['post_parent'] = $this->input->get('post_parent', TRUE); $this->data['post_parent'] = $this->input->get('post_parent', TRUE);
$this->data['view'] = empty($post_idx) ? array() : $this->board_model->get_post($brd_key, $post_idx, FALSE);
$this->data['parent'] = empty($this->data['post_parent']) ? array() : $this->board_model->get_post($brd_key, $this->data['post_parent'], FALSE);
$this->data['view'] = empty($post_idx) ? array() : $this->boardlib->get_post($brd_key, $post_idx, FALSE);
$this->data['parent'] = empty($this->data['post_parent']) ? array() : $this->boardlib->get_post($brd_key, $this->data['post_parent'], FALSE);
if( $this->data['post_idx'] && (! $this->data['view'] OR ! isset($this->data['view']['post_idx']) OR !$this->data['view']['post_idx'] ) ) if( $this->data['post_idx'] && (! $this->data['view'] OR ! isset($this->data['view']['post_idx']) OR !$this->data['view']['post_idx'] ) )
{ {

2
wheeparam/application/core/WB_Controller.php

@ -11,7 +11,7 @@ defined('BASEPATH') OR exit();
class WB_Controller extends CI_Controller class WB_Controller extends CI_Controller
{ {
protected $view = FALSE; protected $view = FALSE;
protected $data = array();
public $data = array();
protected $asides = array(); protected $asides = array();
public $theme = FALSE; public $theme = FALSE;
public $theme_file = "theme"; public $theme_file = "theme";

44
wheeparam/application/helpers/widgets_helper.php

@ -21,37 +21,31 @@ function latest($skin_name="", $brd_key="", $rows=5, $get_thumb_img=FALSE, $file
$cache_name = "board-{$brd_key}-{$rows}-".($get_thumb_img ? 'thumb' : 'nothumb'); $cache_name = "board-{$brd_key}-{$rows}-".($get_thumb_img ? 'thumb' : 'nothumb');
$CI->load->model('board_model');
$data['board'] = $CI->board_model->get_board($brd_key, FALSE);
$CI->load->library('boardlib');
$data['board'] = $CI->boardlib->get($brd_key, FALSE);
if(empty($data['board']) OR !isset($data['board']['brd_key'])) return '<p class="alert alert-danger">'.langs('게시판/msg/not_exist').'</p>'; if(empty($data['board']) OR !isset($data['board']['brd_key'])) return '<p class="alert alert-danger">'.langs('게시판/msg/not_exist').'</p>';
if( ! $data['list'] = $CI->cache->get($cache_name) ) {
// 일반 글 목록 가져오기
$param['select'] = "P.*, PC.bca_name, B.brd_title";
$param['where']['P.brd_key'] = $brd_key;
$param['where_in']['post_status'] = array('Y','B');
$param['order_by'] = "post_num DESC, post_reply ASC, post_idx ASC";
$param['from'] = "board_post AS P";
$param['join'][] = array("board_category AS PC","PC.bca_idx=P.bca_idx","left");
$param['join'][] = array("board AS B","B.brd_key=P.brd_key","inner");
$param['limit'] = TRUE;
$param['where']['post_notice'] = "N";
$param['page_rows'] = $rows;
$param['page'] = 1;
if ( $data['board']['brd_use_assign'] == 'Y' && ! PAGE_ADMIN )
{
$param['where']['post_assign'] = 'Y';
}
$post_list = $CI->board_model->get_list($param);
foreach($post_list['list'] as &$row)
if( ! $data['list'] = $CI->cache->get($cache_name) )
{
$CI->db
->select("P.*, B.brd_title")
->from('board_post AS P')
->join("board AS B","B.brd_key=P.brd_key","inner")
->where('P.brd_key', $brd_key)
->where('post_status','Y')
->where('post_notice', 'N')
->order_by("post_num DESC, post_reply ASC, post_idx ASC")
->limit(5);
$post_list = $CI->db->get()->Result_array();
foreach($post_list as &$row)
{ {
$row = $CI->board_model->post_process($data['board'], $row, "", $file_list, $get_thumb_img);
$row = $CI->boardlib->post_process($data['board'], $row, "", $file_list);
} }
$data['list'] = $post_list['list'];
$data['list'] = $post_list;
if(! IS_TEST) { if(! IS_TEST) {
$CI->cache->save($cache_name, $data['list'], 60*5); $CI->cache->save($cache_name, $data['list'], 60*5);

419
wheeparam/application/libraries/Boardlib.php

@ -43,4 +43,423 @@ class Boardlib {
return $board_list; return $board_list;
} }
/******************************************************************************************************
* 게시판의 정보를 가져옵니다.
*****************************************************************************************************/
function get($brd_key, $get_raw_data = FALSE) {
return $get_raw_data ? $this->_get_board_raw($brd_key) : $this->_get_board_mixed($brd_key);
}
/******************************************************************************************************
* 가공되지 않은 게시판 정보를 가져옵니다.
*****************************************************************************************************/
private function _get_board_raw($brd_key = "")
{
if(empty($brd_key)) return array();
// 캐시된 데이타가 없으면 DB에서 새로 가져옴
if( ! $board = $this->CI->cache->get('board_raw_'.$brd_key) )
{
$result =
$this->CI->db
->from('board')
->where('brd_key', $brd_key)
->limit(1)
->get();
$board = $result->row_array();
// 개발환경에선 테스트를 위해 CACHE 저장을 하지 않는다.
if( ENVIRONMENT !== 'development') {
$this->CI->cache->save('board_raw_'.$brd_key, $board, 60*5);
}
}
return $board;
}
/******************************************************************************************************
* 가공된 게시판 정보를 가져옵니다.
*****************************************************************************************************/
private function _get_board_mixed($brd_key ="")
{
if( empty($brd_key) ) return array();
// 캐시된 데이타가 없으면 DB에서 새로 가져옴
if( ! $board = $this->CI->cache->get('board_'.$brd_key) ) {
$board = $this->_get_board_raw($brd_key);
$board['category'] = explode(";", rtrim($board['brd_category'],';'));
if(count($board['category']) > 0) {
foreach($board['category'] as &$row)
{
$row = trim($row);
}
}
// 개발환경에선 테스트를 위해 CACHE 저장을 하지 않는다.
if( ENVIRONMENT !== 'development') {
$this->cache->save('board_'.$brd_key, $board, 60*5);
}
}
return $board;
}
/******************************************************************************************************
* 특정 게시판의 캐시 데이타를 삭제한다.
*****************************************************************************************************/
function delete_cache($brd_key)
{
$this->CI->cache->delete('board_raw_'.$brd_key);
$this->CI->cache->delete('board_'.$brd_key);
}
/******************************************************************************************************
* 특정 게시판의 캐시 데이타를 삭제한다.
*****************************************************************************************************/
function common_data($brd_key)
{
$this->CI->data['board'] = $this->get($brd_key, FALSE);
if( empty($this->CI->data['board']) OR ! isset($this->CI->data['board']))
{
alert('존재하지 않는 게시판 또는 삭제된 게시판입니다.');
exit;
}
$this->CI->data['use_secret'] = ($this->CI->data['board']['brd_use_secret'] == 'Y' OR $this->CI->data['board']['brd_use_secret'] == 'A');
$this->CI->data['use_notice'] = PAGE_ADMIN OR $this->CI->member->is_super();
$this->CI->data['use_category'] = (($this->CI->data['board']['brd_use_category'] == 'Y') && (count($this->CI->data['board']['category']) > 0));
$this->CI->data['board']['brd_skin_l'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_skin_l_m'] : $this->CI->data['board']['brd_skin_l'];
$this->CI->data['board']['brd_skin_w'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_skin_w_m'] : $this->CI->data['board']['brd_skin_w'];
$this->CI->data['board']['brd_skin_c'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_skin_c_m'] : $this->CI->data['board']['brd_skin_c'];
$this->CI->data['board']['brd_skin_v'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_skin_v_m'] : $this->CI->data['board']['brd_skin_v'];
$this->CI->data['board']['brd_page_rows'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_page_rows_m'] : $this->CI->data['board']['brd_page_rows'];
$this->CI->data['board']['brd_fixed_num'] = ($this->CI->site->viewmode == DEVICE_MOBILE) ? $this->CI->data['board']['brd_fixed_num_m'] : $this->CI->data['board']['brd_fixed_num'];
unset($this->CI->data['board']['brd_skin_m'], $this->CI->data['board']['brd_page_rows_m'], $this->CI->data['board']['brd_fixed_num_m']);
// 카테고리 목록
$this->CI->data['category_list'] = ( $this->CI->data['use_category'] && count($this->CI->data['board']['category']) > 0 ) ? $this->CI->data['board']['category'] : NULL;
// GET 데이타 정리
$this->CI->param['page'] = $this->CI->data['page'] = (int)$this->CI->input->get('page', TRUE, 1) >= 1 ? $this->CI->input->get('page', TRUE, 1) : 1;
$this->CI->param['scol'] = $this->CI->data['scol'] = $this->CI->input->get('scol', TRUE, '');
$this->CI->param['stxt'] = $this->CI->data['stxt'] = $this->CI->input->get('stxt', TRUE, '');
$this->CI->param['category'] = $this->CI->data['category'] = $this->CI->input->get('category', TRUE, '');
// 링크 주소 정리
$queryParam = array();
foreach($this->CI->param as $key=>$val) if(! empty($val)) $queryParam[$key] = $val;
$param = ( $queryParam && is_array($queryParam) ) ? '?'.http_build_query($queryParam): '';
$this->CI->data['board']['link']['base_url'] = PAGE_ADMIN ? base_url("admin/board/posts/{$brd_key}") : base_url("board/{$brd_key}");
$this->CI->data['board']['link']['list'] = PAGE_ADMIN ? base_url("admin/board/posts/{$brd_key}{$param}") : base_url("board/{$brd_key}$param");
$this->CI->data['board']['link']['write'] = PAGE_ADMIN ? base_url("admin/board/write/{$brd_key}/{$param}") : base_url( "board/{$brd_key}/write{$param}");
$this->CI->data['board']['link']['rss'] = base_url("rss/{$brd_key}");
if(! empty($post_idx))
{
$this->CI->data['board']['link']['modify'] = PAGE_ADMIN ? base_url( "admin/board/write/{$brd_key}/{$post_idx}{$param}" ) : base_url( "board/{$brd_key}/write/{$post_idx}{$param}");
$this->CI->data['board']['link']['delete'] = base_url( "board/{$brd_key}/delete/{$post_idx}".$param );
$this->CI->data['board']['link']['reply'] = base_url( "board/{$brd_key}/reply/{$post_idx}". $param );
}
$this->CI->data['board']['auth']['admin'] = $this->CI->member->is_super();
$this->CI->data['board']['auth']['read'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_read']) );
$this->CI->data['board']['auth']['list'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_list']) );
$this->CI->data['board']['auth']['write'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_write']) );
$this->CI->data['board']['auth']['download'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_download']) );
$this->CI->data['board']['auth']['comment'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_comment']) );
$this->CI->data['board']['auth']['reply'] = ( $this->CI->data['board']['auth']['admin'] OR ($this->member->level() >= $this->CI->data['board']['brd_lv_reply']) );
}
/**
* 게시글 목록을 가져온다.
* @param $board
* @param array $param
* @return mixed
*/
function post_list($board, $param)
{
$this->CI->db
->select('SQL_CALC_FOUND_ROWS P.*, IF(ISNULL(M.mem_nickname), P.post_nickname, M.mem_nickname) AS post_nickname', FALSE)
->from('board_post AS P')
->join("member AS M", "M.mem_idx=P.upd_user","left")
->where('brd_key', $board['brd_key'])
->where_in('post_status', array('Y'))
->where('post_notice', 'Y')
->order_by("post_num DESC, post_reply ASC, post_idx ASC");
$result= $this->CI->db->get();
$notice_list['list'] = $result->result_array();
$this->CI->db
->select('SQL_CALC_FOUND_ROWS P.*, IF(ISNULL(M.mem_nickname), P.post_nickname, M.mem_nickname) AS post_nickname', FALSE)
->from('board_post AS P')
->join("member AS M", "M.mem_idx=P.upd_user","left")
->where('brd_key', $board['brd_key'])
->where_in('post_status', array('Y','B'))
->where('post_notice', 'N')
->order_by("post_num DESC, post_reply ASC, post_idx ASC");
$start = 0;
if( $board['brd_page_limit'] == 'Y' ) {
$page_rows = $board['brd_page_rows'];
$page = element('page', $param, 1);
$start = ($page - 1) * $page_rows;
$this->CI->db->limit($page_rows, $start);
}
if( element('category', $param) ) {
$this->CI->db->where('post_category', $param['category']);
}
if( element('scol', $param) && element('stxt', $param) )
{
if( $param['scol'] == 'title' ) {
$this->CI->db->like('post_title', $param['stxt']);
}
else if ( $param['scol'] == 'nickname' )
{
$this->CI->db->like('post_nickname', $param['stxt']);
}
}
$list['list'] = $this->CI->db->get()->result_array();
$list['total_count'] = (int)$this->CI->db->query("SELECT FOUND_ROWS() AS cnt")->row(0)->cnt;
foreach($list['list'] as $i=>&$row)
{
$row['nums'] = $list['total_count'] - $i - $start;
}
$list['list'] = array_merge($notice_list['list'], $list['list']);
$query_param = $this->get_param();
foreach($list['list'] as &$row)
{
$row = $this->post_process($board, $row, $query_param);
}
return $list;
}
/**
* 게시글 하나를 가져온다.
* @param $brd_key
* @param $post_idx
* @param bool $get_raw_data
* @return mixed
*/
function get_post($brd_key, $post_idx, $get_raw_data=FALSE)
{
$this->CI->db
->select('P.*, IF(ISNULL(M.mem_nickname), P.post_nickname, M.mem_nickname) AS post_nickname')
->from('board_post AS P')
->join("member AS M", "M.mem_idx=P.upd_user","left")
->where('post_idx', $post_idx)
->where_in('post_status', array('Y','N'))
->where('brd_key', $brd_key);
$result =$this->CI->db->get();
if(! $post = $result->row_array() )
{
return NULL;
}
if( ! $get_raw_data ) {
$board = $this->get($brd_key, FALSE);
$post = $this->post_process($board, $post, $this->CI->param, TRUE);
$np = $this->get_np($brd_key, $post_idx, $post['post_num'], $post['post_reply']);
$post['prev'] = ( isset($np['prev']) && isset($np['prev']['post_idx']) )? $np['prev'] : NULL;
$post['next'] = ( isset($np['next']) && isset($np['next']['post_idx']) )? $np['next'] : NULL;
}
return $post;
}
/**
* 패러미터 정보를 정리해서 가져옴
* @return string
*/
function get_param()
{
// 링크를 위한 자료정리
$queryParam = array();
if( $this->CI->input->get('category', TRUE) ) $queryParam['category'] = $this->CI->input->get('category', TRUE);
if( $this->CI->input->get('page', TRUE) ) $queryParam['page'] = $this->CI->input->get('page', TRUE);
if( $this->CI->input->get('scol', TRUE) ) $queryParam['scol'] = $this->CI->input->get('scol', TRUE);
if( $this->CI->input->get('stxt', TRUE) ) $queryParam['stxt'] = $this->CI->input->get('stxt', TRUE);
$param = "";
if( $queryParam && is_array($queryParam) )
{
$param = http_build_query($queryParam);
$param = "?". $param;
}
return $param;
}
/**
* 게시글의 내용을 정리한다.
* @param $board
* @param $post
* @param $param
* @param bool $extra
* @param bool $files
* @return mixed
*/
function post_process($board, $post, $param, $files=FALSE)
{
if(is_array($param))
{
$param = '?' . http_build_query($param);
}
$post['post_notice'] = ($post['post_notice']=='Y');
$post['link'] = PAGE_ADMIN ? base_url("admin/board/read/{$board['brd_key']}/{$post['post_idx']}{$param}") : base_url("board/{$board['brd_key']}/{$post['post_idx']}{$param}");
$post['link_modify'] = PAGE_ADMIN ? base_url("admin/board/write/{$board['brd_key']}/{$post['post_idx']}") : base_url("board/{$board['brd_key']}/write/{$post['post_idx']}");
$post['link_delete'] = base_url("board/{$board['brd_key']}/delete/{$post['post_idx']}");
$post['is_new'] = ((time() - strtotime($post['reg_datetime']) ) <= (24 * 60 * 60));
$post['is_hot'] = ($post['post_hit'] >= 300) ;
$post['is_secret'] = ($post['post_secret'] == 'Y');
$post['post_datetime'] = display_datetime($post['reg_datetime'], $board['brd_display_time']);
if( $files) {
$post['file'] = $this->get_attach_list($board['brd_key'], $post['post_idx']);
}
return $post;
}
/**
* 해당 게시글의 이전글과 다음글을 가져온다.
* @param $brd_key
* @param $post_idx
* @param $post_num
* @param $post_depth
* @return mixed
*/
function get_np($brd_key, $post_idx,$post_num,$post_reply)
{
$param = $this->get_param();
$this->CI->db->group_start();
$this->CI->db->or_group_start();
$this->CI->db->where("post_num =", (int)$post_num);
$this->CI->db->where('post_reply >', $post_reply);
$this->CI->db->where('post_idx >', $post_idx);
$this->CI->db->group_end();
$this->CI->db->or_group_start();
$this->CI->db->where('post_num <', $post_num);
$this->CI->db->group_end();
$this->CI->db->group_end();
// 이전글 가져오기
$return['prev'] = $this->CI->db->where_in("post_status", array("Y","B"))
->where('post_notice', "N")
->where("brd_key", $brd_key)
->where('post_idx !=', $post_idx)
->limit(1)
->order_by("post_num DESC, post_reply ASC, post_idx ASC")
->get("board_post")
->row_array();
if(isset($return['prev']['post_idx']))
{
$return['prev']['link'] = PAGE_ADMIN ? base_url("admin/board/read/{$brd_key}/{$return['prev']['post_idx']}{$param}") : base_url("board/{$brd_key}/{$return['prev']['post_idx']}{$param}");
}
$this->CI->db->group_start();
$this->CI->db->or_group_start();
$this->CI->db->where("post_num =", (int)$post_num);
$this->CI->db->where('post_reply <', $post_reply);
$this->CI->db->where('post_idx <', $post_idx);
$this->CI->db->group_end();
$this->CI->db->or_group_start();
$this->CI->db->where('post_num >', $post_num);
$this->CI->db->group_end();
$this->CI->db->group_end();
// 다음글 가져오기
$return['next'] =
$this->CI->db->where_in("post_status", array("Y","B"))
->where('post_notice', "N")
->where("brd_key", $brd_key)
->where('post_idx !=', $post_idx)
->limit(1)
->order_by("post_num ASC, post_reply DESC, post_idx DESC")
->get("board_post")->row_array();
if(isset($return['next']['post_idx']))
{
$return['next']['link'] = PAGE_ADMIN ? base_url("admin/board/read/{$brd_key}/{$return['next']['post_idx']}{$param}") : base_url("board/{$brd_key}/{$return['next']['post_idx']}{$param}");
}
return $return;
}
/**
* 게시글에 포함된 첨부파일 목록을 가져온다.
* @param $brd_key
* @param $post_idx
* @return array
*/
function get_attach_list($brd_key, $post_idx)
{
if(empty($brd_key) OR empty($post_idx)) return array();
$file_list = $this->CI->db->where('att_target_type', 'BOARD')->where('att_target', $post_idx)->get('attach')->result_array();
foreach($file_list as &$f)
{
$f['link'] = base_url("board/{$brd_key}/download/{$post_idx}/{$f['att_idx']}");
}
return $file_list;
}
/**
* 댓글 목록 가져오기
* @param $brd_key
* @param $post_idx
*/
function comment_list($brd_key, $post_idx, $board_admin=FALSE, $mem_userid="")
{
$board = $this->get($brd_key, TRUE);
$this->CI->db
->select('SQL_CALC_FOUND_ROWS C.*, IF(ISNULL(C.cmt_nickname), M.mem_nickname, C.cmt_nickname) AS cmt_nickname', FALSE)
->from('board_comment AS C')
->join('member AS M','M.mem_idx=C.reg_user','left')
->where('brd_key', $brd_key)
->where('post_idx', $post_idx)
->where_in('cmt_status', array('Y','B'))
->order_by("cmt_num DESC,cmt_reply ASC, cmt_idx ASC");
$list['list'] = $this->CI->db->get()->result_array();
$list['total_count'] = (int)$this->CI->db->query('SELECT FOUND_ROWS() AS cnt')->row(0)->cnt;
foreach($list['list'] as &$row)
{
$row['cmt_datetime'] = display_datetime( $row['reg_datetime'], $board['brd_display_time']);
$row['link']['delete'] = base_url("board/{$brd_key}/comment/{$post_idx}/{$row['cmt_idx']}/delete");
$row['link']['blind'] = base_url("board/{$brd_key}/comment/{$post_idx}/{$row['cmt_idx']}/blind");
$row['auth'] = $board_admin || ( $row['reg_user'] >0 && $mem_userid == $row['reg_user'] ) || $row['reg_user']==0;
$row['ip'] = display_ipaddress(long2ip($row['cmt_ip']), '1001');
}
return $list;
}
} }

396
wheeparam/application/models/Board_model.php

@ -14,70 +14,6 @@ class Board_model extends WB_Model
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file', 'key_prefix' => PROJECT)); $this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file', 'key_prefix' => PROJECT));
} }
/**
* 게시글 목록을 가져온다.
* @param $board
* @param array $param
* @return mixed
*/
function post_list($board, $param=array())
{
// 공지사항 목록 가져오기
$param['select'] = "P.*, PC.bca_name, M.mem_photo";
$param['where']['P.brd_key'] = $board['brd_key'];
$param['where_in']['post_status'] = array('Y','B');
$param['order_by'] = "post_num DESC, post_reply ASC, post_idx ASC";
$param['from'] = "board_post AS P";
$param['where']['post_notice'] = "Y";
$param['join'][] = array("board_category AS PC","PC.bca_idx=P.bca_idx","left");
$param['join'][] = array("member AS M", "M.mem_idx=P.upd_user","left");
$param['limit'] = FALSE;
$notice_list = array();
$notice_list = $this->get_list($param);
// 일반 글 목록 가져오기
$param['where']['post_notice'] = "N";
$param['page_rows'] = $board['brd_page_rows'];
$param['page'] = element('page', $param, 1);
$param['limit'] = ($board['brd_page_limit'] == 'Y');
if( element('category', $param) ) {
$category_filter = array( $param['category'] );
// 해당 카테고리의 하위 아이템도 같이 불러오기 위함
$sub_cate_list = $this->db->where('bca_parent', $param['category'])->where('brd_key', $board['brd_key'])->get('board_category')->result_array();
foreach($sub_cate_list as $c) $category_filter[] = $c['bca_idx'];
$param['where_in']['P.bca_idx'] = $category_filter;
}
if( element('scol', $param) && element('stxt', $param) )
{
if( $param['scol'] == 'title' ) {
$param['sc'] = "post_title";
$param['st'] = $param['stxt'];
}
else if ( $param['scol'] == 'nickname' )
{
$param['where']['M.mem_nickname'] = $param['stxt'];
}
}
// 게시판에 관리자 승인기능이 있는경우 승인된 게시물만 가져온다.
if ( $board['brd_use_assign'] == 'Y' && ! PAGE_ADMIN )
{
$param['where']['post_assign'] = 'Y';
}
$list = $this->get_list($param);
$list['list'] = array_merge($notice_list['list'], $list['list']);
$param = $this->get_param();
foreach($list['list'] as &$row)
{
$row = $this->post_process($board, $row, $param, $board['brd_use_list_file'] == 'Y', $board['brd_use_list_thumbnail'] == 'Y');
}
return $list;
}
/** /**
* 내용중 외부서버의 이미지를 내부서버로 복제한다. * 내용중 외부서버의 이미지를 내부서버로 복제한다.
@ -140,59 +76,10 @@ class Board_model extends WB_Model
return $content; return $content;
} }
/**
* 댓글 목록 가져오기
* @param $brd_key
* @param $post_idx
*/
function comment_list($brd_key, $post_idx, $board_admin=FALSE, $mem_userid="")
{
$board = $this->get_board($brd_key, TRUE);
$comment_table = $this->db->dbprefix('board_comment');
$param['select']= "{$comment_table}.*,member.mem_photo";
$param['from'] = "board_comment";
$param['join'][] = array("member", "member.mem_userid=board_comment.mem_userid","left");
$param['where']['brd_key'] = $brd_key;
$param['where']['post_idx'] = $post_idx;
$param['where_in']['cmt_status'] = array('Y','B');
$param['order_by'] = "cmt_num DESC,cmt_reply ASC, cmt_idx ASC";
$list = $this->get_list($param);
foreach($list['list'] as &$row)
{
$row['cmt_datetime'] = display_datetime( $row['cmt_regtime'], $board['brd_display_time']);
$row['link']['delete'] = base_url("board/{$brd_key}/comment/{$post_idx}/{$row['cmt_idx']}/delete");
$row['link']['blind'] = base_url("board/{$brd_key}/comment/{$post_idx}/{$row['cmt_idx']}/blind");
$row['auth'] = $board_admin || ( $row['mem_userid'] >0 && $mem_userid == $row['mem_userid'] ) || $row['mem_userid']==0;
$row['ip'] = display_ipaddress(long2ip($row['cmt_ip']), '1001');
}
return $list;
}
/** /**
* 패러미터 정보를 가져온다. * 패러미터 정보를 가져온다.
* @return string * @return string
*/ */
function get_param()
{
// 링크를 위한 자료정리
$queryParam = array();
if( $this->input->get('category', TRUE) ) $queryParam['category'] = $this->input->get('category', TRUE);
if( $this->input->get('page', TRUE) ) $queryParam['page'] = $this->input->get('page', TRUE);
if( $this->input->get('scol', TRUE) ) $queryParam['scol'] = $this->input->get('scol', TRUE);
if( $this->input->get('stxt', TRUE) ) $queryParam['stxt'] = $this->input->get('stxt', TRUE);
$param = "";
if( $queryParam && is_array($queryParam) )
{
$param = http_build_query($queryParam);
$param = "?". $param;
}
return $param;
}
/** /**
* 게시글에 포함된 첨부파일 목록을 가져온다. * 게시글에 포함된 첨부파일 목록을 가져온다.
@ -211,75 +98,7 @@ class Board_model extends WB_Model
return $file_list; return $file_list;
} }
/**
* 게시글 하나를 가져온다.
* @param $brd_key
* @param $post_idx
* @param bool $get_raw_data
* @return mixed
*/
function get_post($brd_key, $post_idx, $get_raw_data=FALSE)
{
$this->db->select('board_post.*, member.mem_photo');
$this->db->from('board_post');
$this->db->join("member", "member.mem_userid=board_post.mem_userid","left");
$this->db->where('post_idx', $post_idx);
$this->db->where_in('post_status', array('Y','N'));
$this->db->where('brd_key', $brd_key);
$result =$this->db->get();
$post = $result->row_array();
if( ! $get_raw_data ) {
$board = $this->get_board($brd_key,FALSE);
$post = $this->post_process($board, $post, '',TRUE, TRUE);
$np = $this->get_np($brd_key, $post_idx, $post['post_num'], $post['post_reply']);
$post['prev'] = ( isset($np['prev']) && isset($np['prev']['post_idx']) )? $np['prev'] : NULL;
$post['next'] = ( isset($np['next']) && isset($np['next']['post_idx']) )? $np['next'] : NULL;
}
return $post;
}
/**
* 게시글의 내용을 정리한다.
* @param $board
* @param $post
* @param $param
* @param bool $extra
* @param bool $files
* @return mixed
*/
function post_process($board, $post, $param, $files=FALSE, $thumbnail=FALSE)
{
$post['post_notice'] = ($post['post_notice']=='Y');
$post['link'] = base_url("board/{$board['brd_key']}/{$post['post_idx']}".$param);
$post['link_modify'] = base_url("board/{$board['brd_key']}/write/{$post['post_idx']}");
$post['link_delete'] = base_url("board/{$board['brd_key']}/delete/{$post['post_idx']}");
$post['is_new'] = ((time() - strtotime($post['post_regtime']) ) <= ($board['brd_time_new'] * 60 * 60));
$post['is_hot'] = ($post['post_hit'] >= $board['brd_hit_count']) ;
$post['is_secret'] = ($post['post_secret'] == 'Y');
$post['post_datetime'] = display_datetime($post['post_regtime'], $board['brd_display_time']);
if( $files)
{
$post['file'] = $this->get_attach_list($board['brd_key'], $post['post_idx']);
}
$post['post_thumbnail'] = "";
if( $thumbnail )
{
if(! isset($post['file']))
{
$post['file'] = $this->get_attach_list($board['brd_key'], $post['post_idx']);
}
$post['post_thumbnail'] = get_post_thumbnail($post, $board['brd_thumb_width'], $board['brd_thumb_height']);
}
return $post;
}
/********************************************************** /**********************************************************
* 첨부파일 삭제 * 첨부파일 삭제
@ -318,221 +137,6 @@ class Board_model extends WB_Model
return ( $result > 0 ); return ( $result > 0 );
} }
/**
* 해당 게시글의 이전글과 다음글을 가져온다.
* @param $brd_key
* @param $post_idx
* @param $post_num
* @param $post_depth
* @return mixed
*/
function get_np($brd_key, $post_idx,$post_num,$post_reply)
{
$param = $this->get_param();
$this->db->group_start();
$this->db->or_group_start();
$this->db->where("post_num =", (int)$post_num);
$this->db->where('post_reply >', $post_reply);
$this->db->where('post_idx >', $post_idx);
$this->db->group_end();
$this->db->or_group_start();
$this->db->where('post_num <', $post_num);
$this->db->group_end();
$this->db->group_end();
// 이전글 가져오기
$return['prev'] = $this->db->where_in("post_status", array("Y","B"))
->where('post_notice', "N")
->where("brd_key", $brd_key)
->where('post_idx !=', $post_idx)
->limit(1)
->order_by("post_num DESC, post_reply ASC, post_idx ASC")
->get("board_post")
->row_array();
if(isset($return['prev']['post_idx']))
{
$return['prev']['link'] = base_url("board/{$brd_key}/{$return['prev']['post_idx']}".$param);
}
$this->db->group_start();
$this->db->or_group_start();
$this->db->where("post_num =", (int)$post_num);
$this->db->where('post_reply <', $post_reply);
$this->db->where('post_idx <', $post_idx);
$this->db->group_end();
$this->db->or_group_start();
$this->db->where('post_num >', $post_num);
$this->db->group_end();
$this->db->group_end();
// 다음글 가져오기
$return['next'] =
$this->db->where_in("post_status", array("Y","B"))
->where('post_notice', "N")
->where("brd_key", $brd_key)
->where('post_idx !=', $post_idx)
->limit(1)
->order_by("post_num ASC, post_reply DESC, post_idx DESC")
->get("board_post")->row_array();
if(isset($return['next']['post_idx']))
{
$return['next']['link'] = base_url("board/{$brd_key}/{$return['next']['post_idx']}".$param);
}
return $return;
}
/**
* 게시판과 관련된 링크를 가져온다.
* @param $brd_key
* @param string $post_idx
* @return mixed
*/
function get_link($brd_key, $post_idx="")
{
$queryParam = array();
if( $this->input->get('category', TRUE) ) $queryParam['category'] = $this->input->get('category', TRUE);
if( $this->input->get('page', TRUE) ) $queryParam['page'] = $this->input->get('page', TRUE);
if( $this->input->get('scol', TRUE) ) $queryParam['scol'] = $this->input->get('scol', TRUE);
if( $this->input->get('stxt', TRUE) ) $queryParam['stxt'] = $this->input->get('stxt', TRUE);
$param = "";
if( $queryParam && is_array($queryParam) )
{
$param = http_build_query($queryParam);
$param = "?". $param;
}
$return['base_url'] = base_url("board/{$brd_key}");
$return['list'] = base_url("board/{$brd_key}". $param);
$return['write'] = base_url( "board/{$brd_key}/write". $param );
$return['rss'] = base_url("rss/{$brd_key}");
if(! empty($post_idx))
{
$return['modify'] = base_url( "board/{$brd_key}/write/{$post_idx}".$param );
$return['delete'] = base_url( "board/{$brd_key}/delete/{$post_idx}".$param );
$return['reply'] = base_url( "board/{$brd_key}/reply/{$post_idx}". $param );
}
return $return;
}
/**
* 게시판 하나의 정보를 가져온다.
* @param $brd_key
*/
function get_board($brd_key, $raw_data = FALSE)
{
return $raw_data ? $this->_get_board_raw($brd_key) : $this->_get_board_mixed($brd_key);
}
/**
* 가공되지 않은 게시판 정보를 가져온다.
* @param $brd_key
*/
private function _get_board_raw($brd_key)
{
if(empty($brd_key)) return array();
if( ! $board = $this->cache->get('board_raw_'.$brd_key) ) {
$param['from'] = "board";
$param['idx'] = $brd_key;
$param['column'] = "brd_key";
$board = $this->get_one($param);
if(! IS_TEST) {
$this->cache->save('board_raw_'.$brd_key, $board, 60*5);
}
}
return $board;
}
/**
* 가공한 게시판의 정보를 가져온다.
* @param $brd_key
*/
private function _get_board_mixed($brd_key)
{
if( empty($brd_key) ) return array();
if( ! $board = $this->cache->get('board_'.$brd_key) ) {
$board = $this->_get_board_raw($brd_key);
$board['category'] = $this->get_all_category($brd_key);
if(! IS_TEST)
{
$this->cache->save('board_'.$brd_key, $board, 60*5);
}
}
return $board;
}
/**
* 특정 게시판의 캐시를 삭제한다.
* @param $brd_key
*/
function delete_cache($brd_key)
{
$this->cache->delete('board_raw_'.$brd_key);
$this->cache->delete('board_'.$brd_key);
}
/**
* 해당게시판의 전체 카테고리 구조 출력
*/
function get_all_category($brd_key)
{
if(empty($brd_key)) return NULL;
$this->db->where('brd_key', $brd_key);
$this->db->order_by('bca_parent ASC, bca_sort ASC', TRUE);
$this->db->from('board_category');
$result = $this->db->get();
$list = $result->result_array();
$return = array();
foreach($list as &$row)
{
if( $row['bca_parent'] == 0 )
{
$row['link'] = base_url("board/{$brd_key}?category=".$row['bca_idx']);
$return[$row['bca_idx']] = $row;
$return[$row['bca_idx']]['items'] = array();
}
else if ( $row['bca_parent'] >= 1 )
{
$row['link'] = base_url("board/{$brd_key}?category=".$row['bca_idx']);
$return[$row['bca_parent']]['items'][] = $row;
}
}
return $return;
}
/**
* 카테고리 한개의 정보를 가져온다.
* @param $bca_idx
* @return bool
*/
function get_category($bca_idx)
{
$param['from'] = "board_category";
$param['idx'] = $bca_idx;
$param['column'] = "bca_idx";
return $this->get_one($param);
}
/** /**
* 해당 게시글의 코멘트가 몇개인지 확인한다. * 해당 게시글의 코멘트가 몇개인지 확인한다.

28
wheeparam/config/wheeparam.sql

@ -75,7 +75,6 @@ DROP TABLE IF EXISTS `wb_board`;
CREATE TABLE `wb_board` ( CREATE TABLE `wb_board` (
`brd_key` varchar(20) NOT NULL DEFAULT '', `brd_key` varchar(20) NOT NULL DEFAULT '',
`brd_title` varchar(30) NOT NULL DEFAULT '', `brd_title` varchar(30) NOT NULL DEFAULT '',
`brd_title_m` varchar(20) NOT NULL DEFAULT '',
`brd_skin_l` varchar(100) NOT NULL DEFAULT '', `brd_skin_l` varchar(100) NOT NULL DEFAULT '',
`brd_skin_l_m` varchar(100) NOT NULL DEFAULT '', `brd_skin_l_m` varchar(100) NOT NULL DEFAULT '',
`brd_skin_v` varchar(100) NOT NULL DEFAULT '', `brd_skin_v` varchar(100) NOT NULL DEFAULT '',
@ -84,8 +83,6 @@ CREATE TABLE `wb_board` (
`brd_skin_w_m` varchar(100) NOT NULL DEFAULT '', `brd_skin_w_m` varchar(100) NOT NULL DEFAULT '',
`brd_skin_c` varchar(100) NOT NULL DEFAULT '', `brd_skin_c` varchar(100) NOT NULL DEFAULT '',
`brd_skin_c_m` varchar(100) NOT NULL DEFAULT '', `brd_skin_c_m` varchar(100) NOT NULL DEFAULT '',
`brd_sort` int(10) unsigned NOT NULL DEFAULT 0,
`brd_search` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_lv_list` tinyint(3) unsigned NOT NULL DEFAULT 0, `brd_lv_list` tinyint(3) unsigned NOT NULL DEFAULT 0,
`brd_lv_read` tinyint(3) unsigned NOT NULL DEFAULT 0, `brd_lv_read` tinyint(3) unsigned NOT NULL DEFAULT 0,
`brd_lv_write` tinyint(3) unsigned NOT NULL DEFAULT 0, `brd_lv_write` tinyint(3) unsigned NOT NULL DEFAULT 0,
@ -98,13 +95,6 @@ CREATE TABLE `wb_board` (
`brd_use_secret` enum('Y','N','A') NOT NULL DEFAULT 'Y', `brd_use_secret` enum('Y','N','A') NOT NULL DEFAULT 'Y',
`brd_use_reply` enum('Y','N') NOT NULL DEFAULT 'Y', `brd_use_reply` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_use_comment` enum('Y','N') NOT NULL DEFAULT 'Y', `brd_use_comment` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_use_attach` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_use_assign` enum('Y','N') NOT NULL DEFAULT 'N',
`brd_thumb_width` smallint(5) unsigned NOT NULL DEFAULT 0,
`brd_thumb_height` smallint(5) unsigned NOT NULL DEFAULT 0,
`brd_use_rss` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_use_total_rss` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_use_sitemap` enum('Y','N') NOT NULL DEFAULT 'Y',
`brd_display_time` enum('sns','basic','full') NOT NULL DEFAULT 'sns', `brd_display_time` enum('sns','basic','full') NOT NULL DEFAULT 'sns',
`brd_count_post` int(10) unsigned NOT NULL DEFAULT 0, `brd_count_post` int(10) unsigned NOT NULL DEFAULT 0,
`brd_page_limit` enum('Y','N') NOT NULL DEFAULT 'Y', `brd_page_limit` enum('Y','N') NOT NULL DEFAULT 'Y',
@ -122,8 +112,6 @@ CREATE TABLE `wb_board` (
`brd_point_download_flag` tinyint(4) NOT NULL DEFAULT -1, `brd_point_download_flag` tinyint(4) NOT NULL DEFAULT -1,
`brd_point_reply` int(10) unsigned NOT NULL DEFAULT 0, `brd_point_reply` int(10) unsigned NOT NULL DEFAULT 0,
`brd_point_reply_flag` tinyint(4) NOT NULL DEFAULT 1, `brd_point_reply_flag` tinyint(4) NOT NULL DEFAULT 1,
`brd_time_new` int(10) unsigned NOT NULL DEFAULT 0,
`brd_hit_count` int(10) unsigned NOT NULL DEFAULT 0,
`brd_keywords` varchar(255) NOT NULL, `brd_keywords` varchar(255) NOT NULL,
`brd_description` text NOT NULL, `brd_description` text NOT NULL,
`brd_blind_nickname` enum('Y','N') NOT NULL DEFAULT 'N', `brd_blind_nickname` enum('Y','N') NOT NULL DEFAULT 'N',
@ -134,18 +122,6 @@ CREATE TABLE `wb_board` (
PRIMARY KEY (`brd_key`) PRIMARY KEY (`brd_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `wb_board_category`;
CREATE TABLE `wb_board_category` (
`bca_idx` int(10) unsigned NOT NULL AUTO_INCREMENT,
`brd_key` varchar(20) NOT NULL,
`bca_name` varchar(20) NOT NULL,
`bca_parent` int(10) unsigned NOT NULL DEFAULT '0',
`bca_sort` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`bca_idx`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `wb_board_comment`; DROP TABLE IF EXISTS `wb_board_comment`;
CREATE TABLE `wb_board_comment` ( CREATE TABLE `wb_board_comment` (
`cmt_idx` int(10) unsigned NOT NULL AUTO_INCREMENT, `cmt_idx` int(10) unsigned NOT NULL AUTO_INCREMENT,
@ -173,7 +149,7 @@ CREATE TABLE `wb_board_post` (
`post_parent` int(10) unsigned NOT NULL DEFAULT 0, `post_parent` int(10) unsigned NOT NULL DEFAULT 0,
`post_reply` varchar(10) NOT NULL DEFAULT '', `post_reply` varchar(10) NOT NULL DEFAULT '',
`brd_key` varchar(20) NOT NULL DEFAULT '', `brd_key` varchar(20) NOT NULL DEFAULT '',
`bca_idx` int(10) unsigned NOT NULL DEFAULT 0,
`post_category` varchar(255) NOT NULL DEFAULT '' COMMENT '카테고리',
`post_title` varchar(255) NOT NULL DEFAULT '', `post_title` varchar(255) NOT NULL DEFAULT '',
`post_thumbnail` varchar(255) NOT NULL DEFAULT '' COMMENT '썸네일 파일', `post_thumbnail` varchar(255) NOT NULL DEFAULT '' COMMENT '썸네일 파일',
`post_content` longtext NOT NULL, `post_content` longtext NOT NULL,
@ -183,11 +159,9 @@ CREATE TABLE `wb_board_post` (
`post_count_comment` int(10) unsigned NOT NULL DEFAULT 0, `post_count_comment` int(10) unsigned NOT NULL DEFAULT 0,
`post_recent_comment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `post_recent_comment` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`post_secret` enum('Y','N') NOT NULL DEFAULT 'N', `post_secret` enum('Y','N') NOT NULL DEFAULT 'N',
`post_html` enum('Y','N') NOT NULL DEFAULT 'Y',
`post_notice` enum('Y','N') NOT NULL DEFAULT 'N', `post_notice` enum('Y','N') NOT NULL DEFAULT 'N',
`post_hit` int(10) unsigned NOT NULL DEFAULT 0, `post_hit` int(10) unsigned NOT NULL DEFAULT 0,
`post_mobile` enum('Y','N') NOT NULL DEFAULT 'N', `post_mobile` enum('Y','N') NOT NULL DEFAULT 'N',
`post_assign` enum('Y','N') NOT NULL DEFAULT 'Y',
`post_ip` int(10) unsigned NOT NULL DEFAULT 0, `post_ip` int(10) unsigned NOT NULL DEFAULT 0,
`post_keywords` varchar(255) NOT NULL, `post_keywords` varchar(255) NOT NULL,
`post_ext1` text NOT NULL, `post_ext1` text NOT NULL,

2
wheeparam/views/skins/board/comment/basic/c_list.php

@ -19,7 +19,7 @@
<!-- END :: 대댓글일 경우--> <!-- END :: 대댓글일 경우-->
<div class="media-body" style="padding-left:<?=strlen($cmt['cmt_reply'])*50?>px"> <div class="media-body" style="padding-left:<?=strlen($cmt['cmt_reply'])*50?>px">
<h4><?=$cmt['mem_nickname']?> <small><?=$cmt['cmt_datetime']?></small></h4>
<h4><?=$cmt['cmt_nickname']?> <small><?=$cmt['cmt_datetime']?></small></h4>
<div data-container="container-comment-content"> <div data-container="container-comment-content">
<?php <?php
if( $cmt['cmt_status'] == 'Y' ) : if( $cmt['cmt_status'] == 'Y' ) :

15
wheeparam/views/skins/board/list/basic/list.php

@ -13,14 +13,7 @@
<ul class="board-category"> <ul class="board-category">
<li><a href="<?=$board['link']['base_url']?>">전체 보기</a></li> <li><a href="<?=$board['link']['base_url']?>">전체 보기</a></li>
<?php foreach($category_list as $cate) :?> <?php foreach($category_list as $cate) :?>
<li>
<a href="<?=$cate['link']?>"><?=$cate['bca_name']?></a>
<ul>
<?php foreach($cate['items'] as $subcate) :?>
<li><a href="<?=$subcate['link']?>"><?=$subcate['bca_name']?></a></li>
<?php endforeach;?>
</ul>
</li>
<li><a href="<?=base_url("board/{$board['brd_key']}/?category={$cate}")?>"><?=$cate?></a></li>
<?php endforeach;?> <?php endforeach;?>
</ul> </ul>
<div class="H30"></div> <div class="H30"></div>
@ -53,7 +46,7 @@
endif;?> endif;?>
</td> </td>
<?php if($use_category) :?> <?php if($use_category) :?>
<td class="text-center"><?=$post['bca_name']?></td>
<td class="text-center"><?=$post['post_category']?></td>
<?php endif;?> <?php endif;?>
<td> <td>
<?php if(strlen($post['post_reply']) >0) :?> <?php if(strlen($post['post_reply']) >0) :?>
@ -66,7 +59,7 @@
<?php if($post['post_count_comment']>0) :?><small>(<?=$post['post_count_comment']?>)</small><?php endif;?> <?php if($post['post_count_comment']>0) :?><small>(<?=$post['post_count_comment']?>)</small><?php endif;?>
<?php if($post['is_secret']) :?><i class="fa fa-lock"></i><?php endif;?> <?php if($post['is_secret']) :?><i class="fa fa-lock"></i><?php endif;?>
</td> </td>
<td class="text-center"><?=$post['mem_nickname']?></td>
<td class="text-center"><?=$post['post_nickname']?></td>
<td class="text-center"><?=$post['post_hit']?></td> <td class="text-center"><?=$post['post_hit']?></td>
<td class="text-center"><?=$post['post_datetime']?></td> <td class="text-center"><?=$post['post_datetime']?></td>
</tr> </tr>
@ -76,7 +69,7 @@
<!-- START:: 등록된 글이 없는 경우--> <!-- START:: 등록된 글이 없는 경우-->
<?php if(count($list['list'])==0):?> <?php if(count($list['list'])==0):?>
<tr> <tr>
<td colspan="5" class="text-center">등록된 글이 없습니다.</td>
<td colspan="6" class="text-center">등록된 글이 없습니다.</td>
</tr> </tr>
<?php endif;?> <?php endif;?>
<!-- END:: 등록된 글이 없는 경우--> <!-- END:: 등록된 글이 없는 경우-->

69
wheeparam/views/skins/board/view/basic/view.php

@ -12,7 +12,7 @@
<ul class="post-info"> <ul class="post-info">
<dl> <dl>
<dt>작성자</dt> <dt>작성자</dt>
<dd><?=$view['mem_nickname']?></dd>
<dd><?=$view['post_nickname']?></dd>
</dl> </dl>
<dl> <dl>
<dt>조회수</dt> <dt>조회수</dt>
@ -92,71 +92,4 @@
<!-- START :: 코멘트 목록 --> <!-- START :: 코멘트 목록 -->
<?=$comment_list?> <?=$comment_list?>
<!-- END:: 코멘트 --> <!-- END:: 코멘트 -->
<div class="H10"></div>
<!-- START :: 게시글 목록-->
<table class="table table-striped">
<thead>
<tr>
<th class="text-center">#</th>
<?php if($use_category) :?>
<th class="text-center">분류</th>
<?php endif;?>
<th class="text-center"> </th>
<th class="text-center">작성자</th>
<th class="text-center">조회수</th>
<th class="text-center">작성일</th>
</tr>
</thead>
<tbody>
<!-- START:: 목록-->
<?php foreach($list['list'] as $post) :?>
<tr>
<td class="text-center">
<?php if($view['post_idx'] == $post['post_idx']) :?>
<?php elseif($post['post_notice']) : ?>
<label class="label label-danger">공지</label>
<?php elseif(strlen($post['post_reply']) > 0) : ?>
<?php else :
echo $post['nums'];
endif;?>
</td>
<?php if($use_category) :?>
<td class="text-center"><?=$post['bca_name']?></td>
<?php endif;?>
<td>
<?php if(strlen($post['post_reply']) >0) :?>
<span style="display:inline-block;width:<?=((strlen($post['post_reply'])-1) * 16)?>px"></span>
<img src="<?=base_url('assets/images/common/icon_reply.gif')?>">
<?php endif;?>
<a href="<?=$post['link']?>"><?=$post['post_title']?></a> <!-- 제목-->
<?php if($post['is_new']) :?><label class="label label-danger label-sm">NEW</label><?php endif;?>
<?php if($post['is_hot']) :?><label class="label label-warning label-sm">HIT</label><?php endif;?>
<?php if($post['post_count_comment']>0) :?><small>(<?=$post['post_count_comment']?>)</small><?php endif;?>
<?php if($post['is_secret']) :?><i class="fa fa-lock"></i><?php endif;?>
</td>
<td class="text-center"><?=$post['mem_nickname']?></td>
<td class="text-center"><?=$post['post_hit']?></td>
<td class="text-center"><?=$post['post_datetime']?></td>
</tr>
<?php endforeach;?>
<!-- END :: 목록-->
<!-- START:: 등록된 글이 없는 경우-->
<?php if(count($list['list'])==0):?>
<tr>
<td colspan="5" class="text-center">등록된 글이 없습니다.</td>
</tr>
<?php endif;?>
<!-- END:: 등록된 글이 없는 경우-->
</tbody>
</table>
<div class="text-center">
<?=$pagination?>
</div>
<!-- END :: 게시글 목록-->
</div> </div>

30
wheeparam/views/skins/board/write/basic/write.php

@ -10,12 +10,9 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2">카테고리</label> <label class="control-label col-sm-3 col-md-2">카테고리</label>
<div class="col-sm-9 col-md-10"> <div class="col-sm-9 col-md-10">
<select class="form-control" name="bca_idx">
<?php foreach($board['category'] as $cate) :?>
<option value="<?=$cate['bca_idx']?>" <?=element('bca_idx', $view)==$cate['bca_idx']?'selected':''?>><?=$cate['bca_name']?></option>
<?php foreach($cate['items'] as $sub_cate) : ?>
<option value="<?=$sub_cate['bca_idx']?>" <?=element('bca_idx', $view)==$sub_cate['bca_idx']?'selected':''?>><?=$cate['bca_name']?> > <?=$sub_cate['bca_name']?></option>
<?php endforeach;?>
<select class="form-control" name="post_category">
<?php foreach($board['category'] as $cate):?>
<option value="<?=$cate?>" <?=$cate==element('post_category', $view)?'selected':''?>><?=$cate?></option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</div> </div>
@ -64,32 +61,23 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2">작성자</label> <label class="control-label col-sm-3 col-md-2">작성자</label>
<div class="col-sm-9 col-md-10"> <div class="col-sm-9 col-md-10">
<input class="form-control" name="mem_nickname" value="<?=element('mem_nickname', $view)?>" required>
<input class="form-control" name="post_nickname" value="<?=element('post_nickname', $view)?>" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2">비밀번호</label> <label class="control-label col-sm-3 col-md-2">비밀번호</label>
<div class="col-sm-9 col-md-10"> <div class="col-sm-9 col-md-10">
<input type="password" class="form-control" name="mem_password" value="" required>
<input type="password" class="form-control" name="post_password" value="" required>
</div> </div>
</div> </div>
<!--END :: 비회원일 경우 입력폼 추가 --> <!--END :: 비회원일 경우 입력폼 추가 -->
<?php endif;?> <?php endif;?>
<!-- START :: 추가입력필드 SAMPLE // 관리자->게시판관리 에서 추가입력필드를 추가한 후 사용
<div class="form-group">
<label class="control-label col-sm-3 col-md-2">주소</label>
<div class="col-sm-9 col-md-10">
<input class="form-control" name="extra[address]" value="<?=element('bmt_value', element('address', element('extra',$view )))?>" required>
</div>
</div>
<!-- END :: 추가입력필드 SAMPLE -->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2"> 내용</label> <label class="control-label col-sm-3 col-md-2"> 내용</label>
<div class="col-sm-9 col-md-10"> <div class="col-sm-9 col-md-10">
<?=get_editor('post_content', element('post_content', $view), '', $use_wysiwyg);?>
<?=get_editor('post_content', element('post_content', $view), '');?>
</div> </div>
</div> </div>
@ -99,8 +87,7 @@
<input class="form-control" name="post_keywords" value="<?=element('post_keywords', $view)?>"> <input class="form-control" name="post_keywords" value="<?=element('post_keywords', $view)?>">
</div> </div>
</div> </div>
<?php if( $use_attach ) :?>
<!-- START :: 파일 첨부 기능을 사용하고, 권한이 있을경우 --> <!-- START :: 파일 첨부 기능을 사용하고, 권한이 있을경우 -->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2">파일 첨부</label> <label class="control-label col-sm-3 col-md-2">파일 첨부</label>
@ -109,9 +96,8 @@
</div> </div>
</div> </div>
<!-- END :: 파일 첨부 기능을 사용하고, 권한이 있을경우 --> <!-- END :: 파일 첨부 기능을 사용하고, 권한이 있을경우 -->
<?php endif;?>
<?php if($use_attach && $post_idx && count(element('file', $view)) > 0) :?>
<?php if( $post_idx && count(element('file', $view)) > 0) :?>
<!-- START :: 현재 첨부되어 있는 이미지 --> <!-- START :: 현재 첨부되어 있는 이미지 -->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3 col-md-2">첨부된 파일</label> <label class="control-label col-sm-3 col-md-2">첨부된 파일</label>

72
wheeparam/views/themes/admin/board/category.php

@ -1,72 +0,0 @@
<div class="page-header">
<h1 class="page-title">'<?=$board['brd_title']?>' 게시판 카테고리 설정</h1>
</div>
<div class="row">
<div class="col-sm-3">
<ul class="nav nav-cards">
<li role="presentation"><a class="card" href="<?=base_url('admin/board/form/'.$board['brd_key'])?>">게시판 정보 수정</a></li>
<li role="presentation" class="active"><a href="#" class="card selected">카테고리 설정</a></li>
</ul>
</div>
<div class="col-sm-9">
<ul class="category-list">
<li>
<div>
<?=$board['brd_title']?>
<button type="button" class="btn btn-xs btn-default" onclick="APP.BOARD.CATEGORY.form('<?=$board['brd_key']?>',0)"><i class="fal fa-plus-circle"></i></button>
</div>
<ul id="category-list">
<?php foreach($board['category'] as $cate) : ?>
<li data-idx="<?=$cate['bca_idx']?>">
<div>
<i class="fal fa-folder-open"></i> <span class="move-item"><?=$cate['bca_name']?></span>
<button type="button" class="btn btn-xs btn-default" onclick="APP.BOARD.CATEGORY.form('<?=$board['brd_key']?>', <?=$cate['bca_idx']?>)"><i class="fal fa-plus-circle"></i></button>
<button type="button" class="btn btn-xs btn-default" onclick="APP.BOARD.CATEGORY.form('<?=$board['brd_key']?>', 0,<?=$cate['bca_idx']?>)"><i class="fal fa-pencil"></i></button>
<button type="button" class="btn btn-xs btn-danger" onclick="APP.BOARD.CATEGORY.remove('<?=$cate['bca_idx']?>')"><i class="fal fa-trash"></i></button>
</div>
<ul class="items">
<?php foreach($cate['items'] as $ct):?>
<li data-idx="<?=$ct['bca_idx']?>">
<div>
<span class="move-item"><?=$ct['bca_name']?></span>
<button type="button" class="btn btn-xs btn-default" onclick="APP.BOARD.CATEGORY.form('<?=$board['brd_key']?>', <?=$cate['bca_idx']?>, <?=$ct['bca_idx']?>)"><i class="fal fa-pencil"></i></button>
<button type="button" class="btn btn-xs btn-danger" onclick="APP.BOARD.CATEGORY.remove('<?=$ct['bca_idx']?>')"><i class="fal fa-trash"></i></button>
</div>
</li>
<?php endforeach;?>
</ul>
</li>
<?php endforeach;?>
</ul>
</li>
</ul>
</div>
</div>
<script>
$(function(){
$("#category-list").sortable({
update: function(){
var obj = [];
$("#category-list > li").each(function(){
obj.push( $(this).data('idx') );
});
$.post(base_url+'/ajax/board/category_sort',{brd_key:'<?=$board['brd_key']?>', idxs:obj});
}
});
$("#category-list >li > .items").sortable({
update : function(event, ui) {
var obj = [];
$("#category-list >li > .items > li").each(function(){
obj.push( $(this).data('idx') );
});
$.post(base_url+'/ajax/board/category_sort',{brd_key:'<?=$board['brd_key']?>', idxs:obj});
}
});
});
</script>

15
wheeparam/views/themes/admin/board/category_form.php

@ -1,15 +0,0 @@
<?=form_open(NULL,array('autocomplete'=>'off','class'=>'form-flex'))?>
<input type="hidden" name="brd_key" value="<?=$brd_key?>">
<input type="hidden" name="bca_parent" value="<?=$bca_parent?>">
<input type="hidden" name="bca_idx" value="<?=$bca_idx?>">
<div class="form-group">
<label class="control-label control-label-sm">카테고리 이름</label>
<div class="controls">
<input class="form-control" name="bca_name" value="<?=element('bca_name', $view)?>" required autofocus>
</div>
</div>
<div class="H10"></div>
<div class="text-center">
<button class="btn btn-primary"><i class="fal fa-save"></i> 저장하기</button>
</div>
<?=form_close()?>

875
wheeparam/views/themes/admin/board/form.php

@ -3,516 +3,439 @@
</div> </div>
<?=validation_errors('<p class="alert alert-danger">')?> <?=validation_errors('<p class="alert alert-danger">')?>
<?=form_open(NULL, array("autocomplete"=>"off","data-form"=>"board-form",'class'=>'form-flex'))?> <?=form_open(NULL, array("autocomplete"=>"off","data-form"=>"board-form",'class'=>'form-flex'))?>
<div class="row">
<div class="col-sm-3">
<ul class="nav nav-cards">
<li role="presentation"><a class="card selected"><?=empty($brd_key)?'게시판 신규 등록': "게시판 정보 수정";?></a></li>
<?php if($brd_key) : ?>
<li role="presentation"><a class="card" href="<?=base_url('admin/board/category/'.$brd_key)?>">카테고리 설정</a></li>
<?php endif;?>
</ul>
<div data-ax-tbl>
<div class="caption">게시판 기본 설정</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>게시판 고유 </div>
<div data-ax-td-wrap>
<input class="form-control form-control-inline" maxlength="20" name="brd_key" value="<?=element('brd_key', $view)?>" <?=$brd_key?'readonly':'required'?>>
<p class="help-block">4-20자의 영어소문자</p>
</div>
</div>
<div data-ax-td>
<div data-ax-td-wrap>
<?php if (empty($brd_key)) : ?>
<button type="button" class="btn btn-default btn-sm ML10" id="btn-check-brd-key"><i class="fal fa-check"></i> 중복 확인</button>
<?php endif;?>
</div>
</div>
</div> </div>
<div class="col-sm-9">
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">기본 설정</h4>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>게시판 이름</div>
<div data-ax-td-wrap>
<input class="form-control" name="brd_title" maxlength="30" value="<?=element('brd_title', $view)?>" required>
</div> </div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">게시판 고유 </label>
<div class="controls">
<input class="form-control form-control-inline" maxlength="20" name="brd_key" value="<?=element('brd_key', $view)?>" <?=$brd_key?'readonly':'required'?>>
<?php if (empty($brd_key)) : ?>
<button type="button" class="btn btn-default ML10" id="btn-check-brd-key"><i class="fal fa-check"></i> 중복 확인</button>
<?php endif;?>
</div>
</div>
<div class="form-group">
<label class="control-label">게시판 이름</label>
<div class="controls">
<input class="form-control" name="brd_title" value="<?=element('brd_title', $view)?>" required>
</div>
<label class="control-label">게시판 이름 (모바일)</label>
<div class="controls">
<input class="form-control" name="brd_title_m" value="<?=element('brd_title_m', $view)?>">
</div>
</div>
<div class="form-group">
<label class="control-label">게시판 키워드</label>
<div class="controls">
<input class="form-control" name="brd_keywords" value="<?=element('brd_keywords', $view)?>">
</div>
</div>
<div class="form-group">
<label class="control-label">요약 설명</label>
<div class="controls">
<textarea class="form-control" name="brd_description" rows="4"><?=element('brd_description', $view)?></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label">검색 설정</label>
<div class="controls">
<label class="w-check">
<input type="checkbox" name="brd_search" value="Y" <?=element('brd_search', $view, 'Y')=='Y'?'checked':''?>><span>전체 검색시 게시판의 글 노출</span>
</label>
</div>
<label class="control-label">노출 순서</label>
<div class="controls">
<input type="number" class="form-control" name="brd_sort" value="<?=element('brd_sort', $view, 0)?>">
</div>
</div>
<div class="form-group">
<label class="control-label">카테고리 기능 사용</label>
<div class="controls">
<label class="w-check">
<input type="checkbox" name="brd_use_category" value="Y" <?=element('brd_use_category', $view)=='Y'?'checked':''?>><span>카테고리 기능 사용</span>
</label>
</div>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>게시판 키워드</div>
<div data-ax-td-wrap>
<input class="form-control" name="brd_keywords" value="<?=element('brd_keywords', $view)?>">
</div> </div>
</div> </div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">게시판 스킨 설정</h4>
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>게시판 요약설명</div>
<div data-ax-td-wrap>
<textarea class="form-control" name="brd_description" data-autosize><?=element('brd_description', $view)?></textarea>
</div> </div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">목록 스킨</label>
<div class="controls">
<select class="form-control" name="brd_skin_l">
<?php foreach($skin_list_l as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_l',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
<label class="control-label">목록 스킨 (모바일)</label>
<div class="controls">
<select class="form-control" name="brd_skin_l_m">
<?php foreach($skin_list_l as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_l_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">글쓰기 스킨</label>
<div class="controls">
<select class="form-control" name="brd_skin_w">
<?php foreach($skin_list_w as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_w',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
<label class="control-label">글쓰기 스킨 (모바일)</label>
<div class="controls">
<select class="form-control" name="brd_skin_w_m">
<?php foreach($skin_list_w as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_w_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label"> 보기 스킨</label>
<div class="controls">
<select class="form-control" name="brd_skin_v">
<?php foreach($skin_list_v as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_v',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
<label class="control-label">글쓰기 스킨 (모바일)</label>
<div class="controls">
<select class="form-control" name="brd_skin_v_m">
<?php foreach($skin_list_v as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_v_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">댓글 스킨</label>
<div class="controls">
<select class="form-control" name="brd_skin_c">
<?php foreach($skin_list_c as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_c',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
<label class="control-label">댓글 스킨 (모바일)</label>
<div class="controls">
<select class="form-control" name="brd_skin_c_m">
<?php foreach($skin_list_c as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_c_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>카테고리</div>
<div data-ax-td-wrap>
<label class="w-check">
<input type="checkbox" name="brd_use_category" value="Y" <?=element('brd_use_category', $view)=='Y'?'checked':''?>><span>기능 사용</span>
</label>
</div> </div>
</div> </div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">게시판 권한 설정</h4>
</div>
<div class="panel-body">
<p class="alert alert-info"><i class="fal fa-info-circle"></i> 레벨0은 비회원을 의미합니다.</p>
<div class="form-group">
<label class="control-label">목록 보기</label>
<div class="controls">
<select class="form-control" name="brd_lv_list">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_list', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
<label class="control-label"> 내용 보기</label>
<div class="controls">
<select class="form-control" name="brd_lv_read">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_read', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label"> 작성하기</label>
<div class="controls">
<select class="form-control" name="brd_lv_write">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_write', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
<label class="control-label">답변글 작성</label>
<div class="controls">
<select class="form-control" name="brd_lv_reply">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_reply', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">댓글 작성</label>
<div class="controls">
<select class="form-control" name="brd_lv_comment">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_comment', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
<label class="control-label">첨부파일 다운로드</label>
<div class="controls">
<select class="form-control" name="brd_lv_download">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_download', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">첨부파일 업로드</label>
<div class="controls">
<select class="form-control" name="brd_lv_upload">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_upload', $view, 0)?'selected':''?>><?=$i?></option>
<?php endfor;?>
</select>
</div>
<label class="control-label"></label>
<div class="controls"></div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>카테고리 목록</div>
<div data-ax-td-wrap>
<input class="form-control" name="brd_category" value="<?=element('brd_category', $view)?>" maxlength="255">
<p class="help-block">카테고리를 세미콜론(;)으로 여러개를 입력해주세요. ex) 자유;정보;잡담</p>
</div> </div>
</div> </div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title"> 목록 설정</h4>
</div>
<div class="panel-body">
<p class="alert alert-info"><i class="fal fa-info-circle"></i> 갤러리 형식의 게시판에서는 '목록에서 썸내일 불러오기' / '목록에서 첨부파일 불러오기' 활성화 하세요.</p>
<div class="form-group">
<label class="control-label">썸네일 생성하기</label>
<div class="controls">
<select class="form-control" name="brd_use_list_thumbnail">
<option value="Y" <?=element('brd_use_list_thumbnail',$view,'N')=='Y'?'selected':''?>>생성하기</option>
<option value="N" <?=element('brd_use_list_thumbnail',$view,'N')=='N'?'selected':''?>>생성하지 않기</option>
</select>
</div>
<label class="control-label">썸네일 너비</label>
<div class="controls">
<input type="number" class="form-control" name="brd_thumb_width" value="<?=element('brd_thumb_width',$view,300)?>" min="0">
</div>
<label class="control-label">썸네일 높이</label>
<div class="controls">
<input type="number" class="form-control" name="brd_thumb_height" value="<?=element('brd_thumb_height',$view,300)?>" min="0">
</div>
</div>
<div class="form-group">
<label class="control-label">첨부파일 목록 불러오기</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_list_file">
<option value="Y" <?=element('brd_use_list_file',$view,'N')=='Y'?'selected':''?>>불러오기</option>
<option value="N" <?=element('brd_use_list_file',$view,'N')=='N'?'selected':''?>>불러오지 않기</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">NEW 표시 시간</label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_time_new" value="<?=element('brd_time_new', $view, 24)?>" min="0">
</div>
</div>
<div class="form-group">
<label class="control-label">HIT 표시 조회수</label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_hit_count" value="<?=element('brd_hit_count', $view, 500)?>" min="0">
</div>
</div>
</div>
</div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title"> 내용보기 설정</h4>
</div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">내용보기 에서 목록</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_view_list">
<option value="Y" <?=element('brd_use_view_list',$view,'N')=='Y'?'selected':''?>>불러오기</option>
<option value="N" <?=element('brd_use_view_list',$view,'N')=='N'?'selected':''?>>불러오지 않기</option>
</select>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>시간 표시형식</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_display_time">
<option value="sns" <?=element('brd_use_anonymous',$view)=='sns'?'selected':''?>>SNS형식</option>
<option value="basic" <?=element('brd_use_anonymous',$view)=='basic'?'selected':''?>>기본형</option>
<option value="full" <?=element('brd_use_anonymous',$view)=='full'?'selected':''?>>전체표시</option>
</select>
</div> </div>
</div> </div>
</div>
</div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">페이지네이션 기능</h4>
</div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">기능 사용여부</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_page_limit">
<option value="Y" <?=element('brd_page_limit',$view,'Y')=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_page_limit',$view,'Y')=='N'?'selected':''?>>미사용</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">페이지 </label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_page_rows" value="<?=element('brd_page_rows', $view, 15)?>">
</div>
<label class="control-label">페이지 (모바일)</label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_page_rows_m" value="<?=element('brd_page_rows_m', $view, 10)?>">
</div>
</div>
<div class="form-group">
<label class="control-label">표시할 페이지 </label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_fixed_num" value="<?=element('brd_fixed_num', $view, 10)?>">
</div>
<label class="control-label">표시할 페이지 (모바일)</label>
<div class="controls">
<input type="number" class="form-control form-control-inline" name="brd_fixed_num_m" value="<?=element('brd_fixed_num_m', $view, 5)?>">
</div>
</div>
<div class="H10"></div>
<div data-ax-tbl>
<div class="caption">페이지 기능</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>페이지 기능</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_page_limit">
<option value="Y" <?=element('brd_page_limit',$view,'Y')=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_page_limit',$view,'Y')=='N'?'selected':''?>>미사용</option>
</select>
</div> </div>
</div> </div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">게시판 기능 설정</h4>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>한페이지 글수</div>
<div data-ax-td-wrap>
<input type="number" min="0" class="form-control form-control-inline" name="brd_page_rows" value="<?=element('brd_page_rows', $view, 15)?>" required>
</div> </div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">시간 표시 형식</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_display_time">
<option value="sns" <?=element('brd_use_anonymous',$view)=='sns'?'selected':''?>>SNS형식</option>
<option value="basic" <?=element('brd_use_anonymous',$view)=='basic'?'selected':''?>>기본형</option>
<option value="full" <?=element('brd_use_anonymous',$view)=='full'?'selected':''?>>전체표시</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">익명 기능 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_anonymous">
<option value="Y" <?=element('brd_use_anonymous',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_anonymous',$view)=='N'?'selected':''?>>미사용</option>
<option value="A" <?=element('brd_use_anonymous',$view)=='A'?'selected':''?>>항상 사용</option>
</select>
</div>
<label class="control-label">비밀글 기능 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_secret">
<option value="Y" <?=element('brd_use_secret',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_secret',$view)=='N'?'selected':''?>>미사용</option>
<option value="A" <?=element('brd_use_secret',$view)=='A'?'selected':''?>>항상 사용</option>
</select>
</div>
<label class="control-label">답글 기능 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_reply">
<option value="Y" <?=element('brd_use_reply',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_reply',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label">댓글 기능 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_comment">
<option value="Y" <?=element('brd_use_comment',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_comment',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
<label class="control-label">위지윅 에디터 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_wysiwyg">
<option value="Y" <?=element('brd_use_wysiwyg',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_wysiwyg',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
<label class="control-label">파일 첨부 사용</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_attach">
<option value="Y" <?=element('brd_use_attach',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_attach',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<input type="number" min="0" class="form-control form-control-inline" name="brd_page_rows_m" value="<?=element('brd_page_rows_m', $view, 10)?>" required>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>한번에 표시 페이지</div>
<div data-ax-td-wrap>
<input type="number" min="0" class="form-control" name="brd_fixed_num" value="<?=element('brd_fixed_num', $view, 10)?>" required>
</div>
</div>
<div class="form-group">
<label class="control-label">관리자 승인 글만 표시</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_assign">
<option value="Y" <?=element('brd_use_assign',$view,'N')=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_assign',$view,'N')=='N'?'selected':''?>>미사용</option>
</select>
<p class="help-block"><i class="fal fa-exclamation-circle"></i> 승인된 글만 표시하는 기능을 사용하여, 사이트에 불리한 내용을 숨기거나 하는경우 소비자보호센터의 제재를 받을 있습니다.</p>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<input type="number" min="0" class="form-control" name="brd_fixed_num_m" value="<?=element('brd_fixed_num_m', $view, 10)?>" required>
</div> </div>
</div> </div>
</div>
</div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title"><?=$this->site->config('point_name')?> 설정</h4>
</div>
<div class="panel-body">
<?php if($this->site->config('point_use') == 'Y') :?>
<p class="alert alert-info"><i class="fal fa-info-circle"></i> <?=$this->site->config('point_name')?> 지급은 +값, <?=$this->site->config('point_name')?> 차감은 -값을 입력합니다.<br><i class="fal fa-info-circle"></i> 포인트 차감이 설정된 경우 강제로 회원전용 기능으로 전환합니다.</p>
<?php else :?>
<p class="alert alert-info"><i class="fal fa-info-circle"></i> <?=$this->site->config('point_name')?> 기능을 사용 하는경우만 아래 옵션이 활성화 됩니다.</p>
<?php endif;?>
<div class="form-group">
<label class="control-label">글쓰기</label>
<div class="controls">
<input type="number" class="form-control" name="brd_point_write" value="<?=element('brd_point_write', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<label class="control-label">답글쓰기</label>
<div class="controls">
<input type="number" class="form-control" name="brd_point_reply" value="<?=element('brd_point_reply', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<label class="control-label">댓글쓰기</label>
<div class="controls">
<input type="number" class="form-control" name="brd_point_comment" value="<?=element('brd_point_comment', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
</div>
<div class="form-group">
<label class="control-label">내용 보기</label>
<div class="controls">
<input type="number" class="form-control" name="brd_point_read" value="<?=element('brd_point_read', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<label class="control-label">첨부파일 다운</label>
<div class="controls">
<input type="number" class="form-control" name="brd_point_download" value="<?=element('brd_point_download', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<label class="control-label"></label>
<div class="controls"></div>
</div>
<div class="H10"></div>
<div data-ax-tbl>
<div class="caption">게시판 스킨 설정</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>목록 스킨</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_l">
<?php foreach($skin_list_l as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_l',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_l_m">
<?php foreach($skin_list_l as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_l_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>글쓰기 스킨</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_w">
<?php foreach($skin_list_w as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_w',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_w_m">
<?php foreach($skin_list_w as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_w_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div> </div>
</div> </div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>글내용 보기 스킨</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_v">
<?php foreach($skin_list_v as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_v',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_v_m">
<?php foreach($skin_list_v as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_v_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>댓글 스킨</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_c">
<?php foreach($skin_list_c as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_c',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_skin_c_m">
<?php foreach($skin_list_c as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_c_m',$view)?'selected':''?>><?=$skin?></option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
</div>
<div class="panel panel-dark">
<div class="panel-heading">
<h4 class="panel-title">검색엔진 최적화 설정</h4>
</div>
<div class="panel-body">
<div class="form-group">
<label class="control-label">통합 RSS</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_total_rss">
<option value="Y" <?=element('brd_use_total_rss',$view)=='Y'?'selected':''?>>포함</option>
<option value="N" <?=element('brd_use_total_rss',$view)=='N'?'selected':''?>>포함하지 않기</option>
</select>
</div>
<label class="control-label">게시판 RSS</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_rss">
<option value="Y" <?=element('brd_use_rss',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_rss',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
<label class="control-label">사이트맵 노출</label>
<div class="controls">
<select class="form-control form-control-inline" name="brd_use_sitemap">
<option value="Y" <?=element('brd_use_sitemap',$view)=='Y'?'selected':''?>>노출</option>
<option value="N" <?=element('brd_use_sitemap',$view)=='N'?'selected':''?>>감추기</option>
</select>
</div>
</div>
<div class="H10"></div>
<div data-ax-tbl>
<div class="caption">게시판 권한 설정</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>목록 보기</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_list">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_list', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div> </div>
</div> </div>
<div data-ax-td>
<div data-ax-td-label> 작성</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_write">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_write', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label> 내용 보기</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_read">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_read', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>답글 작성</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_reply">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_reply', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>댓글 작성</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_comment">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_comment', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>첨부파일 다운</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_lv_download">
<?php for($i=0; $i<=10; $i++):?>
<option value="<?=$i?>" <?=$i==element('brd_lv_download', $view, 0)?'selected':''?>><?=$i?><?=$i==0?' (비회원)':''?></option>
<?php endfor;?>
</select>
</div>
</div>
</div>
</div>
<div class="H10"></div>
<div data-ax-tbl>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>답글 기능</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_use_reply">
<option value="Y" <?=element('brd_use_reply',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_reply',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>댓글 기능</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_use_comment">
<option value="Y" <?=element('brd_use_comment',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_comment',$view)=='N'?'selected':''?>>미사용</option>
</select>
</div>
</div>
<div data-ax-td></div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>익명 기능</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_use_anonymous">
<option value="Y" <?=element('brd_use_anonymous',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_anonymous',$view)=='N'?'selected':''?>>미사용</option>
<option value="A" <?=element('brd_use_anonymous',$view)=='A'?'selected':''?>>항상 사용</option>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>비밀글 기능</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_use_secret">
<option value="Y" <?=element('brd_use_secret',$view)=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_use_secret',$view)=='N'?'selected':''?>>미사용</option>
<option value="A" <?=element('brd_use_secret',$view)=='A'?'selected':''?>>항상 사용</option>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>이름 * 처리</div>
<div data-ax-td-wrap>
<select class="form-control form-control-inline" name="brd_blind_nickname">
<option value="Y" <?=element('brd_blind_nickname',$view, 'N')=='Y'?'selected':''?>>사용</option>
<option value="N" <?=element('brd_blind_nickname',$view, 'N')=='N'?'selected':''?>>미사용</option>
</select>
<p class="help-block">관리자 <i class="fal fa-caret-right"></i> *</p>
</div>
</div>
</div>
</div>
<div class="H10"></div>
<div class="text-center">
<button class="btn btn-primary btn-lg">저장하기</button>
<div class="H10"></div>
<?php if($this->site->config('point_use') != 'Y') :?>
<p class="alert alert-info"><i class="fal fa-info-circle"></i> <?=$this->site->config('point_name')?> 기능을 사용 하는경우만 아래 옵션이 활성화 됩니다.</p>
<div class="H10"></div>
<?php endif;?>
<div data-ax-tbl>
<div class="caption"><?=$this->site->config('point_name')?> 설정</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>글쓰기 <?=$this->site->config('point_name')?></div>
<div data-ax-td-wrap>
<input type="number" class="form-control text-right" name="brd_point_write" value="<?=element('brd_point_write', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_point_write_flag">
<option value="1" <?=element('brd_point_write_flag', $view, 1)=='1'?'selected':''?>>증가</option>
<option value="-1" <?=element('brd_point_write_flag', $view, 1)=='-1'?'selected':''?>>차감</option>
</select>
</div>
</div> </div>
<div data-ax-td>
<div data-ax-td-label>답글쓰기 <?=$this->site->config('point_name')?></div>
<div data-ax-td-wrap>
<input type="number" class="form-control text-right" name="brd_point_reply" value="<?=element('brd_point_reply', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_point_reply_flag">
<option value="1" <?=element('brd_point_reply_flag', $view, 1)=='1'?'selected':''?>>증가</option>
<option value="-1" <?=element('brd_point_reply_flag', $view, 1)=='-1'?'selected':''?>>차감</option>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>댓글쓰기 <?=$this->site->config('point_name')?></div>
<div data-ax-td-wrap>
<input type="number" class="form-control text-right" name="brd_point_comment" value="<?=element('brd_point_comment', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_point_comment_flag">
<option value="1" <?=element('brd_point_comment_flag', $view, 1)=='1'?'selected':''?>>증가</option>
<option value="-1" <?=element('brd_point_comment_flag', $view, 1)=='-1'?'selected':''?>>차감</option>
</select>
</div>
</div>
</div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label> 내용 보기</div>
<div data-ax-td-wrap>
<input type="number" class="form-control text-right" name="brd_point_read" value="<?=element('brd_point_read', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_point_read_flag">
<option value="1" <?=element('brd_point_read_flag', $view, 1)=='1'?'selected':''?>>증가</option>
<option value="-1" <?=element('brd_point_read_flag', $view, 1)=='-1'?'selected':''?>>차감</option>
</select>
</div>
</div>
<div data-ax-td>
<div data-ax-td-label>첨부파일 다운</div>
<div data-ax-td-wrap>
<input type="number" class="form-control text-right" name="brd_point_download" value="<?=element('brd_point_download', $view, 0)?>" <?=$this->site->config('point_use') != 'Y'?'readonly':''?>>
</div>
<div data-ax-td-wrap>
<select class="form-control" name="brd_point_download_flag">
<option value="1" <?=element('brd_point_download_flag', $view, 1)=='1'?'selected':''?>>증가</option>
<option value="-1" <?=element('brd_point_download_flag', $view, 1)=='-1'?'selected':''?>>차감</option>
</select>
</div>
</div>
<div data-ax-td></div>
</div> </div>
</div> </div>
<div class="text-center MT15">
<button class="btn btn-primary"><i class="fal fa-save"></i> 저장하기</button>
</div>
<?=form_close()?> <?=form_close()?>
<div class="H30"></div> <div class="H30"></div>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$('[name="brd_use_category"]').change(function() {
var checked = $(this).prop('checked');
if( checked ) $('[name="brd_category"]').removeAttr('disabled');
else $('[name="brd_category"]').attr('disabled','disabled');
}).change();
$("select[name='brd_page_limit']").change(function(){ $("select[name='brd_page_limit']").change(function(){
if( $(this).find('option:selected').val() == 'Y' ) if( $(this).find('option:selected').val() == 'Y' )
{ {

154
wheeparam/views/themes/admin/board/posts.php

@ -5,121 +5,89 @@
<form data-grid-search onsubmit="grid.refresh(1);return false;" data-fit-aside autocomplete="off"> <form data-grid-search onsubmit="grid.refresh(1);return false;" data-fit-aside autocomplete="off">
<div data-ax-tbl> <div data-ax-tbl>
<div data-ax-tr> <div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>작성 기간 검색</div>
<div data-ax-td-wrap>
<input class="form-control" data-chained-datepicker="[name='enddate']" name="startdate" data-toggle="datepicker" value="">
</div>
<div data-ax-td-wrap>
<input class="form-control" name="enddate" data-toggle="datepicker" value="">
</div>
</div>
<div data-ax-td> <div data-ax-td>
<div data-ax-td-label>검색어 입력</div> <div data-ax-td-label>검색어 입력</div>
<div data-ax-td-wrap> <div data-ax-td-wrap>
<select class="form-control form-control-inline" name="sc">
<option value="post_title">질문 제목</option>
<option value="qna_name">작성자</option>
<option value="qna_phone">연락처</option>
<option value="qna_email">이메일</option>
<select class="form-control form-control-inline" name="scol">
<option value="title" <?=$scol=='title'?'selected':''?>>제목</option>
<option value="nickname" <?=$scol=='nickname'?'selected':''?>>작성자</option>
</select> </select>
</div> </div>
</div> </div>
<div data-ax-td> <div data-ax-td>
<div data-ax-td-wrap> <div data-ax-td-wrap>
<input class="form-control" name="st" value="">
</div>
<div data-ax-td-wrap>
<button class="btn btn-default btn-sm"><i class="fal fa-search"></i> 필터적용</button>
<input class="form-control" name="stxt" value="<?=$stxt?>">
</div> </div>
</div>
<div data-ax-td class="right">
<div data-ax-td-wrap> <div data-ax-td-wrap>
<button type="button" class="btn btn-default btn-sm" data-button="qna-category"><i class="fal fa-sitemap"></i> Q&amp;A 유형 관리</button>
<button class="btn btn-default btn-sm"><i class="fal fa-search"></i> 검색</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
<div class="ax-button-gorup" data-fit-aside>
<div class="H10"></div>
</div>
<div class="container">
<div class="ax-button-group">
<div class="left">
<h2></h2>
</div>
</div>
<div class="grid">
<table>
<thead>
<div class="grid">
<table>
<thead>
<tr>
<th class="W20 text-center"><label class="w-check margin-auto"><input type="checkbox" data-checkbox="post" data-checkbox-all="true"><span class="empty"></span></label></th>
<th class="W60">#</th>
<?php if($use_category) :?>
<th class="W120">카테고리</th>
<?php endif;?>
<th>제목</th>
<th class="W120">작성자</th>
<th class="W120">작성일</th>
<th class="W80">조회수</th>
<th class="W60">모바일</th>
<th class="W100">작성 IP</th>
</tr>
</thead>
<tbody>
<?php foreach($list['list'] as $row):?>
<tr> <tr>
<th><input type="checkbox" data-checkbox="post" data-checkbox-all="true"></th>
<th>#</th>
<th class="col-xs-6">제목</th>
<th>작성자</th>
<th>작성일</th>
<th>조회수</th>
<?php if($board['brd_use_assign'] == 'Y'):?>
<th>승인상태</th>
<td class="text-center">
<label class="w-check margin-auto"><input type="checkbox" data-checkbox="post" name="post_idx[]" value="<?=$row['post_idx']?>"><span class="empty"></span></label>
</td>
<td class="text-right"><?=number_format($row['nums'])?></td>
<?php if($use_category) :?>
<td><?=$row['post_category']?></td>
<?php endif;?> <?php endif;?>
</tr>
</thead>
<tbody>
<?php foreach($list['list'] as $row):?>
<tr>
<td class="text-center"><input type="checkbox" data-checkbox="post" name="post_idx[]" value="<?=$row['post_idx']?>"></td>
<td class="text-center"><?=number_format($row['nums'])?></td>
<td>
<?php if(strlen($row['post_reply']) >0) :?>
<span style="display:inline-block;width:<?=((strlen($row['post_reply'])-1) * 16)?>px"></span>
<img src="<?=base_url('assets/images/common/icon_reply.gif')?>">
<?php endif;?>
<a href="<?=base_url("admin/board/read/{$board['brd_key']}/{$row['post_idx']}/?").http_build_query($this->input->get()) ?>"><?=$row['post_title']?></a>
<?php if($row['is_new']) :?><label class="label label-warning ML10">NEW</label><?php endif;?>
<?php if($row['is_hot']) :?><label class="label label-danger ML10">HIT</label><?php endif;?>
<?php if($row['post_count_comment']>0) :?><small>(<?=$row['post_count_comment']?>)</small><?php endif;?>
<?php if($row['is_secret']) :?><i class="fal fa-lock"></i><?php endif;?>
</td>
<td class="text-center"><?=$row['mem_nickname']?></td>
<td class="text-center"><?=$row['post_regtime']?></td>
<td class="text-center"><?=number_format($row['post_hit'])?></td>
<?php if($board['brd_use_assign'] == 'Y'):?>
<td class="text-center">
<?php if($row['post_assign'] == 'Y'):?>
<label class="label label-success">승인</label>
<?php else :?>
<label class="label label-default">미승인</label>
<?php endif;?>
</td>
<td>
<?php if(strlen($row['post_reply']) >0) :?>
<span style="display:inline-block;width:<?=((strlen($row['post_reply'])-1) * 16)?>px"></span>
<img src="<?=base_url('assets/images/common/icon_reply.gif')?>">
<?php endif;?> <?php endif;?>
</tr>
<?php endforeach;?>
<?php if(count($list['list']) <= 0) :?>
<tr>
<td colspan="10" class="empty">검색된 글이 없습니다.</td>
</tr>
<?php endif;?>
</tbody>
</table>
</div>
<div class="MT10">
<div class="pull-right">
</div>
<div class="clearfix"></div>
</div>
<div class="MT10">
<a href="<?=base_url("admin/board/read/{$board['brd_key']}/{$row['post_idx']}/?").http_build_query($this->input->get()) ?>"><?=$row['post_title']?></a>
<?php if($row['is_new']) :?><label class="label label-warning ML10">NEW</label><?php endif;?>
<?php if($row['is_hot']) :?><label class="label label-danger ML10">HIT</label><?php endif;?>
<?php if($row['post_count_comment']>0) :?><small>(<?=$row['post_count_comment']?>)</small><?php endif;?>
<?php if($row['is_secret']) :?><i class="fal fa-lock"></i><?php endif;?>
</td>
<td class="text-center"><?=$row['post_nickname']?></td>
<td class="text-center"><?=$row['post_datetime']?></td>
<td class="text-right"><?=number_format($row['post_hit'])?></td>
<td class="text-center"><?=$row['post_mobile']?></td>
<td class="text-center"><?=long2ip((int)$row['post_ip'])?></td>
</tr>
<?php endforeach;?>
<?php if(count($list['list']) <= 0) :?>
<tr>
<td colspan="10" class="empty">검색된 글이 없습니다.</td>
</tr>
<?php endif;?>
</tbody>
</table>
</div>
<div class="ax-button-group ax-button-group-bottom">
<div class="left">
<button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 선택 삭제</button> <button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 선택 삭제</button>
<div class="pull-right">
<a class="btn btn-primary" href="<?=base_url("admin/board/write/{$board['brd_key']}")?>"><i class="fal fa-pencil"></i> 작성</a>
</div>
<div class="clearfix"></div>
</div>
<div class="right">
<a class="btn btn-primary" href="<?=base_url("admin/board/write/{$board['brd_key']}")?>"><i class="fal fa-pencil"></i> 작성</a>
</div> </div>
</div> </div>

63
wheeparam/views/themes/admin/board/read.php

@ -14,17 +14,32 @@
<div data-ax-tr> <div data-ax-tr>
<div data-ax-td> <div data-ax-td>
<div data-ax-td-label>작성자</div> <div data-ax-td-label>작성자</div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['mem_nickname']?></p></div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['post_nickname']?></p></div>
</div> </div>
<div data-ax-td> <div data-ax-td>
<div data-ax-td-label>작성시간</div> <div data-ax-td-label>작성시간</div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['post_regtime']?></p></div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['reg_datetime']?></p></div>
</div>
<div data-ax-td>
<div data-ax-td-label>최종수정</div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['upd_datetime']?></p></div>
</div> </div>
<div data-ax-td> <div data-ax-td>
<div data-ax-td-label>조회수</div> <div data-ax-td-label>조회수</div>
<div data-ax-td-wrap><p class="form-control-static"><?=number_format($view['post_hit'])?></p></div> <div data-ax-td-wrap><p class="form-control-static"><?=number_format($view['post_hit'])?></p></div>
</div> </div>
</div> </div>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>작성IP</div>
<div data-ax-td-wrap><p class="form-control-static"><?=long2ip((int)$view['post_ip'])?></p></div>
</div>
<div data-ax-td>
<div data-ax-td-label>모바일</div>
<div data-ax-td-wrap><p class="form-control-static"><?=$view['post_mobile']?></p></div>
</div>
</div>
<div data-ax-tr> <div data-ax-tr>
<div data-ax-td class="width-100"> <div data-ax-td class="width-100">
@ -51,11 +66,9 @@
<div data-ax-td class="width-100"> <div data-ax-td class="width-100">
<div data-ax-td-label>첨부파일</div> <div data-ax-td-label>첨부파일</div>
<div data-ax-td-wrap> <div data-ax-td-wrap>
<ul class="list-group" style="margin-bottom:0px;">
<?php foreach($view['file'] as $f) :?>
<li class="list-group-item"><a href="<?=$f['link']?>"><i class="fal fa-download"></i> <?=$f['att_origin']?> (<?=format_size($f['att_filesize'])?>)</a></li>
<?php endforeach;?>
</ul>
<?php foreach($view['file'] as $f) :?>
<a class="btn btn-xs btn-default" href="<?=$f['link']?>"><i class="fal fa-download"></i> <?=$f['att_origin']?> (<?=format_size($f['att_filesize'])?>)</a>
<?php endforeach;?>
</div> </div>
</div> </div>
</div> </div>
@ -81,19 +94,12 @@
</div> </div>
</div> </div>
<div class="text-center MT10"> <div class="text-center MT10">
<a href="<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>" class="btn btn-default">목록</a>
<a href="<?=base_url("admin/board/posts/{$board['brd_key']}/?".http_build_query($this->input->get()))?>" class="btn btn-default MR5">목록</a>
<?php if( $board['brd_use_reply'] == 'Y' ):?> <?php if( $board['brd_use_reply'] == 'Y' ):?>
<a href="<?=base_url("admin/board/write/{$board['brd_key']}/?post_parent={$view['post_idx']}")?>" class="btn btn-default">답글</a>
<?php endif;?>
<a href="<?=base_url("admin/board/write/{$board['brd_key']}/{$view['post_idx']}")?>" class="btn btn-default"><i class="fal fa-pencil"></i> 수정</a>
<button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 선택 삭제</button>
<?php if( $board['brd_use_assign'] == 'Y' ):?>
<?php if($view['post_assign'] == 'Y') :?>
<button type="button" class="btn btn-default" data-button="btn-assign" data-value="N"><i class="fal fa-ban"></i> 승인 취소</button>
<?php else :?>
<button type="button" class="btn btn-default" data-button="btn-assign" data-value="Y"><i class="fal fa-check"></i> 승인 처리</button>
<?php endif;?>
<a href="<?=base_url("admin/board/write/{$board['brd_key']}/?post_parent={$view['post_idx']}")?>" class="btn btn-default MR5">답글</a>
<?php endif;?> <?php endif;?>
<a href="<?=base_url("admin/board/write/{$board['brd_key']}/{$view['post_idx']}")?>" class="btn btn-default MR5"><i class="fal fa-pencil"></i> 수정</a>
<button type="button" class="btn btn-danger" data-button="btn-remove-posts"><i class="fal fa-trash"></i> 삭제</button>
</div> </div>
</div> </div>
@ -116,26 +122,5 @@
} }
}) })
}); });
$('[data-button="btn-assign"]').click(function(e){
var value = $(this).data('value');
var message = "현재 글을 승인 처리하시겠습니까?";
if( value == 'N' ) message = '현재 글을 승인 취소하시겠습니까?';
if(! confirm(message)) return;
$.ajax({
url : '/ajax/board/assign',
type:'POST',
data : {
post_idx : '<?=$view['post_idx']?>',
post_assign : value
},
success:function(){
location.reload();
}
})
});
}); });
</script> </script>

125
wheeparam/views/themes/admin/board/write.php

@ -1,70 +1,95 @@
<div class="container">
<div class="ax-button-group">
<div class="left">
<h2><?=$board['brd_title']?> 글쓰기</h2>
</div>
<div class="ax-button-group">
<div class="left">
<h2><?=$board['brd_title']?> 글쓰기</h2>
</div> </div>
</div>
<?=$form_open?>
<div class="form-flex">
<?=$form_open?>
<?=validation_errors('<p class="alert alert-danger">')?>
<div class="form-group">
<label class="control-label">제목</label>
<div class="controls">
<?=validation_errors('<p class="alert alert-danger">')?>
<div data-ax-tbl>
<?php if($use_category) :?>
<div data-ax-tr>
<div data-ax-td>
<div data-ax-td-label>카테고리</div>
<div data-ax-td-wrap>
<select class="form-control" name="post_category">
<?php foreach($board['category'] as $cate):?>
<option value="<?=$cate?>" <?=$cate==element('post_category', $view)?'selected':''?>><?=$cate?></option>
<?php endforeach;?>
</select>
</div>
</div>
</div>
<?php endif;?>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>제목</div>
<div data-ax-td-wrap>
<input class="form-control" id="w_title" name="post_title" value="<?=element('post_title', $view)?>" required> <input class="form-control" id="w_title" name="post_title" value="<?=element('post_title', $view)?>" required>
</div> </div>
</div> </div>
<?php if(! defined('IS_REPLY_WRITE_FORM') && $use_notice) :?>
<div class="form-group">
<label class="control-label">공지</label>
<div class="controls">
<label class="w-check">
<input type="checkbox" value="Y" name="post_notice" <?=element('post_notice',$view,'N')=='Y'?'checked':''?>><span>공지로 등록</span>
</label>
</div>
</div>
<?php if(! defined('IS_REPLY_WRITE_FORM') && $use_notice) :?>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>공지</div>
<div data-ax-td-wrap>
<label class="w-check">
<input type="checkbox" value="Y" name="post_notice" <?=element('post_notice',$view,'N')=='Y'?'checked':''?>><span>공지로 등록</span>
</label>
</div> </div>
<?php endif;?>
<div class="form-group">
<label class="control-label">내용</label>
<div class="controls">
</div>
</div>
<?php endif;?>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>내용</div>
<div data-ax-td-wrap>
<?=get_editor('post_content', element('post_content', $view), '');?> <?=get_editor('post_content', element('post_content', $view), '');?>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">태그</label>
<div class="controls">
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>태그</div>
<div data-ax-td-wrap>
<input class="form-control" id="w_keywords" name="post_keywords" value="<?=element('post_keywords', $view)?>"> <input class="form-control" id="w_keywords" name="post_keywords" value="<?=element('post_keywords', $view)?>">
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label">파일첨부</label>
<div class="controls">
</div>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>파일첨부</div>
<div data-ax-td-wrap>
[widget name="board_file_upload"] [widget name="board_file_upload"]
</div> </div>
</div> </div>
<?php if( $post_idx && count(element('file', $view, array())) > 0) :?>
<div class="form-group">
<label class="control-label">첨부된 파일</label>
<div class="controls">
<?php foreach($view['file'] as $attach) : ?>
<div class="col-sm-3">
<?php $img_url = ($attach['att_is_image'] == 'Y') ? base_url($attach['att_filepath']) : base_url('assets/images/common/attach.png'); ?>
<figure>
<img class="img-responsive" src="<?=$img_url?>" <?=($attach['att_is_image'] != 'Y')?'style="max-width:64px;margin:auto"':''?>>
<figcaption><?=$attach['att_origin']?></figcaption>
</figure>
<div class="checkbox">
<label><input type="checkbox" name="del_file[]" value="<?=$attach['att_idx']?>"> 파일 삭제</label>
</div>
</div>
<?php if( $post_idx && count(element('file', $view, array())) > 0) :?>
<div data-ax-tr>
<div data-ax-td class="width-100">
<div data-ax-td-label>첨부된 파일</div>
<div data-ax-td-wrap>
<?php foreach($view['file'] as $attach) : ?>
<div class="col-sm-3">
<?php $img_url = ($attach['att_is_image'] == 'Y') ? base_url($attach['att_filepath']) : base_url('assets/images/common/attach.png'); ?>
<figure>
<img class="img-responsive" src="<?=$img_url?>" <?=($attach['att_is_image'] != 'Y')?'style="max-width:64px;margin:auto"':''?>>
<figcaption><?=$attach['att_origin']?></figcaption>
</figure>
<div class="checkbox">
<label><input type="checkbox" name="del_file[]" value="<?=$attach['att_idx']?>"> 파일 삭제</label>
</div> </div>
<?php endforeach;?>
</div>
</div>
<?php endforeach;?>
</div> </div>
<?php endif;?>
<div class="text-center MT10">
<button class="btn btn-primary">작성하기</button>
</div> </div>
<?=$form_close?>
</div> </div>
<?php endif;?>
</div>
<div class="text-center MT15">
<button class="btn btn-primary">작성하기</button>
</div> </div>
<?=$form_close?>

1
wheeparam/views/themes/admin/members/login.php

@ -1,5 +1,6 @@
<style> <style>
html,body,.frame-content {height:100%;} html,body,.frame-content {height:100%;}
.frame-content {padding:0;}
</style> </style>
<article id="login-form"> <article id="login-form">
<div class="login-wrap"> <div class="login-wrap">

Loading…
Cancel
Save