📄 admin_news_list.asp
字号:
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("News_List") Then
Call ArtErr("","")
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
<script src="Include/Common.js" type=text/javascript></script>
<script language=Javascript> // '2006_12_29 增加批量删除文章
function checkAll(e, itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0; i<aa.length; i++)
aa[i].checked = e.checked;
}
function checkItem(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked) all.checked = false;
else
{
var aa = document.getElementsByName(e.name);
for (var i=0; i<aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
}
}
function ConfirmDel()
{
if(confirm("确定要执行操作吗?本操作将不能恢复!"))
return true;
else
return false;
}
</script>
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<base target="_self">
</head>
<% '2006_12_29 增加批量删除文章
id=trim(request("id"))
ppdelid=trim(request("ppdelid"))
action=trim(request("action"))
cj=trim(Request("cj")) '新闻采集
if cj="" then cj=0
DelFlag=Trim(Request("DelFlag"))
If DelFlag="删除选定新闻" Then
if ppdelid="" then
Call ArtErr("<li>您好,请选择新闻!</li>","1")
Else
ppdelidd=split(ppdelid,",")
for i=0 to UBound(ppdelidd)
Call DelHtml(ppdelidd(i))
next
conn.Execute "delete from [news] where ID in ("&Request.Form("ppdelid")&")"
Call ArtErr("<li>您好,已删除您选择的新闻!</li>","2")
end if
ElseIf DelFlag="审核所选新闻" Then
if ppdelid="" then
Call ArtErr("<li>您好,请选择新闻!</li>","1")
Else
conn.Execute "update news set sh=1 ,[shUsername]='"&Request.Cookies(Art2008)("adminuser")&"' Where ID in ("&Request.Form("ppdelid")&")"
Call ArtErr("<li>您好,已审核您选择的新闻!</li>","2")
end if
ElseIf DelFlag="清空采集新闻" then
conn.Execute "delete from [news] where newscj=1"
Call ArtErr("<li>您好,已清空所有采集新闻!</li>","2")
end if
'2006_12_29 增加结束
delid=trim(request("delid"))
tj=trim(request("tj"))
sh=trim(Request("sh"))
shsh=trim(Request("shsh"))
if sh="" then sh=1
id=trim(request("id"))
ontopid=trim(Request("ontopid"))
ontoplx=trim(Request("ontoplx"))
topid=trim(request("topid"))
ontop=trim(request("ontop"))
if delid<>"" then
Call DelHtml(delid)
conn.Execute "delete from [news] where ID="&clng(delid)
conn.Execute "delete from [newspl] where newsID="&clng(delid)
end if
if ontopid<>"" and ontoplx<>"" then
if ontoplx="1" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select ID,ontop,time,updat from [news] where ID="&ontopid&" order by id asc",conn,1,3
if rs.recordcount<>0 then
ontoptime=rs("updat")
set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open "select id,ontop,time,updat from [NEWS] where updat>"&ontoptime&" and ontop=3 order by updat asc , id asc",conn,1,3
if rs2.recordcount<>0 then
rs("updat")=rs2("updat")
rs2("updat")=ontoptime
rs2.update
rs.update
end if
rs2.close:set rs2=nothing
end if
rs.close:set rs=nothing
end if
if ontoplx="0" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select ID,ontop,time,updat from [news] where ID="&ontopid&" order by id asc",conn,1,3
if rs.recordcount<>0 then
ontoptime=rs("updat")
set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open "select id,ontop,time,updat from [NEWS] where updat<"&ontoptime&" and ontop=3 order by updat desc , id desc",conn,1,3
if rs2.recordcount<>0 then
rs("updat")=rs2("updat")
rs2("updat")=ontoptime
rs2.update
rs.update
end if
rs2.close:set rs2=nothing
end if
rs.close:set rs=nothing
end if
end if
if topid<>"" then
conn.Execute "update news set ontop="&ontop&" where id="&clng(topid)
end if
if shsh<>"" and id<>"" then
conn.Execute "update [news] set [sh]="&shsh&",[shUsername]='"&Request.Cookies(Art2008)("adminuser")&"' where id="&clng(id)
Set URS=Server.CreateObject("adodb.recordset")
Urs.open "select userid,adduser,shUsername from [news] where id="&clng(id),conn,1,1
adduser=urs("adduser")
userid=urs("userid")
shUsername=urs("shUsername")
urs.close:set urs=nothing
Set RsG=ArtEXE("Select GroupSetting from Art_Group Where GroupID=" & userid & " order by GroupID desc")
If Not RsG.Eof Then
GroupArr=Split(RsG("GroupSetting"),"^@$@^")
G_tgdianshu= GroupArr(15)
G_tgzijin= GroupArr(16)
End If
RsG.Close:Set RsG=Nothing
if userid<>0 and shsh=1 then
Conn.Execute("Update Art_User Set ArticleNum=ArticleNum+1 Where UserName='" & adduser & "'")
if G_tgdianshu<>0 then Call PointInOrOut(1,0,adduser,1,G_tgdianshu,shUsername,"审核文章后,赠送的点数")
if G_tgzijin<>0 then Call MoneysInOrOut(adduser,adduser,G_tgzijin,4,1,"0",0,shUsername,"审核文章后,赠送的资金")
end if
end if
if tj<>"" then
conn.Execute = "update news set tj='"&tj&"' where ID="&id
end if
%>
<script language="VBScript" type="text/vbscript">
<!--
function FrontPage_Form1_onsubmit()
Set theForm = document.FrontPage_Form1
If (theForm.title.value = "") Then
MsgBox "请在 关键字 域中输入值。", 0, "有效性验证错误"
theForm.title.focus()
FrontPage_Form1_onsubmit = False
Exit Function
End If
If (Len(theForm.title.value) < 1) Then
MsgBox "在 关键字 域中,请至少输入 1 个字符。", 0, "有效性验证错误"
theForm.title.focus()
FrontPage_Form1_onsubmit = False
Exit Function
End If
If (Len(theForm.title.value) > 10) Then
MsgBox "在 关键字 域中,请最多输入 10 个字符。", 0, "有效性验证错误"
theForm.title.focus()
FrontPage_Form1_onsubmit = False
Exit Function
End If
FrontPage_Form1_onsubmit = True
End Function
-->
</script>
<table cellpadding=2 cellspacing=1 border=0 width=98% class=tableBorder align=center>
<tr align=center>
<th height=25 align=center colspan="2"><strong>文章列表管理</strong></th>
</tr>
<tr>
<td width=12% height=30 class=forumRow> <strong>管理导航:</strong></td>
<td width=88% height=30 class=forumRow><a href='admin_news_add.asp'>添加文章</a> | <a href='admin_news_list.asp'>文章管理</a></td>
</tr>
</TABLE>
<table width="100%" border="0" align=center cellpadding="3" cellspacing="1" bgcolor="#C4D8ED">
<form method="POST" action="admin_news_list.asp" onSubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
<tr>
<td width="12%" height=25 class=forumRow> <strong>分类显示:</strong></td>
<td class=forumRow >
<% if Request.Cookies(Art2008)("admindj")="1" then '判断是不是管理员,如果是执行以下代码---天星数码 %>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt">
<option value>请选择栏目</option>
<option value=admin_news_list.asp?all=all>显示所有新闻信息</option>
<%
sql = "select * from lm where lm<>'' order by id asc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
while not rs.eof
%>
<option value='admin_news_list.asp?lm=<%=rs("id")%>' <% if clng(lmid)=clng(rs("id")) then response.write " selected" %>>(ID:<%=rs("id")%>)<%=rs("lm")%></option>
<%
sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
while not rs2.eof
%>
<option value='admin_news_list.asp?lm=<%=rs2("id")%>' <% if clng(lmid)=clng(rs2("id")) then response.write " selected" %>> ├(ID:<%=rs2("id")%>)<%=rs2("lm2")%></option>
<%
Set rs33 = Server.CreateObject("ADODB.RecordSet")
rs33.Open "select * from [lm] where lmid='"&rs2("id")&"' and LM3<>'' order by id desc",conn,1,1
while not rs33.eof
%>
<option value='admin_news_list.asp?lm=<%=rs33("id")%>' <% if clng(lmid)=clng(rs33("id")) then response.write " selected" %>> ├(ID:<%=rs33("id")%>)<%=rs33("lm3")%></option>
<%
rs33.movenext
wend
rs2.movenext
wend
rs.movenext
wend
rs.close
set rs=nothing
%>
</select>
<%Else '如果不是管理员执行以下代码%>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt">
<option value>请选择栏目</option>
<option value=admin_news_list.asp?all=all>显示所有新闻信息</option>
<%
admin_sql = "select * from admin where [user]='"&Request.Cookies(Art2008)("adminuser")&"' order by id desc"
Set admin_rs = Server.CreateObject("ADODB.RecordSet")
admin_rs.Open admin_sql,conn,1,1
admin_lmid=admin_rs("lmid") '修改,原句是:lmid=rs3("lmid") ,这个变量与新闻的lmid冲突了。
if right(admin_lmid,1)="," then admin_lmid=left(admin_lmid,len(admin_lmid)-1) '增加一句
array_admin_lmid=split(admin_lmid,",")
For i=0 to ubound(array_admin_lmid)
aaa=array_admin_lmid(i) '取出编辑者拥有的权限ID号.
lm_1_sql = "select * from lm where id="&aaa
Set lm_1_rs = Server.CreateObject("ADODB.RecordSet")
lm_1_rs.Open lm_1_sql,conn,1,1
while not lm_1_rs.eof
if lm_1_rs("lm")<>"" then
%>
<option value='admin_news_list.asp?lm=<%=lm_1_rs("id")%>' <% if int(lmid)=lm_1_rs("id") then response.write " selected" %>>(ID:<%=lm_1_rs("id")%>)<%=lm_1_rs("lm")%></option>
<%
ElseIf lm_1_rs("lm2")<>"" then
%>
<option value='admin_news_list.asp?lm=<%=lm_1_rs("id")%>' <% if int(lmid)=lm_1_rs("id") then response.write " selected" %>> ├(ID:<%=lm_1_rs("id")%>)<%=lm_1_rs("lm2")%></option>
<%
Elseif lm_1_rs("lm3")<>"" then
get_1_id_sql="select lmid from [lm] where id="&clng(lm_1_rs("lmid"))
set get_1_id_rs = Server.CreateObject("ADODB.RecordSet")
get_1_id_rs.Open get_1_id_sql,conn,1,1
lmid31=get_1_id_rs("lmid")
get_1_id_rs.close
set get_1_id_rs=nothing
%>
<option value='admin_news_list.asp?lm=<%=lm_1_rs("id")%>' <% if int(lmid)=lm_1_rs("id") then response.write " selected" %>> ├(ID:<%=lm_1_rs("id")%>)<%=lm_1_rs("lm3")%></option>
<%
end if '结尾配对lm_1_rs("lm")<>""
lm_1_rs.movenext
wend
lm_1_rs.close
set lm_1_rs=nothing
next
admin_rs.close
set admin_rs=nothing
%>
</select>
<%end If '判断语句结束%>
</td>
<td class=forumRow align="center"><strong>关键字搜索:</strong></td>
<td class=forumRow> <select size="1" name="Searchtp">
<option value="1">标题内容</option>
<option value="2">文章作者</option>
<option value="3">录入员</option>
</select>
<input type="text" name="title" size="20" maxlength="10" value="<%=request("title")%>" style="border-style: solid; border-width: 1px">
<input type="submit" value="搜索" name="B1" style="border: 1px solid #000000; background-color: #FFFFFF"></td>
</tr>
</table>
<%if Request.Cookies(Art2008)("admindj")=1 then%>
<table width="100%" border="0" align=center cellpadding="3" cellspacing="1" bgcolor="#C4D8ED" >
<tr>
<td class=forumRow >
<%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -