📄 ad_softcomment.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=3
Const PurviewLevel_Soft=1
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="ad_ChkPurview.asp"-->
<!--#include file="inc/Conn_User.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ubbcode.asp"-->
<%
dim strFileName
strFileName="ad_SoftComment.asp"
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages,i,j
dim SearchContent,ShowSoftID
dim Action,FoundErr,Errmsg
ShowSoftID=Trim(request("ShowSoftID"))
Action=Trim(request("Action"))
SearchContent=Trim(request("SearchContent"))
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql,rs
%>
<html>
<head>
<title>软件评论管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" type="text/css" href="ad_Style.css">
<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>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<tr class="topbg">
<td height="22" colspan=2 align=center><b>软 件 评 论 管 理</b></td>
</tr>
<tr class="tdbg">
<td width="70" height="30"><strong>管理导航:</strong></td>
<td height="30">
<table width="100%"><tr>
<form name="searchsoft" method="get" action="ad_SoftComment.asp">
<td>
<input name="SearchContent" type="text" class=smallInput id="SearchContent" size="28">
<input name="Query" type="submit" id="Query" value="查 询">
请输入查询的内容。如果为空,则查找所有评论。</td>
</form></tr></table>
</td>
</tr>
</table>
<%
if Action="Modify" then
call Modify()
elseif Action="SaveModify" then
call SaveModify()
elseif Action="Del" then
call DelComment()
elseif Action="Del2" then
call DelComment2()
elseif Action="Reply" then
call Reply()
elseif Action="SaveReply" then
call SaveReply()
else
call main()
end if
if FoundErr=True then
call WriteErrMsg()
end if
call CloseConn()
sub main()
sql="select S.SoftID,S.ClassID,S.SoftName,S.SoftVersion,C.CommentID,C.UserName,C.IP, C.Content,C.WriteTime,C.ReplyName,C.ReplyContent,C.ReplyTime,C.Email,C.Oicq,C.Homepage,C.Icq,C.Msn,C.UserType,C.Score from SoftComment C Left Join Soft S On C.SoftID=S.SoftID where 1 "
if SearchContent<>"" then
sql=sql & " and C.Content like '%" & SearchContent & "%' "
end if
if ShowSoftID<>"" then
sql=sql & " and C.SoftID=" & ShowSoftID & " "
end if
sql=sql & " order by S.SoftID desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="del" method="Post" action="ad_SoftComment.asp" onsubmit="return ConfirmDel();">
<tr>
<td align="center">
<table border="0" cellpadding="2" width="100%" cellspacing="0">
<tr>
<td>您现在的位置:<a href="ad_SoftComment.asp">评论管理</a> >>
<%
if request.querystring="" then
response.write "所有评论"
else
if SearchContent<>"" then
response.write "评论内容中含有“<font color=blue>" & SearchContent & "</font>”的评论"
else
response.Write("所有评论")
end if
end if
%>
</td>
<td width="150" align="right">
<%
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>
<%
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
%>
</form>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub
sub showContent
dim i,rsCommentUser
i=0
dim PrevID
PrevID=rs("SoftID")
do while not rs.eof
if rs("SoftID")<>PrevID then response.write "</table></td></tr></table><br>"
if i=0 or rs("SoftID")<>PrevID then
%>
<table class="border" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="title">
<td width="80%" height="22">|
<%
response.write "<a href='ad_SoftShow.asp?SoftID=" & rs("SoftID") & "'>" & rs("SoftName") & " " & rs("SoftVersion") & "</a>"
%></td>
<td width="20%" align="right"><a href="ad_SoftComment.asp?SoftID=<%=rs("SoftID")%>&Action=Del2">删除此软件下的所有评论</a></td>
</tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="1" width="100%" cellpadding="0" style="word-break:break-all">
<%end if%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td width="30" align="center">
<input name='CommentID' type='checkbox' onclick="unselectall()" id="CommentID" value='<%=cstr(rs("CommentID"))%>'>
</td>
<td><a href="#" Title="<%=left(rs("Content"),200)%>"><%=left(rs("Content"),25)%></a></td>
<td width="70" align="center">评分:<%=rs("Score")%></td>
<td width="50" align="center"><%if rs("UserType")=1 then response.write "会员" else response.write "游客" end if%> </td>
<td width="100" align="center">
<%
if rs("UserType")=1 then
set rsCommentUser=Conn_User.execute("select " & db_User_ID & "," & db_User_Name & "," & db_User_Email & "," & db_User_QQ & "," & db_User_ICQ & "," & db_User_Msn & "," & db_User_Homepage & " from " & db_User_Table & " where " & db_User_Name & "='" & rs("UserName") & "'")
if rsCommentUser.bof and rsCommentUser.eof then
response.write rs("UserName")
else
response.write "<a href='UserInfo.asp?UserID=" & rsCommentUser(0) & "' title='姓名:" & rsCommentUser(1) & vbcrlf & "信箱:" & rsCommentUser(2) & vbcrlf & "Oicq:" & rsCommentUser(3) & vbcrlf & " Icq:" & rsCommentUser(4) & vbcrlf & " Msn:" & rsCommentUser(5) & vbcrlf & " I P:" & rs("IP") & vbcrlf & "主页:" & rsCommentUser(6)&"' target='_blank'>" & rs("UserName") & "</a>"
end if
else
response.write "<span title='姓名:" & 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
%>
</td>
<td width="120" align="center"><%= rs("WriteTime") %></td>
<td width="100" align="center">
<%
if rs("ReplyName")<>"" then
response.write " "
else
response.write "<a href='ad_SoftComment.asp?Action=Reply&CommentID=" & rs("Commentid") & "'>回复</a> "
end if
response.write "<a href='ad_SoftComment.asp?Action=Modify&CommentID=" & rs("Commentid") & "'>修改</a> "
response.write "<a href='ad_SoftComment.asp?Action=Del&CommentID=" & rs("CommentID") & "' onclick='return ConfirmDel();'>删除</a>"
%>
</td>
</tr>
<%if rs("ReplyName")<>"" then%>
<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="center"> </td>
<td colspan="5">
<%response.write "管理员【" & rs("ReplyName") & "】于 " & rs("ReplyTime") & " 回复:<br><div style='padding:0px 20px'>" & rs("ReplyContent") & "</div>"%>
</td>
<td align="center"><a href="ad_SoftComment.asp?Action=Reply&CommentID=<%=rs("CommentID")%>">修改回复内容</a></td>
</tr>
<%
end if
i=i+1
if i>=MaxPerPage then exit do
PrevID=rs("SoftID")
rs.movenext
loop
%>
</table></td>
</tr>
</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>
<%
end sub
sub Modify()
dim CommentID
CommentID=trim(Request("CommentID"))
if CommentID="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>请指定评论ID</li>"
Exit sub
else
CommentID=Clng(CommentID)
end if
sql="Select * from SoftComment where CommentID=" & CommentID
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,1
if rs.Bof or rs.EOF then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的评论!</li>"
else
%>
<form method="post" action="ad_SoftComment.asp" 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>
<%if rs("UserType")=1 then response.write "(会员模式)" else response.write "(游客模式)" end if%>
</td>
</tr>
<% if rs("UserType")=0 then%>
<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")%>">
</td>
<td class="tdbg" align="right" width="101">评论人Oicq:</td>
<td class="tdbg" width="475">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -