diff --git a/bbs/write.php b/bbs/write.php
index ad0ce86c2..8ca1120c7 100644
--- a/bbs/write.php
+++ b/bbs/write.php
@@ -304,6 +304,7 @@ $secret_checked = "";
if ($w == '') {
$password_required = 'required';
+ $file = array('count'=>$file_count);
} else if ($w == 'u') {
$password_required = '';
@@ -348,6 +349,7 @@ if ($w == '') {
for ($i=1; $i<=G5_LINK_COUNT; $i++) {
$write['wr_link'.$i] = get_text($write['wr_link'.$i]);
}
+ $file = array('count'=>$file_count);
}
set_session('ss_bo_table', $_REQUEST['bo_table']);
diff --git a/bbs/write_update.php b/bbs/write_update.php
index 7b57aa085..878616c3e 100644
--- a/bbs/write_update.php
+++ b/bbs/write_update.php
@@ -410,6 +410,24 @@ if (!$group['gr_use_access'] && $board['bo_read_level'] < 2 && !$secret) {
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);
@chmod(G5_DATA_PATH.'/file/'.$bo_table, G5_DIR_PERMISSION);
diff --git a/mobile/skin/board/basic/write.skin.php b/mobile/skin/board/basic/write.skin.php
index 8d9076d2f..28c804213 100644
--- a/mobile/skin/board/basic/write.skin.php
+++ b/mobile/skin/board/basic/write.skin.php
@@ -129,7 +129,7 @@ add_stylesheet('', 0
-
+
| 파일 # |
diff --git a/mobile/skin/board/gallery/write.skin.php b/mobile/skin/board/gallery/write.skin.php
index 4aec1baaf..4ff2536ee 100644
--- a/mobile/skin/board/gallery/write.skin.php
+++ b/mobile/skin/board/gallery/write.skin.php
@@ -128,7 +128,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/skin/board/basic/write.skin.php b/skin/board/basic/write.skin.php
index 34d190e7e..bf5ab682f 100644
--- a/skin/board/basic/write.skin.php
+++ b/skin/board/basic/write.skin.php
@@ -146,7 +146,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/skin/board/gallery/write.skin.php b/skin/board/gallery/write.skin.php
index e8bcf7bd6..6f49a1433 100644
--- a/skin/board/gallery/write.skin.php
+++ b/skin/board/gallery/write.skin.php
@@ -146,7 +146,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/theme/basic/mobile/skin/board/basic/write.skin.php b/theme/basic/mobile/skin/board/basic/write.skin.php
index aa5f5b4ad..1226bd841 100644
--- a/theme/basic/mobile/skin/board/basic/write.skin.php
+++ b/theme/basic/mobile/skin/board/basic/write.skin.php
@@ -129,7 +129,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/theme/basic/mobile/skin/board/gallery/write.skin.php b/theme/basic/mobile/skin/board/gallery/write.skin.php
index 4aec1baaf..4ff2536ee 100644
--- a/theme/basic/mobile/skin/board/gallery/write.skin.php
+++ b/theme/basic/mobile/skin/board/gallery/write.skin.php
@@ -128,7 +128,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/theme/basic/skin/board/basic/write.skin.php b/theme/basic/skin/board/basic/write.skin.php
index 34d190e7e..bf5ab682f 100644
--- a/theme/basic/skin/board/basic/write.skin.php
+++ b/theme/basic/skin/board/basic/write.skin.php
@@ -146,7 +146,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
diff --git a/theme/basic/skin/board/gallery/write.skin.php b/theme/basic/skin/board/gallery/write.skin.php
index e8bcf7bd6..6f49a1433 100644
--- a/theme/basic/skin/board/gallery/write.skin.php
+++ b/theme/basic/skin/board/gallery/write.skin.php
@@ -146,7 +146,7 @@ add_stylesheet('', 0
|
-
+
| 파일 # |
|