UBB 转换函数演示 (经典论坛)(3)

re=https://www.jb51.net/(\[UPLOAD=(.[^\[]*)\])(.*?)(\[\/UPLOAD\])/ig
 strContent= strContent.replace(re,"<br><IMG SRC="https://www.jb51.net/+picurl+"$2.gif border=0> <a href=https://www.jb51.net/article/$3>点击浏览该文件</a>")

re=https://www.jb51.net/(\[URL\])(.*?)(\[\/URL\])/ig
 strContent= strContent.replace(re,"<A HREF=https://www.jb51.net/article/$2 TARGET=_blank>$2</A>")
 re=https://www.jb51.net/(\[URL=(.[^\[]*)\])(.*?)(\[\/URL\])/ig
 strContent= strContent.replace(re,"<A HREF=https://www.jb51.net/article/$2 TARGET=_blank>$3</A>")

re=https://www.jb51.net/(\[EMAIL\])(.*?)(\[\/EMAIL\])/ig
 strContent= strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/email1.gif><A HREF=\"mailto:$2\">$2</A>")
 re=https://www.jb51.net/(\[EMAIL=(.[^\[]*)\])(.*?)(\[\/EMAIL\])/ig
 strContent= strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/email1.gif><A HREF=\"mailto:$2\" TARGET=_blank>$3</A>")

re =https://www.jb51.net/^(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/[^>=""](http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/^(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/[^>=""](ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/^(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/[^>=""](rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/^(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")
 re =https://www.jb51.net/[^>=""](mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
 strContent = strContent.replace(re,"<img align=absmiddle src=https://www.jb51.net/pic/url.gif><a target=_blank href=https://www.jb51.net/article/$1>$1</a>")

if(strIcons == "1"){                       //笑脸转换
 re=https://www.jb51.net/(\[em(.*?)\])/ig
 strContent=strContent.replace(re,"<img src="https://www.jb51.net/+picurl+ImgName+"$2.gif border=0 align=middle>")
 }

if(strSmile == "1"){                       //笑脸转换
 re=https://www.jb51.net/(\[s(\d{1,2})\])/ig
 strContent=strContent.replace(re,"<img src=https://www.jb51.net/smile/face$2.gif border=0 align=middle>")
 }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wfzzgd.html