게시물에서 파일첨부 음악파일을 올렸을경우 . 정보
게시물에서 파일첨부 음악파일을 올렸을경우 .본문
- 음악 파일을 파일첨부로 올렸을 경우 ,
view 화면으로 들어가면 그 음악파일이 재생되게
할 수 있나요?
댓글 전체

설치경로/lib/common.lib.php 파일 line 922 부근 보시면 파일 재생에 대한 소스 있습니다.
if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
else if (preg_match("/\.($config[cf_movie_extension])$/i", $file) || preg_match("/\.mp3$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(obj_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
마지막 else if 문에 || preg_match("/\.mp3$/i", $file) 이 조건 추가해서 mp3 파일 실행 테스트 했습니다.
파일의 확장자에 따라 다른 조건과 실행 방법을 추가해 주시면 됩니다.
else if (preg_match("/\.mp3$/i", $file))
return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
수정하지 않고 맨 아래 이렇게 추가해 주시는 방법도 있습니다.
if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";
else if (preg_match("/\.($config[cf_movie_extension])$/i", $file) || preg_match("/\.mp3$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(obj_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
마지막 else if 문에 || preg_match("/\.mp3$/i", $file) 이 조건 추가해서 mp3 파일 실행 테스트 했습니다.
파일의 확장자에 따라 다른 조건과 실행 방법을 추가해 주시면 됩니다.
else if (preg_match("/\.mp3$/i", $file))
return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
수정하지 않고 맨 아래 이렇게 추가해 주시는 방법도 있습니다.
유용한 응용정보입니다
pdf파일 첨부시 include(???) 하고 싶습니다....
간단한 조언 부탁 드립니다.
pdf파일 첨부시 include(???) 하고 싶습니다....
간단한 조언 부탁 드립니다.