user_comments.asp

来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 472 行 · 第 1/2 页

ASP
472
字号
<!--#include file="user_top.asp"-->
<!--#include file="inc/class_blog.asp"-->
<%
Dim action
action = Trim(request("action"))
%>
</head>
<body scroll="no" style="overflow:auto!important;overflow:hidden;background:#fff;">
<%
Dim sIp, sGuide
Dim rs, sql,mainid
Dim id, cmd, Keyword, sField

Keyword = Trim(request("keyword"))
If Keyword <> "" Then
    Keyword = oblog.filt_badstr(Keyword)
End If
sField = Trim(request("Field"))
cmd = Trim(request("cmd"))

id = Trim(request("id"))
mainid = Int(request("mainid"))
sIp = CheckIP(request("IP"))
If cmd = "" Then
    cmd = 0
Else
    cmd = Int(cmd)
End If
G_P_FileName = "user_comments.asp?cmd=" & cmd
If Keyword <> "" Then
    G_P_FileName="user_comments.asp?cmd=10&keyword="&Keyword&"&Field="&sField
End If
G_P_FileName =G_P_FileName & "&page="
If request("page") <> "" Then G_P_This = Int(request("page")) Else G_P_This = 1
If sIp <> "" Then G_P_FileName = "user_comments.asp"

If action = "modify" Then
    Call modify
ElseIf action = "savemodify" Then
    Call Savemodify
ElseIf action = "del" Then
    Call delcomment
ElseIf action = "passcomment" Then
	Call passcomment
Else
    Call main
End If
%>

</body>
</html>
<script language=javascript>

function VerifySubmit()
{
    topic = del_space(document.oblogform.topic.value);
     if (topic.length == 0)
     {
        alert("您忘了填写题目!");
    return false;
     }

    submits();
    if (document.oblogform.edit.value == "")
     {
        alert("请输入内容!");
    return false;
     }
    return true;
}
</script>
<%

Sub main()
    server.scriptTimeOut = 999999999
    Dim  ssql,i,lPage,lAll,lPages,iPage
    ssql = "userid,mainid,commenttopic,addtime,commentid,comment_user,addip,comment,iState"
    sGuide = ""
    Select Case cmd
        Case 0
            sql="select "&ssql&" from [oblog_comment] where userid="&oblog.l_uid&" order by commentid desc"
            sGuide = sGuide & "所有评论"
        Case 1
            sql="select "&ssql&" from [oblog_comment] where userid="&oblog.l_uid&" order by commentid desc"
            sGuide = sGuide & "我文章里的评论"
        Case 2
            sql="select "&ssql&" from [oblog_comment] where userid="&oblog.l_uid&" and iState=1 order by commentid desc"
            sGuide = sGuide & "已审核的的评论"
        Case 3
            sql="select "&ssql&" from [oblog_comment] where userid="&oblog.l_uid&" and iState=0 order by commentid desc"
            sGuide = sGuide & "未审核的的评论"
        Case 10
            If Keyword = "" Then
                oblog.adderrstr ("错误:关键字不能为空!")
                oblog.showusererr
                Exit Sub
            Else
                Select Case sField
                Case "id"
                    sql="select "&ssql&" from [oblog_comment] where comment_user like '%" & Keyword&" %' and userid="&oblog.l_uid&" order by commentid desc"
                    sGuide = sGuide & "作者名称含有<font color=red> " & Keyword & " </font>的评论"
                Case "topic"
                    sql="select "&ssql&" from [oblog_comment] where commenttopic like '%" & Keyword & "%' and userid="&oblog.l_uid&" order by commentid desc"
                    sGuide = sGuide & "标题中含有“ <font color=red>" & Keyword & "</font> ”的评论"
                Case "ip"
                    sql="select "&ssql&" from [oblog_comment] where addip='" & Keyword&"' and userid="&oblog.l_uid&" order by commentid desc"
                    sGuide = sGuide & "作者ip含有<font color=red> " & Keyword & " </font>的评论"
                Case "content"
                    sql="select "&ssql&" from [oblog_comment] where comment like '%" & Keyword&"%'  and userid="&oblog.l_uid&" order by commentid desc"
                    sGuide = sGuide & "评论内容中包含<font color=red> " & Keyword & " </font>的评论"
                End Select
            End If
        Case Else
    End Select
    Set rs = server.CreateObject("Adodb.RecordSet")
    rs.Open sql, conn, 1, 3
    lAll=INT(rs.recordcount)
    If lAll=0 Then    	
    	rs.Close
    	Set rs=Nothing
    	%>
    	<div id="user_page_content">
		   <div id="content_li">
		   	<ul class="content_li_conten">
		   		<li class="t1"></li>
		   		<li class="t3">&nbsp;</li>
		   	</ul>
		   	<ul class="content_li_conten">
		   		<li class="t1"></li>
		   		<li class="t3"><%=sGuide & " 没有相关纪录" %></li></ul>
		  	</div>
		  </div>
    	<%
    	Exit Sub
    End If
    i=0
    iPage=12
	'分页
	If Request("page") = "" Or Request("page") ="0" then
		lPage = 1
	Else
		lPage = Int(Request("page"))
	End If
	
	'设置缓存大小 = 每页需显示的记录数目
	rs.CacheSize = iPage
	rs.PageSize = iPage
	rs.movefirst		
	lPages = rs.PageCount
	If lPage>lPages Then lPage=lPages
	rs.AbsolutePage = lPage
	i=0
	%>
	<ul id="user_page_top">
		<li id="p7"><a href="#" onclick="chk_idAll(myform,1)">全部选择</a></li>
		<li id="p8"><a href="#" onclick="chk_idAll(myform,0)">全部取消</a></li>
		<li id="p7"><a href="#" onclick="if (chk_idBatch(myform,'通过审核选中的评论吗?')==true) {document.myform.action.value='passcomment';document.myform.iState.value='1'; document.myform.submit();}">通过审核</a></li>
		<li id="p8"><a href="#" onclick="if (chk_idBatch(myform,'取消审核选中的评论吗?')==true) {document.myform.action.value='passcomment';document.myform.iState.value='0'; document.myform.submit();}">取消审核</a></li>
		<li id="p4"><a href="#" onclick="if (chk_idBatch(myform,'删除选中的评论吗?')==true) {document.myform.action.value='del'; document.myform.submit();}">删除评论</a></li>
	</ul>
	<div id="showpage">
	  <%=MakeMiniPageBar(lAll,iPage,lPage,G_P_FileName)%>
	</div>
<style type="text/css">
<!--
	.content_li_top .t2 {width:88px;padding:0 0 0 10px;}
	.content_li_top .t3 {width:38%;text-align:left}
	.content_li_top .t4 {width:107px; text-align:left;padding-left:14px;}
	.content_li_top .t5 {width:100px;text-align:left;margin:-2px 0 0 0;}
	.content_li_top .t6 {width:100px;text-align:left}
	#content_li .content_li_conten .t2 {width:85px;margin:-2px 0 0 0;color:#f60;text-align:left}
	#content_li .content_li_conten .t3 {width:38%;line-height:1.5;margin:-2px 0 0 0;text-align:left;overflow:hidden;}
	#content_li .content_li_conten .t4 {width:130px;color:#888;text-align:center;font-size:10px;}
	#content_li .content_li_conten .t5 {width:120px;text-align:left;}
	#content_li .content_li_conten .t6 a {color:#069;text-align:left}
	#content_li .content_li_conten .t6 a:hover {color:#06c;text-align:left}
	#content_li .content_li_conten .t6 {width:100px;text-align:left;font-size:10px;}
-->
</style>
	<div id="user_page_content">
		<ul class="content_li_top">
			<li class="t1">选中</li>
			<li class="t2">作者</li>
			<li class="t3">评论内容</li>
			<li class="t4">发表时间</li>
			<li class="t5">评论者IP</li>
			<li class="t6">操作</li>
			
		</ul>
   		<div id="content_li">
			<form name="myform" method="Post" action="user_comments.asp" onSubmit="return confirm('确定要执行选定的操作吗?');">
          <%
          Do while not rs.EOF
          	i = i + 1%>
		   <ul class="content_li_conten" id="u<%=rs("commentid")%>"  onclick="chk_iddiv('<%=rs("commentid")%>')">
			<li class="t1" title="点击选中"><input name='id' type='checkbox' id="c<%=rs("commentid")%>" value='<%=rs("commentid")%>' onclick="chk_id('<%=rs("commentid")%>')" /></li>
			<li class="t2" title="作者:<%=rs("comment_user")%>"><%=rs("comment_user")%></li>
			<li class="t3" ><a href=go.asp?logid=<%=rs("mainid")%>#<%=rs("commentid")%> target="_blank"
			title="
				cssbody=[dvbdy1] cssheader=[dvhdr1] header=[<%=oblog.filt_html(rs("commenttopic"))%>] body=[<%=oblog.filt_html(FilterUbb(rs("comment")))%>]"
			><%If rs("iState") = 0 Then %><font color=black>[待审]</font><%End if%><%=oblog.filt_html(rs("commenttopic"))%></a></li>
			<li class="t4"><%=rs("addtime")%></li>
			<li class="t6"><%=rs("addip")%></li>
			<li class="t5"><a href="user_comments.asp?action=modify&id=<%=rs("commentid")%>&re=true">回复</a>&nbsp; <a href="user_comments.asp?action=modify&id=<%=rs("commentid")%>">修改</a>&nbsp;<a href="user_comments.asp?action=del&id=<%=rs("commentid")%>" onClick="return confirm('确定要删除此评论吗?');">删除</a></li>
			
    	</ul>
<%
    	If i>iPage Then Exit Do
	    rs.movenext
	Loop
    rs.Close
    Set rs = Nothing
    %>
<INPUT TYPE="hidden" name="iState">
<input type="hidden" name="action" value="">
     </form>
    </div>
	</div>
    <%
End Sub


%>

<div id="user_page_search">
    <form action="user_comments.asp" name=form1 method="get">
快速查找评论:
    <select size=1 name="cmd" onChange="javascript:submit()">
          <option value="0">列出所有评论</option>
		  <option value="2">已审核的评论</option>
		  <option value="3">待审核的评论</option>
          <option value="10" selected>请选择查询类型</option>

        </select>
搜索:
         <select name="Field" id="Field">

⌨️ 快捷键说明

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