%@ LANGUAGE="VBSCRIPT" %>
<%
Rem ----------------------
Rem ------主程序开始------
Rem ----------------------
dim sql,rs
dim username,cname
dim bBoardEmpty
dim totalrec
dim n,i
dim p
dim currentpage
currentPage=request.form("page")
if membername="" then
Errmsg="您还没有登陆,请登陆后浏览"
founderr=true
end if
orders=request("s")
if orders="" or not isInteger(orders) then
orders=1
else
orders=clng(orders)
if err then
orders=1
err.clear
end if
end if
if orders=1 then
sql="select top 200 AnnounceID,parentID,boardID,UserName,child,Topic,body,DateAndTime,hits,RootID,Expression,times,locktopic,istop,isbest,isvote from bbs1 where username='"&membername&"' and parentid=0 ORDER BY announceid desc"
ordername="我参与的主题"
elseif orders=2 then
sql="select top 200 AnnounceID,parentID,boardID,UserName,child,Topic,body,DateAndTime,hits,RootID,Expression,times,locktopic,istop,isbest,isvote from bbs1 where username='"&membername&"' and parentid=0 and child>0 ORDER BY announceid desc"
ordername="已被回复的我的发言"
else
sql="select top 200 AnnounceID,parentID,boardID,UserName,child,Topic,body,DateAndTime,hits,RootID,Expression,times,locktopic,istop,isbest,isvote from bbs1 where username='"&membername&"' and parentid=0 ORDER BY announceid desc"
ordername="我参与的主题"
end if
if currentpage="" or not isInteger(currentpage) then
currentpage=1
else
currentpage=clng(currentpage)
if err then
currentpage=1
err.clear
end if
end if
set rs=server.createobject("adodb.recordset")
%>
<%
stats=ordername
call nav()
call headline(1)
if founderr then
call error()
else
call AnnounceList1()
call listPages3()
end if
call endline()
sub AnnounceList1()
'on error resume next
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
boardid=rs("boardid")
response.write "仅列出您的最新200条记录"&_
""&_
""&_
""&_
"| 状态 | "&_
"主 题 | "&_
"作 者 | "&_
"回复/人气 | "&_
"最后更新 | 回复人 | "&_
"
"&_
"
"
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("child")>=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
dim Ers, Eusername, Edateandtime
Eusername=""
Edateandtime=""
set Ers=conn.execute("select top 1 username,dateandtime,body,announceid,rootid from bbs1 where rootid="& rs("rootid") &" and not announceid="& rs("rootid") &" order by announceid desc")
if not(Ers.eof and Ers.bof) then
body=Ers("body")
Eusername=htmlencode(Ers("username"))
Edateandtime=Ers("dateandtime")
end if
Ers.close
set Ers=nothing
if body="" then body=rs("body")
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 " | "
if Eusername="" then
response.write " "&_
FormatDateTime(rs("dateandtime"),2)&" "&FormatDateTime(rs("dateandtime"),4)&_
" | ------"
else
response.write " "&_
FormatDateTime(Edateandtime,2)&" "&FormatDateTime(Edateandtime,4)&_
" | "
if rs("announceid")=rs("times") then
response.write "------"
else
response.write ""&Eusername&""
end if
end if
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
%>
<% if err.number<>0 then err.clear
end sub
sub showEmptyBoard1()
%>
| >状态 |
>主 题 (点心情符为开新窗浏览) |
>作 者 |
>回复/人气 |
>最新回复 |
| 暂无内容,欢迎发帖:) |
<%
rs.close
end sub
set rs=nothing
%>