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

📄 index.asp

📁 这是一个文章管理的网页源程序
💻 ASP
字号:
<!--#include file="ie586top.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<%
	dim rs,sql
	dim classid
	dim classname
   	dim totalPut   
   	dim CurrentPage
   	dim TotalPages
   	if request("classid")<>"" then
		classid=request("classid")
   	else
		classid=1
   	end if
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
  	set rs = server.createobject("adodb.recordset")
 	set rs1=server.createobject("adodb.recordset")
   	if trim(request("Nclassid"))<>"" then
		Nclassid=trim(request("Nclassid"))
  		sql="select * from ANclass where NclassID="&cstr(Nclassid)
 		rs.open sql,conn,1,1
 		if not rs.eof then
			Nclassname=rs("Nclass")
 		end if
		rs.close
   	else
		Nclassid=""
		Nclassname="全部文章"
   	end if
  	sql="select * from Aclass where classID="&cstr(classid)
 	rs.open sql,conn,1,1
 	if not rs.eof then
		classname=rs("class")
 	end if
	rs.close
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="晨怡网景,http://www.ie586.net">
<title><%=classname%></title>
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<link rel="stylesheet" href="images/new.css">
</head>

<body background="images/bgbig.gif" leftmargin="0" topmargin="0">
<div align="center">
  <table border=0 cellpadding=0 cellspacing=0 width=750>
    <tbody> 
    <tr> 
    <td>
  <br>
<TABLE cellSpacing=0 cellPadding=0 width="750" border=0 align=center>
  <TBODY> 
  <TR>
    <TD bgColor="<%=Tablebackcolor%>">
      <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
        <TR>
          <TD bgColor="<%=Tabletitlecolor%>">
<%
	sql="select class,classid from Aclass"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "还没有任何栏目"
	else
	do while not rs.eof
%>|&nbsp;&nbsp;<a href="default.asp?classid=<%=rs("classid")%>"><%if cint(rs("classid"))=cint(classid) then%><font color=red><%=rs("class")%></font><%else%><%=rs("class")%><%end if%></a>&nbsp;|&nbsp;  
<%  
	rs.movenext  
	loop  
	end if  
	rs.close  
%>  
	</TD></TR>
        <TR>
            <TD bgColor="<%=Tablebodycolor%>"> | <a href="index.asp">您的位置</a> 
              &gt;&gt;&nbsp;&nbsp;<%=classname%> >> 
              <%if Nclassid="" then%>
              全部文章 
              <%else%>
              <%=Nclassname%> 
              <%end if%>
            </TD>
        </TR>
      </table>
    </td>
  </tr>
  </tbody>
</table>
<br>
                                        
                                          
  <table border="0" width=750 align=center cellspacing="0" cellpadding="1" bgcolor="#FFFFFF">
    <tr>  
      <td valign="top" width="25%"> <!--#include file="top.asp"--><br>
        <!--#include file="revirw.asp"-->
      </td> 
      <td valign="top" width="3%">&nbsp;    
      </td> 
      <td width="72%" valign="top">   
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 align=center>
  <TBODY>
  <TR>
    <TD bgColor="<%=Tablebackcolor%>">
      <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0>
        <TR>
          <TD bgColor="<%=Tabletitlecolor%>">|<b>&nbsp;
<%if Nclassid="" then%><%=Nclassname%>>>
<%
	sql="select * from ANclass where classid="&classid
	rs.open sql,conn,1,1
	do while not rs.eof
		response.write "&nbsp;<a href=index.asp?classid="&classid&"&Nclassid="&rs("Nclassid")&">"&rs("Nclass")&"</a>"
	rs.movenext
	loop
	rs.close
else
%>
<font color=red><%=Nclassname%></font>
<%
	sql="select * from ANclass where Nclassid<>"&Nclassid&" and classid="&classid
	rs.open sql,conn,1,1
	do while not rs.eof
		response.write "&nbsp;<a href=index.asp?classid="&classid&"&Nclassid="&rs("Nclassid")&">"&rs("Nclass")&"</a>"
	rs.movenext
	loop
	rs.close
%>
<%end if%></B>
	</TD></TR>
        <TR>
                  <TD bgColor="<%=Tablebodycolor%>"> <font style=line-height:150%> <% 
   	if Nclassid<>"" then
sql="select * from article where Nclassid="+cstr(Nclassid)+" and classid="+cstr(classid)+" and daifa=1  order by articleid desc" 
	else
sql="select * from article where classid="+cstr(classid)+" and daifa=1 order by articleid desc" 
	end if
	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
%><%=i+1%>. <a href="list.asp?id=<%=rs("articleid")%>"><%=rs("title")%></a> (<%if rs("dateandtime")=date() then%><font color=red><%=month(rs("dateandtime"))%>月<%=day(rs("dateandtime"))%>日</font><%else%><font color='#999999'><%=month(rs("dateandtime"))%>月<%=day(rs("dateandtime"))%>日</font><%end if%>,<font color=green><%=rs("hits")%></font>) 
                    <br>
                    <% 
	i=i+1
	if i>=MaxPerPage then exit do
	rs.movenext 
	loop 
	end sub
%> </font> <!--#include file="query.asp"--> </TD>
                </TR>
      </table>
    </td>
  </tr>
  </tbody>
</table>
      <table cellspacing=0 cellpadding=0 width="100%" border=0 align=center>
        <tbody> 
        <tr align="right"> 
          <td>
            <!--#include file="go.asp"--></td>
        </tr>
        </tbody> 
      </table>
    </td> 
    </tr>                            
  </table>                            

<%
	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&"?classid="&request("classid")&"&Nclassid="&request("Nclassid")&">"
  	response.write "<font color='red'>"&Nclassname&"</font>"

  	if CurrentPage<2 then
    		response.write "共"&totalnumber&"篇&nbsp;首页 上一页&nbsp;"
  	else
    		response.write ""&totalnumber&"个&nbsp;<a href="&filename&"?page=1&classid="&request("classid")&"&Nclassid="&request("Nclassid")&">首页</a>&nbsp;"
    		response.write "<a href="&filename&"?page="&CurrentPage-1&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&">上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&"&classid="&request("classid")&"&Nclassid="&request("Nclassid")&">尾页</a>"
  	end if
   	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    	response.write "&nbsp;<b>"&maxperpage&"</b>篇文章/页 "
%>
转:<select name='page' size='1' onchange='javascript:submit()'>   
              <%for i = 1 to n%>   
              <option value='<%=i%>' <%if cint(Page)=cint(i) then%> selected <%end if%>>第<%=i%>页</option>   
              <%next%>   
            </select></form>
  <%     
end function

   	set rs=nothing   
	conn.close
	set conn=nothing
%>
  <img src="images/downdown.gif" width="748" height="10"> 
</div>
<!--#include file="ie586top-2.asp"-->
</BODY>                              
</HTML>                              








⌨️ 快捷键说明

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