<% Dim Action,ID,UserName,BbsID MNBoard.ShowHead=false Action=Lcase(Request.querystring("Action")) If len(Action)>10 Then MNBoard.GoToErr(1) ID=MNBoard.Checknum(request.querystring("ID")) Select Case Action Case"vote" Vote Case"placard" Placard() Case"preview" Preview() Case"checkname" CheckUserName() Case"headpic" HeadPic() End Select Response.Write"" Set MNBoard =Nothing Sub Vote() Dim Rs,Arr_Rs,i,Temp,Content,Vote,VoteNum,AllvoteNum,VotePicW,ii,VoteShow,VoteType,voteopt MNBoard.Head"preview.asp?Action=vote","","投票详情" If Not MNBoard.FoundUser Then Response.Write"你还没有登陆,不能查看投票详细信息。":Response.End Set Rs=MNBoard.Execute("Select TopicID,Vote,VoteNum,VoteType,OutTime From [i_TopicVote] where TopicID="&ID&"") If Not Rs.Eof then VoteType=Rs("VoteType") Vote=Split(Rs("Vote"),"|") VoteNum=split(Rs("VoteNum"),"|") For i=1 to ubound(Vote) AllvoteNum=Int(AllvoteNum+VoteNum(i)) Next IF AllVoteNum=0 then AllvoteNum=1 For i=1 To ubound(Vote) ii=ii+1 VotePicW=VoteNum(i)/AllvoteNum*85 IF ii>6 Then ii=1 VoteShow=VoteShow&MNBoard.Row(i&". "&MNBoard.Fun.HtmlCode(Vote(i))," "&VoteNum(i)&" 票","40%","22px") next End if Content=VoteShow&"
共投了:"&AllvoteNum&"票 截止时间:"&Rs("OutTime")&"
" Rs.Close Response.Write"" MNBoard.ShowTable "投票选项",Content Set Rs=MNBoard.execute("select VoteNum,User From[i_TopicVoteUser] where TopicID="&ID&"") Content="" If Not Rs.eof Then Arr_Rs=Rs.GetRows Rs.Close If IsArray(Arr_Rs) Then For i=0 To Ubound(Arr_Rs,2) VoteOpt=Split(Arr_Rs(0,i),",") Temp="" For II=0 to ubound(VoteOpt) If VoteOpt(ii)<>"" then Temp=Temp&"投票第"&VoteOpt(ii)&"项:"&MNBoard.Fun.HtmlCode(Vote(int(VoteOpt(ii))))&"
" End if Next Content=Content&MNBoard.Row(" "&Arr_Rs(1,i),Temp,"70%","22px") Next MNBoard.ShowTable"投票用户",Content End If End Sub Sub HeadPic() Dim Content,Temp,I,tr_I MNBoard.Head"preview.asp?Action=headpic","","头像选择器" Response.Write"" Response.Write"" For I=1 To Int(MNBoard.Info(53)) tr_i=tr_i+1 Temp=Temp &"" If tr_i=5 Then Temp=temp &"":Tr_i=0 Next Content=""& Temp &"
" MNBoard.ShowTable "论坛自带的头像 共"& MNBoard.Info(53) &"个",Content End Sub Sub Placard() Dim Rs,Caption,Content,IUBB,S MNBoard.Head"preview.asp?Action=placard","","论坛公告" Response.Write"" Set Rs=MNBoard.execute("select Caption,Content,AddTime,Name,hits,ubbString from [i_Placard] where Id="&ID&"") If Rs.eof then Caption="错误信息" Content="没有公告内容。" Else Set IUBB=New Cls_IUBB IUBB.UbbString=Rs("ubbString") Caption=MNBoard.Fun.HtmlCode(Rs("Caption")) S="
" If MNBoard.MSIE Then S=Replace(S,"min-","width:97%;padding-right:0px; overflow-x: hidden;") Content="
"&S&IUBB.UBB(Rs("Content"),2)&"
发布人:"&Rs("name")&" |  发表于:"&Rs("AddTime")&" | 阅读次数:"&Rs("hits")&"
" Set IUBB=Nothing MNBoard.execute("Update [i_Placard] set Hits=Hits+1 where Id="&ID&"") End If Rs.close Set Rs=Nothing MNBoard.ShowTable Caption,Content Response.Write"
" End Sub Sub Preview() Dim Caption,Content,IUBB,S MNBoard.Head"preview.asp?Action=preview","","帖子预览" Response.Write"" Caption=MNBoard.Fun.HtmlCode(trim(request.form("PCaption"))) Content=MNBoard.CheckEspecial(request.form("PContent")) S="
" If MNBoard.MSIE Then S=Replace(S,"min-","width:97%;padding-right:0px; overflow-x: hidden;") Set IUBB=New Cls_IUBB IUBB.UbbString=MNBoard.Fun.UbbString(Content) Content=S&"
"&S&IUBB.UBB(Content,1)&"
" Set IUBB=Nothing MNBoard.ShowTable Caption,Content End Sub Sub CheckUserName() Dim Caption,Content,Temp,Name,can,I MNBoard.Head"preview.asp?Action=CheckName","","检测用户名" Name=trim(Request("name")) Caption="新用户注册" If Name="" or Name=NULL Then Temp= "对不起!
请填写用户名!" Else If not MNBoard.Fun.CheckName(Name) or MNBoard.Fun.strLength(Name)>14 or MNBoard.Fun.strLength(Name)<2 Then Temp="对不起!
用户名 "&MNBoard.Fun.HtmlCode(Name)&"
含有非法字符或字符过多或过少" Else If Not MNBoard.execute("select name from [i_User] where name='"&Name&"'").eof Then Temp="对不起!
用户名 "&MNBoard.Fun.HtmlCode(Name)&" 已被人注册了!" Else If instr(lcase(MNBoard.Info(52)),lcase(Name))>0 Then Can=true End If If Can Then Temp="非法用户名或含有屏蔽字符,不能注册!" Else Temp="恭喜你,"&Name&" 可以注册。" End If End If End If End If Response.Write "
 新用户注册

"&Temp&"
" End Sub%>