我通过更改discuzcode.func.php中的相关代码成:[code]/*去除帖子中的广告链接*/
function parseurl($url, $text) {
if(!$url && preg_match("/((https?|ftp|@|mailto|gopher|news|telnet|rtsp|mms|mailto|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) {
$url = $matches[0];
$length = 65;
if(strlen($url) > $length) {
$text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
}
return $text;
} else {
$url = substr($url, 1);
if(substr(strtolower($url), 0, 4) == 'www.') {
$url = 'http://'.$url;
}
return $text;
}
}
[/code]以上相关资料见:http://www.liuyebo.com/archives/200902/545.html去除了外部链接点击打开功能,可是发现外部链接的视频、flash等都不能正常显示了,变成地址了,请问,有什么办法既能显示flash视频等又能去除其它的外部链接直接打开?求教
function parseurl($url, $text) {
if(!$url && preg_match("/((https?|ftp|@|mailto|gopher|news|telnet|rtsp|mms|mailto|callto|bctp|ed2k|thunder|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) {
$url = $matches[0];
$length = 65;
if(strlen($url) > $length) {
$text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
}
return $text;
} else {
$url = substr($url, 1);
if(substr(strtolower($url), 0, 4) == 'www.') {
$url = 'http://'.$url;
}
return $text;
}
}
[/code]以上相关资料见:http://www.liuyebo.com/archives/200902/545.html去除了外部链接点击打开功能,可是发现外部链接的视频、flash等都不能正常显示了,变成地址了,请问,有什么办法既能显示flash视频等又能去除其它的外部链接直接打开?求教
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货