dzxstatic
Version:
The static files of Discuz! X
1 lines • 20.3 kB
JavaScript
var re,DISCUZCODE=[];function addslashes(e){return preg_replace(["\\\\","\\'","\\/","\\(","\\)","\\[","\\]","\\{","\\}","\\^","\\$","\\?","\\.","\\*","\\+","\\|"],["\\\\","\\'","\\/","\\(","\\)","\\[","\\]","\\{","\\}","\\^","\\$","\\?","\\.","\\*","\\+","\\|"],e)}function atag(e,t){if(""==trim(t))return"";var r=parsestyle(e,"","");return href=getoptionvalue("href",e),"javascript:"==href.substr(0,11)?trim(recursion("a",t,"atag")):r.prepend+"[url="+href+"]"+trim(recursion("a",t,"atag"))+"[/url]"+r.append}function bbcode2html(str){if(""==str)return"";for(i in"undefined"==typeof parsetype&&(parsetype=0),!fetchCheckbox("bbcodeoff")&&allowbbcode&&1!=parsetype&&(str=str.replace(/\[code\]([\s\S]+?)\[\/code\]/gi,(function(e,t){return parsecode(t)}))),fetchCheckbox("allowimgurl")&&(str=str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/gi,"$1[img]$2[/img]")),allowhtml&&fetchCheckbox("htmlon")||(str=str.replace(/</g,"<"),str=str.replace(/>/g,">"),fetchCheckbox("parseurloff")||(str=parseurl(str,"html",!1))),EXTRAFUNC.bbcode2html){EXTRASTR=str;try{eval("str = "+EXTRAFUNC.bbcode2html[i]+"()")}catch(e){}}if(!fetchCheckbox("smileyoff")&&allowsmilies&&"object"==typeof smilies_type)for(var typeid in smilies_array)for(var page in smilies_array[typeid])for(var i in smilies_array[typeid][page])re=new RegExp(preg_quote(smilies_array[typeid][page][i][1]),"g"),str=str.replace(re,'<img src="'+STATICURL+"image/smiley/"+smilies_type["_"+typeid][1]+"/"+smilies_array[typeid][page][i][2]+'" border="0" smilieid="'+smilies_array[typeid][page][i][0]+'" alt="'+smilies_array[typeid][page][i][1]+'" />');if(!fetchCheckbox("bbcodeoff")&&allowbbcode){for(str=clearcode(str),str=str.replace(/\[url\]\s*((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)([^\[\"']+?)\s*\[\/url\]/gi,(function(e,t,r,s){return cuturl(t+s)})),str=str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\r\n\[\"']+?)\]([\s\S]+?)\[\/url\]/gi,'<a href="$1$3" target="_blank">$4</a>'),str=str.replace(/\[email\](.[^\\=[]*)\[\/email\]/gi,'<a href="mailto:$1">$1</a>'),str=str.replace(/\[email=(.[^\\=[]*)\](.*?)\[\/email\]/gi,'<a href="mailto:$1" target="_blank">$2</a>'),str=str.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/gi,(function(e,t){return addCSS="",in_array(t,postimg_type.postbg)&&(addCSS='<style type="text/css" name="editorpostbg">body{background-image:url("'+STATICURL+"image/postbg/"+t+'");}</style>'),addCSS})),str=str.replace(/\[color=([\w#\(\),\s]+?)\]/gi,'<font color="$1">'),str=str.replace(/\[backcolor=([\w#\(\),\s]+?)\]/gi,'<font style="background-color:$1">'),str=str.replace(/\[size=(\d+?)\]/gi,'<font size="$1">'),str=str.replace(/\[size=(\d+(\.\d+)?(px|pt)+?)\]/gi,'<font style="font-size: $1">'),str=str.replace(/\[font=([^\[\<\=]+?)\]/gi,'<font face="$1">'),str=str.replace(/\[align=([^\[\<\=]+?)\]/gi,'<div align="$1">'),str=str.replace(/\[p=(\d{1,2}|null), (\d{1,2}|null), (left|center|right)\]/gi,'<p style="line-height: $1px; text-indent: $2em; text-align: $3;">'),str=str.replace(/\[float=left\]/gi,'<br style="clear: both"><span style="float: left; margin-right: 5px;">'),str=str.replace(/\[float=right\]/gi,'<br style="clear: both"><span style="float: right; margin-left: 5px;">'),1!=parsetype&&(str=str.replace(/\[quote]([\s\S]*?)\[\/quote\]\s?\s?/gi,'<div class="quote"><blockquote>$1</blockquote></div>\n')),re=/\[table(?:=(\d{1,4}%?)(?:,([\(\)%,#\w ]+))?)?\]\s*([\s\S]+?)\s*\[\/table\]/gi,i=0;i<4;i++)str=str.replace(re,(function(e,t,r,s){return parsetable(t,r,s)}));str=preg_replace(["\\[\\/color\\]","\\[\\/backcolor\\]","\\[\\/size\\]","\\[\\/font\\]","\\[\\/align\\]","\\[\\/p\\]","\\[b\\]","\\[\\/b\\]","\\[i\\]","\\[\\/i\\]","\\[u\\]","\\[\\/u\\]","\\[s\\]","\\[\\/s\\]","\\[hr\\]","\\[list\\]","\\[list=1\\]","\\[list=a\\]","\\[list=A\\]","\\s?\\[\\*\\]","\\[\\/list\\]","\\[indent\\]","\\[\\/indent\\]","\\[\\/float\\]"],["</font>","</font>","</font>","</font>","</div>","</p>","<b>","</b>","<i>","</i>","<u>","</u>","<strike>","</strike>",'<hr class="l" />',"<ul>",'<ul type=1 class="litype_1">','<ul type=a class="litype_2">','<ul type=A class="litype_3">',"<li>","</ul>","<blockquote>","</blockquote>","</span>"],str,"g")}fetchCheckbox("bbcodeoff")||(allowimgcode?(str=str.replace(/\[img\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/gi,'<img src="$1" border="0" alt="" style="max-width:400px" />'),str=str.replace(/\[attachimg\](\d+)\[\/attachimg\]/gi,(function(e,t){if(!$("image_"+t))return"";if(width=$("image_"+t).getAttribute("cwidth"),!width){var r=(re=/cwidth=(["']?)(\d+)(\1)/i).exec($("image_"+t).outerHTML);null!=r&&(width=r[2])}return'<img src="'+$("image_"+t).src+'" border="0" aid="attachimg_'+t+'" width="'+width+'" alt="" />'})),str=str.replace(/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/gi,(function(e,t,r,s){return"<img"+(t>0?' width="'+t+'"':"")+(r>0?' _height="'+r+'"':"")+' src="'+s+'" border="0" alt="" />'}))):(str=str.replace(/\[img\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/gi,'<a href="$1" target="_blank">$1</a>'),str=str.replace(/\[img=(\d{1,4})[x|\,](\d{1,4})\]\s*([^\[\"\<\r\n]+?)\s*\[\/img\]/gi,'<a href="$3" target="_blank">$3</a>')));for(var i=0;i<=DISCUZCODE.num;i++)str=str.replace("[\tDISCUZ_CODE_"+i+"\t]",DISCUZCODE.html[i]);return str=allowhtml&&fetchCheckbox("htmlon")?str.replace(/<script[^\>]*?>([^\x00]*?)<\/script>/gi,""):str.replace(/(^|>)([^<]+)(?=<|$)/gi,(function(e,t,r){return t+preg_replace(["\t"," "," ","(\r\n|\n|\r)"],[" "," "," ","<br />"],r)})),str}function clearcode(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\[url\]\[\/url\]/gi,"",e)).replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\s\[\"']+?)\]\[\/url\]/gi,"",e)).replace(/\[email\]\[\/email\]/gi,"",e)).replace(/\[email=(.[^\[]*)\]\[\/email\]/gi,"",e)).replace(/\[color=([^\[\<]+?)\]\[\/color\]/gi,"",e)).replace(/\[size=(\d+?)\]\[\/size\]/gi,"",e)).replace(/\[size=(\d+(\.\d+)?(px|pt)+?)\]\[\/size\]/gi,"",e)).replace(/\[font=([^\[\<]+?)\]\[\/font\]/gi,"",e)).replace(/\[align=([^\[\<]+?)\]\[\/align\]/gi,"",e)).replace(/\[p=(\d{1,2}), (\d{1,2}), (left|center|right)\]\[\/p\]/gi,"",e)).replace(/\[float=([^\[\<]+?)\]\[\/float\]/gi,"",e)).replace(/\[quote\]\[\/quote\]/gi,"",e)).replace(/\[code\]\[\/code\]/gi,"",e)).replace(/\[table\]\[\/table\]/gi,"",e)).replace(/\[free\]\[\/free\]/gi,"",e)).replace(/\[b\]\[\/b]/gi,"",e)).replace(/\[u\]\[\/u]/gi,"",e)).replace(/\[i\]\[\/i]/gi,"",e)).replace(/\[s\]\[\/s]/gi,"",e)}function cuturl(e){var t='<a href="'+("www."==e.toLowerCase().substr(0,4)?"http://"+e:e)+'" target="_blank">';return e.length>65&&(e=e.substr(0,parseInt(32.5))+" ... "+e.substr(e.length-parseInt(19.5))),t+=e+"</a>"}function dstag(e,t,r){if(""==trim(t))return"\n";var s=parsestyle(e,"",""),i=s.prepend,a=s.append;return in_array(r,["div","p"])&&(align=getoptionvalue("align",e),in_array(align,["left","center","right"])?(i="[align="+align+"]"+i,a+="[/align]"):a+="\n"),i+recursion(r,t,"dstag")+a}function ptag(e,t,r){if(""==trim(t))return"\n";if(""==trim(e))return t+"\n";var s,i,a=null,l=null;return null!=(i=/line-height\s?:\s?(\d{1,3})px/i.exec(e))&&(a=i[1]),null!=(i=/text-indent\s?:\s?(\d{1,3})em/i.exec(e))&&(l=i[1]),s=null!=(i=/text-align\s?:\s?(left|center|right)/i.exec(e))?i[1]:getoptionvalue("align",e),s=in_array(s,["left","center","right"])?s:"left",style=getoptionvalue("style",e),style=preg_replace(["line-height\\s?:\\s?(\\d{1,3})px","text-indent\\s?:\\s?(\\d{1,3})em","text-align\\s?:\\s?(left|center|right)"],"",style),null===a&&null===l?"[align="+s+"]"+(style?'<span style="'+style+'">':"")+t+(style?"</span>":"")+"[/align]":"[p="+a+", "+l+", "+s+"]"+(style?'<span style="'+style+'">':"")+t+(style?"</span>":"")+"[/p]"}function fetchCheckbox(e){return $(e)&&1==$(e).checked?1:0}function fetchoptionvalue(e,t){return!1!==(position=strpos(t,e))?(delimiter=position+e.length,'"'==t.charAt(delimiter)?delimchar='"':"'"==t.charAt(delimiter)?delimchar="'":delimchar=" ",delimloc=strpos(t,delimchar,delimiter+1),!1===delimloc?delimloc=t.length:'"'!=delimchar&&"'"!=delimchar||delimiter++,trim(t.substr(delimiter,delimloc-delimiter))):""}function fonttag(e,t){var r="",s="",i=new Array;for(bbcode in i={font:"face=",size:"size=",color:"color="})optionvalue=fetchoptionvalue(i[bbcode],e),optionvalue&&(r+="["+bbcode+"="+optionvalue+"]",s="[/"+bbcode+"]"+s);var a=parsestyle(e,r,s);return a.prepend+recursion("font",t,"fonttag")+a.append}function getoptionvalue(e,t){var r=(re=new RegExp(e+"(s+?)?=(s+?)?[\"']?(.+?)([\"']|$|>)","ig")).exec(t);return null!=r?trim(r[3]):""}function html2bbcode(str){if(allowhtml&&fetchCheckbox("htmlon")||""==trim(str)){for(i in EXTRAFUNC.html2bbcode){EXTRASTR=str;try{eval("str = "+EXTRAFUNC.html2bbcode[i]+"()")}catch(e){}}return str=str.replace(/<img[^>]+smilieid=(["']?)(\d+)(\1)[^>]*>/gi,(function(e,t,r){return smileycode(r)})),str=str.replace(/<img([^>]*aid=[^>]*)>/gi,(function(e,t){return imgtag(t)})),str}if(str=str.replace(/<div\sclass=["']?blockcode["']?>[\s\S]*?<blockquote>([\s\S]+?)<\/blockquote>[\s\S]*?<\/div>/gi,(function(e,t){return codetag(t)})),!fetchCheckbox("bbcodeoff")&&allowbbcode){var postbg="";str=str.replace(/<style[^>]+name="editorpostbg"[^>]*>body{background-image:url\("([^\[\<\r\n;'\"\?\(\)]+?)"\);}<\/style>/gi,(function(e,t){return"[postbg]"+(t=t.replace(STATICURL+"image/postbg/",""))+"[/postbg]"})),str=str.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/gi,(function(e,t){return postbg=t,""})),postbg&&(str="[postbg]"+postbg+"[/postbg]"+str)}for(i in str=preg_replace(["<style.*?>[\\s\\S]*?</style>","<script.*?>[\\s\\S]*?<\/script>","<noscript.*?>[\\s\\S]*?</noscript>","<select.*?>[sS]*?</select>","<object.*?>[sS]*?</object>","\x3c!--[\\s\\S]*?--\x3e",' on[a-zA-Z]{3,16}\\s?=\\s?"[\\s\\S]*?"'],"",str),str=str.replace(/(\r\n|\n|\r)/gi,""),str=str.replace(/&((#(32|127|160|173))|shy|nbsp);/gi," "),fetchCheckbox("allowimgurl")&&(str=str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/gi,"$1[img]$2[/img]")),fetchCheckbox("parseurloff")||(str=parseurl(str,"bbcode",!1)),EXTRAFUNC.html2bbcode){EXTRASTR=str;try{eval("str = "+EXTRAFUNC.html2bbcode[i]+"()")}catch(e){}}str=str.replace(/<br\s+?style=(["']?)clear: both;?(\1)[^\>]*>/gi,""),str=str.replace(/<br[^\>]*>/gi,"\n"),!fetchCheckbox("bbcodeoff")&&allowbbcode&&(str=preg_replace(["<table[^>]*float:\\s*(left|right)[^>]*><tbody><tr><td>\\s*([\\s\\S]+?)\\s*</td></tr></tbody></table>","<table([^>]*(width|background|background-color|backcolor)[^>]*)>","<table[^>]*>","<tr[^>]*(?:background|background-color|backcolor)[:=]\\s*([\"']?)([()\\s%,#\\w]+)(\\1)[^>]*>","<tr[^>]*>","(<t[dh]([^>]*(left|center|right)[^>]*)>)\\s*([\\s\\S]+?)\\s*(</t[dh]>)","<t[dh]([^>]*(width|colspan|rowspan)[^>]*)>","<t[dh][^>]*>","</t[dh]>","</tr>","</table>","<h\\d[^>]*>","</h\\d>"],[function(e,t,r){return"[float="+t+"]"+r+"[/float]"},function(e,t){return tabletag(t)},"[table]\n",function(e,t,r){return"[tr="+r+"]"},"[tr]",function(e,t,r,s,i,a){return t+"[align="+s+"]"+i+"[/align]"+a},function(e,t){return tdtag(t)},"[td]","[/td]","[/tr]\n","[/table]","[b]","[/b]"],str),str=str.replace(/<h([0-9]+)[^>]*>([\s\S]*?)<\/h\1>/gi,(function(e,t,r){return"[size="+(7-t)+"]"+r+"[/size]\n\n"})),str=str.replace(/<hr[^>]*>/gi,"[hr]"),str=str.replace(/<img[^>]+smilieid=(["']?)(\d+)(\1)[^>]*>/gi,(function(e,t,r){return smileycode(r)})),str=str.replace(/<img([^>]*src[^>]*)>/gi,(function(e,t){return imgtag(t)})),str=str.replace(/<a\s+?name=(["']?)(.+?)(\1)[\s\S]*?>([\s\S]*?)<\/a>/gi,"$4"),str=str.replace(/<div[^>]*quote[^>]*><blockquote>([\s\S]*?)<\/blockquote><\/div>([\s\S]*?)(<br[^>]*>)?/gi,"[quote]$1[/quote]"),str=str.replace(/<div[^>]*blockcode[^>]*><blockquote>([\s\S]*?)<\/blockquote><\/div>([\s\S]*?)(<br[^>]*>)?/gi,"[code]$1[/code]"),str=recursion("b",str,"simpletag","b"),str=recursion("strong",str,"simpletag","b"),str=recursion("i",str,"simpletag","i"),str=recursion("em",str,"simpletag","i"),str=recursion("u",str,"simpletag","u"),str=recursion("strike",str,"simpletag","s"),str=recursion("a",str,"atag"),str=recursion("font",str,"fonttag"),str=recursion("blockquote",str,"simpletag","indent"),str=recursion("ol",str,"listtag"),str=recursion("ul",str,"listtag"),str=recursion("div",str,"dstag"),str=recursion("p",str,"ptag"),str=recursion("span",str,"fonttag")),str=str.replace(/<[\/\!]*?[^<>]*?>/gi,"");for(var i=0;i<=DISCUZCODE.num;i++)str=str.replace("[\tDISCUZ_CODE_"+i+"\t]",DISCUZCODE.html[i]);return str=clearcode(str),preg_replace([" ","<",">","&"],[" ","<",">","&"],str)}function tablesimple(e,t,r){return strpos(r,"[tr=")||strpos(r,"[td=")?e:"[table="+t+"]\n"+preg_replace(["\\[tr\\]","\\[\\/td\\]\\s?\\[td\\]","\\[\\/tr\\]s?","\\[td\\]","\\[\\/td\\]","\\[\\/td\\]\\[\\/tr\\]"],["","|","","","","",""],r)+"[/table]"}function imgtag(e){var t="",r="";if(null==(s=(re=/src=(["']?)([\s\S]*?)(\1)/i).exec(e)))return"";var s,i=s[2];(null==(s=(re=/(max-)?width\s?:\s?(\d{1,4})(px)?/i).exec(e))||s[1]||(t=s[2]),null!=(s=(re=/height\s?:\s?(\d{1,4})(px)?/i).exec(e))&&(r=s[1]),t)||null!=(s=(re=/width=(["']?)(\d+)(\1)/i).exec(e))&&(t=s[2]);r||null!=(s=(re=/height=(["']?)(\d+)(\1)/i).exec(e))&&(r=s[2]);return null!=(s=(re=/aid=(["']?)attachimg_(\d+)(\1)/i).exec(e))?"[attachimg]"+s[2]+"[/attachimg]":(r=r>0?r:0,(t=t>0?t:0)>0||r>0?"[img="+t+","+r+"]"+i+"[/img]":"[img]"+i+"[/img]")}function listtag(e,t,r){t=recursion("li",t=t.replace(/<li>(([\s\S](?!<\/li))*?)(?=<\/?ol|<\/?ul|<li|\[list|\[\/list)/gi,"<li>$1</li>")+(BROWSER.opera?"</li>":""),"litag");var s="[list]",i=fetchoptionvalue("type=",e);return i=""!=i?i:"ol"==r?"1":"",in_array(i,["1","a","A"])&&(s="[list="+i+"]"),t?s+"\n"+recursion(r,t,"listtag")+"[/list]":""}function litag(e,t){return"[*]"+t.replace(/(\s+)$/g,"")+"\n"}function parsecode(e){return DISCUZCODE.num++,e=e.replace(/\$/gi,"$$$$"),DISCUZCODE.html[DISCUZCODE.num]='<div class="blockcode"><blockquote>'+htmlspecialchars(e)+"</blockquote></div>","[\tDISCUZ_CODE_"+DISCUZCODE.num+"\t]"}function parsestyle(e,t,r){var s=[["align",!0,"text-align:\\s*(left|center|right);?",1],["float",!0,"float:\\s*(left|right);?",1],["color",!0,"(^|[;\\s])color:\\s*([^;]+);?",2],["backcolor",!0,"(^|[;\\s])background-color:\\s*([^;]+);?",2],["font",!0,"font-family:\\s*([^;]+);?",1],["size",!0,"font-size:\\s*(\\d+(\\.\\d+)?(px|pt|in|cm|mm|pc|em|ex|%|));?",1],["size",!0,"font-size:\\s*(x\\-small|small|medium|large|x\\-large|xx\\-large|\\-webkit\\-xxx\\-large);?",1,"size"],["b",!1,"font-weight:\\s*(bold);?"],["i",!1,"font-style:\\s*(italic);?"],["u",!1,"text-decoration:\\s*(underline);?"],["s",!1,"text-decoration:\\s*(line-through);?"]],i={"x-small":1,small:2,medium:3,large:4,"x-large":5,"xx-large":6,"-webkit-xxx-large":7},a=getoptionvalue("style",e);re=/^(?:\s|)color:\s*rgb\((\d+),\s*(\d+),\s*(\d+)\)(;?)/i,a=a.replace(re,(function(e,t,r,s,i){return"color:#"+parseInt(t).toString(16)+parseInt(r).toString(16)+parseInt(s).toString(16)+i}));for(var l=s.length,n=0;n<l;n++)s[n][4]=s[n][4]?s[n][4]:"",re=new RegExp(s[n][2],"ig"),match=re.exec(a),null!=match&&(opnvalue=match[s[n][3]],"size"==s[n][4]&&(opnvalue=i[opnvalue]),t+="["+s[n][0]+(1==s[n][1]?"="+opnvalue+"]":"]"),r="[/"+s[n][0]+"]"+r);return{prepend:t,append:r}}function parsetable(e,t,r){if(isUndefined(e))e="";else try{e="%"==e.substr(e.length-1,e.length)?e.substr(0,e.length-1)<=98?e:"98%":e<=560?e:"98%"}catch(t){e=""}if(!isUndefined(r)){if(!1===strpos(r,"[/tr]")&&!1===strpos(r,"[/td]")){var s=r.split("\n"),a="";for(i=0;i<s.length;i++)a+="<tr><td>"+preg_replace(["\r","\\\\\\|","\\|","\\\\n"],["","|","</td><td>","\n"],s[i])+"</td></tr>";r=a,simple=" simpletable"}else simple="",r=(r=(r=(r=(r=(r=r.replace(/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,4}%?))?\]/gi,(function(e,t,r){return"<tr"+(t?' style="background-color: '+t+'"':"")+"><td"+(r?' width="'+r+'"':"")+">"}))).replace(/\[tr(?:=([\(\)\s%,#\w]+))?\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/gi,(function(e,t,r,s,i){return"<tr"+(t?' style="background-color: '+t+'"':"")+"><td"+(r?' colspan="'+r+'"':"")+(s?' rowspan="'+s+'"':"")+(i?' width="'+i+'"':"")+">"}))).replace(/\[\/td\]\s*\[td(?:=(\d{1,4}%?))?\]/gi,(function(e,t){return"</td><td"+(t?' width="'+t+'"':"")+">"}))).replace(/\[\/td\]\s*\[td(?:=(\d{1,2}),(\d{1,2})(?:,(\d{1,4}%?))?)?\]/gi,(function(e,t,r,s){return"</td><td"+(t?' colspan="'+t+'"':"")+(r?' rowspan="'+r+'"':"")+(s?' width="'+s+'"':"")+">"}))).replace(/\[\/td\]\s*\[\/tr\]\s*/gi,"</td></tr>")).replace(/<td> <\/td>/gi,"<td> </td>");return"<table "+(""==e?"":'width="'+e+'" ')+'class="t_table"'+(isUndefined(t)?"":' style="background-color: '+t+'"')+simple+">"+r+"</table>"}}function preg_quote(e){return(e+"").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!<>\|\:])/g,"\\$1")}function recursion(tagname,text,dofunction,extraargs){null==extraargs&&(extraargs=""),tagname=tagname.toLowerCase();var open_tag="<"+tagname,open_tag_len=open_tag.length,close_tag="</"+tagname+">",close_tag_len=close_tag.length,beginsearchpos=0;do{var textlower=text.toLowerCase(),tagbegin=textlower.indexOf(open_tag,beginsearchpos);if(-1==tagbegin)break;var strlen=text.length,inquote="",found=!1,tagnameend=!1,optionend=0,t_char="";for(optionend=tagbegin;optionend<=strlen;optionend++)if(t_char=text.charAt(optionend),'"'!=t_char&&"'"!=t_char||""!=inquote)if('"'!=t_char&&"'"!=t_char||inquote!=t_char){if(">"==t_char&&!inquote){found=!0;break}"="!=t_char&&" "!=t_char||tagnameend||(tagnameend=optionend)}else inquote="";else inquote=t_char;if(!found)break;tagnameend||(tagnameend=optionend);var offset=optionend-(tagbegin+open_tag_len),tagoptions=text.substr(tagbegin+open_tag_len,offset),acttagname=textlower.substr(1*tagbegin+1,tagnameend-tagbegin-1);if(acttagname==tagname){var tagend=textlower.indexOf(close_tag,optionend);if(-1==tagend)break;for(var nestedopenpos=textlower.indexOf(open_tag,optionend);-1!=nestedopenpos&&-1!=tagend&&!(nestedopenpos>tagend);)tagend=textlower.indexOf(close_tag,tagend+close_tag_len),nestedopenpos=textlower.indexOf(open_tag,nestedopenpos+open_tag_len);if(-1!=tagend){var localbegin=optionend+1,localtext=eval(dofunction)(tagoptions,text.substr(localbegin,tagend-localbegin),tagname,extraargs);text=text.substring(0,tagbegin)+localtext+text.substring(tagend+close_tag_len),beginsearchpos=tagbegin+localtext.length}else beginsearchpos=optionend}else beginsearchpos=optionend}while(-1!=tagbegin);return text}function simpletag(e,t,r,s){return""==trim(t)?"":"["+s+"]"+(t=recursion(r,t,"simpletag",s))+"[/"+s+"]"}function smileycode(e){if("object"==typeof smilies_type)for(var t in smilies_array)for(var r in smilies_array[t])for(var s in smilies_array[t][r])if(smilies_array[t][r][s][0]==e)return smilies_array[t][r][s][1]}function strpos(e,t,r){isUndefined(r)&&(r=0);var s=e.toLowerCase().indexOf(t.toLowerCase(),r);return-1!=s&&s}function tabletag(e){var t="";null!=(r=(re=/width=(["']?)(\d{1,4}%?)(\1)/i).exec(e))?t="%"==r[2].substr(r[2].length-1,r[2].length)?r[2].substr(0,r[2].length-1)<=98?r[2]:"98%":r[2]<=560?r[2]:"98%":null!=(r=(re=/width\s?:\s?(\d{1,4})([px|%])/i).exec(e))&&(t="%"==r[2]?r[1]<=98?r[1]+"%":"98%":r[1]<=560?r[1]:"98%");var r,s="";return null!=(r=(re=/(?:background|background-color|bgcolor)[:=]\s*(["']?)((rgb\(\d{1,3}%?,\s*\d{1,3}%?,\s*\d{1,3}%?\))|(#[0-9a-fA-F]{3,6})|([a-zA-Z]{1,20}))(\1)/i).exec(e))&&(s=r[2],t=t||"98%"),s?"[table="+t+","+s+"]\n":t?"[table="+t+"]\n":"[table]\n"}function tdtag(e){var t,r=1,s=1,i="";return null!=(t=(re=/colspan=(["']?)(\d{1,2})(\1)/i).exec(e))&&(r=t[2]),null!=(t=(re=/rowspan=(["']?)(\d{1,2})(\1)/i).exec(e))&&(s=t[2]),null!=(t=(re=/width=(["']?)(\d{1,4}%?)(\1)/i).exec(e))&&(i=t[2]),in_array(i,["","0","100%"])?1==r&&1==s?"[td]":"[td="+r+","+s+"]":1==r&&1==s?"[td="+i+"]":"[td="+r+","+s+","+i+"]"}DISCUZCODE.num="-1",DISCUZCODE.html=[],EXTRAFUNC.bbcode2html=[],EXTRAFUNC.html2bbcode=[],"function"==typeof jsloaded&&jsloaded("bbcode");