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

📄 admin_comment.asp

📁 正版创力4.1SQL商业版!!!ASP版。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Inc/Const.asp"-->
<%
if ChannelID=0 then Cl.ShowErr("<br /><li>请指定频道ID!</li>")
if Not Cl.TrueChannelPurview(3,ChannelID) then
	Cl.ShowErr("<br /><li>您无此操作权限!</li>")
end if
const PageSize=20
dim Action,strShowFileName
dim j,SearchContent,InfoID
Action			= Trim(request("Action"))
SearchContent	= Trim(request("SearchContent"))
InfoID			= Trim(request("InfoID"))
CurrentPage		= Cl.GetClng(request("page"))
Cl.Load_ChannelSetting(ChannelID)
FileName="Admin_Comment.asp?ChannelID="&ChannelID&""
Header
%>
<script language="JavaScript" type="text/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;
	}
}
</script>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
  <tr class="title"> 
    <td height="22" colspan="3" align="center"><b><%=Cl.Channel.selectSingleNode("@channelitemname").text%>评论管理</b></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30" align="right"><strong>管理导航:</strong></td>
    <td width="220" height="30">&nbsp;&nbsp;<a href="<%=FileName%>">所有评论</a>&nbsp;&nbsp;<a href="<%=FileName%>&Action=Pass">已审评论</a>&nbsp;&nbsp;<a href="<%=FileName%>&Action=NoPass">待审评论(<font color='#FF0000'><%=Cl.Execute("select count(*) From Cl_Comment Where Status=0 and ChannelID="&ChannelID&"")(0)%></font>)</a>&nbsp;</td>
    <td height="30">
      <table width="100%">
	  <form name="searchArticle" method="get" action="Admin_Comment.asp">
	  <tr>
		<td> 
		<input name="ChannelID" type="hidden" id="ChannelID" value="<%=ChannelID%>" />
		<input name="SearchContent" type="text" class="smallInput" id="SearchContent" size="28" />
		<input name="Query" type="submit" id="Query" value="查 询" />
		&nbsp;&nbsp;如果为空,则查找所有评论。</td>
		</tr>
	  </form>
	  </table>
	</td>
  </tr>
</table>
<%
OpenConn
Select Case Action
Case "Modify"
	call Modify()
Case "SaveModify"
	call SaveModify()
Case "Del"
	call DelComment()
Case "DelAll"
	call DelCommentAll()
Case "Reply"
	call Reply()
Case "SaveReply"
	call SaveReply()
Case "SetPass"
	call SetPass()
Case "SetNoPass"
	call SetNoPass()
Case else
	call main()
end Select
if FoundErr=True then Cl.ShowErr(ErrMsg)
Footer

Sub main()
	Dim strSql,strSql2
	strSql="M.CommentID,M.InfoID,M.UserID,M.UserName,M.UserGroupID,M.UserEmail,M.UserIP,M.CommentTime,M.CommentContent,M.ParentID,M.ParentContent,M.Agrees,M.DisAgrees,M.Middles,M.ReplyCount,M.Elite,M.Argue,M.Status from Cl_Comment M Left join"
	strSql2=" where M.ChannelID="&ChannelID&" and I.ChannelID="&ChannelID&" "
	if SearchContent<>"" then
		strSql2=strSql2 & " and M.CommentContent like '%" & SearchContent & "%' "
		FileName=FileName & "&SearchContent=" & SearchContent
	end if
	if Isnumeric(InfoID) then
		strSql2=strSql2 & " and M.InfoID="&Clng(InfoID)&" "
		FileName=FileName & "&InfoID=" & InfoID
	end if
	if Action="NoPass" then
		strSql2=strSql2 & " and M.Status=0 "
		FileName=FileName & "&Action=NoPass"
	Elseif Action="Pass" then
		strSql2=strSql2 & " and M.Status=1 "
		FileName=FileName & "&Action=Pass"
	end if
	if Not Cl.TrueChannelPurview(2,ChannelID) then
		if Cl.Admin_Info(5)<>"" then
			Dim TarrChildID,sTemparrID,tClass
			sTemparrID=Split(Cl.Admin_Info(5),",")
			TarrChildID=""
			for i=0 to Ubound(sTemparrID)
				set tClass=Cl.Execute("select ClassName,RootID,ParentID,Depth,ParentPath,Child,arrChildID,ClassMaster From Cl_Class where  ClassID=" & Clng(sTemparrID(i)) )
				if Not (tClass.Bof and tClass.Eof) then
					'ClassID=Clng(sTemparrID(i))
					if TarrChildID="" then
						TarrChildID=tClass(6)
					else
						TarrChildID=TarrChildID & "," & tClass(6)
					end if
				end if
				Set tClass=Nothing
			next
			if TarrChildID="" then
				Cl.ShowErr("<br /><li>您无权管理此栏目下的资料</li>")
			else
				strSql2=strSql2 & " and I.ClassID In (" & TarrChildID & ")"
			end if
		else
		Cl.ShowErr("<br /><li>您无权管理此栏目下的资料</li>")
		end if
	end if
	Select Case Clng(Cl.Channel.selectSingleNode("@moduleid").text)
	Case 1
	sql="select I.InfoID,I.ClassID,I.Title,"&strSql&" Cl_Article I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Article.asp?Action=Show&InfoID="
	Case 2
	sql="select I.InfoID,I.ClassID,I.SoftName,"&strSql&" Cl_Soft I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Soft.asp?Action=Show&InfoID="
	Case 3
	sql="select I.InfoID,I.ClassID,I.PhotoName,"&strSql&" Cl_Photo I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Photo.asp?Action=Show&InfoID="
	Case 4
	sql="select I.InfoID,I.ClassID,I.MovieName,"&strSql&" Cl_Movie I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Movie.asp?Action=Show&InfoID="
	Case 5
	sql="select I.InfoID,I.ClassID,I.ProductName,"&strSql&" Cl_Product I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Product.asp?Action=Show&InfoID="
	Case Else
	sql="select I.InfoID,I.ClassID,I.Title,"&strSql&" Cl_Article I On M.InfoID=I.InfoID "&strSql2&" order by M.CommentID desc,I.InfoID desc"
	strShowFileName="Admin_Article.asp?Action=Show&InfoID="
	end Select
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,Conn,1,1
%>
<br />
<%  
	if Not (rs.eof and rs.bof) then
		TotalPut=rs.recordcount
		if (TotalPut mod PageSize)=0 then
			TotalPages = TotalPut \ PageSize
		else
			TotalPages = TotalPut \ PageSize + 1
		end if
		if CurrentPage > TotalPages then CurrentPage=TotalPages
		if CurrentPage < 1 then CurrentPage=1
		rs.move (CurrentPage-1)*PageSize
		Call ShowComment()
		Response.write Cl.ShowPage(FileName,TotalPut,PageSize,"篇","评论")
	end if
	rs.close:set rs=Nothing
end sub

Sub ShowComment()
	dim rsCommentU,UserIM
	dim PrevID
	PrevID=rs(0)
	%>
<form action="Admin_Comment.asp?ChannelID=<%=ChannelID%>" method="post" name="del" id="del" onsubmit="return ConfirmDel();">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
	<tr class="title"> 
		<td width="30">选</td>
		<td>内容</td>
		<td width="80">评论人</td>
		<td width="120">时间</td>
		<td width="80">属性</td>
		<td width="80">操用</td>
	</tr>
<%
For i=1 To PageSize
	'if i=0 or rs(0)<>PrevID then	%>
	<!--
	<tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'">
		<td colspan="6" align="left"><b>标题:<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%'=rs(0)%>"><%'=rs(2)%></a></b>[<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%'=rs(0)%>" class="blue">查看所有评论]</a>&nbsp;[<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%'=rs(0)%>&Action=DelAll" onclick= "return confirm('确定要删除本标题下所有评论吗?注意:此操作将不可恢复!');" class="blue">删除所有评论</a>]</td>
	</tr>-->
	<%'end if%>
	<tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'"> 
		<td align="center">
		<input name="CommentID" type="checkbox" onclick="unselectall()" id="CommentID" value="<%=rs("CommentID")%>" /></td>
		<td onMouseOut="showlayer('comment_<%=rs("CommentID")%>',0)" onMouseOver="showlayer('comment_<%=rs("CommentID")%>',1)"><%=Left(rs("CommentContent"),60)%>
		<span id="comment_<%=rs("CommentID")%>" class="hidden">
		<table border="0" cellspacing="1" align="center" cellpadding="0" style="width:400px;">
			<tr class="title">
				<td colspan="2" align="left">&nbsp;&nbsp;<%=rs(2)%></td>
			</tr>
			<tr class="tdbg">
				<td width="20%" align="right" nowrap><strong>可用操作:</strong></td>
				<td width="80%"><%
		if rs("Status")=1 then
			response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=SetNoPass&CommentID=" & rs("Commentid") & "'>取消</a>&nbsp;&nbsp;"
		else
			response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=SetPass&CommentID=" & rs("Commentid") & "'><font color='#ff0033'>审核</font></a>&nbsp;&nbsp;"
		end if
		response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=Modify&CommentID=" & rs("Commentid") & "'>修改</a>&nbsp;&nbsp;" 
		response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=Del&CommentID=" & rs("CommentID") & "' onclick='return ConfirmDel();'>删除</a>"
		%>
			&nbsp;&nbsp;
			[<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%=rs(0)%>">查看本标题所有</a>]&nbsp;
			[<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%=rs(0)%>&Action=DelAll" onclick= "return confirm('确定要删除本标题下所有评论吗?注意:此操作将不可恢复!');">删除本标题所有</a>]
			</td>
			</tr>
			<tr class="tdbg">
				<td width="20%" align="right" nowrap><strong>评 论 人:</strong></td>
				<td width="80%"><%=rs("UserName")%>(<font color='#0000ff'><%=Cl.GetUserGroupName(rs("UserGroupID"))%></font>)
				<%If rs("UserID")>0 then%>
				[<a href="Admin_User.asp?Action=Modify&UserName=<%=rs("UserName")%>" class="blue">信息</a>]
				<%End if%>
				<strong>Email:</strong><%=rs("UserEmail")%></td>
			</tr>
			<tr class="tdbg">
				<td width="20%" align="right"><strong>评论时间:</strong></td>
				<td width="80%"><%=rs("CommentTime")%>&nbsp;&nbsp;
				<strong>IP:</strong><%=rs("UserIP")%>[<a href="IpAddress.asp?IP=<%=rs("UserIP")%>" class="blue" target="_blank">来源</a>]</td>
			</tr>
			<tr class="tdbg">
				<td width="20%" align="right"><strong>评论内容:</strong></td>
				<td width="80%"><%
				Response.write Left(rs("CommentContent")&"",1000)
				if rs("ParentID")>0 then
				Response.write "<br />[<a href='"&InstallDir&"Comment/Show.asp?CommentID="&rs("ParentID")&"' target='_blank'><font color='blue'>原贴</font></a>]<font color='#888888'>"&Left(rs("ParentContent")&"",1000)&"</font>"
				end if
				%></td>
			</tr>
			<tr class="tdbg">
				<td width="20%" align="right"><strong>网友评价:</strong></td>
				<td width="80%">支持:<%=Rs("Agrees")%>&nbsp;&nbsp;反对:<%=Rs("DisAgrees")%>&nbsp;&nbsp;中立:<%=rs("Middles")%>&nbsp;&nbsp;回复:<%=rs("ReplyCount")%></td>
			</tr>
		</table>
		</span>
		</td>
		<td><%=rs("UserName")%></td>
		<td width="120" align="center"><%=rs("CommentTime")%></td>
		<td width="80" align="center"><%
		if rs("Status")=1 Then
			Response.write "<font color='#0000ff'>通过</font>"
		Else
			Response.write "<font color='#888888'>待审</font>"
		End If
		if rs("Elite")=1 Then
			Response.write "&nbsp;<font color='#006600'>荐</font>"
		Else
			Response.write "&nbsp;<font color='#C5C5C5'>荐</font>"
		End If
		if rs("Argue")=1 Then
			Response.write "&nbsp;<font color='#FF0000'>辩</font>"
		Else
			Response.write "&nbsp;<font color='#C5C5C5'>辩</font>"
		End if
		%></td>
		<td width="80" align="center"><%
		if rs("Status")=1 then
			response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=SetNoPass&CommentID=" & rs("Commentid") & "'>取消</a>&nbsp;"
		else
			response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=SetPass&CommentID=" & rs("Commentid") & "'><font color='#ff0033'>审核</font></a>&nbsp;"
		end if
		response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=Modify&CommentID=" & rs("Commentid") & "'>修改</a>&nbsp;" 
		response.write "<a href='Admin_Comment.asp?ChannelID="&ChannelID&"&Action=Del&CommentID=" & rs("CommentID") & "' onclick='return ConfirmDel();'>删除</a>"
		%></td>
	</tr>
	<%
	'i = i+1
	'if i >= PageSize Then Exit Do
	'PrevID=rs(0)
	rs.movenext
	If rs.Eof Then Exit For
Next
%>
</table>
<table width="100%" 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>
</form>
<%
end sub 

sub Modify()
	dim CommentID
	CommentID=Cl.GetClng(Request("CommentID"))
	if CommentID=0 then
		Cl.ShowErr("<br /><li>请指定评论ID</li>")
	end if
	sql="Select * from Cl_Comment where CommentID=" & CommentID
	Set rs=Server.CreateObject("Adodb.RecordSet")
	rs.Open sql,Conn,1,1
	if rs.Bof or rs.EOF then
		Cl.ShowErr("<br /><li>找不到指定的评论!</li>")
	else
	
%>
<form method="post" action="Admin_Comment.asp?ChannelID=<%=ChannelID%>" name="form1">

⌨️ 快捷键说明

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