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

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

strContent=re.Replace(strContent,"<img src="&picurl&ImgName&"$2.gif border=0 align=middle>")
end if

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


re.Pattern="(\[color=(.[^\*)\])(.*?)(\[\/color\])"
strContent=re.Replace(strContent,"<font color=$2 style=""font-size:"&FontSize&"pt;line-height:"&FontHeight&"pt"">$3</font>")
re.Pattern="(\[face=(.[^\*)\])(.*?)(\[\/face\])"
strContent=re.Replace(strContent,"<font face=$2 style=""font-size:"&FontSize&"pt;line-height:"&FontHeight&"pt"">$3</font>")
re.Pattern="(\[align=(.[^\*)\])(.*?)(\[\/align\])"
strContent=re.Replace(strContent,"<div align=$2>$3</div>")
'循环转换quote
re.Pattern="(\[QUOTE\])(.*?)(\[\/QUOTE\])"
while (instr(strContent,"[quote]")>0 and instr(strContent,"[/quote]")>0)
strContent=re.Replace(strContent,"<blockquote>引用:<hr><span>$2</span><hr></blockquote>")
wend
re.Pattern="(\[fly\])(.*?)(\[\/fly\])"
strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
re.Pattern="(\[move\])(.*?)(\[\/move\])"
strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$2</marquee>")
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]"
strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")

re.Pattern="(\[i\])(.*?)(\[\/i\])"
strContent=re.Replace(strContent,"<i>$2</i>")
re.Pattern="(\[u\])(.*?)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$2</u>")
re.Pattern="(\[b\])(.*?)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$2</b>")

re.Pattern="(\[size=1\])(.*?)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=1 style=""line-height:"&FontHeight&"pt"">$2</font>")
re.Pattern="(\[size=2\])(.*?)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=2 style=""line-height:"&FontHeight&"pt"">$2</font>")
re.Pattern="(\[size=3\])(.*?)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=5 style=""line-height:"&FontHeight&"pt"">$2</font>")
re.Pattern="(\[size=4\])(.*?)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=6 style=""line-height:"&FontHeight&"pt"">$2</font>")

re.Pattern="\[size=([ |-]?[0-7])\](.*?)(\[\/size\])"
strContent=re.Replace(strContent,"<font size=$1 style=""line-height:"&FontHeight&"pt"">$2</font>")

re.Pattern="(\[center\])(.*?)(\[\/center\])"

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