📄 m_blog.asp
字号:
<!--#include file="inc/inc_sys.asp"-->
<!--#include file="../inc/class_blog.asp"-->
<%
If CheckAccess("r_user_blog")=False Then Response.Write "无权操作":Response.End
dim rs, sql
dim id,cmd,Keyword,sField,sDate1,sDate2
Dim douname
'-----------------------------
Dim Z_logRole,Z_classRole
If oblog.CheckAdmin(1) Then
Z_classRole=" "
Else
Z_logRole=session("r_classes1")
If Len(z_logrole) > 0 Or Not IsNull(z_logrole) Then
If InStr(z_logrole,",") Then
Z_classRole=" and classid in("&Z_logRole&") "
ElseIf Len(z_logrole) > 0 Then
Z_classRole=" and classid = "&Int(Z_logRole)&" "
End If
End If
End If
'-----------------------------
keyword=Trim(Request("keyword"))
if keyword<>"" then
keyword=oblog.filt_badstr(keyword)
end if
sField=Trim(Request("Field"))
cmd=Trim(Request("cmd"))
Action=LCase(Trim(Request("Action")))
douname=lcase(trim(oblog.filt_badstr(request("douname"))))
id=Trim(Request("id"))
sDate1=Request("date1")
sDate2=Request("date2")
If sDate1<>"" Then sDate1=Int(sDate1)
If sDate2<>"" Then sDate2=Int(sDate2)
if cmd="" then
cmd=0
else
cmd=CLng(cmd)
end if
G_P_FileName="m_blog.asp?cmd=" & cmd & "&field=" & sField & "&keyword=" & keyword & "&date1=" & sDate1 & "&date2=" &sDate2
if Request("page")<>"" then
G_P_This=cint(Request("page"))
else
G_P_This=1
end if
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.myform.chkAll.checked){
document.myform.chkAll.checked = document.myform.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>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>oBlog--后台管理</title>
<link rel="stylesheet" href="images/style.css" type="text/css" />
<script src="images/menu.js" type="text/javascript"></script>
</head>
<body>
<div id="main_body">
<ul class="main_top">
<li class="main_top_left left">日 志 管 理</li>
<li class="main_top_right right"> </li>
</ul>
<div class="main_content_rightbg">
<div class="main_content_leftbg">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" Class="border">
<form name="form1" action="m_blog.asp" method="get">
<tr class="tdbg">
<td width="100" height="30"><strong>快速查找:</strong></td>
<td width="687" height="30"><select size=1 name="cmd" onChange="javascript:submit()">
<option value=>请选择查询条件</option>
<option value="0">最新500篇日志</option>
<option value="1">已审核日志</option>
<option value="2">未通过审核的日志</option>
<option value="3">精华日志</option>
<!-- <option value="4">待审核的精华日志</option> -->
<option value="9">可疑日志</option>
<option value="10">所有日志</option>
</select>
<a href="m_blog.asp">日志管理首页</a>| <a href="m_blog.asp?cmd=9">可疑列表</a>| <a href="m_blog.asp?cmd=3">精华列表</a></td>
</tr>
</form>
<form name="form2" method="post" action="m_blog.asp">
<tr class="tdbg">
<td width="120"><strong>高级查询:</strong></td>
<td >
<select name="Field" id="Field">
<option value="author" selected>用户名称</option>
<option value="logid" >日志ID</option>
<option value="userid" >用户ID</option>
<option value="ip">发表IP</option>
<option value="title" >标题内容</option>
<option value="content" >正文内容</option>
</select>
<input name="Keyword" type="text" id="Keyword" size="20" maxlength="30">
<input type="submit" name="Submit2" value=" 查 询 ">
<input name="cmd" type="hidden" id="cmd" value="10">
若为空,则查询所有</td>
</tr>
</form>
<form name="form3" method="post" action="m_blog.asp">
<tr class="tdbg">
<td width="120"><strong>按时间区段查询:</strong></td>
<td>
开始时间:<input type="text" name="date1" size=14 maxlength=14>
结束时间:<input type="text" name="date2" size=14 maxlength=14>
<input type="submit" name="Submit2" value=" 查 询 ">
<input name="cmd" type="hidden" id="cmd" value="11">
<br/>
时间格式:YYYYMMDDHHMm,如2006年6月6日9点12分,则输入200606060912,其他格式均不支持</td>
</tr>
</form>
</table>
</div>
</div>
<ul class="main_end">
<li class="main_end_left left"></li>
<li class="main_end_right right"></li>
</ul>
</div>
<%
If id<>"" Then
If Instr(id,",") Then
id=FilterIds(id)
Else
id=Int(Id)
End If
End If
If action = "del" Or action = "best0" Or action = "best1" Or action = "pass0" Or action = "pass1" Or action = "move" Or action = "moveclass" Then
If id = "" Then
oblog.ShowMsg "请至少选择一个ID进行操作" , ""
End If
End If
select Case LCase(action)
Case "modify"
call Modify()
Case "savemodify"
call SaveModify()
Case "del"
Call DelScore(id)
oblog.execute("update oblog_log Set isdel=1 where logid In ("&id & ")")
'删除日志文件!
delblogs id
WriteSysLog "删除了 "&douname&" 的一篇ID为("&id&")的日志.(放入回收站)",oblog.NowUrl&"?"&OB_IIF(Request.QueryString,Request.Form)
oblog.ShowMsg "删除成功!",""
Case "best0"
Call BestScore(id,0)
oblog.execute("update oblog_log Set isbest=0 Where logid In (" & id & ")")
' Response.Redirect "m_blog.asp?cmd=3"
WriteSysLog "取消了 "&douname&" 的一篇ID为("&id&")的日志的精华.",oblog.NowUrl&"?"&OB_IIF(Request.QueryString,Request.Form)
oblog.ShowMsg "取消精华成功!",""
Case "best1"
Call BestScore(id,1)
oblog.execute("update oblog_log Set isbest=1 Where logid In (" & id & ")")
' Response.Redirect "m_blog.asp?cmd=3"
WriteSysLog "给 "&douname&" 的ID为("&id&")标题为("&oblog.filt_badstr(unescape(request("title")))&")的日志设置为精华",oblog.NowUrl&"?"&OB_IIF(Request.QueryString,Request.Form)
If int(oblog.CacheConfig(86)) = 1 Then
oblog.execute("INSERT INTO oblog_pm(incept,sender,topic,content) VALUES('"&doUname&"','系统管理员','系统通知!您的文章被设为精华!','恭喜,您的标题为 "&id&". "&oblog.filt_badstr(unescape(request("title")))&" 的日志,已经被管理员设为精华!再接再励哦!(此信息系统自动发出,阅读后将被自动删除.您不必回复!)')")
End If
oblog.ShowMsg "设置精华成功!",""
Case "pass0"
oblog.execute("update oblog_log Set passcheck=0 Where logid In (" & id & ")")
oblog.execute("update oblog_userdigg Set iState=0 Where logid In (" & id & ")")
'进行日志更新
DoUpdatelog id
' Response.Redirect "m_blog.asp"
WriteSysLog "进行了日志取消审核操作,目标日志ID:"&id&"",oblog.NowUrl&"?"&Request.QueryString
oblog.ShowMsg "已设置日志为未审核状态!",""
Case "pass1"
oblog.execute("update oblog_log Set passcheck=1 Where logid In (" & id & ")")
oblog.execute("update oblog_userdigg Set iState=1 Where logid In (" & id & ")")
'进行日志更新
DoUpdatelog id
' Response.Redirect "m_blog.asp"
WriteSysLog "进行了日志通过审核操作,目标日志ID:"&id&"",oblog.NowUrl&"?"&Request.QueryString
oblog.ShowMsg "已设置日志为审核状态!",""
Case "move"
oblog.execute("update oblog_log Set specialid=" & Int(Request("SpecialId")) &" Where logid In (" & id & ")")
' Response.Redirect "m_blog.asp"
WriteSysLog "进行了日志转移操作,目标日志ID:"&id&"",oblog.NowUrl&"?"&Request.QueryString
oblog.ShowMsg "日志转移成功!",""
Case "moveclass"
oblog.execute("update oblog_log Set classid=" & Int(Request("classid")) &" Where logid In (" & id & ")")
' Response.Redirect "m_blog.asp"
WriteSysLog "进行了日志分类转移操作,目标日志ID:"&id&"",oblog.NowUrl&"?"&Request.QueryString
oblog.ShowMsg "日志分类转移成功!",""
Case Else
call main()
end select
if FoundErr=true then
call WriteErrMsg()
end if
sub main()
Dim sQryFields
sQryFields="top 500 topic,logtext,logid,userid,addtime,passcheck,isbest,author,addip,classid"
select case cmd
case 0
sql="select " & sQryFields & " from oblog_log Where isdel=0 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "最新500篇日志"
case 1
sql="select " & sQryFields & " from oblog_log where passcheck=1 And isdel=0 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "通过审核的日志"
case 2
sql="select " & sQryFields & " from oblog_log where passcheck=0 And isdel=0 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "未通过审核的日志"
Case 3
sql="select " & sQryFields & " from oblog_log where passcheck=1 And isdel=0 and isbest=1 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "精华日志"
Case 4
' sql="select " & sQryFields & " from oblog_log where passcheck=1 And isdel=0 and isbest=2 order by logid desc"
' sGuide=sGuide & "待审核的精华日志"
Case 9
sql="select " & sQryFields & " from oblog_log where isTrouble=1 And isdel=0 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "可疑日志"
case 10
if Keyword="" then
sql="select " & sQryFields & " from oblog_log Where isdel=0 " & Z_classRole & " order by logid desc"
sGuide=sGuide & "所有日志"
else
select case sField
case "logid"
if Not IsNumeric(Keyword) then
FoundErr=true
ErrMsg=ErrMsg & "<br><li>ID必须是整数!</li>"
else
sql="select " & sQryFields & " from oblog_log where isdel=0 and logid =" & CLng(Keyword) & Z_classRole
sGuide=sGuide & "日志ID等于<font color=red> " & CLng(Keyword) & " </font>的日志"
end if
case "userid"
if Not IsNumeric(Keyword) then
FoundErr=true
ErrMsg=ErrMsg & "<br><li>ID必须是整数!</li>"
else
sql="select " & sQryFields & " from oblog_log where isdel=0 and userid =" & CLng(Keyword) & Z_classRole
sGuide=sGuide & "作者ID等于<font color=red> " & CLng(Keyword) & " </font>的日志"
end if
case "author"
sql="select " & sQryFields & " from oblog_log where isdel=0 and author like '%" & Keyword & "%' " & Z_classRole & " order by logid desc"
sGuide=sGuide & "作者名称中含有“ <font color=red>" & Keyword & "</font> ”的日志"
case "ip"
sql="select " & sQryFields & " from oblog_log where isdel=0 and addip like '%" & Keyword & "%' " & Z_classRole & " order by logid desc"
sGuide=sGuide & "发布日志时的IP中含有“ <font color=red>" & Keyword & "</font> ”的日志"
case "title"
sql="select " & sQryFields & " from oblog_log where isdel=0 and topic like '%" & Keyword & "%' " & Z_classRole & " order by logid desc"
sGuide=sGuide & "日志标题中含有“ <font color=red>" & Keyword & "</font> ”的日志"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -