ubb.asp

来自「一个不错的论坛原代码」· ASP 代码 · 共 515 行 · 第 1/2 页

ASP
515
字号
	re.Pattern="(^.*)(\[beauty=*([0-9]*)\])(.[^\[]*)(\[\/beauty\])(.*)"
 beautyd=re.Replace(strContent,"$3")
 if IsNumeric(beautyd) then
 if chktopic1 or chkbanzhu or issupermaster or ismaster or fycpbbeauty>int(beautyd) then
	strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为魅力贴,只有魅力大于$3才能观看</u>:$4<BR>$6")
	 else
	strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有魅力值大于$3才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
	end if
	end if
	
	'威望
	re.Pattern="(^.*)(\[weiwang=*([0-9]*)\])(.[^\[]*)(\[\/weiwang\])(.*)"
	 weiwangd=re.Replace(strContent,"$3")
 if IsNumeric(weiwangd) then
 if chktopic1 or chkbanzhu or issupermaster or ismaster or fycpbweiwang>int(weiwangd) then
	strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为威望贴,只有威望大于$3才能观看</u>:$4<BR>$6")
	 else
	strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有威望值大于$3才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
	end if
	end if
	
	'买卖贴
	re.Pattern="(^.*)(\[buy=*([0-9]*)\])(.[^\[]*)(\[\/buy\])(.*)"
 buyd=re.Replace(strContent,"$3")
 if IsNumeric(buyd) then
 if not(isnull(t_buysend)) then
 t_buysend1=split(t_buysend, ",")
 for i=0 to (ubound(t_buysend1)-1)
      if cpbusername=t_buysend1(i) then
      buyed=1
      exit for
      end if
      next
end if

 if chktopic1 or chkbanzhu or issupermaster or ismaster  or (fycpbmoney>int(buyd) and buyed=1) or buyed=1 then

  if (chktopic1 or chkbanzhu or issupermaster or ismaster) and not(isnull(t_buysend)) then
    buymoney="<select size=1 class=bdtj3>"
	 	buymoney=buymoney & "<option value=0>已购买用户</option>"
		for i=0 to (ubound(t_buysend1)-1)
			buymoney=buymoney & "<option value="&i&">"&t_buysend1(i)&"</option>"
		next
	elseif chktopic1 or chkbanzhu or issupermaster or ismaster then
	  buymoney="<select size=1 class=bdtj3>"
	buymoney=buymoney & "<option value=0>没有用户购买</option>"
	end if
	 buymoney=buymoney & "</select>"
	 strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为出售贴,只有金钱大于$3并花费$3才能观看</u>:$4"&buymoney&"<BR>$6")
	 else
	if fycpbmoney>int(buyd) then
		strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,需要花费$3购买才可浏览<br><form name=vote method=post action=buytopic.asp><input type=submit name=Submit value='我要买' class='bdtj'><input type=hidden name=l_id value="&l_id&"><input type=hidden name=t_id value="&t_id&"><input type=hidden name=jmoney value=$3></form><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")

	else
		strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有金钱值大于并花费$3购买才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
end if
	end if
	end if

	re.Pattern="(^.*)(\[send=*([0-9]*)\])(.[^\[]*)(\[\/send\])(.*)"
     sendd=re.Replace(strContent,"$3")
	  if IsNumeric(sendd) then
	 if chktopic1 or chkbanzhu or issupermaster or ismaster or fycpbsend>int(sendd) then
	strContent=re.Replace(strContent,"$1<BR>注意:<U>本贴为文章贴,只有发表文章数大于$3才能观看</u>:$4<BR>$6")
	 else
	strContent=re.Replace(strContent,"$1<BR><center>===================<b>以下为隐藏内容</b>==================<br><br>该段部分内容已被隐藏,只有发表文章数大于$3才可浏览<br><br>====================<b>隐藏内容结束</b>===================</center><BR>$6")
	end if
	end if
	end if
	
end if


'自动寻找

if checkurl="1" or checkurlreply="1" then

'自动识别网址
re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@[\]\':+!]+)"
strContent = re.Replace(strContent,"<img align=absmiddle src=image/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,"<img align=absmiddle src=image/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=image/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,"<img align=absmiddle src=image/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,"<img align=absmiddle src=image/email.gif border=0><a target=_blank href=""mailto:$2"">$2</a>")
	end if
    set re=Nothing
     end if
    UBBCode=strContent
   
end function


function ubbsign(strContent)
    if h_html<>"1" then 
    strContent =  cpbhtmlencode(strContent)
    else
    strContent = HTMLcode(strContent)
    end if
       if h_ubb<>"1" then
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True
   
re.Pattern="(javascript)"
strContent=re.Replace(strContent,"&#106avascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"&#106script:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"&#106s:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"&#118alue")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about&#58")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file&#58")
re.Pattern="(document.cookie)"
strContent=re.Replace(strContent,"documents&#46cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"&#118bscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"&#111n$2")
	
if h_signimg<>"1" then
re.Pattern="(\[IMG\])(http|https|ftp):\/\/(.[^\[]*)(\[\/IMG\])"
	strContent=re.Replace(strContent,"<IMG SRC=""$2://$3"" border=0  onload=""javascript:if(this.width>screen.width-300)this.width=screen.width-300""><br>")	
	end if
	
 'flash转换
    if h_flash<>"1" then
    re.Pattern="\[FLASH\](http|https|ftp):\/\/(.[^\[]*)\[\/FLASH\]"
	strContent= re.Replace(strContent,"<BR><OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=480 height=280><PARAM NAME=movie VALUE=""$1://$2""><PARAM NAME=quality VALUE=high><embed src=""$1://$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=480 height=280>$1://$2</embed></OBJECT><BR>")
    end if
    
    
  'url与email 转换
 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\])((\w)+[@]{1}(\w)+[.]{1,3}(\w)+)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=image/email.gif><A HREF=""mailto:$2"">$2</A>")
re.Pattern="(\[EMAIL=((\w)+[@]{1}(\w)+[.]{1,3}(\w)+)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"<img align=absmiddle src=image/email.gif><A HREF=""mailto:$2"" TARGET=_blank>$3</A>")


 '一般的文字处理
	
	 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="\[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="\[fly\](.[^\[]*)\[\/fly\]"
 	strContent=re.Replace(strContent,"<marquee width=90% behavior=alternate scrollamount=3>$1</marquee>")


        re.Pattern="\[font=(.[^\[]*)\](.[^\[]*)\[\/font\]"
	strContent=re.Replace(strContent,"<font face=$1>$2</font>")

re.Pattern="\[size=(.[^\[]*)\](.[^\[]*)\[\/size\]"
	strContent=re.Replace(strContent,"<font size=$1>$2</font>")
	
	re.Pattern="\[move\](.[^\[]*)\[\/move\]"
	strContent=re.Replace(strContent,"<MARQUEE scrollamount=3>$1</marquee>")
	
	re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
	strContent=re.Replace(strContent,"<table width=$1 style=""filter:glow(color=$2, strength=$3)"">$4</table>")
	
	re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
	strContent=re.Replace(strContent,"<table width=$1 style=""filter:shadow(color=$2, strength=$3)"">$4</table>")
	
	 strContent=replace(strContent,"[br]","<br>")
    set re=Nothing
      end if
    UBBsign=strContent
      
end function

'-------------回复标签---------
function reubb(strContent)
	strContent =  cpbhtmlencode(strContent)
	   if h_ubb<>"1" then
	Set re=new RegExp
	re.IgnoreCase =true
	re.Global=True
re.Pattern="(javascript)"
strContent=re.Replace(strContent,"&#106avascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"&#106script:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"&#106s:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"&#118alue")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about&#58")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file&#58")
re.Pattern="(document.cookie)"
strContent=re.Replace(strContent,"documents&#46cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"&#118bscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"&#118bs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"&#111n$2")
	re.Pattern="(\[QUOTE\])(.[^\[]*)(\[\/QUOTE\])"
	strContent=re.Replace(strContent,"")
        re.Pattern="\[login\](.[^\[]*)\[\/login\]"
        strContent=re.Replace(strContent,"")
        re.Pattern="\[replyview\](.[^\[]*)\[\/replyview\]"
        strContent=re.Replace(strContent,"")
        re.Pattern="(^.*)(\[fen=*([0-9]*)\])(.[^\[]*)(\[\/fen\])(.*)"
        strContent=re.Replace(strContent,"")
        re.Pattern="(^.*)(\[send=*([0-9]*)\])(.[^\[]*)(\[\/send\])(.*)"
        strContent=re.Replace(strContent,"")
          re.Pattern="(^.*)(\[beauty=*([0-9]*)\])(.[^\[]*)(\[\/beauty\])(.*)"
        strContent=re.Replace(strContent,"")
         re.Pattern="(^.*)(\[money=*([0-9]*)\])(.[^\[]*)(\[\/money\])(.*)"
        strContent=re.Replace(strContent,"")
        re.Pattern="(^.*)(\[weiwang=*([0-9]*)\])(.[^\[]*)(\[\/weiwang\])(.*)"
        strContent=re.Replace(strContent,"")
 re.Pattern="(^.*)(\[buy=*([0-9]*)\])(.[^\[]*)(\[\/buy\])(.*)"
        strContent=re.Replace(strContent,"")
	set re=Nothing
	  end if
	reUBB=strContent
end function


%>

⌨️ 快捷键说明

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