분류 사용할 때 분류선택 여부 체크 추가

This commit is contained in:
chicpro
2015-12-14 11:06:14 +09:00
parent fb3f11a93f
commit 35c2bac898
2 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,17 @@ $g5['title'] = '게시글 저장';
$msg = array();
if($board['bo_use_category']) {
$ca_name = trim($_POST['ca_name']);
if(!$ca_name) {
$msg[] = '<strong>분류</strong>를 선택하세요.';
} else {
$categories = array_map('trim', explode("|", $board['bo_category_list'].($is_admin ? '|공지' : '')));
if(!empty($categories) && !in_array($ca_name, $categories))
$msg[] = '분류를 올바르게 입력하세요.';
}
}
$wr_subject = '';
if (isset($_POST['wr_subject'])) {
$wr_subject = substr(trim($_POST['wr_subject']),0,255);

View File

@ -796,7 +796,7 @@ function get_category_option($bo_table='', $ca_name='')
{
global $g5, $board, $is_admin;
$categories = explode("|", $board['bo_category_list'].($is_admin?"|공지":"")); // 구분자가 , 로 되어 있음
$categories = explode("|", $board['bo_category_list'].($is_admin?"|공지":"")); // 구분자가 | 로 되어 있음
$str = "";
for ($i=0; $i<count($categories); $i++) {
$category = trim($categories[$i]);