참고만 하셔요.
<?php for ($i=0; $is_file && $i<$file_count; $i++) { ?>
<div class="bo_w_flie write_div">
<div class="file_wr write_div" title="mp3/4,pdf/ppt/xls, mediaList_1 text-file upload">
<label for="bf_file_<?php echo $i+1 ?>" class="lb_icon"><i id="fa_<?php echo $i+1 ?>" class="fa fa-folder-open" aria-hidden="true"></i><span class="sound_only"> 파일 #<?php echo $i+1 ?></span></label>
<?php if ($file[$i]['file']) echo "<span style=cursor:pointer onclick=copyMode('".$file[$i]['path'].'/'.$file[$i]['file']."','파일주소가')>";?>
<label style="margin-left:40px;cursor:pointer" title="<?php if($file[$i]['file']){echo $file[$i]['path']."/".$file[$i]['file'].' 클릭 복사';}?>">
<?php
$file = get_file($bo_table, $wr_id);
$image = urlencode($file[$i]['file']);
$image_path = G5_DATA_PATH.'/file/'.$bo_table;
$image_url = G5_DATA_URL.'/file/'.$bo_table;
if (preg_match("/\.(gif|jpg|jpeg|png|webp)$/i", $image)) {
$thumb = thumbnail($image, $image_path , $image_path , 38, 28, false, true);
$image_content = $image_url.'/'.$thumb;
} else {
$pattern = "#.+\.(?P<ftype>[a-z]{3})#i";
preg_match($pattern, $file[$i]['source'], $match);
if($match['ftype']){
$image_content = $board_skin_url.'/img/'.$match['ftype'].'.gif';
} else {
$image_content = $board_skin_url.'/img/noimage.png';
}
}
echo "<img class='img_preview".($i+1)."' style='width:38px;height:28px;opacity:.8' src='".$image_content."'>";
?></label><?php echo "</span>";?>
<input type="radio" class="radio<?php echo $i+1 ?>" id="radio_<?php echo $i+1 ?>" name="wr_6" value="<?php echo $i ?>" <?php if ($write['wr_6'] == $i&&$write['wr_6'] >= '0') echo "checked";if(!preg_match("/\.(gif|jpg|jpeg|png|webp)$/i", $image))echo 'disabled';?> title="select list view"> <label for="<?php echo $i ?>" title="list file_<?php echo $i+1 ?>" class="homepage"></label>
<!--input type="file" name="bf_file[]" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file "-->
<input type="button" value="file 찿기" id="ba_file_<?php echo $i+1 ?>" onclick="document.getElementById('bf_file_<?php echo $i+1 ?>').click()" title="Attachments <?php echo $i+1 ?> : Volume <?php echo $upload_max_filesize ?> Only the following can be uploaded" class="frm_file ">
<label for="<?php echo $i ?>" id="file-name_<?php echo $i+1 ?>" class="homepage">선택된 file 없음</label>
<input type="file" name="bf_file[]" style="display:none" id="bf_file_<?php echo $i+1 ?>" title="파일첨부 <?php echo $i+1 ?> : 용량 <?php echo $upload_max_filesize ?> 이하만 업로드 가능" class="frm_file ">
<script>
inputElement<?php echo $i+1 ?> = document.getElementById('bf_file_<?php echo $i+1 ?>');
labelElement<?php echo $i+1 ?> = document.getElementById('file-name_<?php echo $i+1 ?>');
inputElement<?php echo $i+1 ?>.onchange = function(event) {
var path = inputElement<?php echo $i+1 ?>.value;
labelElement<?php echo $i+1 ?>.innerHTML = path.split(/(\\|\/)/g).pop();
}
</script>
</div>
<?php if ($is_file_content) { ?>
<input type="text" name="bf_content[]" value="<?php echo ($w == 'u') ? $file[$i]['bf_content'] : ''; ?>" title="파일 설명을 입력해주세요." class="full_input frm_input" size="50" placeholder="파일 설명을 입력해주세요.">
<?php } ?>
<?php if($w == 'u' && $file[$i]['file']) { ?>
<span class="file_del">
<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 ?>"><a href="<?php echo $file[$i]['href']?>"><?php echo $file[$i]['source'].'('.$file[$i]['size'].')';?></a> 파일 삭제</label>
</span>
<?php } ?>
</div>
<?php } ?>