📄 comment_manage.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="../inc/Conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim strFileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim i,j
dim ArticleID
dim Title
dim sql,rs
Title=Trim(request("Title"))
ID=Request("ID")
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
Set rs=Server.CreateObject("Adodb.Recordset")
if id = "" then
Sql = "SELECT Comment.Com_id,Comment.Com_name,Comment.Com_content, Comment.Com_ip,Comment.Com_typeid,Comment.Com_date,News.title,News.id ,News.AddDate FROM Comment INNER JOIN News ON Comment.Com_typeid = news.id ORDER BY Comment.Com_id DESC"
else
Sql = "SELECT Comment.Com_id,Comment.Com_name,Comment.Com_content, Comment.Com_ip,Comment.Com_typeid,Comment.Com_date,News.title,News.id ,News.AddDate FROM Comment INNER JOIN News ON Comment.Com_typeid = news.id WHERE Comment.Com_typeid = "&id &" ORDER BY Comment.Com_id DESC"
end if
rs.open sql,conn,1,3
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.del.chkAll.checked){
document.del.chkAll.checked = document.del.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(confirm("确定要删除选中的新闻评论吗?一旦删除将不能恢复!"))
return true;
else
return false;
}
</SCRIPT>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top">
<table border="0" align="center" cellpadding="5" cellspacing="1" class="border">
<tr></tr>
</table>
<form name="del" method="Post" action="comment_Del.asp" onSubmit="return ConfirmDel();">
<table border="0" cellpadding="0" cellspacing="1" class="border" >
<tr class=tdbg>
<td height="25"> 新闻评论管理</td>
<td width="150">
<%
if rs.eof and rs.bof then
response.write "共找到 0 条新闻评论</td></tr></table>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
response.Write "共找到 " & totalPut & " 条新闻评论"
%> </td>
</tr>
</table>
<br>
<%
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"条新闻评论"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"条新闻评论"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,false,"条新闻评论"
end if
end if
end if
%>
<%
sub showContent
' dim i
i=0
%>
<table border="0" cellpadding="0" cellspacing="1" class="border" style="word-break:break-all">
<tr>
<td width="37" height="25" align="center" class="Title">选中</td>
<td width="41" height="25" align="center" class="Title">ID</td>
<td width="273" align="center" class=Title >评论内容</td>
<td width="279" align="center" class="Title" >新闻标题</td>
<td width="117" align="center" class="Title" >留言者姓名</td>
<td width="132" align="center" class="Title" >留言者IP</td>
<td width="89" align="center" class="Title" >评论时间</td>
</tr>
<%do while not rs.eof%>
<tr class="tdbg">
<td width="37" height="22" align="center" class=tdbg>
<input name='ID' type='checkbox' onClick="unselectall()" id="ID" value='<%=cstr(rs("Com_ID"))%>'> </td>
<td width="41" align="center" class=tdbg><%=rs("Com_ID")%></td>
<td class=tdbg><a href="AdminShownews.asp?ID=<%=rs("Com_ID")%>"><%=left(rs("Com_content"),30)%></a></td>
<td class=tdbg>
<div align="center"><a href="AdminShownews.asp?ID=<%=rs("ID")%>"><%=left(rs("title"),30)%></a></div></td>
<td class=tdbg>
<div align="center"><%=rs("Com_name")%></div></td>
<td><div align="center"><%=rs("Com_ip")%></div></td>
<td align="center" class=tdbg><%= FormatDateTime(rs("Com_date"),2) %> </td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有新闻评论</td>
<td><input name="submit" type='submit' value='删除选定的新闻评论'>
<input name="Action" type="hidden" id="Action" value="Del"></td>
</tr>
</table>
<%
end sub
%>
</form>
<!-- #include file="Inc/Foot.asp" -->
<%
rs.close
set rs=nothing
call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -