strIcons = "1" //允许笑脸转换
strSmile="1" //同上
ImgName="em"
picurl="/images/emot/"
function UBBCode(content,html){
content=content.replace("\\r","");
content=content.replace("\\n","");
return (trans(content));
}
function trans(strContent){
var re;
re=/\[IMG\](.+?)\[\/IMG\]/ig;
strContent=strContent.replace(re,"
re=/\[DIR=*([0-9]*),*([0-9]*)\](.*?)\[\/DIR]/ig
strContent=strContent.replace(re,"")
re=/\[QT=*([0-9]*),*([0-9]*)\](.*?)\[\/QT]/ig
strContent=strContent.replace(re,"
re=/(\[FLASH\])(.*?)(\[\/FLASH\])/ig
strContent= strContent.replace(re,"")
re=/(\[FLASH=*([0-9]*),*([0-9]*)\])(.*?)(\[\/FLASH\])/ig
strContent= strContent.replace(re," [全屏欣赏]
")
re=/(\[UPLOAD=gif\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
此主题相关图片如下:
screen.width-333)this.width=screen.width-333\">")
re=/(\[UPLOAD=jpg\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
此主题相关图片如下:
screen.width-333)this.width=screen.width-333\">")
re=/(\[UPLOAD=png\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
此主题相关图片如下:
screen.width-333)this.width=screen.width-333\">")
re=/(\[UPLOAD=swf\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
[全屏欣赏]
")
re=/(\[UPLOAD=asf\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=avi\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=mpg\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=wmv\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=mp3\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=wav\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=mid\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
")
re=/(\[UPLOAD=(.[^\[]*)\])(.*?)(\[\/UPLOAD\])/ig
strContent= strContent.replace(re,"
点击浏览该文件")
re=/(\[refer=(\d{1,}),(.*?)\])(.*?)(\[\/refer\])/ig
strContent=strContent.replace(re,"
回复$2楼$3发表: |
$4 |
re=/(\[URL\])(.*?)(\[\/URL\])/ig
strContent= strContent.replace(re,"$2")
re=/(\[URL=(.[^\[]*)\])(.*?)(\[\/URL\])/ig
strContent= strContent.replace(re,"$3")
re=/(\[EMAIL\])(.*?)(\[\/EMAIL\])/ig
strContent= strContent.replace(re,"$2")
re=/(\[EMAIL=(.[^\[]*)\])(.*?)(\[\/EMAIL\])/ig
strContent= strContent.replace(re,"$3")
re =/^(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
strContent = strContent.replace(re,"$1")
re =/[^>=""](http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/^(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
strContent = strContent.replace(re,"$1")
re =/[^>=""](ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/^(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
strContent = strContent.replace(re,"$1")
re =/[^>=""](rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/^(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
re =/(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig
strContent = strContent.replace(re,"$1")
re =/[^>=""](mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig
strContent = strContent.replace(re,"$1")
if(strIcons == "1"){ //笑脸转换
re=/(\[em(.*?)\])/ig
strContent=strContent.replace(re," ")
}
if(strSmile == "1"){ //笑脸转换
re=/(\[s(\d{1,2})\])/ig
strContent=strContent.replace(re," ")
}
re=/(\[color=(.[^\[]*)\])(.*?)(\[\/color\])/ig
strContent=strContent.replace(re,"$3")
re=/(\[face=(.[^\[]*)\])(.*?)(\[\/face\])/ig
strContent=strContent.replace(re,"$3")
re=/(\[align=(.[^\[]*)\])(.*?)(\[\/align\])/ig
strContent=strContent.replace(re,"
//循环转换quote
re=/(\[quote\])(.*?)(\[\/quote\])/ig
while(strContent.indexOf("[quote]")>-1 && strContent.indexOf("[/quote]")>0){
strContent=strContent.replace(re,"
引用:")
$2
}
re=/(\[fly\])(.*?)(\[\/fly\])/ig
strContent=strContent.replace(re,"")
re=/(\[move\])(.*?)(\[\/move\])/ig
strContent=strContent.replace(re,"")
re=/\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/GLOW]/ig
strContent=strContent.replace(re,"
re=/\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.*?)\[\/SHADOW]/ig
strContent=strContent.replace(re,"
re=/(\[i\])(.*?)(\[\/i\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[u\])(.*?)(\[\/u\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[b\])(.*?)(\[\/b\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[size=1\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[size=2\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[size=3\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[size=4\])(.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"$2")
re=/\[size=([+|-]?[0-7])\](.*?)(\[\/size\])/ig
strContent=strContent.replace(re,"$2")
re=/(\[list\])(.+?)(\[\/list\])/ig;
strContent=strContent.replace(re,"
- $2<\/UL>");
- ");
re=/(\[center\])(.*?)(\[\/center\])/ig
strContent=strContent.replace(re,"$2 ")
re=/(\[list=)(A|1)(\])(.+?)(\[\/list\])/ig;
strContent=strContent.replace(re,"
- $4<\/OL>");
re=/(\[\*\])/ig;
strContent=strContent.replace(re,"
return(strContent);
}