")
Else
GuestDetail 1
Footer()
End If
CloseConn()
Sub GuestDetail(sysmode)
Dim tid,rs
tid=Trim(Request.QueryString("id"))
If Len(tid)>0 And IsNumeric(tid) Then tid=CLng(tid) Else ShowAndGoto "主题不存在或已关闭!","./"
Dim returl,ipagesize,sql
ipagesize=TopicPageSize
returl=ReferUrl
sql="select [ID],[BoardID],[Title],[Content],[IP],[AddDate],[AddTime],[Status],[Secret],[Top],[ReplyCount],[NoReply],[HideReply],[UserID],[Name],[ReadCount],[EditUserName],[EditDate],[EditTime] from [Guest] where [ID]="&tid
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,Conn,1,2
If (rs.BOF And rs.EOF) Then
rs.Close
Set rs=Nothing
CloseConn()
ShowAndGoto "主题不存在或已关闭!","./"
Else
rs("ReadCount")=rs("ReadCount")+1
rs.Update
End If
Dim replycount,boardid,boardname,boardlink,moderators,pageurl,title,currurlpath,currurlfile,irecordcount,ipage
boardid=rs(1)
boardlink="b.asp?id="&boardid
boardname=GetBoardNameByID(boardid,moderators)
ipage=GetCurrentPage()
currurlpath=GetUrlPath()
currurlfile=CurrentFileName()
Dim hidreply
pageurl="?id="&tid
title=rs(2)
replycount=rs(10) '取得的回复数是所有回复,如果有未审核的,也会计算在内
hidreply=rs(12)
If ipage=1 Then
Call Header("",title&" - "&boardname,"","",""&boardname&" » "&""&title&"",True,"")
Else
Call Header("",title&"("&ipage&")"&" - "&boardname,"","",""&boardname&" » "&""&title&"",True,"")
End If
GuestDetailPageTemplate tid,replycount,ipagesize,ipage,pageurl
Dim preply,paudit,pmodify,ptop,pdelete,praudit,prmodify,prdelete,prhide
preply=HasPermission(8)
paudit=HasPermission(51)
pmodify=HasPermission(52)
ptop=HasPermission(54)
pdelete=HasPermission(53)
praudit=HasPermission(57)
prmodify=HasPermission(58)
prdelete=HasPermission(59)
prhide=HasPermission(60)
'pdenyip=HasPermission(61)
If ipage=1 Then
DetailArea sysmode,0,moderators,currurlpath,ipage,tid,"",title,rs(3),rs(4),rs(5)&" "&rs(6),rs(7),rs(8),0,rs(9),"",rs(13),rs(14),rs(16),rs(17)&" "&rs(18),rs(11),hidreply,paudit,pmodify,pdelete,ptop,praudit,preply,prhide,prmodify,prdelete
End If
Dim top,locked
rs.Close
If replycount>0 And Not hidreply Then ReplyList sysmode,moderators,currurlpath,ipagesize,ipage,rs,tid,title,top,locked,hidreply,paudit,pmodify,pdelete,ptop,praudit,preply,prhide,prmodify,prdelete
Set rs=Nothing
GuestDetailPageTemplate tid,replycount,ipagesize,ipage,pageurl
If sysmode=0 Then
GuestBottomNavTemplate()
Else
BbsBottomNavTemplate(boardid)
End If
End Sub
Sub ReplyList(sysmode,moderators,urlpath,ipagesize,ipage,rs,tid,title,top,locked,hidreply,paudit,pmodify,pdelete,ptop,praudit,preply,prhide,prmodify,prdelete)
Dim sql
sql="select [ID],[Content],[IP],[AddDate],[AddTime],[Status],[Secret],[Floor],[UserID],[Name],[EditUserName],[EditDate],[EditTime] from [Reply] where [GuestID]="&tid&" and [Status]=3 order by [ID] asc"
rs.Open sql,Conn,1,1
If Not (rs.BOF And rs.EOF) Then
irecordcount=rs.RecordCount
If ipage=1 Then
rs.MoveFirst
Else
rs.Move CLng(ipage-1)*ipagesize
End If
i=0
While ircount Then dspcount=rcount Else dspcount=RepListNum
sql="SELECT TOP "&dspcount&" [ID],[Content],[IP],[AddDate],[AddTime],[Status],[Secret],[Floor],[UserID],[Name],[EditUserName],[EditDate],[EditTime] from [Reply] where [GuestID]="&tid&" order by [ID]"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,Conn,0,1
If Not (rs.BOF And rs.EOF) Then
i=0
While idspcount Then ReplyListMoreTemplate(tid)
rs.Close
Set rs=Nothing
End Sub
Function ReplyActionJoiner(istatus,secret,praudit,prmodify,prdelete,rurl)
astr=""
If praudit Then
If istatus=0 Or istatus=1 Then astr=astr&""&LangAuditPass&""
If istatus=0 Or istatus=3 Then astr=astr&""&LangAuditNoPass&""
'astr=astr&" "
astr=astr&" "
If istatus=2 Then
astr=astr&""&LangDisplay&""
Else
astr=astr&""&LangHide&""
End If
End If
If prmodify Then astr=astr&" "&LangModify&""
If prdelete Then astr=astr&" "&LangDelete&""
ReplyActionJoiner=astr
End Function
'获取版块名称
Function GetBoardNameByID(id,ByRef moderators)
On Error Resume Next
Dim sql,rs
sql="select [Name],[Moderators] from [Board] where [ID]="&id
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,Conn,0,1
If Not (rs.BOF And rs.EOF) Then
GetBoardNameByID=rs(0)
moderators=rs(1)
End If
rs.Close
Set rs=Nothing
If Err Then
ShowAndBack(Err.Description)
End If
End Function
Function ReplyAreaTemplate(tyname,id,title,content,datetime,username,avatar,gender,sign,uinfo,sact,astr,dspr,editinfo)%>