📄 class.asp
字号:
<!--#include file="db/user.asp" -->
<!--#include file="inc/const.asp"-->
<!--#include file="head.asp"-->
<%
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim keyword
dim sql
dim rs
dim updown
dim order_name
order_name=Request("Order")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if request("updown")<>"" then
updown="desc"
else
updown=""
end if
select case order_name
case "name"
order_name="name"
case "commend"
order_name="commend"
case "time"
order_name="time"
case "count"
order_name="count"
case "orders"
order_name="orders"
case "size"
order_name="size"
case else
order_name="time"
updown="desc"
end select
set rs=server.createobject("adodb.recordset")
dim classid,Nclassid
dim classname,Nclassname
if request("classid")="" then
' classid=""
' classname="所有软件"
classid="classid=1 and "
sql="select class from class where classid=1"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write "还没有任何栏目,请到管理页面添加"
response.end
else
classname=rs("class")
end if
rs.close
else
classid="classid="&cstr(request("classid"))&" and "
sql="select class from class where classid="&cstr(request("classid"))
rs.open sql,conn,1,1
classname=rs("class")
rs.close
end if
if request("Nclassid")="" then
Nclassid=""
Nclassname="所有软件"
else
Nclassid=" Nclassid="&cstr(request("Nclassid"))&" and "
sql="select Nclass.Nclass,class.class from Nclass,class where Nclass.classid=class.classid and Nclass.Nclassid="&cstr(request("Nclassid"))
rs.open sql,conn,1,1
classname=rs("class")
Nclassname=rs("Nclass")
rs.close
end if
%>
<table width="737" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td>您现在的位置:公益下载站 -- 公益电子书 -- <a href="class.asp?classid=<%=request("classid")%>"><%=classname%></a>
-- <%=Nclassname%></td>
</tr>
</table>
<tr>
<td>
<table width="737" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="28%" valign="top" bgcolor="#FFFFFF">
<table width="243" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td height="27" background="tu/bg.gif">
<div align="center"><a class="white" href="class.asp?classid=<%=request("classid")%>"><%=classname%>详细分类</a></div>
</td>
</tr>
</table>
<table width="243" border="0" align="center" cellspacing="1" cellpadding="4" bgcolor="#E6E6E6">
<tr>
<td bgcolor="#FFFFFF" valign="top">
<%
sql="select Nclass,Nclassid from Nclass where classid="&request("classid")
rs.open sql,conn,1,1%>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#D4D4D4">
<%do while not rs.eof%>
<tr>
<td align="right" height="11" width="21%" bgcolor="#F3F3F3" >
<img src="images/hot_p.gif"> </td>
<td align="left" width="79%" bgcolor="#F3F3F3">
<%if not Rs.eof then%>
<span style="letter-spacing: 2pt"> <a href="class.asp?classid=<%=request("classid")%>&Nclassid=<%=rs("Nclassid")%>"><%=Rs("Nclass")%></a></span>
</td>
<%rs.movenext
end if %>
</tr>
<%loop
Rs.Close
%>
</table>
</td>
</tr>
</table>
<table width="243" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td height="27" background="tu/bg.gif">
<div align="center"><%=classname%>下载Top10 </div>
</td>
</tr>
</table>
<table width="243" border="0" align="center" cellspacing="1" cellpadding="4" bgcolor="#E6E6E6">
<tr>
<td bgcolor="#FFFFFF" valign="top">
<%if request("Nclassid")="" then
sql="select top 10 id,name,downcount,count from download where download.classid="&request("classid")
sql=sql&" order by download.downcount desc"
else
sql="select top 10 id,name,downcount,count from download where download.Nclassid="&request("Nclassid")
sql=sql&" order by download.downcount desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write ("没有软件或电子书")
else
do while not rs.eof
response.write ("<img border='0' src='images/RedArrow.gif'> <A href=show.asp?id="&rs("id")&">"&rs("name")&" </A>[ <font color='#FF0000'>"&rs("downcount")&"/"&rs("count")&"</font>]<br>")
rs.movenext
loop
end if
rs.close
%>
</td>
</tr>
</table>
</td>
<td width="72%" bgcolor="#FFFFFF">
<div align="right">
<table width="99%" border="0" cellspacing="1" bgcolor="#E1E1E1">
<tr>
<td bgcolor="#F6F6F6">
<form name="searchtitle" method="POST" action="search.asp" target="_blank">
<div align="center">
<input type="text" name="ttt" class="unnamed5" size="18">
<select class="unnamed5" name="sss" size="1">
<option selected>按软件名称</option>
<option>按软件简介</option>
</select>
<input type="submit" name="Submit" value="搜 索" class="unnamed1">
<input type="reset" name="Submit2" value="取 消" class="unnamed1">
</div>
</form>
</td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td align="left" width="100%" bgcolor="#FFFFFF" valign="top">
<div align="center">
<center>
<%
if request("Nclassid")="" then
sql="select * from download where download.classid="&request("classid")
sql=sql&" order by "&order_name&" "&updown
else
sql="select * from download where download.Nclassid="&request("Nclassid")
sql=sql&" order by "&order_name&" "&updown
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<table border=0 width=100% height=100 cellpadding=0><tr><td width='100%'><p align=center>没有或没有找到任何程序</td></tr></table>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"class.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"class.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"class.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
%>
<%if request("updown")="" then%>
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#E6E6E6">
<tr>
<td bgcolor="#F7F7F7">
<table border="0" width="100%" cellspacing="0" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111" height="1" cellpadding="0">
<tr bgcolor="#DDDDDD">
<td height="27" width="299" align="right"><font color="#FFFFFF"></font></td>
<td width="59" align="center" height="27">整理日期</td>
<td width="58" align="center" height="27">文件大小</td>
<td width="57" align="center" height="27">人 气</td>
<td width="58" align="center" height="27">下载</td>
</tr>
<%end if%>
<%do while not rs.eof%>
<tr>
<td height="1" width="299"> <img src="images/arrow.gif" width="11" height="14"><a class="date" href="show.asp?id=<%=rs("id")%>" title=软件名称:"<%=rs("name")%>"><b>
<%=rs("name")%> </b> </a></td>
<td width="59" align="center" height="1"><%=rs("time")%></td>
<td width="58" align="center" height="1"><%=rs("size")%></td>
<td width="57" align="center" height="1"><font color="red"><%=rs("count")%></font></td>
<td width="58" align="center" height="1"><%=rs("downcount")%>
</td>
</tr>
<tr>
<td colspan="5" height="1"> · <%=left(rs("show"),150)%>......
</td>
</tr>
<tr>
<td colspan="3" height="1"><font class="date">软件性质:<%=classname%>/</font><%=Nclassname%></td>
<td colspan="2" height="1"> </td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td colspan="5" height="1" ></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr bgcolor="#FFFFFF">
<td colspan="6">
<p align="center">
<% end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&"?classid="&request("classid")&"&Nclassid="&request("Nclassid")&"&order="&request("order")&"&updown="&request("updown")&">"
response.write "<font color='red'>"&Nclassname&"</font>"
if CurrentPage<2 then
response.write ""&totalnumber&"个 首页 上一页 "
else
response.write ""&totalnumber&"个 <a href="&filename&"?page=1&classid="&request("classid")&"&Nclassid="&request("Nclassid")&"&order="&request("order")&"&updown="&request("updown")&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&"&order="&request("order")&"&updown="&request("updown")&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&"&order="&request("order")&"&updown="&request("updown")&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&"&order="&request("order")&"&updown="&request("updown")&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " <b>"&maxperpage&"</b>个软件/页 "%>
<%
end function
%>
</td>
</tr>
<tr> </tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<!--#include file="myads.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -