UBB 转换函数演示(5)_Dreamweaver教程
//循环转换quote
re=/(\[QUOTE\])(.*?)(\[\/QUOTE\])/ig
while(strContent.indexOf("[quote]")>0 && strContent.indexOf("[/quote] ")>0){
strContent=strContent.replace(re,"<blockquote>引用:<hr><span>$2</span><hr></blockquote>")
}
re=/(\[fly\])(.*?)(\[\/fly\])/ig
strContent=strContent.replace(re,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
re=/(\[move\])(.*?)(\[\/move\])/ig
strContent=strContent.replace(re,"<MARQUEE scrollamount=3>$2</marquee>")
re=/\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]/ig
strContent=strContent.replace(re,"<table width=$1 style=\"filter:glow(color=$2, strength=$3)\">$4</table>")
re=/\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]/ig
strContent=strContent.replace(re,"<table width=$1 style=\"filter:shadow(color=$2, strength=$3)\">$4</table>")
re=/(\[i\])(.*?)(\[\/i\])/ig
strContent=strContent.replace(re,"<i>$2</i>")
re=/(\[u\])(.*?)(\[\/u\])/ig
strContent=strContent.replace(re,"<u>$2</u>")
re=/(\[b\])(.*?)(\[\/b\])/ig
strContent=strContent.replace(re,"<b>$2</b>")
re=/(\[size=1\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"<font size=1>$2</font>")
re=/(\[size=2\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"<font size=2>$2</font>")
re=/(\[size=3\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"<font size=5>$2</font>")
re=/(\[size=4\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"<font size=6>$2</font>")
re=/\[size=([ |-]?[0-7])\](.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"<font size=$1>$2</font>")
re=/(\[list\])(. ?)(\[\/list\])/ig;
strContent=strContent.replace(re,"<UL TYPE=SQUARE>$2<\/UL>");
re=/(\[list=)(A|1)(\])(. ?)(\[\/list\])/ig;
strContent=strContent.replace(re,"<OL TYPE=$2>$4<\/OL>");
re=/(\[\*\])/ig;
strContent=strContent.replace(re,"<LI>");
re=/(\[center\])(.*?)(\[\/center\])/ig
strContent=strContent.replace(re,"<center>$2</center>")
re=/(\[table=(#*[a-z0-9]*),(#*[a-z0-9]*),(#*[a-z0-9]*)\])(.*?)(\[\/table\])/ig
strContent=strContent.replace(re,"<table border=0 cellpadding=5 cellspacing=1 bgcolor=$2><tr><td bgcolor=$3><font color=$4>$5</font></td></tr></table>")
return(strContent);
}
</script>
VBScript:
- 相关链接:
- 教程说明:
Dreamweaver教程-UBB 转换函数演示(5)。