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

📄 index.asp

📁 不错的一个网站哦, 不错的一个网站哦
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->


<%
	dim rs,sql
   	dim totalPut   
   	dim CurrentPage, TotalPages
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
  	set rs = server.createobject("adodb.recordset")
%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<LINK href="style.css" rel=stylesheet>
<title>文章</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<div align="center">
  <center>
  <table border="0" width="704" cellspacing="0" cellpadding="0" height="399">
    <tr>
      <td width="780" align="center" height="350" ><img src="../love1.jpg" width="780" height="350">       </td>
    </tr>
    <tr>
      <td width="702" align="center" style="background-repeat: no-repeat; background-attachment: fixed; background-position: left center"></td>
    </tr>
    <tr>
                <td height="8" width="780" > 
                  <TABLE width="738" border=0 align="center" cellPadding=4 cellSpacing=1 class="table">
                    <tr align="center"> 
                      <td width="18"></td>
                      <td colspan="2"><img border="0" src="1.gif"></td>
                      <td width="103" background="blue45副本.gif"><img border="0" src="2.gif"></td>
                      <td width="93" background="blue45副本.gif"><img border="0" src="3.gif"></td>
                      <td width="89" background="blue45副本.gif"><img border="0" src="4.gif"></td>
                    </tr>
                    <TR bgcolor="#FFFFFF"> 
                      <TD colspan="6"> <% 
	sql="select * from article order by articleid desc"
	rs.open sql,conn,1,1 
  	if rs.eof and rs.bof then 
       		response.write "<p align='center'>没有找到任何文章</p>" 
   	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,"index.asp" 
       		else 
          		if (currentPage-1)*MaxPerPage<totalPut then 
            			rs.move  (currentPage-1)*MaxPerPage 
            			showContent 
             			showpage totalput,MaxPerPage,"index.asp" 
        		else 
	        		currentPage=1 
           			showContent 
           			showpage totalput,MaxPerPage,"index.asp" 
	      		end if 
	   	end if 
   	rs.close 
   	end if 
	         sub showContent 
       	dim i 
	   	i=0 
	do while not rs.eof
%> 
                    <tr> 
                      <td width="18" align="center" class="hittd" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"><b><%=i+1%></b></td>
                      <td width="209" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"><font color="#333333"><a href="list.asp?id=<%=rs("articleid")%>" target="_blank"><%=rs("title")%> </a></font></td>
                      <td width="171" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"><div align="left"><a href="admin.asp">(文章系统管理)</a><a href="mailto:taiyanzhang@163.com"> | (BLOG申请)</a></div></td>
                      <td width="103" align="center" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"> <font color="#333333"> 
                        <%if not isnull(rs("writer")) then%>
                        <%=rs("writer")%> 
                        <%else%>
                        不详 
                        <%end if%>
                      </font></td>
                      <td width="93" align="center" class="hittd" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"><font color="#333333"><b> 
                        <%if rs("dateandtime")=date() then%>
                        <%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%> 
                        <%else%>                                 
                        <%=year(rs("dateandtime"))%>-<%=month(rs("dateandtime"))%>-<%=day(rs("dateandtime"))%>                                
                        <%end if%>                                 
                        </b></font></td>
                      <td width="89" align="center" class="hittd" style="background-repeat: no-repeat; background-attachment: fixed; background-position: right 50%"><font color="#333333"><b><%=rs("hits")%></b></font></td>
                    </tr>
                    <% 
	i=i+1
	if i>=MaxPerPage then exit do
	rs.movenext 
	loop 
end sub
%>
                  </table>
                  
                  <span class="font">
                  <%
function showpage(totalnumber,maxperpage,filename)
  	dim n, i
  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<form method=post name=myform action=ru_query.asp>"
  	response.write "<tr align=center ><td bgcolor=#ffffff colspan=3 font color=#333333>"

  	if CurrentPage<2 then
    		response.write "共有 "&totalnumber&" 篇文章 | 首页 | 上一页 | "
  	else
    		response.write "共有 "&totalnumber&" 篇文章 | <a href="&filename&"?page=1>首页</a> | "
    		response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a> | "
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 | 尾页 | "
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    		response.write "下一页</a> | <a href="&filename&"?page="&n&">尾页</a> | "
  	end if
   	response.write "页次:"&CurrentPage&"/"&n&"页 | "
    	response.write ""&maxperpage&"篇页"
		response.write "</td><td colSpan=2 bgColor=#ffffff ><table width=80% border=0 cellspacing=0 cellpadding=0 cellpadding=1 align=center><tr><td align=center>"
		response.write "<input type=text name=keyword size=10 maxlength=50 class=input></td><td align=center>"
		response.write "<input name=Submit type=image src=search.gif width=38 height=18></td></tr></table>"
		response.write "</td></tr>"
		response.write "</form>"
%>
                  </span> 
                  <%     
end function

   	set rs=nothing   
	conn.close
	set conn=nothing
%>
                </td>
    </tr>
 
  </table>
  </center>
</div>
</body>                              
</html>

⌨️ 快捷键说明

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