Merge branch 'g5'

This commit is contained in:
chicpro
2016-05-03 17:31:57 +09:00
10 changed files with 33 additions and 8 deletions

View File

@ -304,6 +304,7 @@ $secret_checked = "";
if ($w == '') { if ($w == '') {
$password_required = 'required'; $password_required = 'required';
$file = array('count'=>$file_count);
} else if ($w == 'u') { } else if ($w == 'u') {
$password_required = ''; $password_required = '';
@ -348,6 +349,7 @@ if ($w == '') {
for ($i=1; $i<=G5_LINK_COUNT; $i++) { for ($i=1; $i<=G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]); $write['wr_link'.$i] = get_text($write['wr_link'.$i]);
} }
$file = array('count'=>$file_count);
} }
set_session('ss_bo_table', $_REQUEST['bo_table']); set_session('ss_bo_table', $_REQUEST['bo_table']);

View File

@ -15,7 +15,12 @@ if($board['bo_use_category']) {
$categories = array_map('trim', explode("|", $board['bo_category_list'].($is_admin ? '|공지' : ''))); $categories = array_map('trim', explode("|", $board['bo_category_list'].($is_admin ? '|공지' : '')));
if(!empty($categories) && !in_array($ca_name, $categories)) if(!empty($categories) && !in_array($ca_name, $categories))
$msg[] = '분류를 올바르게 입력하세요.'; $msg[] = '분류를 올바르게 입력하세요.';
if(empty($categories))
$ca_name = '';
} }
} else {
$ca_name = '';
} }
$wr_subject = ''; $wr_subject = '';
@ -410,6 +415,24 @@ if (!$group['gr_use_access'] && $board['bo_read_level'] < 2 && !$secret) {
naver_syndi_ping($bo_table, $wr_id); naver_syndi_ping($bo_table, $wr_id);
} }
// 파일개수 체크
$file_count = 0;
$upload_count = count($_FILES['bf_file']['name']);
for ($i=0; $i<$upload_count; $i++) {
if($_FILES['bf_file']['name'][$i] && is_uploaded_file($_FILES['bf_file']['tmp_name'][$i]))
$file_count++;
}
if($w == 'u') {
$file = get_file($bo_table, $wr_id);
if($file_count && (int)$file['count'] > $board['bo_upload_count'])
alert('기존 파일을 삭제하신 후 첨부파일을 '.number_format($board['bo_upload_count']).'개 이하로 업로드 해주십시오.');
} else {
if($file_count > $board['bo_upload_count'])
alert('첨부파일을 '.number_format($board['bo_upload_count']).'개 이하로 업로드 해주십시오.');
}
// 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.) // 디렉토리가 없다면 생성합니다. (퍼미션도 변경하구요.)
@mkdir(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION); @mkdir(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION); @chmod(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION);

View File

@ -129,7 +129,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -128,7 +128,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -146,7 +146,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -146,7 +146,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -129,7 +129,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -128,7 +128,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -146,7 +146,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>

View File

@ -146,7 +146,7 @@ add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0
</tr> </tr>
<?php } ?> <?php } ?>
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?> <?php for ($i=0; $is_file && $i<$file['count']; $i++) { ?>
<tr> <tr>
<th scope="row">파일 #<?php echo $i+1 ?></th> <th scope="row">파일 #<?php echo $i+1 ?></th>
<td> <td>