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

📄 index.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<!--#include file="articleconn.asp"-->
<!--#include file="home1.asp"-->
<!--#include file="inc/part_1.asp"-->
<script language="JavaScript">
<!--
function checkinput()
{
	if (document.search.keyword.value=="")
	 {
		alert("请输入想查询的内容!");
		document.search.keyword.focus();

		return false;
	 }
	 return true;
}
-->
</script>

<%
   dim rs
   MaxPerPage=rs("duo")
   dim totalPut
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   dim ty
   
   if isempty(request("youid")) or request("youid")="" then
      addtion=""
   else
      addtion="&youid=" & request("youid")
   end if   
   typeid=request("typeid")
   typename="图吧"
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
      dim rstype
   dim typesql
   dim typeid,typename1
   if not isEmpty(request("typeid")) then
	typeid=request("typeid")
   else
	typeid=0
   end if
 set rstype=server.createobject("adodb.recordset")
  typesql="select * from type where typeid="&typeid&""
 rstype.open typesql,conn,1,1
 if not rstype.eof then
	typename1=rstype("type")
 else typename1="全部贺卡"
 end if
rstype.close
set rst=server.CreateObject("ADODB.RecordSet")
%>
<!--#include file="home.asp" -->
<!--#include file="inc/part_2.asp"-->
<%
dim sql

if typeid=0 then
   sql="select learning.*,type.type from learning,type where learning.typeid=type.typeid order by learning.articleid desc"
else
   sql="select learning.*,type.type from learning,type where learning.typeid=type.typeid and learning.typeid="&typeid&" order by learning.articleid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
 if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 卡 片</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,"index.asp"
	    showContent
	    showpage1 totalput,MaxPerPage,"index.asp"
       else
	  if (currentPage-1)*MaxPerPage<totalPut then
	    rs.move  (currentPage-1)*MaxPerPage
	    dim bookmark
	    bookmark=rs.bookmark
	    showpage totalput,MaxPerPage,"index.asp"
	    showContent
	    showpage1 totalput,MaxPerPage,"index.asp"
	else
		currentPage=1
	  showpage totalput,MaxPerPage,"index.asp"
	   showContent
	   showpage1 totalput,MaxPerPage,"index.asp"
	      end if
	   end if
   rs.close
   end if

   set rs=nothing
   conn.close
   set conn=nothing


sub showContent
       dim i
	   i=0

%>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr><td colspan=2 bgcolor="#E32D3F" height="1"></td></tr>
<tr><td height="8" width="50%"></td><td height="8" width="50%"></td></tr>
<tr>
<%
	  i=0
	  do while not rs.eof
%>

     <td>
                              
      <table border="0" cellspacing="0" cellpadding="0" width="100%">
      <tbody>
         <tr>
	  <td width="120" valign="top">
	  <table border="0" cellspacing="0" cellpadding="0" width="100%">
	  <tbody>
	  <tr><td height="4"></td></tr>
	  </tbody>
	  </table>
	  <a href="write.asp?id=<%response.write rs("articleid") & addtion %>" title="发送贺卡">
<%
if not isnull(rs("images")) and rs("images")<> "" then
   response.write "<img src=" + rs("images") + " border=0 >"
end if
%>
          </a></td>
          <td width="5">&nbsp;&nbsp;</td>             
          <td> 
                        <table border="0" cellspacing="0" cellpadding="0" width="152">
                        <tbody>
			    <tr>
			      <td>贺卡名称: <%=rs("title")%></td>
			    </tr>
			    <tr>
			      <td>加入日期: <%=rs("dateandtime")%></td>
			    </tr>
			    <tr>
			      <td><a href="<%=rs("images1")%>" target="_blank">放大观看</a> 类别:<a href="index.asp?typeid=<%=rs("typeid")%>"><%=rs("type")%></a></td>
			    </tr>
			    <tr>
			      <td>发送次数: <%=rs("hits")%></td>
			    </tr>
			    <tr>
			      <td>
				<a href="review.asp?ID=<%=rs("articleid")%>" target="_blank">贺卡点评</a>:
				<font color="#FF0000"><%=rs("reviewcount")%>
				篇</font></td>
			    </tr>
			  </tbody>
			  </table>
	</td></tr>
	</tbody>
	</table>
<%
 if i mod 2 <> 0 then
%>
</tr><tr><td height="15" width="50%"></td><td height="15" width="50%"></td></tr>
<tr>
<%end if%>
	      <%
	      i=i+1
	      if i>=MaxPerPage  then exit do
	      rs.movenext
	      if rs.eof then exit do
	      loop
		  %>
</td></tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
  <tr><td height="1" background="../images/hline.gif"></td></tr>
</tbody>
</table>
	  <%
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  "<table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"" height=24>"
  response.write  "<tbody><tr><td>"
  Response.Write  "共有贺卡: <b><font color=""red"">"&totalnumber&"</font></b> 幅 页次: <font color=""red""><b>"&CurrentPage&"</b> / <b>"&n&"</b></font> 页</td>"
  response.write "<td align=right>"
  if CurrentPage<2 then
    response.write "上一页&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
    response.write ">下一页</a>"
  end if
  Response.Write "</td></tr></tbody></table>"
end function



function showpage1(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  Response.Write  "<table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"" height=30><tbody>"
%>
<form action=<%response.write ""&filename&"?typeid="&typeid&""%> method="POST">
<%
  response.write "<tr><td>"
  if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "下一页 末页"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&page="&n&">末页</a></td>"
  end if
%>
<td align=right>
转到 <input type="Text" name="page" value="<%=CurrentPage%>" size="3" maxlength="3" class="put"> 页
</td></tr></form></tbody></table>
<%  
end function
%>
<!--#include file="inc/part_3.asp"-->

⌨️ 快捷键说明

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