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

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!


re=/(\[FLASH\])(.*?)(\[\/FLASH\])/ig
strContent= strContent.replace(re,"<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400><PARAM NAME=movie VALUE=$2><PARAM NAME=quality VALUE=high><embed src=$2 quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=500 height=400>$2</embed></OBJECT>")
re=/(\[FLASH=*([0-9]*),*([0-9]*)\])(.*?)(\[\/FLASH\])/ig
strContent= strContent.replace(re,"<a href=$4 TARGET=_blank><IMG SRC=pic/swf.gif border=0 alt=点击开新窗口欣赏该FLASH动画!> [全屏欣赏]</a><br><br><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=$2 height=$3><PARAM NAME=movie VALUE=$4><PARAM NAME=quality VALUE=high><param name=menu value=false><embed src=$4 quality=high menu=false pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width=$2 height=$3>$4</embed></OBJECT>")

re=/(\[UPLOAD=gif\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"<br><IMG SRC=" picurl "gif.gif border=0>此主题相关图片如下:<br><A HREF=$2 TARGET=_blank><IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>")
re=/(\[UPLOAD=jpg\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"<br><IMG SRC=" picurl "jpg.gif border=0>此主题相关图片如下:<br><A HREF=$2 TARGET=_blank><IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>")
re=/(\[UPLOAD=bmp\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"<br><IMG SRC=" picurl "bmp.gif border=0>此主题相关图片如下:<br><A HREF=$2 TARGET=_blank><IMG SRC=$2 border=0 alt=按此在新窗口浏览图片 onload=\"javascript:if(this.width>screen.width-333)this.width=screen.width-333\"></A>")

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

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

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

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