accesstopic.asp
来自「现在好了」· ASP 代码 · 共 528 行 · 第 1/2 页
ASP
528 行
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/dv_clsother.asp" -->
<!--#include file="inc/Dv_LoadCache.asp"-->
<%
Dvbbs.Loadtemplates("")
Dvbbs.stats="帖子审核"
Dvbbs.Nav
If Dvbbs.BoardID=0 Then
Dvbbs.Head_var 2,0,"",""
Else
Dvbbs.Head_var 1,Dvbbs.BoardNode.attributes.getNamedItem("depth").text,"",""
End If
Dim currentPage,Rs,SQl,i
Dim AdminLockTopic
Dim p,announceIDRange1,announceIDRange2,tableclass
Dim bBoardEmpty
bBoardEmpty=False
AdminLockTopic=False
If (Dvbbs.master or Dvbbs.superboardmaster or Dvbbs.boardmaster) And Cint(Dvbbs.GroupSetting(36))=1 Then
AdminLockTopic=True
Else
AdminLockTopic=False
End If
If Cint(Dvbbs.GroupSetting(36))=1 And Dvbbs.UserGroupID>3 Then
AdminLockTopic=True
End If
If Dvbbs.FoundUserPer And Cint(Dvbbs.GroupSetting(36))=1 Then
AdminLockTopic=true
ElseIf Dvbbs.FoundUserPer And Cint(Dvbbs.GroupSetting(36))=0 Then
AdminLockTopic=False
End If
If Not AdminLockTopic Then Response.redirect "showerr.asp?ErrCodes=<li>您没有在本版面审核帖子的权限。&action=OtherErr"
currentPage=request("page")
Dim PostTable,ptable
PostTable=GetAllPostTable
ptable=Dvbbs.Checkstr(Request("posttable"))
Dim NowUseBBS
NowUseBBS=Dvbbs.NowUseBBS
If ptable<>"" Then
For i= 0 to UBound(PostTable,2)
If LCase(ptable)=LCase(PostTable(1,i)) Then
Dvbbs.NowUseBBS=PostTable(1,i)
End If
Next
End If
If currentpage="" or not IsNumeric(currentpage) Then
currentpage=1
Else
currentpage=clng(currentpage)
End If
If request("action")="freetopic" Then
freetopic()
ElseIf request("action")="dispaudit" Then
View()
Else
main()
End If
Dvbbs.activeonline()
Dvbbs.footer()
Sub main()
Dim totalrec,ii,page_count
Dim n,pi
Dim rs1,sql1
%>
<BR>
<TABLE cellPadding=1 cellSpacing=1 class=tableborder1 align=center>
<tr><th colspan=2>贴子审核</th></tr>
<tr><td class=tablebody1 width="400">
请选择论坛:<Select NAME="BoardJumpList" ID="BoardJumpList" onchange="if(this.options[this.selectedIndex].value!=''){location='?boardid='+this.options[this.selectedIndex].value+'&posttable=<%=Request("posttable")%>';}"></SELECT>
</td>
<td class=tablebody1 width="*"> 数据表:<Select name="tb" onchange="if(this.options[this.selectedIndex].value!=''){location='?posttable='+this.options[this.selectedIndex].value+'&boardid=<%=Dvbbs.Boardid%>';}">
<Option>请选择数据表</Option>
<%
For i= 0 to UBound(PostTable,2)
%>
<Option value="<%=PostTable(1,i)%>" <%If Request("posttable")=PostTable(1,i) Then Response.Write "selected"%>><%=PostTable(2,i)%></Option>
<%
Next
%></Select></td>
</tr>
</table>
<SCRIPT LANGUAGE="JavaScript">
BoardJumpListSelect('<%=Dvbbs.boardid%>',"BoardJumpList","所有论坛","0",0)
</SCRIPT>
<BR>
<TABLE cellPadding=1 cellSpacing=1 class=tableborder1 align=center>
<form action="?action=freetopic&posttable=<%=ptable%>" method=post name=batch>
<input type=hidden value="<%=Dvbbs.boardid%>" name=boardid>
<TR align=middle>
<Th height=25 width="5%" id=tabletitlelink>选项</th>
<Th width="15%">版面</Th>
<Th width=*>主 题</Th>
<Th width="15%">作 者</Th>
</TR>
<%
'BoardXML.documentElement.selectSingleNode(BoardPath&"[@boardid='"&Rs(0)&"']")
Dim BoardNode
Set Rs=server.createobject("adodb.recordset")
If dvbbs.boardid=0 Then
sql="select AnnounceID,boardID,UserName,Topic,DateAndTime,RootID,layer,orders,Expression,body,PostUserID,locktopic,parentid from "& Dvbbs.NowUseBBS &" where BoardID=777 Order by AnnounceID Desc"
Else
sql="select AnnounceID,boardID,UserName,Topic,DateAndTime,RootID,layer,orders,Expression,body,PostUserID,locktopic,parentid from "& Dvbbs.NowUseBBS &" where BoardID=777 And locktopic="&dvbbs.boardid&" Order by AnnounceID Desc"
End If
If Not IsObject(Conn) Then ConnectionDatabase
Rs.Open Sql,Conn,1,1
If rs.eof And rs.bof Then
Response.Write "<tr><td colSpan=4 width=100% class=tablebody1 height=25> 暂无审核内容</td></tr>"
Else
rs.PageSize = cint(Dvbbs.Forum_Setting(11))
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
Do While Not Rs.Eof and (not page_count = rs.PageSize)
page_count=page_count+1
If rs("layer")= 1 Then
tableclass="tablebody1"
Else
tableclass="tablebody2"
End If
'Response.Write Rs(11)
BoardNode = GetBoard_info(Rs(11),0)
Response.Write "<TR align=middle><TD class=tablebody2 height=27 class="&tableclass&">"
Response.Write "<input type=checkbox name=Announceid value="""&rs("Announceid")&""">"
Response.Write "</TD><TD class="&tableclass&">"
Response.Write BoardNode
Response.Write "</TD><TD class="&tableclass&" align=""left"">"
Response.Write "<img src=skins/default/topicface/"&rs("Expression")&"> "
If Rs("ParentID")>0 Then GetTopic(Rs("RootID"))
Response.Write "<a href='accesstopic.asp?action=dispaudit&boardID="& Rs("locktopic") &"&ID="&cstr(rs("RootID"))&"&replyID="&Cstr(rs("announceID"))&"' target=_blank>"
If Rs("topic")="" or isnull(rs("topic")) Then
If Len(rs("body"))>50 Then
Response.Write Dvbbs.htmlencode(replace(left(rs("body"),50),chr(10),""))
Else
Response.Write Dvbbs.htmlencode(replace(rs("body"),chr(10),""))
End If
Else
If len(rs("Topic"))>50 Then
Response.Write Dvbbs.htmlencode(left(rs("Topic"),50))
Else
Response.Write Dvbbs.htmlencode(rs("Topic"))
End If
End If
Response.Write " ("&rs("dateandtime")&")</TD>"
Response.Write "<TD class="&tableclass&"><a href=""dispuser.asp?id="& rs("postuserid") &""" target=_blank>"& Dvbbs.htmlencode(rs("username")) &"</a></TD>"
Response.Write "</TR>"
Rs.MoveNext
Loop
End If
Rs.Close
Set Rs=Nothing
If totalrec mod Dvbbs.Forum_Setting(11)=0 Then
n= totalrec \ Dvbbs.Forum_Setting(11)
Else
n= totalrec \ Dvbbs.Forum_Setting(11)+1
End If
If currentpage-1 mod 10=0 Then
p=(currentpage-1) \ 10
Else
p=(currentpage-1) \ 10
End If
Dim pagelist,pagelistbit
%>
<TR align=middle>
<Td height=25 class=tablebody2 colspan=4><input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">选中所有显示帖子 请选择要操作的内容:<input name="actiontype" value="1" type=radio checked>通过审核 <input name="actiontype" value="2" type=radio>删除帖子 <input name=submit value="执行" type=submit onclick="{if(confirm('您确定执行的操作吗?')){return true;}return false;}"></Td>
</TR>
</table>
<table border=0 cellpadding=0 cellspacing=3 width="<%=Dvbbs.mainsetting(0)%>" align="center">
</form>
<form method=post action="accesstopic.asp">
<tr>
<td valign=middle>页次:<b><%= currentPage %></b>/<b><%= n %></b>页 每页<b><%= Dvbbs.Forum_Setting(11) %></b> 主题数<b><%= totalrec %></b></td>
<td valign=middle><div align=right >分页:
<%
If currentPage=1 Then
Response.Write "<font face=webdings color="&Dvbbs.mainsetting(1)&">9</font> "
Else
Response.Write "<a href='?boardid="&Dvbbs.boardid&"&page=1&action="&request("action")&"' title=首页><font face=webdings>9</font></a> "
End If
If p*10>0 Then Response.Write "<a href='?boardid="&Dvbbs.boardid&"&page="&Cstr(p*10)&"&action="&request("action")&"' title=上十页><font face=webdings>7</font></a> "
Response.Write "<b>"
for ii=p*10+1 to P*10+10
If ii=currentPage Then
Response.Write "<font color="&Dvbbs.mainsetting(1)&">"+Cstr(ii)+"</font> "
Else
Response.Write "<a href='?boardid="&Dvbbs.boardid&"&page="&Cstr(ii)&"&action="&request("action")&"'>"+Cstr(ii)+"</a> "
End If
If ii=n Then exit for
Next
Response.Write "</b>"
If ii<n Then Response.Write "<a href='?boardid="&Dvbbs.boardid&"&page="&Cstr(ii)&"&action="&request("action")&"' title=下十页><font face=webdings>8</font></a> "
If currentPage=n Then
Response.Write "<font face=webdings color="&Dvbbs.mainsetting(1)&">:</font> "
Else
Response.Write "<a href='?boardid="&Dvbbs.boardid&"&page="&Cstr(n)&"&action="&request("action")&"' title=尾页><font face=webdings>:</font></a> "
End If
%>
转到:<input type=text name=Page size=3 maxlength=10 value='<%= currentpage %>'><input type=submit value=Go name=submit>
</div></td></tr>
<input type=hidden name=BoardID value='<%= Dvbbs.BoardID %>'>
</form></table>
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name =='Announceid') e.checked = form.chkall.checked;
}
}
//-->
</script>
<%
End sub
Function GetTopic(TopicID)
Dim Trs
Set Trs=Dvbbs.Execute("Select Title,BoardID From Dv_Topic Where TopicID="&TopicID)
If Not(Rs.Eof And Rs.Bof) Then
Response.Write "[<a href=dispbbs.asp?boardid="&trs(1)&"&id="&TopicID&" target=_blank>主题帖:"&Dvbbs.HtmlEncode(Left(Trs(0),16))&"</a>] "
Else
Response.Write "[未找到相关主题] "
End If
Set Trs=Nothing
End Function
Sub freetopic()
Dim BoardID
If request.form("announceid")="" Then Response.redirect "showerr.asp?ErrCodes=<li>请指定相关帖子。&action=OtherErr"
Dim id,trs,ars
Dim PostID, PostUser, LogType, LogCase, Fi
Dim FoundID,MyID
Dim bbsnum,topicnum,todaynum
Dim haveaudit
PostUser = ""
For Fi = 1 to request.form("Announceid").count
bbsnum=0
topicnum=0
todaynum=0
BoardId=0
LogCase = ""
ID=replace(request.form("Announceid")(Fi),"'","")
If Not IsNumeric(ID) Then
ID = 0
Else
ID = Clng(ID)
End If
'删除
If request("actiontype")=2 Then
LogType = 3
Set Rs=Dvbbs.Execute("select rootid, UserName, Topic from "&Dvbbs.NowUsebbs&" where parentid=0 And Announceid="&id)
PostID = Id
If not (rs.eof And rs.bof) Then
ID = Rs(0)
PostUser = Rs(1)
LogCase = "《" & Left(Rs(2),26) & "…》"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?