📄 admin_comment.asp
字号:
<!--#include file="Admin_Common.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Const NeedCheckComeUrl = True '是否需要检查外部访问
Const PurviewLevel = 2 '0--不检查,1--超级管理员,2--普通管理员
Const PurviewLevel_Channel = 1 '0--不检查,1--频道管理员,2--栏目总编,3--栏目管理员
Const PurviewLevel_Others = "" '其他权限
Dim Passed
Dim ClassID
Dim tClass, ClassName, RootID, ParentID, Depth, ParentPath, Child, arrChildID, ParentDir, ClassDir, ClassPurview
Passed = Trim(Request("Passed"))
If Passed = "" Then
Passed = Session("Passed")
End If
If Passed = "" Then
Passed = "All"
End If
Session("Passed") = Passed
FileName = "Admin_Comment.asp?ChannelID=" & ChannelID
strFileName = "Admin_Comment.asp?ChannelID=" & ChannelID & "&ClassID=" & ClassID & "&Field=" & strField & "&keyword=" & Keyword
'页面头部HTML代码
Response.Write "<html><head><title>评论管理</title>" & vbCrLf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
Response.Write "<link href='Admin_Style.css' rel='stylesheet' type='text/css'>" & vbCrLf
Response.Write "</head>" & vbCrLf
Response.Write "<body leftmargin='2' topmargin='0' marginwidth='0' marginheight='0'>" & vbCrLf
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>" & vbCrLf
Call ShowPageTitle(ChannelShortName & "评论管理", 10010)
If Action = "" Then
Response.Write "<form name='form' method='Post' action='" & strFileName & "'><tr class='tdbg'>"
Response.Write " <td width='70' height='30' ><strong>评论选项:</strong></td><td>"
Response.Write " <input name='Passed' type='radio' value='All' onclick='submit();'"
If Passed = "All" Then Response.Write " checked"
Response.Write ">所有" & ChannelShortName & "评论 <input name='Passed' type='radio' value='False' onclick='submit();'"
If Passed = "False" Then Response.Write " checked"
Response.Write ">未审核的" & ChannelShortName & "评论 <input name='Passed' type='radio' value='True' onclick='submit();'"
If Passed = "True" Then Response.Write " checked"
Response.Write ">已审核的" & ChannelShortName & "评论"
Response.Write " <input name='Passed' type='radio' value='New' onclick='submit();'"
If Passed = "New" Then Response.Write " checked"
Response.Write ">最新的" & ChannelShortName & "评论"
Response.Write "</td></tr></form>" & vbCrLf
End If
Response.Write "</table>" & vbCrLf
'执行的操作
Select Case Action
Case "Modify"
Call Modify
Case "SaveModify"
Call SaveModify
Case "SetPassed", "CancelPassed", "Del", "DelReply"
Call SetProperty
Case "Del2", "DelUser"
Call DelComment2
Case "Reply"
Call Reply
Case "SaveReply"
Call SaveReply
Case Else
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Response.Write "</body></html>"
Call CloseConn
Sub main()
Dim rs, sql
ClassID = PE_CLng(Trim(Request("ClassID")))
If ClassID > 0 Then
Dim tClass
Set tClass = Conn.Execute("select ClassName,RootID,ParentID,Depth,ParentPath,Child,arrChildID from PE_Class where ClassID=" & ClassID)
If tClass.BOF And tClass.EOF Then
FoundErr = True
ErrMsg = ErrMsg & "<li>找不到指定的栏目</li>"
Exit Sub
Else
ClassName = tClass("ClassName")
RootID = tClass("RootID")
ParentID = tClass("ParentID")
Depth = tClass("Depth")
ParentPath = tClass("ParentPath")
Child = tClass("Child")
arrChildID = tClass("arrChildID")
End If
Set tClass = Nothing
End If
sql = "select "
Select Case ModuleType
Case 1
sql = "select I.Title as Title,I.IncludePic"
Case 2
sql = "select I.SoftName as Title"
Case 3
sql = "select I.PhotoName as Title"
Case 5
sql = "select I.ProductName as Title"
Case 6
sql = "select I.SupplyTitle as Title"
End Select
sql = sql & ",I." & ModuleName & "ID as ObjectID,C.CommentID,C.UserType,C.UserName,C.Email,C.Oicq,C.Homepage,C.Icq,C.Msn,C.IP"
sql = sql & ",C.Content,C.WriteTime,C.ReplyName,C.ReplyContent,C.ReplyTime,C.Score,C.Passed"
sql = sql & " from PE_Comment C Left Join " & SheetName & " I On C.InfoID=I." & ModuleName & "ID"
sql = sql & " where C.ModuleType=" & ModuleType & " and I.ChannelID=" & ChannelID
If Keyword <> "" Then
Select Case strField
Case "CommentContent"
sql = sql & " and C.Content like '%" & Keyword & "%' "
Case "CommentName"
sql = sql & " and C.UserName like '%" & Keyword & "%' "
Case "InfoID"
sql = sql & " and I." & ModuleName & "ID = " & PE_CLng(Keyword) & ""
Case "CommentTime"
If IsDate(Trim(Request("keyword"))) = False Then
FoundErr = True
ErrMsg = ErrMsg & "<li>输入的关键字不是有效日期!</li>"
Exit Sub
Else
sql = sql & " and DateDiff(" & PE_DatePart_D & ",C.WriteTime,'" & Keyword & "')=0 "
End If
End Select
End If
If Passed = "True" Then
sql = sql & " and C.Passed =" & PE_True & ""
ElseIf Passed = "False" Then
sql = sql & " and C.Passed =" & PE_False & ""
End If
If ClassID > 0 Then
If Child > 0 Then
sql = sql & " and I.ClassID in (" & arrChildID & ")"
Else
sql = sql & " and I.ClassID=" & ClassID
End If
End If
If Passed = "New" Then
sql = sql & " order by C.WriteTime desc"
Else
sql = sql & " order by " & ModuleName & "ID desc"
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, Conn, 1, 1
Call ShowJS_Main("评论")
Response.Write "<br><table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22'>" & GetRootClass() & "</td>"
Response.Write " </tr>" & GetChild_Root() & ""
Response.Write "</table>"
Response.Write "<br><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"
Response.Write "<form name='myform' method='post' action='" & strFileName & "' onsubmit='return ConfirmDel();'>"
Response.Write " <tr>"
Response.Write " <td align='center'>"
Response.Write " <table border='0' cellpadding='2' width='100%' cellspacing='0'>"
Response.Write " <tr>"
If strField = "InfoID" Then
Response.Write " <td>您现在的位置: 评论管理"
If Not (rs.BOF And rs.EOF) Then
Response.Write " >> 主题:" & rs("Title") & "</td>"
End If
Else
Response.Write " <td>" & GetCommentPath() & "</td>"
End If
Response.Write " <td width='150' align='right'>"
If rs.BOF And rs.EOF Then
Response.Write "共找到 0 篇评论</td></tr></table>"
Else
totalPut = rs.RecordCount
Response.Write "共找到 " & totalPut & " 篇评论</td></tr></table>"
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
If CurrentPage > 1 Then
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rs.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Dim CommentNum, rsCommentUser
CommentNum = 0
Dim PrevID, iTemp
iTemp = 1
PrevID = rs("ObjectID")
If Passed = "New" Then
Response.Write " <table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"
Response.Write " <tr class='title'>"
Response.Write " <td width='80%' height='22'>"
Response.Write "<font color='#000000'>最新" & ChannelShortName & "评论</font>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td colspan='2'>"
Response.Write " <table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"
End If
Do While Not rs.EOF
If Passed <> "New" Then
If rs("ObjectID") <> PrevID Then Response.Write "</table></td></tr></table><br>"
If CommentNum = 0 Or rs("ObjectID") <> PrevID Then
iTemp = 1
Response.Write " <table class='border' width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>"
Response.Write " <tr class='title'>"
Response.Write " <td width='80%' height='22'>"
Response.Write "<a href='Admin_" & ModuleName & ".asp?ChannelID=" & ChannelID & "&Action=Show&" & ModuleName & "ID=" & rs("ObjectID") & "'>" & rs("Title") & "</a>"
Response.Write " </td>"
Response.Write " <td width='20%' align='right'><a href='" & strFileName & "&Action=Del2&InfoID=" & rs("ObjectID") & "'>删除此" & ChannelShortName & "下的所有评论</a></td>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td colspan='2'>"
Response.Write " <table border='0' cellspacing='1' width='100%' cellpadding='0' style='word-break:break-all'>"
End If
End If
Response.Write " <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
Response.Write " <td width='30' align='center'>"
Response.Write " <input name='CommentID' type='checkbox' onclick=""unselectall()"" id='CommentID' value='" & CStr(rs("CommentID")) & "'>"
Response.Write " </td>"
Response.Write " <td width='20' align='center'>" & iTemp & "</td>"
Response.Write " <td align='left'>"
If rs("UserType") = 1 Then
Response.Write "[会员] "
Else
Response.Write "[游客] "
End If
If rs("UserType") = 1 Then
Response.Write "<a href='Admin_User.asp?UserName=" & rs("UserName") & "' target='_blank'>" & rs("UserName") & "</a>"
Else
Response.Write "<span title='" & nohtml("姓名:" & rs("UserName") & vbCrLf & "信箱:" & rs("Email") & vbCrLf & "Oicq:" & rs("Oicq") & vbCrLf & " Icq:" & rs("Icq") & vbCrLf & " Msn:" & rs("Msn") & vbCrLf & " I P:" & rs("IP") & vbCrLf & "主页:" & rs("Homepage")) & "' style='cursor:hand'>" & rs("UserName") & "</span>"
End If
Response.Write " 于 " & rs("WriteTime") & " 发表如下评论内容,同时评分:" & rs("Score") & "分<br>"
Response.Write rs("Content")
Response.Write " </td><td width='30' align='center'>"
If rs("Passed") = True Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -