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

📄 index.asp

📁 不错的ASP整站源代码。在IIS环境下运行都没有问题
💻 ASP
字号:
<!--#include file="articleconn.asp"--> 
<!--#include file="home1.asp"-->
<!--#include file="INC/fun.inc"-->
<!--#include file="inc/part_1.asp"-->
<style type="text/css">
<!--
.fstspan1{font-size:14px;letter-spacing:1px;width:100%;padding-bottom:7px}
.fstspan2{width:100%;padding-top:6px}
.fst3 div,.fst4 div{width:95%;margin-bottom:1px;text-align:left}
.fst3 div.fstdiv1{border-bottom:2px solid #FF99CC;padding:5px 0px 3px 0px}
.fst3 div.fstdiv2{font-size:14px;border-top:2px solid #FF99CC;padding:6px 0px 2px 0px;text-align:center}
.fst4 div{border-bottom:1px solid #FFC8E3;border-top:1px solid #FFC8E3;padding:9px 0px;line-height:17px}
-->
</style>
<script language="javascript">
function popwin2(id,path)
{		window.open("openarticle.asp?id="+id+"&ppath="+path,"","");
}
</script>
<%
   dim rs
   MaxPerPage=rs("duo")
   dim totalPut   
   dim CurrentPage
   dim TotalPages
   dim i,j

   dim typename
   dim ty
   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 type.typeid,type.type,learning.articleid,learning.typeid,learning.user_id,learning.name,learning.title,learning.content,learning.dateandtime,learning.reviewcount,learning.hits from learning,type where type.typeid=learning.typeid order by learning.articleid desc"
else
    sql="select type.typeid,type.type,learning.articleid,learning.typeid,learning.user_id,learning.name,learning.title,learning.content,learning.dateandtime,learning.reviewcount,learning.hits from learning,type where type.typeid=learning.typeid and learning.typeid="+cstr(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
           do while not rs.eof%>
          
            <div class=fst4><div>
            <span class=fstspan1>→<a href="javascript:popwin2(<%=rs("articleid")%>)"><%=rs("title")%></a></span>
            ...&nbsp;<%=RmHtml ( Left(rs("content"),100))%>&nbsp;...
            <br>
            <span class=fstspan2>作者:<a href="../read.asp?user_id=<%=rs("user_id")%>"><%=rs("name")%></a> 发表日期:<%=GetDateTime(rs("dateandtime"))%> 类目:<a href="index.asp?typeid=<%=rs("typeid")%>"><%=rs("type")%></a> 字数:<%=FormatNumber(Len(rs("content")),0)%> 阅读次数:<%=rs("hits")%> 点评:<%=rs("reviewcount")%>
            </span>
          </div></div>
          
            <% i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	   loop
		  %>
          
      <%
   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  "<div class=fst3><div class=fstdiv1><table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%"" height=30>"
  response.write  "<tr><td>"
  Response.Write  "<a href=""SIndex.asp?typeid=" & typeid & """ class=""a03"">[简单模式]</a> 共有文章: <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></table></div></div>"
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  "<div class=fst3><div class=fstdiv2><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></div></div>
<%  
end function
%>

<!--#include file="inc/part_3.asp"-->

<%
Function RmHtml(fString)
	fString = Replace(fString, CHR(13), " ")
	fString = Replace(fString, CHR(10) & CHR(10), " ")
	fString = Replace(fString, CHR(10), " ")
	fString = Replace(fString, "<br>", " ")
	fString = Replace(fString, "<BR>", " ")
	fString = Replace(fString, "<Br>", " ")
	fString = Replace(fString, "<bR>", " ")
	fString = Replace(fString, "<p>", " ")
	fString = Replace(fString, "<P>", " ")
	fString = replace(fString, ">", "&gt;")
	fString = replace(fString, "<", "&lt;")
        RmHtml=fString
End Function
%>

⌨️ 快捷键说明

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