실제 업로드 모드 와 모달을 띄워서 본문에 삽입용도로 쓰거나 */ function getAttachFileList($parent_data,$mod,$type,$p_module) { 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=='photo') $sql='type=2'; else if($type=='audio') $sql='type=4'; else if($type=='video') $sql='type=5'; else $sql='(type=1 or type=6 or type=7)'; if ($mod=='view') $sql.=' and hidden=0'; $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,$p_module); else if($type=='photo') $html.=getAttachFile($U,$mod,$featured_img_uid,$p_module); else if($type=='audio') $html.=getAttachAudio($U,$mod,$featured_audio_uid,$p_module); else if($type=='video') $html.=getAttachVideo($U,$mod,$featured_video_uid,$p_module); else $html.=getAttachFile($U,$mod,$featured_img_uid,$p_module); } return $html; } // 첨부파일 리스트 추출 함수 (낱개) function getAttachFile($R,$mod,$featured_img_uid,$p_module) { global $g,$r,$TMPL ; include_once $GLOBALS['g']['path_core'].'function/sys.class.php'; $fileName=explode('.',$R['name']); $file_name=$fileName[0]; // 파일명만 분리 $sync_array = getArrayString($R['sync']); $m = $sync_array['data'][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'],'q'); // 미리보기 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.) $thumb_modal=getPreviewResize($R['src'],'n'); // 정보수정 모달용 사이즈 조정 (이미지 업로드시 썸네일을 만들 필요 없다.) $thumb_view=getPreviewResize($R['src'],'600x600'); // 보기 페이지 출력용 $insert_text=''; }else if($type=='file'){ $caption=$R['caption']?$R['caption']:$R['name']; $src=$R['host'].$R['folder'].'/'.$R['name']; $down_url=$g['s'].'/?r='.$r.'&m=mediaset&a=download&uid='.$R['uid']; } $html=''; $TMPL['m']=$p_module; $TMPL['is_featured']=$R['uid']==$featured_img_uid?'':' hidden'; $TMPL['is_hidden']=!$R['hidden']?' hidden':''; $TMPL['hidden_code']=$R['hidden']?'show':'hide'; $TMPL['hidden_str']=$R['hidden']?'보이기':'숨기기'; $TMPL['img_origin']=$img_origin; $TMPL['uid']=$R['uid']; $TMPL['img_origin_width']=$R['width']; $TMPL['img_origin_height']=$R['height']; $TMPL['type']=$type; $TMPL['type_modal']=$R['type']==2?'photo':'file'; $TMPL['file_name']=$file_name; $TMPL['fileext']=$R['ext']; $TMPL['caption']=$caption; $TMPL['showhide']=!$R['hidden']?'hide':'show'; $TMPL['insert_text']=$insert_text; $TMPL['thumb_modal']=$thumb_modal; $TMPL['thumb_list']=$thumb_list; $TMPL['thumb_view']=$thumb_view; $TMPL['name']=$R['name']; $TMPL['_name']=getStrCut($R['name'],25,'..'); $TMPL['size']=getSizeFormat($R['size'],2); $TMPL['uid']=$R['uid']; $TMPL['down_url']=$down_url; if ($mod=='upload') { if ($R['type']==2) $markup_file = 'edit_photo_row'; else $markup_file = 'edit_file_row'; } else { if ($R['type']==2) $markup_file = 'view_photo_row'; else $markup_file = 'view_file_row'; } $skin=new skin($markup_file); $html.=$skin->make(); return $html; } // 오디오파일 리스트 추출 함수 (낱개) function getAttachAudio($R,$mod,$featured_audio_uid) { global $g,$r; $fileName=explode('.',$R['name']); $file_name=$fileName[0]; // 파일명만 분리 $caption=$R['caption']?$R['caption']:$file_name; $html=''; $html.='
'.getSizeFormat($R['size'],2).'
'; if($mod=='upload'){ $html.='