www.gusucode.com > 书生图片管理Asp源码程序 > code/Default.asp

    <!--#include file="articleconn.asp"-->
<!--#include file="home1.asp"-->
<html>
<%
   dim rs
   MaxPerPage=rs("zu")
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j
   dim typename
   dim keyword 
   dim sql
   keyword=trim(request("keyword"))
   typename=request.Querystring("typename")
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=rs("homes")%>==><%=rs("home")%></title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" href="css/style.css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" marginwidth="0">
<div align="center"><!--#include file="home.asp"--> 
</div>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" background="images/kuan.gif">
  <tr> 
    <td> <img src="images/bian1.gif" width="760" height="1"> 
      <table border="1" width="750" bordercolorlight="#0066CC" bordercolordark="#FFFFFF" cellpadding="0" cellspacing="1" align="center" background="images/kuan.gif">
        <tr bgcolor="#006cd9"> 
          <td width="100%" height="20"> 
            <p align="center"><font color="#000000"><b><font color="#FFFFFF" size="3"><%=rs("home")%></font></b></font> 
          </td>
        </tr>
      </table>
      <img src="images/bian1.gif" width="760" height="1" align="top"></td>
  </tr>
</table><div align="center">
  <table border="0" width="760" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" cellspacing="0" align="center" background="images/kuan.gif">
    <tr> 
    <td width="100%" height="152"> 
        <form method="post" action="Default.asp">
          <br>
          <font color="#FF0000"> </font> 
          <table border=0 cellpadding=0 cellspacing=0 width="400" align="center">
            <tr> 
              <td valign=center colspan="3" align="right"> 
                <div align="center">查询关键字<font color="#FF0000"><%=keyword%></font> 
                </div>
              </td>
            </tr>
            <tbody> 
            <tr> 
              <td width="29%" align="right">请输入搜索字符: </td>
              <td valign=center colspan="2" align="center" width="71%"> 
                <input  name=keyword size=30 maxlength=30 class=smallInput>
                <input class=buttonface type=submit  value=搜索   name=submit>
              </td>
            </tr>
            </tbody> 
          </table>
        </form>
        <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" >
          <tr>
            <td colspan="2" valign="top">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td width="54%"> 
                    <p align="center"><span style="position:relative; width:100; height:50; filter:blur(Add=1,Direction=135,Strength=4)"><a href="index.asp?typeid=0">最新加入酷图</a></span></p>
                  </td>
                  <td width="36%"> 
                    <div align="center"><span
style="position:relative; width:100; height:50; filter:blur(Add=1,Direction=135,Strength=4)"> 
                      <a href="good.asp?typeid=0">观赏排行榜</a></span></div>
                  </td>
                  <td width="10%"> 
                    <div align="center"><font face="Wingdings" color="#009966" size="6">4</font></div>
                  </td>
                </tr>
              </table>
               </td>
          </tr>
          <tr> 
            <td colspan="2" valign="top"> 
              <p align="center"><%
sql="select * from type where type like '%"&keyword&"%' order by typeid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
  if rs.eof and rs.bof then
       response.write "<p align='type'> 还 没 有 任 何 图 片 分 类</p>"
   else
	  totalPut=rs.recordcount
      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
           showpage totalput,MaxPerPage,"Default.asp"
            showContent
            showpage totalput,MaxPerPage,"Default.asp"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"Default.asp"
            showContent
             showpage totalput,MaxPerPage,"Default.asp"
        else
	        currentPage=1
           showpage totalput,MaxPerPage,"Default.asp"
           showContent
           showpage totalput,MaxPerPage,"Default.asp"
	      end if
	   end if
   rs.close
   end if
	        
   set rs=nothing  
   conn.close
   set conn=nothing
   sub showContent
       dim i
	   i=0
%> </p>
              <table border="0" cellspacing="5" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" vspace="10" hspace="40" width="80%" align="center">
                <tr> <%do while not rs.eof%> 
                <tr> 
                  <td colspan="2"> 
                    <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
                      <tr> 
                        <td width="25%"><b><font color="#006cd9">□</font></b> 
                          <a href="index.asp?typeid=<%=rs("typeid")%>"><%=rs("type")%></a></td>
                        <td><%=rs("jian")%></td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %> 
              </table>
              <div 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&">"
  if CurrentPage<2 then
    response.write "<font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    response.write "&nbsp;共<b>"&totalnumber&"</b>个分类 <b>"&maxperpage&"</b>个分类/页 "
   response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput type='text' name='txtitle' value="&currentpage&">"
   response.write "<input class=buttonface type='submit'  value=' Goto '  name='cndok'></span></p></form>"     
end function
%> </div>
            </td>
          </tr>
        </table>
        
        <p align="right"><a href="login.asp" title="站长专用,生人勿近">《站长管理》</a></p>
      <p><img src="images/bian1.gif" width="760" height="1"></p>
    </td>
  </tr>
</table>
 <table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td><img src="images/bian.gif" width="760" height="13"></td>
    </tr>
  </table>
  <!--#include file="homes.asp" --></div>
</body> </html>