꽃

게시물에서 파일첨부 음악파일을 올렸을경우 .



- 음악 파일을 파일첨부로 올렸을 경우 ,

view 화면으로 들어가면 그 음악파일이 재생되게

할 수 있나요?

댓글 2개

설치경로/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>";

수정하지 않고 맨 아래 이렇게 추가해 주시는 방법도 있습니다.
유용한 응용정보입니다

pdf파일 첨부시 include(???) 하고 싶습니다....
간단한 조언 부탁 드립니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
09-10-09 조회 1,269
09-10-08 조회 892
09-10-08 조회 1,072
09-10-08 조회 1,092
09-10-08 조회 1,606
09-10-08 조회 1,180
09-10-08 조회 1,632
09-10-08 조회 1,682
09-10-08 조회 1,031
09-10-08 조회 1,773
09-10-08 조회 1,056
09-10-08 조회 2,459
09-10-08 조회 1,771
09-10-08 조회 928
09-10-08 조회 1,026
09-10-08 조회 832
09-10-08 조회 1,024
09-10-08 조회 1,007
09-10-08 조회 1,017
09-10-08 조회 1,300