⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.asp

📁 asp
💻 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=split(rs(1),".")
  csort=rs(2)
else
  rs.close
  call msgbox("该分类不存在!",1)
end if
rs.close

if csort><"article" or isNull(csort) or csort="" then
  if csort><"article" and csort><"" then
    response.redirect "../"&csort&"/default.asp?categoryid="&categoryid
    response.end
  else
    call msgbox("该分类未指定录入类型!","../category/chg.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,categorypath,categorysort,categoryindex from category where categoryindex like '"&nindex&"'"
  rs.open sql,conn,1,1
  if not rs.eof then
    if rs(3)><"" or not isNull(rs(3)) then
      tophtml=tophtml&"<a href=""../"&rs(3)&"/default.asp?categoryid="&rs(0)&""" style=""color:FFFFFF"">"&rs(1)&"</a>"
    else
      tophtml=tophtml&rs(1)
    end if
    tophtml=tophtml&" <a href=""../category/class.asp?category="&cindex(0)&"&categoryindex="&rs(4)&""" 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,author,source,csize,otime,categoryid from article where categoryid like '%."&categoryid&".%' order by id DESC"
'SQL
'sql="select id,title,pic,author,source,csize,convert(varchar(20),otime,20) as otime,categoryid from article 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
  articlelist	=rs.getrows(20)
end if
rs.close
if page>AllNum then page=100

%>
<!--#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="../article/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="10%">来源</td><th width="5%">字节</td><th width="20%">时间</td><th colspan="3">进行操作</td></tr>
<%
if isarray(articlelist) then
  for i=0 to ubound(articlelist,2)
%>
  <tr bgcolor="#FFFFFF">
    <td><%=articlelist(0,i)%></td>
    <td title="所属分类:&#13;&#10;<%
if articlelist(7,i)><"" then
  articlesort=split(articlelist(7,i),".")
  if isarray(articlesort) then
    for j=1 to ubound(articlesort,1)-1 step 2
response.write "&#13;&#10; "&articlesort(j+1)
    next
  end if
end if%>"><a href="../article.asp?id=<%=articlelist(0,i)%>" target="_blank"><%=articlelist(1,i)%></a><%if articlelist(2,i)=true then%>[<font color=orange>图</font>]<%end if%></td>
    <td nowrap><%=articlelist(3,i)%></td>
    <td nowrap><%=articlelist(4,i)%></td>
    <td nowrap><%=articlelist(5,i)%></td>
    <td align=right nowrap><%=articlelist(6,i)%></td>
    <th nowrap><a href="javascript:openwin('../article/mov.asp?id=<%=articlelist(0,i)%>','move',400,400);">关系</a></th>
    <th nowrap><a href="../article/chg.asp?id=<%=articlelist(0,i)%>">编辑</a></th>
    <th nowrap><a href="../article/del.asp?id=<%=articlelist(0,i)%>">删除</a></th>
  </tr>
<%
  next
  for i=ubound(articlelist,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 articlelist=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('../article/default.asp?categoryid=<%=categoryid%>',<%=AllNum%>,<%=MaxPage%>,<%=Page%>,0);</script>


<!--#include file="../inc/foot.asp"-->

⌨️ 快捷键说明

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