<%
'其实本页面已没有什么作用了，可以删除！可供参考学习！
function ubbtst(strer)
dim re,po,ii
Set re=new RegExp
re.IgnoreCase=true
re.Global=True
po=0
ii=0
'---------------------------------------------背景音乐----------------------------------------------------------
re.Pattern="(\/奉献)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/fenxian.MID border=0 align=middle>")
re.Pattern="(\/心雨)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/xinyu.MID border=0 align=middle>")
re.Pattern="(\/童年)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/tongnian.MID border=0 align=middle>")
re.Pattern="(\/国歌)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/guoge.MID border=0 align=middle>")
re.Pattern="(\/天涯)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/tianya.MID border=0 align=middle>")
re.Pattern="(\/天意)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/tianyi.MID border=0 align=middle>")
re.Pattern="(\/女人)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/nvren.MID border=0 align=middle>")
re.Pattern="(\/后来)"
    strer=re.Replace(strer,"<bgsound src=../images/bmusic/76.mid border=0 align=middle>")
re.Pattern="(\/彩虹)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/95.mid border=0 align=middle>")
re.Pattern="(\/最美)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/3.mid border=0 align=middle>")
re.Pattern="(\/心动)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/90.mid border=0 align=middle>")
re.Pattern="(\/勇气)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/87.mid border=0 align=middle>")
re.Pattern="(\/星晴)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/57.mid border=0 align=middle>")
re.Pattern="(\/约定)"
	strer=re.Replace(strer,"<bgsound src=../images/bmusic/61.mid border=0 align=middle>")
re.Pattern="(\/宽容)"
'-----------------------------------------------回复可见----------------------------------------------------------
if instr(lcase(strer),"[/replyview]")>0 then
	re.Pattern="(\[replyview\])(.*)(\[\/replyview\])"
    if forum_power_true(forumpower)<>false then
	strer=re.Replace(strer,"<hr noshade size=1><font class=red2>以下内容为需要回复才能浏览</font><BR>$2<hr noshade size=1>")
    else
	sql="select id from bbs_data where forum_id="&forumid&" and reply_id="&viewid&" and username='"&login_username&"'"
    set rs=joekoe_cms.exec(sql,1)
	if rs.eof and rs.bof then
	strer=re.Replace(strer,"<hr noshade size=1><font class=red2>此内容需要回复才能浏览</font><hr noshade size=1>")
	else
	strer=re.Replace(strer,"<hr noshade size=1>以下内容为需要回复才能浏览<BR>$2<hr noshade size=1>")
	end if
	rs.close
	end if
end if
'--------------------------------------------------金钱可见-------------------------------------------------------
if instr(lcase(strer),"[/money]")>0 then
	re.Pattern="(^.*)(\[money=*([0-9]*)\])(.*)(\[\/money\])(.*)"
	po=re.Replace(strer,"$3")
	if IsNumeric(po) then
		ii=int(po)
	else
		ii=0
	end if
    if forum_power_true(forumpower)<>false  or vdim(7,i)=login_username or int(login_emoney)>=ii then
		strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>以下为需要"&web_dim(9)&"数达到<B>$3</B>才能浏览的内容</font><BR>$4<hr noshade size=1>$6")
	else
		strer=re.Replace(strer,"$1<hr noshade size=1><font class=red>此内容要求"&web_dim(9)&"数达到<b>$3</b>以上才可以浏览</font><hr noshade size=1>$6")
	end if
end if
'---------------------------------------------------积分可见------------------------------------------------------
if instr(lcase(strer),"[/point]")>0 then
    re.Pattern="(^.*)(\[point=*([0-9]*)\])(.*)(\[\/point\])(.*)"
    po=re.Replace(strer,"$3")
    if IsNumeric(po) then
       ii=int(po)
    else
       ii=0
    end if
   if forum_power_true(forumpower)<>false  or vdim(7,i)=login_username or int(login_integral)>=ii then
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>以下为需要积分达到<B>$3</B>才能浏览的内容</font><BR>$4<hr noshade size=1>$6")
    else
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red>此内容要求积分达到<b>$3</b>以上才可以浏览</font><hr noshade size=1>$6")
    end if
end if
'---------------------------------------------------贴子数可见------------------------------------------------------
if instr(lcase(strer),"[/post]")>0 then
    re.Pattern="(^.*)(\[post=*([0-9]*)\])(.*)(\[\/post\])(.*)"
    po=re.Replace(strer,"$3")
    if IsNumeric(po) then
       ii=int(po)
    else
       ii=0
    end if
   if forum_power_true(forumpower)<>false  or vdim(7,i)=login_username or int(login_bbs_counter)>=ii then
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>以下为需要贴子数达到<B>$3</B>才能浏览的内容<BR></font>$4<hr noshade size=1>$6")
    else
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red>此内容要求贴子达到<b>$3</b>以上才可以浏览</font><hr noshade size=1>$6")
    end if
end if
'-----------------------------------------------------购买帖子---------------------------------------------------- 
if instr(lcase(strer),"[/usemoney]")>0 then
    re.Pattern="(^.*)(\[usemoney=*([0-9]*)\])(.*)(\[\/usemoney\])(.*)"
    po=re.Replace(strer,"$3")
    if IsNumeric(po) then
	   ii=int(po) 
    else
	   ii=0
    end if
    dim iPostBuyUser
	if login_mode<>"" then
    sql="select username from notes where nsort='b"&forumid&"' and iid="&viewid&" order by id"
    set rs=joekoe_cms.exec(sql,1)
    if rs.eof and rs.bof then
    iPostBuyUser="<select name=buyuser size=1><option>还没有用户购买</option>"
    else
    iPostBuyUser="<select name=buyuser size=1><option>已购买用户</option>"
    end if
    do while not rs.eof
    iPostBuyUser=iPostBuyUser&"<option>"&rs("username")&"</option>"
    rs.movenext
    loop
    iPostBuyUser=iPostBuyUser&"</select>"
    rs.close
	end if
    sql="select id from notes where username='"&login_username&"' and nsort='b"&forumid&"' and iid="&viewid&""
    set rs=joekoe_cms.exec(sql,1)
    if rs.eof and rs.bof then
       if forum_power_true(forumpower)<>false  or vdim(7,i)=login_username then
       strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>以下为需要花<B>$3</B>"&web_dim(9)&"才能购买并浏览的内容&nbsp;&nbsp;"&iPostBuyUser&"</font><BR>$4<hr noshade size=1>$6")
       else
       if int(login_emoney)>=ii then
	   strer=re.Replace(strer,"$1<form action=""buypost.asp"" mothod=post><hr noshade size=1><font class=red>此帖子内容需要您花<b>$3</b>"&web_dim(9)&"来购买浏览&nbsp;&nbsp;<input type=hidden value="&vdim(7,i)&" name=username><input type=hidden value="&ii&" name=emoney><input type=hidden name=forum_id value="&forumid&"><input type=hidden value="&viewid&" name=view_id><input type=submit class=btn name=submit value=好黑啊…我…我买了！>&nbsp;&nbsp;"&iPostBuyUser&"</font><hr noshade size=1></form>$6")
       else
	   strer=re.Replace(strer,"$1<hr noshade size=1><font class=red>此内容要求"&web_dim(9)&"数达到<b>$3</b>以上才可以购买并浏览&nbsp;&nbsp;"&iPostBuyUser&"</font><hr noshade size=1>$6")
       end if
       end if
    else 
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>以下为需要花<B>$3</B>"&web_dim(9)&"才能购买并浏览的内容，您已经购买了本贴&nbsp;&nbsp;"&iPostBuyUser&"<BR></font>$4<hr noshade size=1>$6")
	rs.close
    end if
end if
'------------------------------------------------------指定帖-----------------------------------------------------
if instr(lcase(strer),"[/name]")>0 then
    re.Pattern="(^.*)(\[name=(.[^\[]*)\])(.*)(\[\/name\])(.*)"
    po=re.replace(strer,"$3")
      if forum_power_true(forumpower)<>false  or vdim(7,i)=login_username or zdtusers(po)="yes" then
        strer=re.Replace(strer,"$1<hr noshade size=1><font class=red2>此內容只有作者、 <B>$3</B> 及管理员才能浏览。</font><BR>$4<hr noshade size=1>$6")
      else
        strer=re.Replace(strer,"$1<hr noshade size=1><font class=red>此內容只有作者、 <font class=blue><b>$3</b></font> 及管理员才能浏览。</font><BR><hr noshade size=1>$6")
    end if
end if
  set re=nothing
  strer=replace(strer,vbCrLf,"<br>")
  ubbtst=strer
end function

function reubbtst(strer,t)
    strer = replace(strer, ">", "&gt;")
    strer = replace(strer, "<", "&lt;")
    strer = Replace(strer, CHR(32), "<I></I>&nbsp;")
    strer = Replace(strer, CHR(9), "&nbsp;")
    strer = Replace(strer, CHR(34), "&quot;")
    strer = Replace(strer, CHR(39), "&#39;")
    strer = Replace(strer, CHR(13), "")
    strer = Replace(strer, CHR(10) & CHR(10), "[BR] ")
    strer = Replace(strer, CHR(10), "[br] ")
    if t=0 then strer=replace(code_jk(rs(3)),vbCrLf,"<br>")
dim re
Set re=new RegExp
re.IgnoreCase=true
re.Global=True
if t=1 then 
  strer=replace(strer,"&nbsp;"," ")
  re.Pattern="(\[QUOTE\])(.[^\[]*)(\[\/QUOTE\])"  
  strer=re.Replace(strer,"")
  re.Pattern="(\[replyview\])(.*)(\[\/replyview\])"
  strer=re.Replace(strer,"★★ 回复贴内容不能察看 ★★")	
  re.Pattern="(\[money=*([0-9]*)\])(.*)(\[\/money\])"
  strer=re.Replace(strer,"★★ 金钱贴内容不能察看 ★★")
  re.Pattern="(\[point=*([0-9]*)\])(.*)(\[\/point\])"
  strer=re.Replace(strer,"★★ 积分贴内容不能察看 ★★")
  re.Pattern="(\[usemoney=*([0-9]*)\])(.*)(\[\/usemoney\])"
  strer=re.Replace(strer,"★★ 贴子数贴内容不能察看 ★★")
  re.Pattern="(\[usemoney=*([0-9]*)\])(.*)(\[\/usemoney\])"  
  strer=re.Replace(strer,"★★ 购买贴内容不能察看 ★★")
  re.Pattern="(\[name=(.[^\[]*)\])(.*)(\[\/name\])"
  strer=re.Replace(strer,"★★ 指定贴内容不能察看 ★★")
  else
  re.Pattern="\[replyview\](.*)\[\/replyview\]"
  strer=re.Replace(strer,"☆☆ 回复贴内容不能打印预览 ☆☆")	
  re.Pattern="\[money=*([0-9]*)\](.*)\[\/money\]"
  strer=re.Replace(strer,"☆☆ 金钱贴内容不能打印预览 ☆☆")
  re.Pattern="\[point=*([0-9]*)\](.*)\[\/point\]"
  strer=re.Replace(strer,"☆☆ 积分贴内容不能打印预览 ☆☆")
  re.Pattern="(\[post=*([0-9]*)\])(.*)(\[\/post\])"
  strer=re.Replace(strer,"☆☆ 贴子数贴内容不能打印预览 ☆☆")  
  re.Pattern="\[usemoney=*([0-9]*)\](.*)\[\/usemoney\]"
  strer=re.Replace(strer,"☆☆ 购买贴内容不能打印预览 ☆☆")
  re.Pattern="\[name=(.[^\[]*)\](.*)\[\/name\]"
  strer=re.Replace(strer,"☆☆ 指定贴内容不能打印预览 ☆☆")
end if
strer=replace(strer,"<I></I>","")
set re=Nothing
reubbtst=strer
end function

function zdtusers(zdtname)
  dim zdtuserarr,iiii
    zdtname=lcase(zdtname)
    zdtname=replace(zdtname,"，",",")
	zdtusers = "no"
	if ""&zdtname&"" = "" then
		exit function
	end if
	if instr(zdtname, ",") then
		zdtuserarr	= split(zdtname, ",")
		for iiii = 0 to ubound(zdtuserarr)
			if zdtuserarr(iiii) = lcase(login_username) then
				zdtusers = "yes"
				exit function
			end if
		next
	else
		if zdtname = login_username then
			zdtusers = "yes"
		end if
	end if
end function
%>