[그누보드] 코멘트에 동영상, 플래쉬, 이미지 나오게 하는 방법
-
웹스터디 / 2012.03.15 13:36 / hit 4,631 추천 0
skin/board/게시판스킨/view_comment.skin.php 파일의 코멘트가 출력되는 부분을 아래의 코드로 바꾸세요.
그누보드 board/view_comment.skin.php 60줄
수정전
수정후
불당팩 cheditor/view_comment.skin.php
수정전
수정후
사용법
이미지,동영상,플래쉬 주소에 [] 로 닫기만하면 적용됩니다.
그누보드 board/view_comment.skin.php 60줄
수정전
echo $str;
수정후
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\".*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
불당팩 cheditor/view_comment.skin.php
수정전
echo resize_content($str, $board[bo_image_width] - 150);
수정후
$str = resize_content($str, $board[bo_image_width] - 150);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp|mms)\:\/\/([^[:space:]]+)\.(mp3|wma|wmv|asf|asx|mpg|mpeg)\".*\<\/a\>\]/i", "<script>doc_write(obj_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(swf)\".*\<\/a\>\]/i", "<script>doc_write(flash_movie('$1://$2.$3'));</script>", $str);
$str = preg_replace("/\[\<a\s.*href\=\"(http|https|ftp)\:\/\/([^[:space:]]+)\.(gif|png|jpg|jpeg|bmp)\".*\<\/a\>\]/i", "<img src='$1://$2.$3' id='target_resize_image[]' onclick='image_window(this);'>", $str);
echo $str;
사용법
이미지,동영상,플래쉬 주소에 [] 로 닫기만하면 적용됩니다.
[http://도메인/동영상.mp3][http://도메인/플래쉬.swf][http://도메인/이미지.gif]