📄 ubb_cls.asp
字号:
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_GetUBB=Str
End Function
Private Function YxBBs_Ubb_Login(Str,PostType)
Dim Test
Dim LoopCount
LoopCount=0
Do While True
re.Pattern="\[login\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/login\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[login\])(.+?)(\[\/login\])(.*)"
If YxBBs.FoundUser Then
Str=re.Replace(str,"$1<hr height=1><font color=#A2A2A2>此帖内容<b>必须登陆</b>后才能浏览</font><BR>$3</font><hr size=1>$5")
Else
Str=re.Replace(str,"$1<hr height=1><font color=Red>此帖内容<b>必须<a href=login.Asp>登陆</a></b>后才能浏览<BR></font><hr size=1>$5")
End if
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Login=Str
End Function
Private Function YxBBs_Ubb_Sex(Str,PostType)
Dim Test
Dim LoopCount
Dim Tmp_Str,po
LoopCount=0
Do While True
re.Pattern="\[sex=*([0-1]*)\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/sex\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[sex=*([0-1]*)\])(.+?)(\[\/sex\])(.*)"
If PostType=1 Then
po=re.replace(str,"$3")
If isnumeric(po) then
If int(po)=0 then Tmp_Str="女"
If int(po)=1 then Tmp_Str="男"
If Not YxBBs.FoundUser Then
str=re.Replace(str,"$1<hr size=1><font color=Red>此内容需要性别为<font color=red> <b>"&Tmp_Str&"</b></font> 和作者才能浏览:</font><BR><hr size=1>$6")
Else
If (YxBBs.MySex And int(po)=1) or (Not YxBBs.MySex And int(po)=0) or Lcase(YxBBs.MyName)=Lcase(UserName) Then
str=re.Replace(str,"$1<hr size=1><font color=#A2A2A2>此内容需要性别为<font color=red> <b>"&Tmp_Str&"</b></font> 和作者才能浏览:</font><BR>$4<hr size=1>$6")
Else
str=re.Replace(str,"$1<hr size=1><font color=Red>此内容需要性别为<font color=red> <b>"&Tmp_Str&"</b></font> 和作者才能浏览:</font><BR><hr size=1>$6")
End If
End If
End if
Else
Str=re.Replace(str,"$4")
End If
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Sex=Str
End Function
Private Function YxBBs_Ubb_Name(Str,PostType)
Dim Test
Dim LoopCount
Dim Tmp_My,tmp_str,I
LoopCount=0
Do While True
re.Pattern="\[username=(.[^\[]*)\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/username\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[username=(.[^\[]*)\])(.+?)(\[\/username\])(.*)"
If PostType=1 Then
Tmp_Str=re.replace(str,"$3")
Tmp_Str=split(Tmp_Str,",")
Tmp_My=False
For i=0 to ubound(Tmp_Str)
If lcase(YxBBs.MyName)=lcase(Tmp_Str(i)) then Tmp_My=True:Exit For
Next
If Tmp_My or Lcase(YxBBs.MyName)=Lcase(UserName) Then
Str=re.Replace(str,"$1<hr size=1><font color=#A2A2A2>此内容只有作者和 <b>$3</b> 能浏览:</font><BR>$4<hr size=1>$6")
Else
Str=re.Replace(str,"$1<hr size=1><font color=Red>此内容只有作者和 <b>$3</b> 能浏览:</font><BR><hr size=1>$6")
End if
Else
Str=re.Replace(str,"$4")
End If
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Name=Str
End Function
Private Function YxBBs_Ubb_Reply(Str,PostType)
Dim Test
Dim LoopCount
LoopCount=0
Do While True
re.Pattern="\[reply\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/reply\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[reply\])((.|\n)+?)(\[\/reply\])(.*)"
IF PostType=1 Then
If YxBBs.ClassID=1 or Not(YxBBs.execute("select BbsID From[YX_bbs"&YxBBs.TB&"] where ReplyTopicID="&ID&" and name='"&YxBBs.MyName&"'").eof) or Lcase(YxBBs.MyName)=Lcase(UserName) then
str=re.Replace(str,"$1<hr size=1><font color=Red>此内容只有作者和已经回复此帖的浏览者能浏览:</font><BR>$3<hr size=1>$6")
Else
str=re.Replace(str,"$1<hr size=1><font color=Red>此内容只有作者和已经回复此帖的浏览者能浏览:</font><BR><hr size=1>$6")
End if
Else
str=re.Replace(str,"$3")
End If
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Reply=Str
End Function
Private Function YxBBs_Ubb_Date(Str,PostType)
Dim Tmp_int,Tmp_My,tmp_str
Dim Test
Dim LoopCount
LoopCount=0
Do While True
re.Pattern="\[date=(.[^\[]*)\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/date\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[date=(.[^\[]*)\])(.[^\[]*)(\[\/date\])(.*)"
IF PostType=1 Then
Tmp_Str=re.replace(str,"$3")
If IsDate(Tmp_Str) Then Tmp_Int=Datediff("d",cdate(Tmp_Str),cdate(YxBBs.NowBbsTime)) Else Tmp_Int=-1
If int(Tmp_Int)>0 Then
Str=re.Replace(Str,"$1<hr size=1><font color=Red>此内容只有:<b>"&Tmp_Str&"</b>这天以后才能浏览:</font><BR>$4<hr size=1>$6")
Else
Str=re.Replace(str,"$1<hr size=1><font color=Red>此内容只有:<b>"&Tmp_Str&"</b>这天以后才能浏览:</font><BR><hr size=1>$6")
End If
Else
Str=re.Replace(str,"$1")
End If
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Date=Str
End Function
Private Function YxBBs_Ubb_Buy(Str,PostType)
Dim Tmp_int,Tmp_My,tmp_str,i
Dim Test
Dim LoopCount
LoopCount=0
Do While True
re.Pattern="\[buypost=*([0-9]*)\]"
Test=re.Test(Str)
If Test Then
re.Pattern="\[\/buypost\]"
Test=re.Test(Str)
If Test Then
re.Pattern="(^.*)(\[buypost=*([0-9]*)\])(.+?)(\[\/buypost\])(.*)"
If PostType=1 Then
If Not YxBBs.FoundUser Then
Str=re.Replace(str,"$1<hr size=1><font color=Red>此内容要求金钱数达到$3以上才可以购买并浏览</font><hr noshade size=1>$6")
Else
Tmp_My="<Form action='VoteSubmit.Asp?Action=buy' method='Get'><input type=hidden value="&BbsID&" name='ID'><input type=hidden value="&YxBBs.TB&" name='TB'><input type=submit value='好黑啊…我…我买了!'></form>"
Tmp_Int=re.Replace(str,"$3")
If isnumeric(Tmp_Int) Then Tmp_Int=int(Tmp_Int) Else Tmp_Int=0
If BBSID=0 Then
Tmp_Str=""
Else
Tmp_Str=YxBBs.execute("select Buyer From[YX_bbs"&YxBBs.TB&"] where BbsID="&BbsID&"")(0)
End If
If Lcase(YxBBs.MyName)=Lcase(UserName) or YxBBs.ClassID<=2 Or YxBBs.IsBoardAdmin Then
Dim PostBuyUser
If (not isnull(Tmp_Str)) and Tmp_Str<>"" then
Tmp_Str=split(Tmp_Str,"|")
PostBuyUser=""
For i=0 to ubound(Tmp_Str)
PostBuyUser=PostBuyUser & "<option value="&i&">"&Tmp_Str(i)&"</option>"
Next
PostBuyUser="<select name=buyuser size=1><option value=0>共有"&ubound(Tmp_Str)&"位用户购买</option>"&PostBuyUser & "</select>"
Else
PostBuyUser="<select name=buyuser size=1><option value=0>还没有用户购买</option></select>"
End if
If YxBBs.MyName<>UserName Then PostBuyUser=Tmp_My&PostBuyUser
Str=re.Replace(str,"$1<hr size=1><font color=Red>以下为需要金钱数达到<B>$3</B>才能浏览的内容</font> "&PostBuyUser&"<BR>$4<hr size=1>$6")
Else
If instr("|"&Tmp_Str&"|","|"&YxBBs.MyName&"|")>0 then
Str=re.Replace(str,"$1<hr noshade size=1>以下为需要花 <del><B>$3</B></del> 金钱才能购买并浏览的内容,您已经购买本帖<BR>$4<hr noshade size=1>$6")
Else
If Int(YxBBs.MyCoin)>Tmp_Int then
str=re.Replace(str,"$1<hr size=1><font color=Red>此帖子内容需要您花 <B>$3</B> 金钱来购买浏览 "&Tmp_My&"</font><hr size=1>$6")
Else
str=re.Replace(str,"$1<hr size=1><font color=Red>此内容要求金钱数达到 <B>$3</B> 以上才可以购买并浏览</font><hr size=1>$6")
end if
End if
End if
End if
Else
Str=re.Replace(str,"$4")
End If
Else
Exit Do
End If
Else
Exit Do
End If
LoopCount=LoopCount + 1
If LoopCount>MaxLoopCount Then Exit Do
Loop
YxBBs_Ubb_Buy=Str
End Function
End Class
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -