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

📄 sort.asp

📁 这是作的一个网站,修改很方便,可以做网站设计.管理登陆:admin.asp 帐号和密码:admin/admin
💻 ASP
字号:
<!--#include file="Gaobei_head.asp" -->
<%
    sub navigation()
    response.write " &gt;&gt; "
    response.write ""&Sortname&""
    end sub
%>
<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="778" height="50" bgcolor="#FFFFFF">
		<tr>
			<td width="218" valign="top">
<% call userlogin() %>
<% 'Call Gaobei_Marquee()%>
<% Call Gaobei_articleInfo(1,10,26,0,0) %>
<% call Gaobei_Search() %>
<% 'call Gaobei_vote() %>
</td>
			<td width="560" valign="top">

<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="550" height="160">
		<tr>
			<td width="100%">

<!--主要内容开始-->

<%
    Dim SortID
    SortID=CheckStr(Request.QueryString("SortID")) 
    If isInt(SortID)=False OR Not IsNumeric(SortID) Then
    Response.Redirect "index.asp" 
    Response.End()
    End If
    '栏目统计---------
    set RsH=server.createobject("adodb.recordset")
    hit="update Sort set hit=hit+1 where ID="&SortID
    RsH.open hit,conn,1,3
    '大类选取----------
    sql="select * from Sort where ID="&SortID&""
    Set Rs=conn.execute (sql)
    if rs.eof and rs.bof then 
    response.redirect"index.asp"
    else
    Sortname=Rs("names")
    SettingB=Rs("Setting")
    Info=Rs("Info")
    Rs.close
    set Rs=nothing
    end if
    '分页
    page_count = 20
    MaxPerPage=Page_count 
    dim sql 
    dim rs
    dim gstBookID
    dim totalPut 
    dim CurrentPage
    dim TotalPages
    dim i,j
%>

<TABLE width=100% border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
  <TR>
<TD vAlign=top align=left width=593>
<% 
    '主程序-----------------
    Select Case SettingB
	Case "5"
      call Gaobei_OnlyPage(SortName,Info)
	Case "4"
	  call sortpage()
	Case "3"
	  call pages()
	Case else
	  Call Mainsort()
    End Select
    '主程序-----------------
%>
</TD>
</TR></TBODY></TABLE>

</BODY></HTML>

<%
    sub Mainsort()
    Dim SortID
    dim sqlsort
    dim RsSort
	
    SortID=CheckStr(Request.QueryString("SortID")) 
    If isInt(SortID)=False OR Not IsNumeric(SortID) Then
    Response.Redirect "index.asp" 
    Response.End()
    End If

	sqlsort="select * from Sort where B_id<>0 and setting < 4 and B_ID="&SortID&" order by S_order"
	Set RsSort=conn.execute (sqlsort)
	if RsSort.eof and RsSort.bof then
	response.write "<div align=center>还没有任何栏目...</div>"
	else
	settingc=RsSort("setting")
    if SettingB=1 then 
    '显示图文------
%>




<div align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="550" height="20" background="images/Gaobei_skin/Gaobei_sharedh.gif">
					<tr>
                      <TD width="100%" height="20" style='FILTER: DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1); PADDING-TOP: 2px'>&nbsp;&nbsp;&nbsp;&nbsp;<span style="letter-spacing: 3px"><%=SortName%>推荐图文信息</span></TD>
					</tr>
				</table>
</div>

<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="550" height="5">
		<tr>
			<td></td>
		</tr>
	</table>
</div>




<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR> 
<TD> 
<TABLE style="border: 1px solid #3399FF" bgcolor="#FFFFFF" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>

<TR> 
<TD colspan="2"> <TABLE cellSpacing=5 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR vAlign=top> 
<%
    set Rstop=server.createobject("adodb.recordset")
    sql="select  top 4 * from Info  where Ispic=1 and Sort1="&SortID&" and Pw_Good=True ORDER BY id DESC"
    Rstop.open sql,conn,1,1
    if Rstop.eof or Rstop.bof then
    Call NoPic("无推荐图文信息")
    end if
    do while not Rstop.eof    
%>
<TD height=131 align=middle>
<% Call Gaobei_ShowPic(Rstop("Pic"),Rstop(0),Rstop("Title"),16) %>
</TD>
<%       
    Rstop.movenext             
    loop
%>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<%
    end if 
    '显示图文完 开始列分类 ----------
    do while not RsSort.eof
%>



<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="550" height="5">
		<tr>
			<td></td>
		</tr>
	</table>
</div>

<div align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="550" height="20">
					<tr>
                      <TD width="100%" height="20">
						<div align="center">
							<table border="0" cellpadding="0" cellspacing="0" width="550" height="20" id="table1" background="images/Gaobei_skin/gaobei_sortmore.gif">
								<tr>
									<td width="470" style='FILTER: DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1); PADDING-TOP: 2px'>&nbsp;&nbsp;&nbsp;&nbsp;<span style="letter-spacing: 3px"><%=RsSort(1)%></span></td>
									<td width="57" valign="bottom"><a href="Class.asp?ClassID=<%=RsSort(0)%>">
									<img border="0" src="images/Gaobei_skin/Gaobei_touminglink.gif" width="56" height="17"></a></td>
									<td width="23"> </td>
								</tr>
							</table>
						</div>
						</TD>
					</tr>
				</table>
</div>



<% if RsSort("setting")=3 then%>
<div align="center">
<TABLE style="border: 1px solid #3399FF; " bgcolor="#FFFFFF" cellSpacing=5 cellPadding=5 width="100%" border=0>
<TBODY>
<TR> 
<TD height=74 Valign="top"><%=RsSort("Info")%></TD>
</TR>
</TBODY>
</TABLE>
</div>
<% end if %>
<% if RsSort("setting")<>3 then%>
<div align="center">
<table style="border: 1px solid #3399FF; " bgcolor="#FFFFFF" width="100%" border="0" cellpadding="2" cellspacing="0">
<tr> 
<td width="35%" height="106">
<%
    set RsPic=server.createobject("adodb.recordset")
    sql="select  top 1 * from Info  where Sort2="&RsSort("id")&" and Ispic=1 ORDER BY id DESC"
    RsPic.open sql,conn,1,1
    if RsPic.eof or RsPic.bof then
    Call NoPic("本类暂无图文信息")
    end if
    do while not RsPic.eof
    Call Gaobei_ShowPic(RsPic("Pic"),RsPic(0),RsPic("Title"),16)
    RsPic.movenext
    loop
    RsPic.CLOSE
    SET RsPic=Nothing
%>
</td>
<td width="65%" valign="top"> 
<% Call Gaobei_ShowInfo(6,6,35,RsSort("id"),1) %>
</td>
</tr>
</table>
</div>
<%end if%>
<%  
    RsSort.movenext  
    loop  
    end if  
    RsSort.close  
%>
</TD>
</TR>
<TR> 
<TD></TD>
</TR>
</TBODY>
</TABLE>
<%
    end sub
    '列分类完---------
%>

<%
    '大类只有一级分类时 Setting=3-----------------
    sub pages()
%>
<div align="center">
				<table border="0" cellpadding="0" cellspacing="0" width="550" height="20" background="images/Gaobei_skin/Gaobei_sharedh.gif">
					<tr>
                      <TD width="100%" height="20" style='FILTER: DropShadow(Color=#ffffff, OffX=1, OffY=1, Positive=1); PADDING-TOP: 2px'>&nbsp;&nbsp;&nbsp;&nbsp;<span style="letter-spacing: 3px"><%=SortName%></span></TD>
					</tr>
				</table>
</div>

<div align="center">
	<table border="0" cellpadding="0" cellspacing="0" width="550" height="5">
		<tr>
			<td></td>
		</tr>
	</table>
</div>


<table style="border: 1px solid #CECFCE" bgcolor="#FFFFFF" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td height="15" colspan="2"></td>
		</tr>
	
<tr>
<td width="35%" valign="top"> 
<%
    set RsPic=server.createobject("adodb.recordset")
    sql="select top 3 * from Info where Sort1="&SortID&" and Ispic=1 ORDER BY id DESC"
    RsPic.open sql,conn,1,1
    if RsPic.eof or RsPic.bof then
    Call NoPic("暂无图文信息")
    end if
    do while not RsPic.eof    
    Call Gaobei_ShowPic(RsPic("Pic"),RsPic(0),RsPic("Title"),16)
    RsPic.movenext             
    loop
%>
</td>
<td width="65%" valign="top">


<%
    sql="select * from info where Sort1="&SortID&" ORDER BY ADDdate desc,id DESC"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,1
    rs.pagesize=MaxPerPage
    If trim(Request("Page"))<>"" and IsNumeric(Request("Page")) then
	CurrentPage= CLng(request("Page")) 
	If CurrentPage< 1 then
		CurrentPage= 1 
	ElseIf CurrentPage> rs.PageCount then 
		CurrentPage = rs.PageCount 
	End If 
    Else 
	CurrentPage= 1 
    End If 
    if rs.eof then 
	response.write "<p align='center'>还没有添加信息...</p>" 
    else 
	totalPut=rs.recordcount '记录总数 
	if CurrentPage=1 then 

		showContent
		showpages
	else 
		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move(currentPage-1)*MaxPerPage 
			dim bookmark 
			bookmark=rs.bookmark '移动到开始显示的记录位置 
			showpages 
		    showContent 
		else 
			currentPage=1 
			showContent 
		end if
	end if 
	rs.close 
    end if 
    set rs=nothing 
    set conn=nothing 
%>

</td>
</tr>
</table>
<% end sub %>

<%
    '大类多栏内容显示 Setting=3 -------------
    sub showContent
%>

<TABLE width="100%" align="center" cellspacing="2">
<%
    dim i 
    i=0 
    do while not (rs.eof or err)
%>
<tr>
<td width="27" height="20"><div align="right"><img src="images/Gaobei_skin/Gaobei_ico.gif" width="12" height="11" align="absmiddle"></div></td>
<td width="342" height="20"><div align="left"><a href="ViewInfo.asp?id=<%response.write rs(0)%>" title="<%=rs("title")%>">
<% if Getlen(rs("title"))>40 then%>
<%=LeftStr(rs("title"),38)%>... 
<%else%>
<%response.write rs("title")%>
<%end if%>
</a><%=rs("date")%> </div></td>
</tr>
<%
    i=i+1
    if i>=MaxPerPage then exit do
    rs.movenext 
    loop
%>
</TABLE>
<hr width="90%">
<%end sub%>

<%
    '大类为一级时分页 Setting=3--------------------
    sub showpages()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="34"> <div align="center"> 
<% 
    dim n,k 
    if (totalPut mod MaxPerPage)=0 then
    n= totalPut \ MaxPerPage
    else
    n= totalPut \ MaxPerPage + 1
    end if
%>
共有<%=rs.recordcount%>个记录
&nbsp;每页<%=Page_count%>个记录
<%
    k=currentPage
    if k=1 then
	response.write " 首页 "& vbCrLf
	response.write " 上一页 "& vbCrLf
    end if
    if k<>1 then
	response.write "<a href='Sort.asp?SortID="& SortID &"&page=1'> 首页 </a>"
	response.write "<a href='Sort.asp?SortID="& SortID &"&page="+cstr(k-1)+"'> 上一页 </a>"
    end if
    if k=n then
	response.write " 下一页 "& vbCrLf
	response.write " 末页 "& vbCrLf
    end if
    if k<>n then
	response.write "<a href='Sort.asp?SortID="& SortID &"&page="+cstr(k+1)+"'> 下一页 </a>"
	response.write "<a href='Sort.asp?SortID="& SortID &"&page="+cstr(n)+"'> 末页 </a>"
    end if
    end sub
%>
</div></td>
</tr>
</table>
<!-- 主要内容结束-->



</td>
		</tr>
	</table>
</div>


			</td>
		</tr>
	</table>
</div>
<!--#include file="Gaobei_foot.asp" -->

⌨️ 快捷键说明

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