📄 default.asp
字号:
<%response.expires=0%>
<!--#include file="../inc/conn.asp"-->
<%
userid=Session("userid")
userlevel=Session("userlevel")
if userid="" or userlevel="" then
call msgbox("请重新登陆!",0)
end if
if not isnumeric(userid) or not isnumeric(userlevel) then
call msgbox("请重新登陆!",0)
end if
userid=CCur(userid)
userlevel=CCur(userlevel)
categoryid=strFilter(request("categoryid"),10)
if categoryid="" then
call msgbox("请正确指定分类!",1)
end if
if not isnumeric(categoryid) then
call msgbox("请正确指定分类!",1)
end if
sql="select top 1 categoryname,categoryindex,categorysort from category where categoryid="&categoryid
rs.open sql,conn,1,1
if not rs.eof then
cname=rs(0)
cindex=rs(1)
csort=rs(2)
else
rs.close
call msgbox("该分类不存在!",1)
end if
rs.close
if instr(cindex,".")=0 then
cindex=cindex&".1"
end if
cindex=split(cindex,".")
if csort><"news" or isNull(csort) or csort="" then
if csort><"news" and csort><"" then
response.redirect "../"&csort&"/default.asp?categoryid="&categoryid
response.end
else
call msgbox("该分类未指定录入类型!","../category/chgcategory.asp?categoryid="&categoryid)
end if
end if
for i=0 to ubound(cindex,1)
if nindex="" then
nindex=cindex(0)
else
nindex=nindex&"."&cindex(i)
end if
sql="select top 1 categoryid,categoryname,categorysort,categoryindex from category where categoryindex like '"&nindex&"'"
rs.open sql,conn,1,1
if not rs.eof then
if i=0 then
tophtml=tophtml&rs(1)
else
tophtml=tophtml&"<a href=""../"&rs(2)&"/default.asp?categoryid="&rs(0)&""" style=""color:FFFFFF"">"&rs(1)&"</a>"
end if
tophtml=tophtml&" <a href=""../category/class.asp?category="&cindex(0)&"&categoryindex="&rs(3)&""" style=""color:FFFFFF"">>></a> "
else
rs.close
call msgbox("该分类上级不存在!",1)
end if
rs.close
next
Session("categoryid")=categoryid
page=request("page")
if page="" then page=1
if not isnumeric(page) then page=1 else page=CCur(page)
'ACCESS
sql="select id,title,pic,source,csize,otime,path,filenum,categoryid from news where categoryid like '%."&categoryid&".%' order by id DESC"
'SQL
'sql="select id,title,author,source,csize,convert(varchar(20),otime,20) as otime,categoryid from news where categoryid like '%."&categoryid&".%' order by id DESC"
rs.open sql,conn,1,1
AllNum =rs.recordcount
rs.pagesize =20
MaxPage =rs.pagecount
if not rs.eof then
if page<=MaxPage then
rs.absolutepage=page
else
rs.absolutepage=MaxPage
page =maxpage
end if
newslist =rs.getrows(20)
end if
rs.close
if page>AllNum then page=100
Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->
<table border="0" align="center" width="100%" cellpadding="1" cellspacing="1">
<tr><td colspan="8"><font style="color:FFFFFF"><a href="../category/class.asp" style="color:FFFFFF">分类列表</a> >> <%=tophtml%>新闻管理</font> <a href="../news/add.asp?categoryid=<%=categoryid%>" style="color:FFFFFF">新闻添加</a></td></tr>
<tr class="menutitle"><th width="2%">ID</th><th width="40%">主题</th><th width="10%">来源</td><th width="5%">字节</td><th width="10%">编号</td><th width="20%">时间</td><th colspan="3" nowrap>进行操作</td></tr>
<%
if isarray(newslist) then
for i=0 to ubound(newslist,2)
%>
<tr bgcolor="#FFFFFF">
<td><a href="../news_id.asp?id=<%=newslist(0,i)%>" target=_blank><%=newslist(0,i)%></a></td>
<td title="所属分类: <%
if newslist(8,i)><"" then
newssort=split(newslist(8,i),".")
if isarray(newssort) then
for j=1 to ubound(newssort,1)-1 step 2
response.write " "&newssort(j+1)
next
end if
end if%>"><a href="../news_html.asp?id=<%=newslist(0,i)%>" target="_blank" title="<%=newslist(6,i)&newslist(7,i)%>.htm"><%=newslist(1,i)%></a><%if newslist(2,i)=true then%>[<font color=orange>图</font>]<%end if%></td>
<td nowrap><%=newslist(3,i)%></td>
<td nowrap><%=newslist(4,i)%></td>
<td nowrap><%=newslist(7,i)%></td>
<td align=right nowrap><%=newslist(5,i)%></td>
<th nowrap><a href="javascript:openwin('../news/mov.asp?id=<%=newslist(0,i)%>','move',400,150);">关系</a></th>
<th nowrap><a href="../news/chg.asp?id=<%=newslist(0,i)%>">编辑</a></th>
<th nowrap><a href="../news/del.asp?id=<%=newslist(0,i)%>">删除</a></th>
</tr>
<%
next
for i=ubound(newslist,2) to 18
if i mod 2=0 then bg="F0F0F0" else bg="FFFFFF" end if
response.write "<tr bgcolor=""#"&bg&"""><td> </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"
next
Set newslist=nothing
else
for i=0 to 18
if i mod 2=0 then bg="F0F0F0" else bg="FFFFFF" end if
response.write "<tr bgcolor=""#"&bg&"""><td> </td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"
next
end if
%>
</table>
<script src="../js/page.js"></script>
<script>page('../news/default.asp?categoryid=<%=categoryid%>',<%=AllNum%>,<%=MaxPage%>,<%=Page%>,0);</script>
<!--#include file="../inc/foot.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -