⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ubb.asp

📁 海洋分类信网程序是由海洋城市设计工作室基于ASP+Access/Mssql技术开发的分类信息程序
💻 ASP
字号:
<%
function UBBCode(content)
	dim check
   Set re = New RegExp
   re.IgnoreCase =True
   re.Global=True

'回复可见
if instr(lcase(content),"[replyview]")>0 then
   re.Pattern="(\[replyview\])(.*)(\[/replyview\])"
  if CookieUserName=empty then
    content=re.replace(content,"<hr noshade size=1><font color=ff0000>以下内容需要<B>回复</B>才能浏览,请先登陆</font><hr noshade size=1>")   
  else
  if CookieUserName=rs("username") or conn.execute("select count(id) from [BBSXP_Posts"&conn.Execute("Select PostsTableName From [BBSXP_Threads] where IsDel=0 order by lasttime desc")(0)&"] where ThreadID="&int(request.QueryString("ThreadID"))&" and username='"&CookieUserName&"'")(0)>0 then 
		     content=re.replace(content,"<hr noshade size=1><font color=gray><font color=ff0000>此内容需要<B>回复</B>才能浏览,以下为隐藏内容</font><br>$2</font><hr noshade size=1>")   
		  else
		      content=re.replace(content,"<hr noshade size=1><font color=ff0000>以下内容需要<B>回复</B>才能浏览</font><hr noshade size=1>")      
	     end if
	end if
end if


'帖子达到可见
if instr(lcase(content),"[ybbtopic=")>0 then
  if CookieUserName=empty then
   re.Pattern="(.*)(\[ybbtopic=)(\d*)(\])(.*)(\[/ybbtopic\])(.*)"
  check=re.replace(content,"$3")   
  check=checkint(check)
  content=re.replace(content,"<hr noshade size=1><font color=gray><br><font color=FF0000>以下内容要求发贴数达到<B>"&check&"</B>以上才可以浏览,请先<b>登陆</b></font><br><hr noshade size=1>")   
  else
   re.Pattern="(.*)(\[ybbtopic=)(\d*)(\])(.*)(\[/ybbtopic\])(.*)"
  check=re.replace(content,"$3")   
  check=checkint(check)

dim Ttopic,Ptopic,Rtopic
Ptopic=conn.execute("select PostTopic from [BBSXP_Users] where username='"&CookieUserName&"'")(0)
Rtopic=conn.execute("select PostRevert from [BBSXP_Users] where username='"&CookieUserName&"'")(0)
Ttopic=Ptopic+Rtopic
	    if CookieUserName=rs("username") or Ttopic>=check then
		     content=re.replace(content,"$1<hr noshade size=1><font color=gray><br><font color=FF0000>此内容要求发贴数达到<B>"&check&"</B>以上才可以浏览</font><br>$5<hr noshade size=1>$7")   
		  else
		      content=re.replace(content,"$1<hr noshade size=1><font color=gray><br><font color=FF0000>以下内容要求发贴数达到<B>"&check&"</B>以上才可以浏览</font><br><hr noshade size=1>$7")      
	     end if
	end if
end if


'经验达到可见
if instr(lcase(content),"[ybbexp=")>0 then
  if CookieUserName=empty then
   re.Pattern="(.*)(\[ybbexp=)(\d*)(\])(.*)(\[/ybbexp\])(.*)"
  check=re.replace(content,"$3")   
  check=checkint(check)
  content=re.replace(content,"<hr noshade size=1><font color=gray><br><font color=FF0000>以下内容要求经验值达到<B>"&check&"</B>以上才可以浏览,请先<b>登陆</b></font><br><hr noshade size=1>")   
  else
   re.Pattern="(.*)(\[ybbexp=)(\d*)(\])(.*)(\[/ybbexp\])(.*)"
  check=re.replace(content,"$3")   
  check=checkint(check)
	    if CookieUserName=rs("username") or conn.execute("select Experience from [BBSXP_Users] where username='"&CookieUserName&"'")(0)>=check then
		     content=re.replace(content,"$1<hr noshade size=1><font color=gray><br><font color=FF0000>此内容要求经验值达到<B>"&check&"</B>以上才可以浏览</font><br>$5<hr noshade size=1>$7")   
		  else
		      content=re.replace(content,"$1<hr noshade size=1><font color=gray><br><font color=FF0000>以下内容要求经验值达到<B>"&check&"</B>以上才可以浏览</font><br><hr noshade size=1>$7")      
	     end if
	end if
end if


'工会可见
if instr(lcase(content),"[ybbfaction]")>0 then
   re.Pattern="(\[ybbfaction\])(.*)(\[/ybbfaction\])"
   dim topname
   topname=conn.execute("select Username From [BBSXP_Threads] where ID="&int(request.QueryString("ThreadID"))&"")(0)
   check=conn.execute("select Consortia from [BBSXP_Users] where username='"&topname&"'")(0)
  if CookieUserName=empty then
    content=re.replace(content,"<hr noshade size=1><font color=ff0000>以下内容仅&nbsp;<B>"&check&"</B>&nbsp;的会员才能浏览,请先登陆</font><hr noshade size=1>")   
  else
  if CookieUserName=rs("Username") or conn.execute("select Consortia from [BBSXP_Users] where username='"&CookieUserName&"'")(0)=check then 
		     content=re.replace(content,"<hr noshade size=1><font color=gray><font color=ff0000>此内容仅&nbsp;<B>"&check&"</B>&nbsp;的会员才能浏览,以下为隐藏内容</font><br>$2</font><hr noshade size=1>")   
		  else
		      content=re.replace(content,"<hr noshade size=1><font color=ff0000>以下内容仅&nbsp;<B>"&check&"</B>&nbsp;的会员才能浏览</font><hr noshade size=1>")      
	     end if
	end if
end if


'金钱数可见
if instr(lcase(content),"[postjb=")>0 then
  if CookieUserName=empty then
   re.Pattern="(.*)(\[postjb=)(\d*)(\])(.*)(\[/postjb\])(.*)"
  check=re.replace(content,"$3") 
  content=re.replace(content,"<hr noshade size=1><font color=gray><font color=red>以下内容要求 <font color=blue>金钱数达到 <b>"&check&"</B> 以上</font> 才可以浏览</font><br><hr noshade size=1>")   
  else
   re.Pattern="(.*)(\[postjb=)(\d*)(\])(.*)(\[/postjb\])(.*)"
  check=re.replace(content,"$3")   
  check=checkint(check)
		
	    if CookieUserName=rs("username") or conn.execute("select UserMoney from [BBSXP_users] where username='"&CookieUserName&"'")(0)>=check then
		     content=re.replace(content,"$1<hr noshade size=1><font color=gray><font color=red>以下内容要求 <font color=blue>金钱数达到 <b>"&check&"</B> 以上</font> 才可以浏览</font><br>$5<hr noshade size=1>$7")   
		  else
		      content=re.replace(content,"$1<hr noshade size=1><font color=gray><font color=red>以下内容要求 <font color=blue>金钱数达到 <b>"&check&"</B> 以上</font> 才可以浏览</font><br><hr noshade size=1>$7")      
	     end if
	end if
end if


'定员可见
if instr(lcase(content),"[postme=")>0 then
  if CookieUserName=empty then
   re.Pattern="(.*)(\[postme=)(.*)(\])(.*)(\[/postme\])(.*)"
filtrate=split(content,"[/postme]")
contentT=""
contentT1=split(content,"[postme=")
contentT2=replace(content,contentT1(0)&"[postme=","")
check=split(contentT2,"]")(0)  
  content=re.replace(content,"<hr noshade size=1><font color=gray><font color=red>以下内容只有 <font color=blue><b><a href=Profile.asp?username="&check&">"&check&"</a></B></font> 可以浏览</font><br><hr noshade size=1>")   
  else
   re.Pattern="(.*)(\[postme=)(.*)(\])(.*)(\[/postme\])(.*)"
filtrate=split(content,"[/postme]")
contentT=""
contentT1=split(content,"[postme=")
contentT2=replace(content,contentT1(0)&"[postme=","")
check=split(contentT2,"]")(0)
		
		if conn.execute("select username from [BBSXP_users] where username='"&CookieUserName&"'")(0)=check or rs("username")=CookieUserName then
		     content=re.replace(content,"$1<hr noshade size=1><font color=gray><font color=red>以下内容只有 <font color=blue><b><a href=Profile.asp?username="&check&">"&check&"</a></B></font> 可以浏览</font><br>$5<hr noshade size=1>$7")   
		  else
		      content=re.replace(content,"$1<hr noshade size=1><font color=gray><font color=red>以下内容只有 <font color=blue><b><a href=Profile.asp?username="&check&">"&check&"</a></B></font> 可以浏览</font><br><hr noshade size=1>$7")      
	     end if
	end if
end if


'点击后可见
if Instr(Lcase(Content),"[postad=")>0 then
postad=ReplaceText(Content,".*\[postad\=([^]]*)\].*","$1")
 if postad<>"" then
  if Request("postad")=postad then
   if Request("postad")=postad then Response.write "<SCRIPT>window.open ('"&Request("postad")&"')</SCRIPT>"
   Content=ReplaceText(Content,"\[postad\=[^]]*\]|\[\/postad\]","")
  else
   Content=ReplaceText(Content,"\[postad\=.*\[\/postad\]","<hr noshade size=1><font color=red>以下内容需要 <font color=blue><B>点击下面链接</B></font> 才可以浏览</font><br><form method=POST action=ShowPost.asp?ThreadID="&ThreadID&"><input type=hidden value="&postad&" name=postad> <input type=submit value="&postad&" style="&chr(34)&"border:1px solid #red;color:#0000FF;background-color:#FFFFFF"&chr(34)&"></form><hr noshade size=1>")
  end if
 end if
end if


	set re=Nothing
	UBBCode=content
end function

function checkint(check)
	if IsNumeric(check) then
		check=int(check)
	else
                response.write("<font color=red><b><u>Error!Please Input Int.</u></b></font>")
		check=0
	end if
	checkint=check
end function

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -