我昨天找了一个,在2.5F sp1上不能用,会出现白屏,用这个就可以了
include/discuzcode.php
找
- function parseurl(&$message) {
- return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
- substr(preg_replace( array(
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
- "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
- ), array(
- "[url]\\1\\3[/url]",
- "[email]\\0[/email]"
- ), ' '.$message), 1);
- }
复制代码
替换为
- //[HACK]自动解析图片URL By Bob Gao
- function parseurl(&$message) {
- return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
- substr(preg_replace( array(
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)(.jpg|.png|.gif)/i",
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
- "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
- ), array(
- "[img]\\0[/img]",
- "[url]\\1\\3[/url]",
- "[email]\\0[/email]"
- ), ' '.$message), 1);
- }
- //[HACK]自动解析图片URL By Bob Gao
复制代码
如果别人已经有了就算我没发
[ 本帖最后由 buhuien 于 2005-8-26 07:37 编辑 ] |