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

📄 article_body.asp

📁 在线 点播音乐的功能 只提供参考
💻 ASP
字号:
<%sub article_body()
dim totalart,Currentpage,totalpages,i,j,colname
openarticle
sql="select art_id,cat_id,art_title,art_date,art_count from art order by art_date DESC"
if request("cat_id")<>"" then
sql="select art_id,cat_id,art_title,art_date,art_count from art where cat_id="&request("cat_id")&" order by art_date DESC"
elseif request("keyword")<>"" then
sql="select art_id,cat_id,art_title,art_date,art_count from art where "&request("select")&" like '%"&request("keyword")&"%'order by art_date DESC"
elseif request("cat_id")<>"" and request("keyword")<>"" then
sql="select art_id,cat_id,art_title,art_date,art_count from art where art_title or art_content like '%"&request("keyword")&"%'order by art_date DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
  <tr> 
    <td colspan="3" height="10"></td>
  </tr>
  <tr> 
    <td valign="top" width="554"> 
      <div align="center">
        <center>
        <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="96%" id="AutoNumber1">
          <tr>
            <td width="100%" style="border-style: none; border-width: medium">
            <img border="0" src="images/article.jpg"></td>
          </tr>
          <tr>
            <td width="100%" style="border-style: none; border-width: medium"> </td>
          </tr>
        </table>
        </center>
      </div>
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td class="chinese"> 
            <%if request("cat_id")<> "" then%>
            本分类共有<span class="newshead"><%=rs.recordcount%></span>篇文章 
            <%elseif request("select")<>"" then%>
            共搜索到<span class="newshead"><%=rs.recordcount%></span>篇文章 
            <%else%>
            当前共有<span class="newshead"><%=rs.recordcount%></span>篇文章 
            <%end if%>
          </td>
        </tr>
      </table>
      <div align="center">
        <center>
      <table width="96%" border="1" cellspacing="0" cellpadding="0" bgcolor="#293863" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr bgcolor="#e7e3e7" height="25" align="center"> 
         <td width="73%" height="22" background="images/bg4.gif" class="chinese">文章标体</td>
         <td width="27%" height="22" background="images/bg4.gif"  class="chinese">发表时间</td>
        </tr>
        <%
if not rs.eof then
rs.movefirst
rs.pagesize=articleperpage
if trim(request("page"))<>"" then
   currentpage=clng(request("page"))
   if currentpage>rs.pagecount then
      currentpage=rs.pagecount
   end if
else
   currentpage=1
end if
   totalart=rs.recordcount
   if currentpage<>1 then
      if(currentpage-1)*articleperpage<totalart then
	     rs.move(currentpage-1)*articleperpage
		 dim bookmark
		 bookmark=rs.bookmark
	  end if
   end if
   if (totalart mod articleperpage)=0 then
      totalpages=totalart\articleperpage
   else
      totalpages=totalart\articleperpage+1
   end if
   i=0
do while not rs.eof and i<articleperpage
%>
        <tr> 
          <td bgcolor="#FFFFFF" height="22" class="chinese"><a href="showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>" target="_blank"><%=rs("art_title")%></a></td>
          <td bgcolor="#FFFFFF" align="center" class="chinese"><%=rs("art_date")%> </td>
        </tr>
        <%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
        <tr align="center"> 
          <td bgcolor="#FFFFFF" height="22" colspan="2" class="chinese">当前没有文章!</td>
        </tr>
        <%end if
end if%>
      </table>
        </center>
      </div>
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <form name="form1" method="post" action="article.asp?cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>">
          <tr> 
            <td class="chinese" align="right"><%=currentpage%> /<%=totalpages%>页,<%=totalart%>条记录/<%=articleperpage%>篇每页. 
              <%
if currentpage>9 then
i=int(currentpage/10)*10-1
if i+9>totalpages then
showye=totalpages
else
showye=int(currentpage/10)*10+10
end if
elseif totalpages<=10 then
i=1
showye=totalpages
else
i=1
showye=10
end if
for j=i to showye
if j=currentpage then
%>
              <%=j%> 
              <%else%>
              <a href="article.asp?page=<%=j%>&cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>"><%=j%></a> 
              <%end if
next
if totalpages>currentpage then
if request("page")="" then
page=2
else
page=currentpage+1
end if%>
              <a href="article.asp?page=<%=page%>&cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>" title="下一页">>></a> 
              <%end if%>
              &nbsp;&nbsp;&nbsp;&nbsp; 
              <input type="text" name="page" class="textarea" size="4">
              <input type="submit" name="Submit" value="Go" class="button">
            </td>
          </tr>
        </form>
      </table>
      <br>
      <br>
    </td>
    <td background="images/dotlinev.gif" width="1"></td>
    <td width="205" valign="top" align="center"> 
      <%call articlecat()%>
    </td>
  </tr>
  <tr> 
    <td colspan="3" background="images/dotlineh.gif" height="1"></td>
  </tr>
</table>
<%
rs.close
set rs=nothing
end sub%>

⌨️ 快捷键说明

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