diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 5494cad1..55e66fc4 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -5682,6 +5682,29 @@ } } + function AutoLinkUrls($str,$popup = FALSE){ + if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)){ + $pop = ($popup == TRUE) ? " target=\"_blank\" " : ""; + for ($i = 0; $i < count($matches['0']); $i++){ + $period = ''; + if (preg_match("|\.$|", $matches['6'][$i])){ + $period = '.'; + $matches['6'][$i] = substr($matches['6'][$i], 0, -1); + } + $str = str_replace($matches['0'][$i], + $matches['1'][$i].'http'. + $matches['4'][$i].'://'. + $matches['5'][$i]. + $matches['6'][$i].''. + $period, $str); + }//end for + }//end if + return $str; + }//end AutoLinkUrls + include( 'functions_db.php' ); include( 'functions_filter.php' ); diff --git a/upload/styles/cb_28/layout/watch_video.html b/upload/styles/cb_28/layout/watch_video.html index 934b3640..f3eb4678 100644 --- a/upload/styles/cb_28/layout/watch_video.html +++ b/upload/styles/cb_28/layout/watch_video.html @@ -83,7 +83,7 @@
{$video.description|unescape:"html"}
+{AutoLinkUrls($video.description|unescape:"html")}