⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_comment.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="Admin_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<title><%=EL_Channel.ChannelName%>评论管理</title>
<script language="javascript" src="../js/Common.js"></script>
<script language="javascript" src="../js/InstallDir.js"></script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td align="center" class="top_25"><strong><%=EL_Channel.ChannelName%>评论管理</strong></td>
  </tr>
  <tr>
    <td class="td_50">管理导航:<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>"><%=EL_Channel.ItemName%>评论管理首页</a> | <a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&Action=Batch">批量删除评论</a></td>
  </tr>
</table>
<br>
<%
Dim ClassID, Search_Field, Search_Keywords
Dim ClassURL, CurrentPath, ArrUserType(1)

ArrUserType(0) = "会员"
ArrUserType(1) = "游客"
ClassID = EL_Common.ELRequest("ClassID", 2)
Search_Keywords = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Search_Keywords", 1))
Search_Field = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Search_Field", 1))

If ClassID = "" Then
   ClassURL = URLParameters
Else
   ClassURL = EL_Common.ReplaceText(URLParameters, "\&ClassID=[0-9]*", "")
   ClassURL = EL_Common.ReplaceText(ClassURL, "Show", "")   
End If

CurrentPath = "·您现在的位置:<a href='"& EL_CurrentScriptName &"?ChannelID="& EL_Channel.ChannelID &"'>"& EL_Channel.ItemName &"评论管理</a> "

Select Case Action
  Case "": Call ManageComment()
  Case "Delete": Call AdminComment(-1)
  Case "Modify": Call ModifyComment()
  Case "SaveModify": Call AdminComment(5)
  Case "Reply": Call ReplyComment()
  Case "SaveReply": Call AdminComment(6)
  Case "Clear": Call AdminComment(7)
  Case "ShowAll": Call Comment_ShowAll()
  Case "Batch": Call Batch()
  Case "BatchDelete1": Call AdminComment(8)
  Case "BatchDelete2": Call AdminComment(9)
  Case "BatchDelete3": Call AdminComment(10)
  Case "BatchDelete4": Call AdminComment(11)
End Select
Call EL_Common.Bottom()
Call ApplicationTerminate()

Sub AdminComment(AdminType)
  On Error Resume Next
  Dim CommentCmd
  Dim InfoID, CommentID, Point, Content, DeleteType, ArrCommentID, UserName, ToChannel
  
  InfoID = EL_Common.ELRequest("InfoID", 2)
  CommentID = EL_Common.ELRequest("CommentID", 2)
  Point = EL_Common.ELRequest("Point", 2)
  Content = EL_Common.ELRequest("Content", 1)
  DeleteType = EL_Common.ELRequest("DeleteType", 2)
  ArrCommentID = EL_Common.ELRequest("CheckObject", 1)
  UserName = EL_Admin.AdminName
  ToChannel = EL_Channel.ChannelID
  
  If AdminType = -1 Then
    Select Case DeleteType
	   Case 0: AdminType = 1
	   Case 1: AdminType = 2
	   Case 2: AdminType = 3
	   Case 3: AdminType = 4
	End Select
  End If
  Select Case AdminType
     Case 8:
	    ArrCommentID = EL_Common.ELRequest("UpdateTime", 1)
		ToChannel = EL_Common.ELRequest("ToChannel", 2)
		If ToChannel = -1 Then
		   ToChannel = 0
		Else
		   ToChannel = EL_Channel.ChannelID 
		End If
		If IsDate(ArrCommentID) Then
		    EL_Common.ShowErrorMsg("日期格式错误")
			Exit Sub
		End If
	 Case 9:
	    CommentID = EL_Common.ELRequest("Days", 2) 
		ToChannel = EL_Common.ELRequest("ToChannel", 2)
		If ToChannel = -1 Then
		   ToChannel = 0
		Else
		   ToChannel = EL_Channel.ChannelID 
		End If
		If CommentID < 1 Then
		    EL_Common.ShowErrorMsg("天数必须大于0")
			Exit Sub
		End If
	 Case 10:
	    UserName = EL_Common.ELRequest("UserName", 1) 
		CommentID = EL_Common.ELRequest("IncludeUser", 2) 
		ToChannel = EL_Common.ELRequest("ToChannel", 2)
		If ToChannel = -1 Then
		   ToChannel = 0
		Else
		   ToChannel = EL_Channel.ChannelID 
		End If
		If UserName = "" Then
		    EL_Common.ShowErrorMsg("请指定用户名")
			Exit Sub
		End If
	 Case 11:
	    ArrCommentID = EL_Common.ELRequest("Chars", 1)
		ToChannel = EL_Common.ELRequest("ToChannel", 2)
		If ToChannel = -1 Then
		   ToChannel = 0
		Else
		   ToChannel = EL_Channel.ChannelID 
		End If
		If ArrCommentID = "" Then
		    EL_Common.ShowErrorMsg("请指定包含的字符")
			Exit Sub
		End If
  End Select
  
  Call EL_Common.InitCommand(CommentCmd, "EL_SP_AdminComment")
  With CommentCmd
    .Parameters.Append .CreateParameter("RETURN", 2, 4)
	.Parameters.Append .CreateParameter("@AdminType", 3, 1, 4, AdminType)
	.Parameters.Append .CreateParameter("@CommentID", 3, 1, 4, CommentID)
	.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, ToChannel)
	.Parameters.Append .CreateParameter("@ClassID", 3, 1, 4, ClassID)
	.Parameters.Append .CreateParameter("@InfoID", 3, 1, 4, InfoID)
	.Parameters.Append .CreateParameter("@ArrCommentID", 200, 1, 100, ArrCommentID)
	.Parameters.Append .CreateParameter("@Point", 3, 1, 4, Point)
	.Parameters.Append .CreateParameter("@Content", 203, 1, EL_Common.LenParameter(Content), Content)
	.Parameters.Append .CreateParameter("@IpAddress", 200, 1, 15, RemoteIp)
	.Parameters.Append .CreateParameter("@UserName", 200, 1, 50, UserName)
	.Execute()
  End With  
  Select Case AdminType
     Case 1, 2, 3, 4, 7: EL_Common.ShowScriptError() : Response.Redirect ComeURL
	 Case 5: EL_Common.ShowSuccessMsg("修改评论成功")
	 Case 6: EL_Common.ShowSuccessMsg("发表评论成功")
	 Case 8, 9, 10, 11: ComeURL = "Admin_Comment.asp?ChannelID="& EL_Channel.ChannelID : EL_Common.ShowSuccessMsg("批量删除成功")
  End Select
  
  Set CommentCmd = Nothing
  EL_Common.ShowScriptError()
End Sub

Sub Batch()
On Error Resume Next
%>
<form name="myform" action="Admin_Comment.asp" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td colspan="2" class="top_25"><strong>批量删除评论</strong></td>
  </tr>
  <tr>
    <td nowrap class="td_ItemName"><strong>范围</strong></td>
    <td class="item_25"><input name="ToChannel" type="radio" class="nomargin" value="1" checked>
      只对当前频道
      <input name="ToChannel" type="radio" class="nomargin" value="-1">
      对所有频道</td>
  </tr>
  <tr>
    <td width="28%" nowrap class="td_ItemName"><strong>1. 删除指定日期前的评论</strong></td>
    <td width="72%" class="td_50">日期:
      <input name="UpdateTime" type="text" id="UpdateTime" value="<%=Date()%>" size="20">
      <input type="button" name="Submit6" value="提交" onClick="document.myform.Action.value='BatchDelete1';document.myform.submit();"></td>
  </tr>
  <tr>
    <td nowrap class="td_ItemName"><strong>2. 删除多少天前的评论</strong></td>
    <td class="td_50">天数:
      <input name="Days" type="text" id="Days" value="1" size="10">
      <input type="button" name="Submit62" value="提交" onClick="document.myform.Action.value='BatchDelete2';document.myform.submit();"></td>
  </tr>
  <tr>
    <td nowrap class="td_ItemName"><strong>3. 删除指定用户名发表的评论</strong></td>
    <td class="td_50">用户名:
      <input name="UserName" type="text" id="UserName" size="20">
      <input type="button" name="Submit63" value="提交" onClick="document.myform.Action.value='BatchDelete3';document.myform.submit();">
      <input name="IncludeUser" type="checkbox" class="nomargin" id="IncludeUser" value="1">
      包括会员</td>
  </tr>
  <tr>
    <td nowrap class="td_ItemName"><strong>4. 删除评论内容包含的以下字符的评论</strong></td>
    <td class="td_50">包含的字符:
      <input name="Chars" type="text" id="Chars" size="20">
      <input type="button" name="Submit632" value="提交" onClick="document.myform.Action.value='BatchDelete4';document.myform.submit();">
      <input name="Action" type="hidden" id="Action">
      <input name="ChannelID" type="hidden" id="ChannelID" value="<%=EL_Channel.ChannelID%>"></td>
  </tr>
</table>
</form>
<%
EL_Common.ShowScriptError()
End Sub

Sub Comment_ShowAll()
On Error Resume Next
Dim CommentCmd, rsComment, RowCount, i
Dim InfoID, PageCounts, TotalRowCount, TableName, FieldName, PrimaryKey, InfoTitle
InfoID = EL_Common.ELRequest("InfoID", 2)

Select Case EL_Channel.ChannelModule
  Case 1: TableName = "EL_Article" : FieldName = "Title"       : PrimaryKey = "ArticleID"
  Case 2: TableName = "EL_Hotel"   : FieldName = "HotelName"   : PrimaryKey = "HotelID"
  Case 3: TableName = "EL_Product" : FieldName = "ProductName" : PrimaryKey = "ProductID"
  Case 5: TableName = "EL_Sight"   : FieldName = "SightName"   : PrimaryKey = "SightID"
  Case 6: TableName = "EL_Photo"   : FieldName = "PhotoName"   : PrimaryKey = "PhotoID"
  Case 7: TableName = "EL_Shop"    : FieldName = "ProductName" : PrimaryKey = "ProductID"
  Case 8: TableName = "EL_Car"     : FieldName = "CarName"     : PrimaryKey = "CarID"
  Case Else: EL_Common.ShowErrorMsg("频道参数错误") : Exit Sub
End Select

InfoTitle = EL_Common.GetFieldValue(FieldName, TableName, "ChannelID="& EL_Channel.ChannelID &" AND "& PrimaryKey &"="& InfoID)
CurrentPath = CurrentPath &" >> 查看完整评论 >> <span class=bluetext>"& InfoTitle &"</span>"


Call EL_Common.InitCommand(CommentCmd, "EL_SP_SplitPage")
With CommentCmd
  .Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
  .Parameters.Append .CreateParameter("@Tables", 200, 1, 50, "EL_Comment")
  .Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 50, "CommentID")
  .Parameters.Append .CreateParameter("@Sort", 200, 1, 200, "EL_Comment.UpdateTime DESC")
  .Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
  .Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
  .Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, "*")
  .Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, "ChannelID="& EL_Channel.ChannelID &" AND InfoID="& InfoID)
  .Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
  .Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
  .Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
  Set rsComment = .Execute()
End With
rsComment.Close()
RowCount = CommentCmd(0)
TotalRowCount = CommentCmd(9)
PageCounts = CommentCmd(10)

%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="738" height="22"><%=CurrentPath%></td>
	<td width="253" style="padding-right:5px; text-align:right;" nowrap="nowrap">
	<a href="Admin_Comment.asp?ChannelID=<%=EL_Channel.ChannelID%>&Action=Reply&InfoID=<%=InfoID%>" style="color:blue;">回复评论</a> | 
	<a href="Admin_Comment.asp?ChannelID=<%=EL_Channel.ChannelID%>&Action=Delete&DeleteType=1&InfoID=<%=InfoID%>" style="color:red">删除此<%=EL_Channel.ItemName%>下的所有评论</a> | 
	<a href="javascript:history.back()">返回</a>	</td>
  </tr>
</table>
<%
rsComment.Open()
For i = 1 To RowCount
%>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td colspan="4" class="top_25">
	<div style="float:left; width:200px;">评论人:<%=rsComment("UserName")%> (<%=ArrUserType(rsComment("UserType"))%>)</div>
	<div style="float:left; width:100px;">打分:<%=rsComment("Point")%></div>
	<div style="float:left; width:200px;">评论时间:<%=rsComment("UpdateTime")%></div>
	<div style="float:right; padding-right:5px;"><a href="Admin_Comment.asp?ChannelID=<%=EL_Channel.ChannelID%>&Action=Modify&CommentID=<%=rsComment("CommentID")%>" class="white">修改</a> | <a href="Admin_Comment.asp?ChannelID=<%=EL_Channel.ChannelID%>&Action=Delete&CommentID=<%=rsComment("CommentID")%>" class="white">删除</a></div>
    </td>
  </tr>
  <tr>
    <td class="td_25" width="25%" style="padding:5px;">QQ:<%=rsComment("QQ")%></td>
    <td class="td_25" width="25%" style="padding:5px;">MSN:<%=rsComment("MSN")%></td>
    <td class="td_25" width="25%" style="padding:5px;">Email:<%=rsComment("Email")%></td>
    <td class="td_25" width="25%" style="padding:5px;">IP:<%=rsComment("IpAddress")%></td>
  </tr>
  <tr>
    <td colspan="4" class="td_25" style="padding:5px;"><%=EL_Common.HTMLEncode(rsComment("Content"))%></td>
  </tr>
</table>
<br>
<%
   If i<RowCount Then rsComment.MoveNext
Next
rsComment.Close()
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
  <tr>
    <td width="12%"></td>
    <td width="88%" align="right" nowrap><%Call EL_Common.ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "评论", "条")%></td>
  </tr>
</table>
<%
Set rsComment = Nothing
Set CommentCmd = Nothing
EL_Common.ShowScriptError()
End Sub

Sub ReplyComment()
On Error Resume Next
Dim CommentTitle, InfoID
InfoID = EL_Common.ELRequest("InfoID", 2)
Select Case EL_Channel.ChannelModule
   Case 1: CommentTitle = EL_Common.GetFieldValue("Title", "EL_Article", "ChannelID="& EL_Channel.ChannelID &" AND ArticleID="& InfoID)
   Case 2: CommentTitle = EL_Common.GetFieldValue("HotelName", "EL_Hotel", "ChannelID="& EL_Channel.ChannelID &" AND HotelID="& InfoID)
   Case 3: CommentTitle = EL_Common.GetFieldValue("ProductName", "EL_Product", "ChannelID="& EL_Channel.ChannelID &" AND ProductID="& InfoID)
   Case 5: CommentTitle = EL_Common.GetFieldValue("SightName", "EL_Sight", "ChannelID="& EL_Channel.ChannelID &" AND SightID="& InfoID)
   Case 6: CommentTitle = EL_Common.GetFieldValue("PhotoName", "EL_Photo", "ChannelID="& EL_Channel.ChannelID &" AND PhotoID="& InfoID)
   Case 7: CommentTitle = EL_Common.GetFieldValue("ProductName", "EL_Shop", "ChannelID="& EL_Channel.ChannelID &" AND ProductID="& InfoID)
   Case 8: CommentTitle = EL_Common.GetFieldValue("CarName", "EL_Car", "ChannelID="& EL_Channel.ChannelID &" AND CarID="& InfoID)
End Select

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -