m_blog.asp

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

ASP
466
字号
<!--#include file="inc/inc_sys.asp"-->
<!--#include file="../inc/class_blog.asp"-->
<%
dim rs, sql
dim id,cmd,Keyword,sField,sDate1,sDate2
keyword=trim(request("keyword"))
if keyword<>"" then
	keyword=oblog.filt_badstr(keyword)
end if
sField=trim(request("Field"))
cmd=trim(request("cmd"))
Action=trim(request("Action"))
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>
        &nbsp;&nbsp;&nbsp;&nbsp;<a href="m_blog.asp">日志管理首页</a>|&nbsp;&nbsp;<a href="m_blog.asp?cmd=9">可疑列表</a>|&nbsp;&nbsp;<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=12 maxlength=10>
    	结束时间:<input type="text" name="date2" size=12 maxlength=10>

      <input type="submit" name="Submit2" value=" 查 询 ">
      <input name="cmd" type="hidden" id="cmd" value="11">
      <br/>
        时间格式:YYYYMMDDHHmm,如2006年6月6日9点,则输入2006060609,其他格式均不支持</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
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
		oblog.showok "删除成功!",""
	Case "best0"
		oblog.execute("update oblog_log Set isbest=0 Where logid In (" & id & ")")
'		Response.Redirect "m_blog.asp?cmd=3"
		oblog.showok "设置精华成功!",""
	Case "best1"
		Call BestScore(id)
		oblog.execute("update oblog_log Set isbest=1 Where logid In (" & id & ")")
'		Response.Redirect "m_blog.asp?cmd=3"
		oblog.showok "取消精华成功!",""
	Case "pass0"
		oblog.execute("update oblog_log Set passcheck=0 Where logid In (" & id & ")")
		'进行日志更新
		DoUpdatelog id
		Response.Redirect "m_blog.asp"
		
	Case "pass1"
		oblog.execute("update oblog_log Set passcheck=1 Where logid In (" & id & ")")
		'进行日志更新
		DoUpdatelog id
		Response.Redirect "m_blog.asp"
	Case "move"
		oblog.execute("update oblog_log Set specialid=" & Int(Request("SpecialId")) &" Where logid In (" & id & ")")
		Response.Redirect "m_blog.asp"
	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"
	select case cmd
		case 0
			sql="select " & sQryFields & " from oblog_log  Where isdel=0  order by logid desc"
			sGuide=sGuide & "最新500篇日志"
		case 1
			sql="select " & sQryFields & " from oblog_log where passcheck=1 And isdel=0  order by logid desc"
			sGuide=sGuide & "通过审核的日志"
		case 2
			sql="select " & sQryFields & " from oblog_log where passcheck=0 And isdel=0  order by logid desc"
			sGuide=sGuide & "未通过审核的日志"
		Case 3
			sql="select " & sQryFields & " from oblog_log where passcheck=1 And isdel=0  and isbest=1 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 order by logid desc"
			sGuide=sGuide & "可疑日志"
		case 10
			if Keyword="" then
				sql="select " & sQryFields & " from oblog_log  Where isdel=0 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)
						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)
						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 & "%' 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 & "%' 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 & "%' order by logid  desc"
					sGuide=sGuide & "日志标题中含有“ <font color=red>" & Keyword & "</font> ”的日志"
				case "content"
					sql="select " & sQryFields & " from oblog_log where  isdel=0  and logtext like '%" & Keyword & "%' order by logid  desc"
					sGuide=sGuide & "日志内容中含有“ <font color=red>" & Keyword & "</font> ”的日志"
				end select
			end if
		Case 11
			sDate1=DeDateCode(sDate1)
			sDate2=DeDateCode(sDate2)
			If sDate1<>"" And sDate2<>"" Then
				sql="select " & sQryFields & " from oblog_log where truetime>=" & G_Sql_d_Char & sDate1 & G_Sql_d_Char & " And  truetime<=" & G_Sql_d_Char & sDate2 & G_Sql_d_Char &  " and isdel=0 order by logid  desc"
				sGuide=sGuide & "实际发布时间在 <font color=red>" & sDate1 & "</font> 至 <font color=red>" & sDate2 & "</font> 的日志"

⌨️ 快捷键说明

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