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

📄 user_comment.asp

📁 淘客网上商店网站程序 淘客网上商店网站程序 淘客网上商店网站程序
💻 ASP
字号:
<!--#include file="Inc/Const.asp"-->
<%
if ChannelID=0 then Cl.ShowErr("<br /><li>请指定频道ID!</li>")
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="User_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;
	} 	
}

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="User_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&" and UserID="&Cl.UserID&" "
	if SearchContent<>"" then
		strSql2=strSql2 & " and M.CommentContent like '%" & Cl.CheckStr(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
	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)
	%>
<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%"><%=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"><%
		'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>
<%
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 UserID="&Cl.UserID&" and 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">
    
  <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border" >
    <tr align="center" class="title"> 
      <td height="22" colspan="4"> <strong>修 改 评 论 </strong></td>
    </tr>
    <tr> 
      <td width="200" align="right" class="tdbg">评论人姓名:</td>
      <td class="tdbg" width="200"> 
        <input name="UserName" type="text" id="UserName" maxlength="16" value="<%=rs("UserName")%>" disabled>
      </td>
      <td class="tdbg" align="right" width="101">评论人Email:</td>
      <td class="tdbg" width="475"> 
        <input name="UserEmail" type="text" id="UserEmail" maxlength="40" value="<%=rs("UserEmail")%>">
      </td>
    </tr>
    <tr> 
      <td width="200" align="right" class="tdbg">评论时间:</td>
      <td class="tdbg" width="200"> 
        <input name="CommentTime" type="text" id="CommentTime" value="<%=rs("CommentTime")%>">
      </td>
      <td class="tdbg" align="right" width="101">评论人IP:</td>
      <td class="tdbg" width="475"> 
        <input name="IP" type="text" id="UserIP"  maxlength="15" value="<%=rs("UserIP")%>">
      </td>
    </tr>
    <tr> 
      <td width="200" align="right" class="tdbg">评论内容:</td>
      <td class="tdbg" colspan="3"> 
        <textarea name="CommentContent" cols="56" rows="8" id="Content"><%=rs("CommentContent")%></textarea>
      </td>
    </tr>
    <tr align="center"> 
      <td height="30" colspan="4" class="tdbg"> 
        <input name="ComeUrl" type="hidden" id="ComeUrl" value="<%=ComeUrl%>">
        <input name="Action" type="hidden" id="Action" value="SaveModify">
        <input name="CommentID" type="hidden" id="CommentID" value="<%=rs("CommentID")%>">
        <input name="UserGroupID" type="hidden" id="UserGroupID" value="<%=rs("UserGroupID")%>">
        <input  type="submit" name="Submit" value=" 保存修改结果 ">
      </td>
    </tr>
  </table>
</form>
<%
	end if
	rs.close : set rs=Nothing
end sub

sub DelComment()
	dim CommentID,i
	CommentID=Cl.GetClng(Request("CommentID"))
	if CommentID=0 then
		Cl.OutErr("<br /><li>请指定评论ID</li>")
		Exit sub
	end if
	Cl.Execute "delete from Cl_Comment where UserID="&Cl.UserID&" and Commentid=" & Clng(CommentID)
	Cl.SaveAdminLog
	response.redirect ComeUrl
End sub

sub SaveModify()
	dim rsComment,ClassID,tClass,CommentID
	dim UserGroupID,CommentUName
	dim CommentUEmail,CommentUIP,CommentCommentTime
	dim CommentUScore,CommentUContent
	CommentID=Cl.GetClng(Request("CommentID"))
	UserGroupID=Cl.GetClng(request("UserGroupID"))
	if CommentID=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>请指定评论ID</li>"
		Exit sub
	end if
	if UserGroupID=5 then
		CommentUName=Trim(request.form("UserName"))
		if CommentUName="" then
			founderr=true
			errmsg=errmsg & "<br /><li>请输入姓名</li>"
			Exit sub
		end if
		CommentUEmail=Trim(request.form("UserEmail"))
	end if
	CommentUIP=Trim(request.form("UserIP"))
	CommentCommentTime=Trim(request.form("CommentTime"))
	CommentUContent=Trim(request.Form("Content"))
	if CommentUContent="" or CommentUIP="" or CommentUScore="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请完整输入评论内容、评论时间、评论人IP等信息</li>"
	end if
	CommentUContent=Cl.HTMLEncode(CommentUContent)
	if CommentCommentTime="" then
		CommentCommentTime=now()
	else
		CommentCommentTime=Cdate(CommentCommentTime)
	end if
	if FoundErr=True then exit sub
	sql="Select * from Cl_Comment where ChannelID="&ChannelID&" and UserID="&UserID&" and CommentID=" & CommentID
	Set rsComment=Server.CreateObject("Adodb.RecordSet")
	rsComment.Open sql,Conn,1,3
	if rsComment.Bof or rsComment.EOF then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>找不到指定的评论!</li>"
	else
		if UserGroupID=5 then
			'rsComment("UserGroupID")=UserGroupID
			rsComment("UserName")=CommentUName
			rsComment("UserEmail")=CommentUEmail
		end if
		rsComment("UserIP")=CommentUIP
		rsComment("CommentTime")=CommentCommentTime
		rsComment("CommentContent")=CommentUContent
		rsComment.update
	end if
	rsComment.Close
	set rsComment=Nothing
	ComeUrl=Trim(request("ComeUrl"))
	if ComeUrl="" then ComeUrl=FileName
	Cl.SaveAdminLog
	response.redirect ComeUrl
end sub
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│														 │
'│		CreateLive CMS Version 4.0						 │
'│        				Powered by Aspoo.CN	 	 │
'│ 		          						 │
'│ 	邮箱: support@aspoo.cn		Info@aspoo.cn  	 │
'│		QQ: 3315263				596197794			 │
'│		网站: www.aspoo.cn			www.aspoo.com		 │
'│		论坛: bbs.aspoo.cn			bbs.aspoo.com		 │
'│														 │
'│	Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved.	 │
'└───────────────────────────────────────────────────────┘
'-->
%>

⌨️ 快捷键说明

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