📄 topic.asp
字号:
<!--#include file="mozeenconn.asp"-->
<link href=../css/main.css rel=stylesheet>
<!--#include file="./inc/const.asp"-->
<table width="95%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
<tr>
<td height="20" bgcolor="#eeeeee">当前位置:<a href=main.asp>管理首页</a> >> <a href=topic.asp>专题列表</a></td>
</tr>
</table>
<table width="95%" cellspacing="1" cellpadding="5" bgcolor=#999999 align=center>
<tr bgcolor=#cccccc><td colspan=6><center><b>所有专题列表</b></td></tr>
<tr bgcolor=#ffffff><td colspan=6 height=20><table width=100% cellspacing="0" cellpadding="0"><tr><td>【<a href=admin_topic.asp?action=addtopic><font color=#cc0000>增加专题</a></a>】</td><form action=topic.asp method=get><td align=right>
<select name=classid onchange="javascript:submit()">
<option>总类列表</option>
<option value="">所有专题</option>
<%
set rs = server.CreateObject ("Adodb.recordset")
sql = "select * from class"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<option value=>请先添加总类"
else
do while not rs.EOF
%>
<option value=<%=rs("classid")%>><%=rs("classname")%> </option>
<%
rs.MoveNext
loop
end if
rs.Close
%>
</select>
</td></form></tr></table></td></tr>
<tr bgcolor=#cccccc align=center><td><b>专题名称</td><td><b>专题介绍</td><td><b>所属总类</td><td><b>创建时间</td><td><b>文章统计</td><td><b>状态</td></tr>
<%
dim i,classid
dim pagecount,page,Spage,Epage,recordcount
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
if request("classid")="" then
' classid=0
set rs_1 = server.CreateObject ("adodb.recordset")
Set RS = Server.CreateObject("ADODB.RecordSet")
sql = "select * from topic order by topicid DESC"
else
classid=request("classid")
set rs_1 = server.CreateObject ("adodb.recordset")
Set RS = Server.CreateObject("ADODB.RecordSet")
sql = "select * from topic where classid="& request("classid") &" order by topicid DESC"
end if
RS.Open sql, Conn, 1, 1
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
page = 1
elseif page > pagecount then
page = pagecount
end if
if RS.EOF then
Response.Write("<tr bgcolor=#ffffff><td colspan=6><center><br><font color=red>目前暂无专题</font></td></tr></table>")
else
if recordcount > 0 then RS.AbsolutePage = page
for i = 1 to PAGESIZE
if RS.EOF then exit for
%>
<tr bgcolor=#eeeeee>
<td><a href=topic_list.asp?topicid=<%=rs("topicid")%>><font color=blue><%=rs("topicname")%></font></a></td>
<td><%=rs("topicinfo")%></td>
<td>
<%sql_1 = "select classid,classname from class where classid="&rs("classid")&" order by classid"
rs_1.Open sql_1,conn,1,1
do while not rs_1.EOF
%>
<center><%=rs_1("classname")%>
<%rs_1.MoveNext
loop
rs_1.Close%>
</td>
<td><center><%=rs("adddate")%></td>
<td>总数:<%=rs("topicnum")%></td>
<td><center><%if session("userkey")=4 then%>
<a href=admin_topic.asp?action=edittopic&topicid=<%=rs("topicid")%>>修改</a> | <a href=admin_topic.asp?action=deltopic&topicid=<%=rs("topicid")%>>删除</a> | <%if rs("ifpub")=1 then%><a href=admin_topic.asp?action=pubno&topicid=<%=rs("topicid")%>><font color=blue>已公开</font></a><%else%><a href=admin_topic.asp?action=pubyes&topicid=<%=rs("topicid")%>><font color=green>未公开</font></a><%end if%><%else%><%if rs("ifpub")=1 then%><font color=blue>已公开</font><%else%><font color=green>未公开</font><%end if%><%end if%></td>
</tr>
<%
RS.MoveNext()
next
%>
</table>
<%
end if
if pagecount > 0 then
response.write("<table width=""95%"" cellspacing=0 cellpadding=5 align=center><tr><td align=right>")
response.write("页次:<font color=red><b>" & page & "</font>/" & pagecount & "</b> 每页<b>" & pagesize & "</b> 共<b>" & recordcount & "</b>个专题 分页:")
Spage = page mod PARTSIZE
if page > PARTSIZE then
if Spage = 0 then Spage = PARTSIZE
Spage = page - Spage + 1
else
Spage = 1
end if
Epage = Spage + PARTSIZE - 1
if Epage > pagecount then Epage = pagecount
if page > PARTSIZE then
response.write("<a href=""topiclist.asp?classid="& classid &"&page=" & Spage - 1 & """>[<<]</a>")
end if
for i = Spage to Epage
if i = page then
response.write("[<font color=red><b>" & i & "</b></font>]")
else
response.write("[<a href=""topiclist.asp?classid="& classid &"&page=" & i & """>" & i & "</a>]")
end if
next
if Epage < pagecount then
response.write("<a href=""topiclist.asp?classid="& classid &"&page=" & Epage + 1 & """>[>>]</a>")
end if
if Spage <> 1 then response.write("[<a href=""topiclist.asp?classid="& classid &"&page=1"">首页</a>]")
if Epage <> pagecount then response.write("[<a href=""topiclist.asp?classid="& classid &"&page=" & pagecount & """>尾页</a>]")
response.write("</td></tr></table><br>")
end if
rs.close
set rs=nothing
%>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -