실제 업로드 모드 와 모달을 띄워서 본문에 삽입용도로 쓰거나
*/
function getAttachFileList($parent_data,$mod,$type,$wysiwyg)
{
global $table;
$upload=$parent_data['upload'];
$featured_img_uid=$parent_data['featured_img'];// 대표이미지 uid
$featured_video_uid=$parent_data['featured_video'];// 대표비디오 uid
$featured_audio_uid=$parent_data['featured_audio'];// 대표오디오 uid
if($type=='file') $sql='type=1';
else if($type=='photo') $sql='type=2';
else if($type=='audio') $sql='type=4';
else if($type=='video') $sql='type=5';
else if($type=='doc') $sql='type=6';
else if($type=='zip') $sql='type=7';
else if($type=='pdf') $sql='type=7';
else $sql='type=1';
$attach = getArrayString($upload);
$uid_q='(';
foreach($attach['data'] as $uid)
{
$uid_q.='uid='.$uid.' or ';
}
$uid_q=substr($uid_q,0,-4).')';
$sql=$sql.' and '.$uid_q;
$RCD=getDbArray($table['s_upload'],$sql,'*','gid','asc','',1);
$html='';
while($R=db_fetch_array($RCD)){
$U=getUidData($table['s_upload'],$R['uid']);
if($type=='file') $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);
else if($type=='photo') $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);
else if($type=='audio') $html.=getAttachAudio($U,$mod,$featured_audio_uid,$wysiwyg);
else if($type=='video') $html.=getAttachVideo($U,$mod,$featured_video_uid,$wysiwyg);
else if($type=='doc') $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);
else if($type=='zip') $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);
else if($type=='pdf') $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);
else $html.=getAttachFile($U,$mod,$featured_img_uid,$wysiwyg);;
}
return $html;
}
// 첨부파일 리스트 추출 함수 (낱개)
function getAttachFile($R,$mod,$featured_img_uid,$wysiwyg)
{
global $g,$r;
$fileName=explode('.',$R['name']);
$file_name=$fileName[0]; // 파일명만 분리
if ($R['type']==2) {
$type='photo';
} elseif($R['type']==4) {
$type='audio';
} elseif($R['type']==5) {
$type='video';
} else {
$type='file';
}
if($type=='photo'){
$caption=$R['caption']?$R['caption']:$file_name;
$img_origin=$R['host'].'/'.$R['folder'].'/'.$R['tmpname'];
$thumb_list=getPreviewResize($R['src'],'s'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$thumb_modal=getPreviewResize($R['src'],'n'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.)
$insert_text='