UBB 转换函数演示(4)_Dreamweaver教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!
mailto:$2\" TARGET=_blank>$3</A>")

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

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

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

re=/(\[color=(.[^\*)\])(.*?)(\[\/color\])/ig
strContent=strContent.replace(re,"<font color=$2>$3</font>")
re=/(\[face=(.[^\*)\])(.*?)(\[\/face\])/ig
strContent=strContent.replace(re,"<font face=$2>$3</font>")
re=/(\[align=(.[^\*)\])(.*?)(\[\/align\])/ig
strContent=strContent.replace(re,"<div align=$2>$3</div>")

来源:网上收集//所属分类:Dreamweaver教程/更新时间:2005-05-04
相关Dreamweaver教程