<%@ LANGUAGE="VBSCRIPT" %> <% Rem ---------------------- Rem ------主程序开始------ Rem ---------------------- dim sql,rs dim Ers,Esql dim boardtype dim master_1,master_2 dim username,cname dim bBoardEmpty dim boardid dim timeLimited,limitime,tl dim totalrec dim n,i,RowCount dim p dim currentpage dim announceIDRange1 dim announceIDRange2 dim skin dim tablebody,atablebody dim tablefont,tablecontent,alertfont dim strAllowForumCode,strAllowHTML,strIMGInPosts,strIcons,strflash dim todaynum dim arrRow1 dim guestlist if guibin or boardmaster or boardmaster then guestlist="" else guestlist=" lockboard<>2 and " end if stats="论坛版面" set rs=server.createobject("adodb.recordset") if founderr then call nav() call headline(1) call error() else Call getInput() call chkInput() if founderr then call nav() call headline(1) call error() else call boardinfo(boardid) if founderr then call nav() call headline(1) call error() else call nav() call headline(1) call boardtop(boardid) call AnnounceList1() call listPages3() call boardlist() if founderr=true then call error() end if end if end if call endline() sub boardinfo(boardid) sql="select boardtype,lockboard,boardmaster,boardskin,Tableback,Tabletitle,Tablebody,aTablebody,TableContent,AlertFont,Forumlogo,TableFont,strAllowForumCode,strAllowHTML,strIMGInPosts,strIcons,strflash,todaynum from board where "&guestlist&" boardID="&cstr(boardid) set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if not(rs.bof and rs.eof) then arrRow=rs.getrows rs.close : set rs=nothing boardtype=arrRow(0,0) lockboard=arrRow(1,0) Tablebackcolor=arrRow(4,0) Tabletitlecolor=arrRow(5,0) Tablebodycolor=arrRow(6,0) aTablebodycolor=arrRow(7,0) TableFontcolor=arrRow(11,0) TableContent=arrRow(8,0) Forumlogo=arrRow(10,0) AlertFont=arrRow(9,0) strAllowForumCode=arrRow(12,0) strAllowHTML=arrRow(13,0) strIMGInPosts=arrRow(14,0) strIcons=arrRow(15,0) strflash=arrRow(16,0) todaynum=arrRow(17,0) board_master=arrRow(2,0) stats=""&boardtype&"精华版面" arrRow=null if trim(board_master)<>"" then master_1=split(board_master, "|") for i = 0 to ubound(master_1) master_2=""+master_2+""+master_1(i)+" " next else master_2="无版主" end if else founderr=true Errmsg=Errmsg+"
"+"
  • 您选择的版面不存在或者您没有权限察看该版面。" exit sub end if end sub REM 显示版面信息---Headinfo sub boardtop(boardid) response.write ""&_ "
    "&_ ""&_ "
    本分论坛的公告!不可不看!!"&_ "" sql="select top 1 title,content,addtime from bbsnews where boardid="&boardid&" order by id desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.bof and rs.eof then response.write "当前没有公告 ("& now() &")" else response.write ""& rs("title") &" ("& rs("addtime") &")" end if rs.close set rs=nothing response.write "

    "&_ "

    "&_ ""&_ ""&_ "

    " response.write "
    "&_ ""&_ ""&_ ""&_ "" if request("action")<>"online" then response.write "
    目前论坛总在线"&allonline()&"人,其中"& boardtype &"上共有 "& online() &" 位会员与 "& guest() &" 位客人.今日贴子 "& todaynum &" " if request("action")<>"online" then response.write "[关闭详细列表]" else response.write "[显示详细列表]" end if response.write " [在线用户]"&_ "刷新
    " call onlineuser() response.write "
    " end if response.write "
    " response.write "
    "&_ ""&_ ""&_ ""&_ "
    "&_ "发新帖"&_ "  "&_ "发起新投票 " response.write "  帖子列表  "&_ "论坛版主:"& master_2 &"
    " end sub sub boardlist() response.write ""&_ ""&_ "
    "&_ "
    " response.write ""&_ "
    "&_ ""&_ ""&_ "
     -=> "& ForumName &"图例所有时间均为 - 北京时间  
    "&_ ""&_ ""&_ ""&_ ""&_ ""&_ ""&_ "
    开放的主题 回复超过10贴 锁定的主题 固定顶端的主题 精华帖子
    " if strAllowHTML=0 then response.write "HTML标签:OFF." else response.write "HTML标签:ON." end if if strAllowForumCode=0 then response.write " UBB标签:OFF." else response.write " UBB标签:ON." end if if strIcons=0 then response.write " 贴图标签:OFF." else response.write " 贴图标签:ON." end if if strflash=0 then response.write " Flash标签:OFF." else response.write " Flash标签:ON." end if if strIMGInPosts=0 then response.write " 表情字符转换:OFF." else response.write " 表情字符转换:ON." end if if Uploadpic<>1 then response.write " 上传图片:OFF." else response.write " 上传图片:ON." end if if not UploadFlag then response.write " 头像上传:OFF." else response.write " 头像上传:ON." end if if not titleFlag then response.write " 用户头衔:OFF." else response.write " 用户头衔:ON." end if response.write "

    " end sub sub onlineuser() guests="客人" dim sip dim acip dim grade18,grade19,grade20 grade18=grade(18) grade19=grade(19) grade20=grade(20) '用户信息 sql="select username,startime,lastimebk,ip,stats,userclass,browser,actforip,comefrom,actCome from online where username<>'"&guests&"'" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then rs.close : set rs=nothing else arrRow=rs.getRows rs.close : set rs=nothing for i=0 to Ubound(arrRow,2) if instr(arrRow(4,i),boardtype)>0 then sip=arrRow(3,i) acip=arrRow(7,i) if arrRow(5,i)=grade20 or arrRow(5,i)=grade19 then response.write "特殊人物 " elseif arrRow(5,i)=grade18 then response.write "&user_level18& " else response.write " " end if arrRow(0,i)=htmlencode(arrRow(0,i)) response.write "" response.write " "" then response.write acip else response.write sip end if else response.write "已设置保密" end if else if acip <> "" then response.write acip else response.write sip end if end if response.write " 来源鉴定:" if FromFlag=0 then if boardmaster or master then if acip <> "" then response.write arrRow(9,i) else response.write arrRow(8,i) end if else response.write "已设置保密" end if else if acip <> "" then response.write arrRow(9,i) else response.write arrRow(8,i) end if end if if acip <> "" then response.write " 代理IP:" if IpFlag=0 then if boardmaster or master then response.write sip else response.write "已设置保密" end if else response.write sip end if response.write " 代理鉴定:" if FromFlag=0 then if boardmaster or master then response.write arrRow(8,i) else response.write "已设置保密" end if else response.write arrRow(8,i) end if end if response.write """>"&arrRow(0,i)&" " end if next arrRow=null end if if guestuser=1 then '客人信息 sql="select username,startime,lastimebk,ip,stats,userclass,browser,actforip,comefrom,actCome from online where username='"&guests&"'" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then rs.close : set rs=nothing else arrRow=rs.getrows rs.close : set rs=nothing for i=0 to Ubound(arrRow,2) if instr(arrRow(4,i),boardtype)>0 then sip=arrRow(3,i) acip=arrRow(7,i) response.write " " response.write "" response.write " "" then response.write acip else response.write sip end if else response.write "已设置保密" end if else if acip <> "" then response.write acip else response.write sip end if end if response.write " 来源鉴定:" if FromFlag=0 then if boardmaster or master then if acip <> "" then response.write arrRow(9,i) else response.write arrRow(8,i) end if else response.write "已设置保密" end if else if acip <> "" then response.write arrRow(9,i) else response.write arrRow(8,i) end if end if if acip <> "" then response.write " 代理IP:" if IpFlag=0 then if boardmaster or master then response.write sip else response.write "已设置保密" end if else response.write sip end if response.write " 代理鉴定:" if FromFlag=0 then if boardmaster or master then response.write arrRow(8,i) else response.write "已设置保密" end if else response.write arrRow(8,i) end if end if response.write """>客人 " end if next arrRow=null end if end if end sub sub AnnounceList1() 'on error resume next sql="select bbs1.AnnounceID,bbs1.parentID,bbs1.boardID,bbs1.UserName,bbs1.child,bbs1.Topic,bbs1.body,bbs1.DateAndTime,bbs1.hits,bbs1.RootID,bbs1.Expression,bbs1.times,bbs1.locktopic,bbs1.istop,bbs1.isvote,bbs1.isbest,board.lockboard from bbs1,board where bbs1.boardid=board.boardid and bbs1.boardID="&cstr(boardID)&" and bbs1.isbest=1 "&tl&" ORDER BY bbs1.times desc,bbs1.announceid desc" set rs=server.createobject("adodb.recordset") rs.open sql,conn,1,1 if err.number<>0 then foundErr = true ErrMsg = "
  • 数据库操作失败:" & err.description & "
  • " else if rs.bof and rs.eof then '论坛无内容 call showEmptyBoard1() bBoardEmpty = true else totalrec=rs.recordcount if currentpage<1 then currentpage=1 end if MaxAnnouncePerPage=Clng(MaxAnnouncePerPage) if (currentpage-1)*MaxAnnouncePerPage>totalrec then if (totalrec mod MaxAnnouncePerPage)=0 then currentpage= totalrec \ MaxAnnouncePerPage else currentpage= totalrec \ MaxAnnouncePerPage + 1 end if end if if currentPage=1 then call showpagelist1() else if (currentPage-1)*MaxAnnouncePerPage0 then err.clear end sub REM 显示贴子列表 sub showPageList1() i=0 response.write "
    "&_ ""&_ ""&_ ""&_ ""&_ ""&_ ""&_ ""&_ ""&_ ""&_ "
    状态主 题作 者回复/人气最后更新 | 回复人
    " do while not rs.eof response.write ""&_ ""&_ ""&_ ""&_ ""&_ "
    " if rs("istop")<>1 and lockboard<>1 and rs("locktopic")<>1 and rs("isvote")<>1 and rs("isbest")<>1 and rs("child")<10 then response.write "开放主题" elseif rs("isvote")=1 then response.write "投票贴子" elseif rs("istop")=1 then response.write "固顶主题" elseif rs("isbest")=1 then response.write "精华帖子" elseif rs("")>=10 then response.write "热门主题" elseif rs("locktopic")=1 then response.write "本主题已锁定" elseif lockboard=1 then response.write "本论坛已锁定" else response.write "开放主题" end if response.write "" response.write "" if instr(rs("body"),"[upload=gif]")>0 and instr(rs("body"),"[/upload]")>0 then if instr(rs("body"),".gif")>0 then response.write " " elseif instr(rs("body"),"[upload=jpg]")>0 and instr(rs("body"),"[/upload]")>0 then if instr(rs("body"),".jpg")>0 then response.write " " elseif instr(rs("body"),"[zip]")>0 and instr(rs("body"),"[/zip]")>0 then if instr(rs("body"),".zip")>0 then response.write " " elseif instr(rs("body"),"[rar]")>0 and instr(rs("body"),"[/rar]")>0 then if instr(rs("body"),".rar")>0 then response.write " " end if response.write "" if len(rs("topic"))>26 then response.write ""&left(rs("topic"),26)&"..." else response.write rs("topic") end if response.write "" Maxtitlelist=Cint(Maxtitlelist) if rs("child")+1>Maxtitlelist then response.write "  [分页:" Pnum=(Cint(rs("child")+1)/Maxtitlelist)+1 for p=1 to Pnum response.write " "&p&" " next response.write "]" end if response.write ""& rs("username") &"" if rs("isvote")=1 then set vrs=conn.execute("select votenum from vote where announceid="& rs("announceid") &"") votenum=vrs("votenum") votenum=split(votenum,"|") dim iu for iu = 0 to ubound(votenum) votenum_1=cint(votenum_1)+votenum(iu) next response.write ""&votenum_1&" 票" votenum_1=0 vrs.close set vrs=nothing else response.write ""& rs("child") &"/"& rs("hits") &"" end if response.write " " response.write " "&_ FormatDateTime(rs("dateandtime"),2)&" "&FormatDateTime(rs("dateandtime"),4)&_ " | " response.write "------" response.write "
    " i=i+1 if i>=MaxAnnouncePerPage then exit do rs.movenext loop rs.close if err.number<>0 then err.clear end sub sub listPages3() 'on error resume next dim n if totalrec mod MaxAnnouncePerPage=0 then n= totalrec \ MaxAnnouncePerPage else n= totalrec \ MaxAnnouncePerPage+1 end if %> ">
    页次:<%=currentPage%>/<%=n%>页 每页<%=MaxAnnouncePerPage%> 主题数<%=totalrec%>

    分页: <% for p=1 to n if p<10 then if p=currentPage then response.write "["+Cstr(p)+"] " else response.write "["+Cstr(p)+"] " end if end if next %> 转到:

    <% if err.number<>0 then err.clear end sub sub showEmptyBoard1() %>
    >状态 >主 题 (点心情符为开新窗浏览) >作 者 >回复/人气 >最新回复
    本精华版面暂无内容,欢迎发帖:)
    <% rs.close end sub function online() guests="客人" tmprs=conn.execute("Select count(id) from online where username<>'"&guests&"' and stats like '%"&boardtype&"%'") online=tmprs(0) set tmprs=nothing if isnull(online) then online=0 end function function allonline() tmprs=conn.execute("Select count(id) from online") allonline=tmprs(0) set tmprs=nothing if isnull(allonline) then allonline=0 end function function guest() guests="客人" tmprs=conn.execute("Select count(id) from online where username='"&guests&"' and stats like '%"&boardtype&"%'") guest=tmprs(0) set tmprs=nothing if isnull(guest) then guest=0 end function Sub getInput() 'On Error Resume Next Rem ------获取版面ID------ BoardID = Request("BoardID") Rem ------获取页次------ currentPage=request("page") End Sub sub chkInput 'on error resume next if BoardID="" then BoardID=1 elseif not isInteger(BoardID) then BoardID=1 else BoardID=clng(BoardID) if err then BoardID=1 err.clear end if end if if currentpage="" then currentpage=1 elseif not isInteger(currentpage) then currentpage=1 else currentpage=clng(currentpage) if err then currentpage=1 err.clear end if end if if request("selTimeLimit")="all" then tl="" elseif request("selTimeLimit")="" then tl="" else limitime=request("selTimeLimit") tl=" and dateandtime>=#"&cstr(cdate(now()-limitime))&"# " end if end sub set rs=nothing %>