📄 ubbcode.asp
字号:
strContent= re.Replace(strContent,"<hr noshade size=1><font color=red>注意:<U>本贴为秘密贴,版主、超级版主和管理员可见</U></font><br><hr noshade size=1>$2")
else
re.Pattern="(\[sec\])(.[^\[]*)(\[\/sec\])"
strContent= re.Replace(strContent,"<hr noshade size=1><font color=red>该段为秘密段落,只有版主、超级版主和管理员可见</font><hr noshade size=1>")
end if
'回复可见
if (Cint(Board_Setting(15))=1 or PostUserGroup<4) and PostType=1 then
if instr(lcase(strContent),"[replyview]")>0 and instr(lcase(strContent),"[/replyview]")>0 then
dim vrs
set vrs=conn.execute("select AnnounceID from "&TotalUseTable&" where rootid="&Announceid&" and PostUserID="&UserID)
re.Pattern="(\[replyview\])(.*)(\[\/replyview\])"
if vrs.eof and vrs.bof then
strContent=re.Replace(strContent,"<hr noshade size=1><font color="&Forum_body(8)&">此内容需要回复才能浏览</font><hr noshade size=1>")
else
strContent=re.Replace(strContent,"<hr noshade size=1>以下内容为需要回复才能浏览<BR>$2<hr noshade size=1>")
end if
set vrs=nothing
end if
else
re.Pattern="(\[replyview\])(.*)(\[\/replyview\])"
strContent=re.Replace(strContent,"$2")
end if
'购买帖子
if (Cint(Board_Setting(23))=1 or PostUserGroup<4) and PostType=1 then
re.Pattern="(^.*)(\[usemoney=*([0-9]*)\])(.*)(\[\/usemoney\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
ii=int(po)
else
ii=0
end if
if membername=username and membername<>"" then
if (not isnull(PostBuyUser)) and PostBuyUser<>"" then
SplitBuyUser=split(PostBuyUser,"|")
iPostBuyUser="<option value=0>已购买用户</option>"
for iii=0 to ubound(SplitBuyUser)
iPostBuyUser=iPostBuyUser & "<option value="&iii&">"&SplitBuyUser(iii)&"</option>"
next
else
iPostBuyUser="<option value=0>还没有用户购买</option>"
end if
strContent=re.Replace(strContent,"$1<hr noshade size=1>以下为需要金钱数达到<B>$3</B>才能浏览的内容 <select size=1 name=buyuser>"&iPostBuyUser&"</select><BR>$4<hr noshade size=1>$6")
elseif mymoney>ii or instr("|"&PostBuyUser&"|","|"&membername&"|")>0 then
if membername=username or master or boardmaster or superboardmaster then
if (not isnull(PostBuyUser)) and PostBuyUser<>"" then
SplitBuyUser=split(PostBuyUser,"|")
iPostBuyUser="<select name=buyuser size=1><option value=0>已购买用户</option>"
for iii=0 to ubound(SplitBuyUser)
iPostBuyUser=iPostBuyUser & "<option value="&iii&">"&SplitBuyUser(iii)&"</option>"
next
iPostBuyUser=iPostBuyUser & "</select>"
else
iPostBuyUser="<select name=buyuser size=1><option value=0>还没有用户购买</option></select>"
end if
end if
if (not isnull(PostBuyUser)) and PostBuyUser<>"" then
if instr("|"&PostBuyUser&"|","|"&membername&"|")>0 then
strContent=re.Replace(strContent,"$1<hr noshade size=1>以下为需要花<B>$3</B>金钱才能购买并浏览的内容,您已经购买本贴<BR>$4<hr noshade size=1>$6")
else
strContent=re.Replace(strContent,"$1<Form action=""BuyPost.asp"" mothod=post><font color="&Forum_body(8)&">此帖子内容需要您花$3金钱来购买浏览 <input type=hidden name=boardid value="&boardid&"><input type=hidden value="&replyid&" name=replyid><input type=hidden value="&AnnounceID&" name=id><input type=hidden value="&totalusetable&" name=posttable><input type=submit name=submit value=好黑啊…我…我买了!> "&iPostBuyUser&"</font></form>$6")
end if
else
strContent=re.Replace(strContent,"$1<Form action=""BuyPost.asp"" mothod=post><font color="&Forum_body(8)&">此帖子内容需要您花$3金钱来购买浏览 <input type=hidden name=boardid value="&boardid&"><input type=hidden value="&replyid&" name=replyid><input type=hidden value="&AnnounceID&" name=id><input type=hidden value="&totalusetable&" name=posttable><input type=submit name=submit value=好黑啊…我…我买了!> "&iPostBuyUser&"</font></form>$6")
end if
else
strContent=re.Replace(strContent,"$1<hr noshade size=1><font color="&Forum_body(8)&">此内容要求金钱数达到$3以上才可以购买并浏览</font><hr noshade size=1>$6")
end if
else
re.Pattern="(\[usemoney=*([0-9]*)\])(.*)(\[\/usemoney\])"
strContent=re.Replace(strContent,"$3")
end if
re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$2</A>")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"<A HREF=""$2"" TARGET=_blank>$3</A>")
re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=pic/email1.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
'自动识别网址
re.Pattern = "(^|[^==""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$2>$2</a>")
re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)$"
strContent = re.Replace(strContent,"<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$1>$1</a>")
re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+([^<>""])+)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=$2>$2</a>")
'自动识别www等开头的网址
re.Pattern = "([^(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*[^<>""]+)*)"
strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=http://$2>$2</a>")
'自动识别Email地址,如打开本功能在浏览内容很多的帖子会引起服务器停顿
're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
'strContent = re.Replace(strContent,"$1<img align=absmiddle src=pic/url.gif border=0><a target=_blank href=""mailto:$2"">$2</a>")
'em code
if (Cint(Board_Setting(8)) = 1 or PostUserGroup<4) and instr(lcase(strContent),"[em")>0 then
for ii=0 to Forum_emotNum
if len(ii)=1 then po="0" & ii else po=ii
strContent=replace(strContent,"[em"&po&"]","<img src="&Forum_info(10)&Forum_emot(ii)&" border=0 align=middle>")
next
else
re.Pattern="\[em(.[^\[]*)\]"
strContent=re.Replace(strContent,"")
end if
re.Pattern="\[HTML\](.[^\[]*)\[\/HTML\]"
strContent=re.Replace(strContent,"<table width='100%' border='0' cellspacing='0' cellpadding='6' class='"&abgcolor&"'><td><b>以下内容为程序代码:</b><br>$1</td></table>")
re.Pattern="\[code\](.[^\[]*)\[\/code\]"
strContent=re.Replace(strContent,"<table width='100%' border='0' cellspacing='0' cellpadding='6' class='"&abgcolor&"'><td><b>以下内容为程序代码:</b><br>$1</td></table>")
re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=$1>$2</font>")
re.Pattern="\[color=(.[^\[]*)\](.*)\[\/color\]"
strContent=re.Replace(strContent,"<font color=$1>$2</font>")
re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
strContent=re.Replace(strContent,"<font face=$1>$2</font>")
re.Pattern="\[align=(center|left|right)\](.[^\[]*)\[\/align\]"
strContent=re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern="\[align=(center|left|right)\](.*)\[\/align\]"
strContent=re.Replace(strContent,"<div align=$1>$2</div>")
re.Pattern="\[center\](.*)\[\/center\]"
strContent=re.Replace(strContent,"<div align=center>$1</div>")
re.Pattern="\[QUOTE\](.*)\[\/QUOTE\]"
strContent=re.Replace(strContent,"<table style=""width:100%"" cellpadding=5 cellspacing=1 class=tableborder1><TR><TD class="&abgcolor&" width=""100%"">$1</td></tr></table><br>")
re.Pattern="\[fly\](.*)\[\/fly\]"
strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")
re.Pattern="\[move\](.*)\[\/move\]"
strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$1</marquee>")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"<table width=$1 ><tr><td style=""filter:shadow(color=$2, strength=$3)"">$4</td></tr></table>")
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"<table width=$1 ><tr><td style=""filter:glow(color=$2, strength=$3)"">$4</td></tr></table>")
re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"<i>$1</i>")
re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"<u>$1</u>")
re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"<b>$1</b>")
re.Pattern="\[size=([1-4])\](.[^\[]*)\[\/size\]"
strContent=re.Replace(strContent,"<font size=$1>$2</font>")
strContent=replace(strContent,"<I></I>","")
set re=Nothing
DvBcode=strContent
end function
function DvSignCode(strContent,PostUserGroup)
if Forum_Setting(66)<>1 then
strContent = dvHTMLEncode(strContent)
else
strContent = HTMLcode(strContent)
end if
if Forum_Setting(65)<>1 and PostUserGroup>2 then
DvSignCode=strContent
exit function
end if
dim re,ii,po
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(javascript)"
strContent=re.Replace(strContent,"javascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"jscript:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"js:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"value")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about:")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file:")
re.Pattern="(document.cookie)"
strContent=re.Replace(strContent,"documents.cookie")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -