답변 2개
채택된 답변
+20 포인트
3년 전
이프문을 하나 감으면 되지 않을까요?
function url_auto_link($str)
{
if ($bo_table !== "a게시판") {
원래내용
}
}
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
3년 전
function url_auto_link($str)
{
global $g5;
global $config;
global $bo_table; // 추가
if( $bo_table=='bbs') {
//Made by Vorfeed
//인스타, 유튜브, 트위터 URL 자동 변환 소스.
$regex = '~(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@#?&%=+\/\$_.-]*~i';
$str = preg_replace( $regex, '<iframe width="560" height="315" src="https://www.youtube.com/embed/$1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>', $str );
$regex = "/(https?:\/\/www\.)?instagram\.com(\/p\/\w+\/?)/im";
$str = preg_replace( $regex, '<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="https://www.instagram.com$2" data-instgrm-version="8"><span style="font-size:20px;text-decoration:none;"> instagram.. <i class="fa fa-cog fa-spin"> </i></span></blockquote> <script async defer src="//www.instagram.com/embed.js"></script>', $str );
$regex = "/(https?:\/\/(www\.)?)?twitter\.com\/(?:#!\/)?(\w+)\/status(es)?\/(\d+)/im";
$str = preg_replace( $regex, '<blockquote class="twitter-tweet" data-lang="ko"> <a href="https://twitter.com/$3/status/$5" style="text-decoration:none"><span style="font-size:20px;"> twitter.. <i class="fa fa-cog fa-spin"> </i></span></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>', $str );
} // 필요한 곳까지
// 140326
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인