Browse Source

휘파람보드 1.1.1

- 각 게시판의 스킨을 목록/글쓰기/글보기/댓글 부분으로 분리
master
장선근 6 years ago
parent
commit
1254b7b306
  1. 25
      wheeparam/application/controllers/Board.php
  2. 15
      wheeparam/application/controllers/admin/Board.php
  3. 2
      wheeparam/application/controllers/admin/Setting.php
  4. 10
      wheeparam/config/wheeparam.sql
  5. 0
      wheeparam/views/skins/board/comment/basic/c_list.php
  6. 0
      wheeparam/views/skins/board/comment/basic/c_modify.php
  7. 0
      wheeparam/views/skins/board/comment/basic/c_write.php
  8. 0
      wheeparam/views/skins/board/list/basic/list.php
  9. 0
      wheeparam/views/skins/board/view/basic/password.php
  10. 0
      wheeparam/views/skins/board/view/basic/view.php
  11. 0
      wheeparam/views/skins/board/write/basic/write.php
  12. 102
      wheeparam/views/themes/admin/board/form.php
  13. 4
      wheeparam/views/themes/admin/board/lists.php

25
wheeparam/application/controllers/Board.php

@ -95,7 +95,8 @@ class Board extends WB_Controller {
$this->site->meta_image = $this->data['view']['post_thumbnail']; // 이 페이지에서 표시할 대표이미지 $this->site->meta_image = $this->data['view']['post_thumbnail']; // 이 페이지에서 표시할 대표이미지
// 댓글 입력폼 // 댓글 입력폼
$write_skin_path = DIR_SKIN . "/board/" . $this->data['board']['brd_skin'] . "/comment_write";
$write_skin_path = DIR_SKIN . "/board/comment/" . $this->data['board']['brd_skin_c'] . "/c_write";
$comment_hidden = array("reurl"=>current_full_url(),"cmt_idx"=>"","cmt_parent"=>""); $comment_hidden = array("reurl"=>current_full_url(),"cmt_idx"=>"","cmt_parent"=>"");
$comment_action_url = base_url( "board/{$brd_key}/comment/{$post_idx}", SSL_VERFIY ? 'https':'http' ); $comment_action_url = base_url( "board/{$brd_key}/comment/{$post_idx}", SSL_VERFIY ? 'https':'http' );
$tmp['comment_view'] = array(); $tmp['comment_view'] = array();
@ -104,7 +105,7 @@ class Board extends WB_Controller {
$this->data['comment_write'] = $this->data['board']['brd_use_comment'] == 'Y' && $this->data['board']['auth']['comment'] ? $this->load->view($write_skin_path, $tmp, TRUE) : NULL; $this->data['comment_write'] = $this->data['board']['brd_use_comment'] == 'Y' && $this->data['board']['auth']['comment'] ? $this->load->view($write_skin_path, $tmp, TRUE) : NULL;
// 댓글 목록 // 댓글 목록
$list_skin_path = DIR_SKIN . "/board/" . $this->data['board']['brd_skin'] . "/comment_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') : ''; $mem_userid = ($this->member->is_login()) ? $this->member->info('userid') : '';
@ -129,6 +130,8 @@ class Board extends WB_Controller {
$this->data['comment_list'] = $this->data['board']['brd_use_comment'] == 'Y' ? $this->load->view($list_skin_path, $tmp2, TRUE) : NULL; $this->data['comment_list'] = $this->data['board']['brd_use_comment'] == 'Y' ? $this->load->view($list_skin_path, $tmp2, TRUE) : NULL;
$this->view = "view"; $this->view = "view";
$this->skin_type = "board/view";
$this->skin = $this->data['board']['brd_skin_w'];
} }
/** /**
@ -147,6 +150,9 @@ class Board extends WB_Controller {
// 레이아웃 & 뷰파일 설정 // 레이아웃 & 뷰파일 설정
$this->view = "list"; $this->view = "list";
$this->skin_type = "board/list";
$this->skin = $this->data['board']['brd_skin_l'];
} }
/** /**
@ -380,7 +386,9 @@ class Board extends WB_Controller {
$this->data['is_reply'] = FALSE; $this->data['is_reply'] = FALSE;
$this->theme_file = "popup"; $this->theme_file = "popup";
$this->view = "comment_write";
$this->skin_type = "board/comment";
$this->skin = $this->data['board']['brd_skin_c'];
$this->view = "c_write";
} }
/** /**
@ -476,6 +484,8 @@ class Board extends WB_Controller {
$this->data['form_close']= form_close(); $this->data['form_close']= form_close();
$this->view = "password"; $this->view = "password";
$this->skin_type = "board/view";
$this->skin = $this->data['board']['brd_skin_v'];
} }
else else
{ {
@ -859,6 +869,9 @@ class Board extends WB_Controller {
// 레이아웃 & 뷰파일 설정 // 레이아웃 & 뷰파일 설정
$this->view = "write"; $this->view = "write";
$this->skin_type = "board/write";
$this->skin = $this->data['board']['brd_skin_w'];
} }
} }
@ -1055,7 +1068,10 @@ class Board extends WB_Controller {
$this->data['use_attach'] = ($this->data['board']['brd_use_attach'] == 'Y' && $this->data['board']['auth']['upload']); $this->data['use_attach'] = ($this->data['board']['brd_use_attach'] == 'Y' && $this->data['board']['auth']['upload']);
// 접속한 기기에 따라 설정을 바꾼다. // 접속한 기기에 따라 설정을 바꾼다.
$this->data['board']['brd_skin'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_skin_m'] : $this->data['board']['brd_skin'];
$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_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_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']; $this->data['board']['brd_fixed_num'] = ($this->site->viewmode == DEVICE_MOBILE) ? $this->data['board']['brd_fixed_num_m'] : $this->data['board']['brd_fixed_num'];
@ -1117,7 +1133,6 @@ class Board extends WB_Controller {
// 레이아웃 정의 // 레이아웃 정의
$this->theme = $this->site->get_layout(); $this->theme = $this->site->get_layout();
$this->skin_type = "board"; $this->skin_type = "board";
$this->skin = $this->data['board']['brd_skin'];
$this->active = "/board/".$this->data['board']['brd_key']; $this->active = "/board/".$this->data['board']['brd_key'];
} }

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

@ -39,8 +39,14 @@ class Board extends WB_Controller
$data['brd_title_m'] = $this->input->post('brd_title_m', TRUE); $data['brd_title_m'] = $this->input->post('brd_title_m', 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'] = $this->input->post('brd_skin', TRUE);
$data['brd_skin_m'] = $this->input->post('brd_skin_m', TRUE);
$data['brd_skin_l'] = $this->input->post('brd_skin_l', TRUE);
$data['brd_skin_l_m'] = $this->input->post('brd_skin_l_m', TRUE);
$data['brd_skin_w'] = $this->input->post('brd_skin_w', TRUE);
$data['brd_skin_w_m'] = $this->input->post('brd_skin_w_m', TRUE);
$data['brd_skin_v'] = $this->input->post('brd_skin_v', 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_m'] = $this->input->post('brd_skin_c_m', TRUE);
$data['brd_search'] = $this->input->post('brd_search', TRUE, "N"); $data['brd_search'] = $this->input->post('brd_search', TRUE, "N");
$data['brd_sort'] = $this->input->post('brd_sort', TRUE); $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");
@ -110,7 +116,10 @@ class Board extends WB_Controller
{ {
$this->data['view'] = (empty($brd_key)) ? array() : $this->board_model->get_board($brd_key, TRUE); $this->data['view'] = (empty($brd_key)) ? array() : $this->board_model->get_board($brd_key, TRUE);
$this->data['brd_key'] = $brd_key; $this->data['brd_key'] = $brd_key;
$this->data['skin_list'] = get_skin_list('board');
$this->data['skin_list_l'] = get_skin_list('board/list');
$this->data['skin_list_w'] = get_skin_list('board/write');
$this->data['skin_list_v'] = get_skin_list('board/view');
$this->data['skin_list_c'] = get_skin_list('board/comment');
// 메타태그 설정 // 메타태그 설정
$this->site->meta_title = "게시판 관리"; $this->site->meta_title = "게시판 관리";

2
wheeparam/application/controllers/admin/Setting.php

@ -108,7 +108,7 @@ class Setting extends WB_Controller {
$this->data['active'] = $param; $this->data['active'] = $param;
// 탭리스트 // 탭리스트
$query = $this->db->query('SELECT SUBSTRING_INDEX(loc_key,"/",1) AS `keys` FROM wb_localize GROUP BY SUBSTRING_INDEX(loc_key,"/",1)');
$query = $this->db->query('SELECT SUBSTRING_INDEX(loc_key,"/",1) AS `keys` FROM wbk_localize GROUP BY SUBSTRING_INDEX(loc_key,"/",1)');
$this->data['tab_list'] = $query->result_array(); $this->data['tab_list'] = $query->result_array();
// 메타태그 설정 // 메타태그 설정

10
wheeparam/config/wheeparam.sql

@ -51,8 +51,14 @@ 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_title_m` varchar(20) NOT NULL DEFAULT '',
`brd_skin` varchar(100) NOT NULL DEFAULT '',
`brd_skin_m` varchar(100) NOT NULL DEFAULT '',
`brd_skin_l` 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_m` varchar(100) NOT NULL DEFAULT '',
`brd_skin_w` 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_m` varchar(100) NOT NULL DEFAULT '',
`brd_sort` int(10) unsigned NOT NULL DEFAULT '0', `brd_sort` int(10) unsigned NOT NULL DEFAULT '0',
`brd_search` enum('Y','N') NOT NULL DEFAULT 'Y', `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',

0
wheeparam/views/skins/board/basic/comment_list.php → wheeparam/views/skins/board/comment/basic/c_list.php

0
wheeparam/views/skins/board/basic/comment_modify.php → wheeparam/views/skins/board/comment/basic/c_modify.php

0
wheeparam/views/skins/board/basic/comment_write.php → wheeparam/views/skins/board/comment/basic/c_write.php

0
wheeparam/views/skins/board/basic/list.php → wheeparam/views/skins/board/list/basic/list.php

0
wheeparam/views/skins/board/basic/password.php → wheeparam/views/skins/board/view/basic/password.php

0
wheeparam/views/skins/board/basic/view.php → wheeparam/views/skins/board/view/basic/view.php

0
wheeparam/views/skins/board/basic/write.php → wheeparam/views/skins/board/write/basic/write.php

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

@ -56,43 +56,109 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label">게시판 스킨</label>
<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"> <div class="controls">
<select class="form-control" name="brd_skin">
<?php foreach($skin_list as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin',$view)?'selected':''?>><?=$skin?></option>
<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">
<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;?> <?php endforeach;?>
</select> </select>
</div> </div>
<label class="control-label">게시판 스킨 (모바일)</label>
<label class="control-label">목록 스킨 (모바일)</label>
<div class="controls"> <div class="controls">
<select class="form-control" name="brd_skin_m">
<?php foreach($skin_list as $skin) : ?>
<option value="<?=$skin?>" <?=$skin==element('brd_skin_m',$view)?'selected':''?>><?=$skin?></option>
<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;?> <?php endforeach;?>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label">검색 설정</label>
<label class="control-label">글쓰기 스킨</label>
<div class="controls"> <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>
<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>
<label class="control-label">노출 순서</label>
<label class="control-label">글쓰기 스킨 (모바일)</label>
<div class="controls"> <div class="controls">
<input type="number" class="form-control" name="brd_sort" value="<?=element('brd_sort', $view, 0)?>">
<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 class="form-group"> <div class="form-group">
<label class="control-label">카테고리 기능 사용</label>
<label class="control-label"> 보기 스킨</label>
<div class="controls"> <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>
<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>

4
wheeparam/views/themes/admin/board/lists.php

@ -9,7 +9,7 @@
<th>번호</th> <th>번호</th>
<th>고유키</th> <th>고유키</th>
<th>게시판 이름</th> <th>게시판 이름</th>
<th>스킨</th>
<th>목록 스킨</th>
<th>페이지당 </th> <th>페이지당 </th>
<th>등록된 </th> <th>등록된 </th>
<th>카테고리</th> <th>카테고리</th>
@ -28,7 +28,7 @@
<td class="text-center"><?=$brd['nums']?></td> <td class="text-center"><?=$brd['nums']?></td>
<td class="text-center"><?=$brd['brd_key']?></td> <td class="text-center"><?=$brd['brd_key']?></td>
<td class="text-center"><?=$brd['brd_title']?><a class="btn btn-default btn-sm ML10" data-toggle="tooltip" title="게시판 바로가기" target="_blank" href="<?=base_url('board/'.$brd['brd_key'])?>"><i class="far fa-external-link-square"></i></a></td> <td class="text-center"><?=$brd['brd_title']?><a class="btn btn-default btn-sm ML10" data-toggle="tooltip" title="게시판 바로가기" target="_blank" href="<?=base_url('board/'.$brd['brd_key'])?>"><i class="far fa-external-link-square"></i></a></td>
<td class="text-center"><?=$brd['brd_skin']?></td>
<td class="text-center"><?=$brd['brd_skin_l']?></td>
<td class="text-center"><?=$brd['brd_page_limit']=='Y'?$brd['brd_page_rows']:'미사용'?></td> <td class="text-center"><?=$brd['brd_page_limit']=='Y'?$brd['brd_page_rows']:'미사용'?></td>
<td class="text-center"><?=number_format($brd['brd_count_post'])?></td> <td class="text-center"><?=number_format($brd['brd_count_post'])?></td>
<td class="text-center"><?=$brd['brd_use_category']=='Y'?'사용':'미사용'?></td> <td class="text-center"><?=$brd['brd_use_category']=='Y'?'사용':'미사용'?></td>

Loading…
Cancel
Save