게시판 파일첨부 인풋 동적추가하기
write.skin.php 를 간단하게 수정하시면 됩니다.
스킨 상단에
[code]
<SCRIPT LANGUAGE="JavaScript">
<!--
cnt=0;
function input_append(ff){
cnt++;
if (cnt < <?=$file_count?>)
{
app = document.getElementById("append");
app.innerHTML += "<input type='file' style='height:20px;' name='bf_file[]' title='파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능' class='frm_file inTxt' accept='image' ><br>";
} else {
alert ("<?=$file_count?>개까지 등록 가능합니다")
}
}
//-->
</SCRIPT>
[/code]
이 스크립트를 넣어주시고
파일첨부 부분인
[code]
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
<tr>
<th scope="row">파일 #<?php echo $i+1 ?></th>
<td>
<input type="file" name="bf_file[]" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input">
<?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo $file[$i]['bf_content']; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
<?php } ?>
<?php if($w == 'u' && $file[$i]['file']) { ?>
<input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
<?php } ?>
</td>
</tr>
<?php } ?>
[/code]
이 소스를 아래 소스로 교체하시면 됩니다.
[code]
<tr>
<th scope="row">파일첨부</th>
<td>
<div style="float:right;"><input type="button" value="+ 사진추가" onclick="input_append(this.form)"></div>
<div id="append" style="float:left;" ><input type='file' style="height:20px;" name='bf_file[]' title='파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능' class='frm_file inTxt'><br>
</div>
<div style="clear:both;"></div>
</td>
</tr>
[/code]
+ 만 있고 - 는 따로 넣지 않았습니다.
별도 디자인이 되어있는것도 아니라서 디자인은 하셔야 해요~
스킨 상단에
[code]
<SCRIPT LANGUAGE="JavaScript">
<!--
cnt=0;
function input_append(ff){
cnt++;
if (cnt < <?=$file_count?>)
{
app = document.getElementById("append");
app.innerHTML += "<input type='file' style='height:20px;' name='bf_file[]' title='파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능' class='frm_file inTxt' accept='image' ><br>";
} else {
alert ("<?=$file_count?>개까지 등록 가능합니다")
}
}
//-->
</SCRIPT>
[/code]
이 스크립트를 넣어주시고
파일첨부 부분인
[code]
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
<tr>
<th scope="row">파일 #<?php echo $i+1 ?></th>
<td>
<input type="file" name="bf_file[]" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file frm_input">
<?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo $file[$i]['bf_content']; ?>" title="파일 설명을 입력해주세요." class="frm_file frm_input" size="50">
<?php } ?>
<?php if($w == 'u' && $file[$i]['file']) { ?>
<input type="checkbox" id="bf_file_del<?php echo $i ?>" name="bf_file_del[<?php echo $i; ?>]" value="1"> <label for="bf_file_del<?php echo $i ?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')'; ?> 파일 삭제</label>
<?php } ?>
</td>
</tr>
<?php } ?>
[/code]
이 소스를 아래 소스로 교체하시면 됩니다.
[code]
<tr>
<th scope="row">파일첨부</th>
<td>
<div style="float:right;"><input type="button" value="+ 사진추가" onclick="input_append(this.form)"></div>
<div id="append" style="float:left;" ><input type='file' style="height:20px;" name='bf_file[]' title='파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능' class='frm_file inTxt'><br>
</div>
<div style="clear:both;"></div>
</td>
</tr>
[/code]
+ 만 있고 - 는 따로 넣지 않았습니다.
별도 디자인이 되어있는것도 아니라서 디자인은 하셔야 해요~
댓글 2개
11년 전
파일 첨부를 하고 나서 파일추가를 하면, 그 전에 첨부한 파일이 사라지네요.
그리고 수정시, 첨부된 파일명이 나타나지 않습니다..
그리고 수정시, 첨부된 파일명이 나타나지 않습니다..
11년 전
너무 날림으로했나보네요 ㅡ.,ㅡ;
조만간 수정해서 올리겠습니다~
조만간 수정해서 올리겠습니다~
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 174 | 11년 전 | 7209 | ||
| 173 |
바다웹호스팅
|
11년 전 | 7996 | |
| 172 | 11년 전 | 10912 | ||
| 171 |
사노라가노라
|
11년 전 | 6363 | |
| 170 | 11년 전 | 5253 | ||
| 169 | 11년 전 | 10164 | ||
| 168 | 11년 전 | 11546 | ||
| 167 | 11년 전 | 10261 | ||
| 166 | 11년 전 | 22155 | ||
| 165 | 11년 전 | 7517 | ||
| 164 |
|
11년 전 | 10042 | |
| 163 | 11년 전 | 9213 | ||
| 162 | 11년 전 | 3954 | ||
| 161 | 11년 전 | 5702 | ||
| 160 | 11년 전 | 8313 | ||
| 159 | 11년 전 | 9750 | ||
| 158 | 11년 전 | 3974 | ||
| 157 | 11년 전 | 5078 | ||
| 156 | 11년 전 | 8738 | ||
| 155 | 11년 전 | 6982 | ||
| 154 |
사노라가노라
|
11년 전 | 11851 | |
| 153 | 11년 전 | 6442 | ||
| 152 | 11년 전 | 5008 | ||
| 151 |
|
11년 전 | 5517 | |
| 150 | 11년 전 | 9679 | ||
| 149 | 11년 전 | 9430 | ||
| 148 | 11년 전 | 12098 | ||
| 147 | 11년 전 | 5825 | ||
| 146 | 11년 전 | 20350 | ||
| 145 | 11년 전 | 7445 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기