<%
'****************************************************************
'
'
'****************************************************************
function ubbtst(strer)
dim re,po,ii
Set re=new RegExp
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="(\/宽容)" 
re.IgnoreCase=true
re.Global=True
po=0
ii=0
'回复可见
	re.Pattern="(\[replyview\])(.*)(\[\/replyview\])"
    if login_mode="admin" then  '定义管理员可见
	strer=re.Replace(strer,"<hr noshade size=1>以下内容为需要回复才能浏览<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=red_3>此内容需要回复才能浏览</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
'金钱可见
	re.Pattern="(^.*)(\[money=*([0-9]*)\])(.*)(\[\/money\])(.*)"
	po=re.Replace(strer,"$3")
	if IsNumeric(po) then
		ii=int(po)
	else
		ii=0
	end if
    if login_mode="admin" or vdim(7,i)=login_username or int(login_emoney)>=ii then  '定义管理员及发帖用户可见
		strer=re.Replace(strer,"$1<hr noshade size=1>以下为需要金钱数达到<B>$3</B>才能浏览的内容<BR>$4<hr noshade size=1>$6")
	else
		strer=re.Replace(strer,"$1<hr noshade size=1><font class=red_3>此内容要求金钱数达到$3以上才可以浏览</font><hr noshade size=1>$6")
	end if
'积分可见
    re.Pattern="(^.*)(\[point=*([0-9]*)\])(.*)(\[\/point\])(.*)"
    po=re.Replace(strer,"$3")
    if IsNumeric(po) then
       ii=int(po)
    else
       ii=0
    end if
    if login_mode="admin" or vdim(7,i)=login_username or int(login_integral)>=ii then  '定义管理员及发帖用户可见
    strer=re.Replace(strer,"$1<hr noshade size=1>以下为需要积分达到<B>$3</B>才能浏览的内容<BR>$4<hr noshade size=1>$6")
    else
    strer=re.Replace(strer,"$1<hr noshade size=1><font class=red_3>此内容要求积分达到$3以上才可以浏览</font><hr noshade size=1>$6")
    end if
'购买帖子
    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
    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 size=1><option>还没有用户购买</option>"
    else
    iPostBuyUser="<select 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
    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 login_mode="admin" or vdim(7,i)=login_username then  '定义管理员及发帖用户可见
       strer=re.Replace(strer,"$1<hr noshade size=1>以下为需要花<B>$3</B>金钱才能购买并浏览的内容&nbsp;&nbsp;"&iPostBuyUser&"<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><input type=hidden name=chk value=""yes""><hr noshade size=1><font class=red_3>此帖子内容需要您花$3金钱来购买浏览&nbsp;&nbsp;<input type=hidden value="&vdim(7,i)&" name=username><input type=hidden value="&ii&" name=emoney><input type=hidden value="&forumid&" name=forum_id><input type=hidden value="&viewid&" name=view_id><input type=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_3>此内容要求金钱数达到$3以上才可以购买并浏览&nbsp;&nbsp;"&iPostBuyUser&"</font><hr noshade size=1>$6")
       end if
       end if
    else 
    strer=re.Replace(strer,"$1<hr noshade size=1>以下为需要花<B>$3</B>金钱才能购买并浏览的内容，您已经购买本贴&nbsp;&nbsp;"&iPostBuyUser&"<BR>$4<hr noshade size=1>$6")
	rs.close
    end if
  set re=nothing
  strer=replace(strer,vbCrLf,"<br>")
  ubbtst=strer
end function

function reubbtst(strer)
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] ")
dim re
Set re=new RegExp
re.IgnoreCase=true
re.Global=True
  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,"…… 加密内容 ……")
strer=replace(strer,"<I></I>","")
set re=Nothing
reubbtst=strer
end function
'****************************************************************
'
'              
'
'****************************************************************
%>