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

📄 art_body.asp

📁 一个不错的企业网站
💻 ASP
字号:
<%sub art_body()
dim totalart,Currentpage,totalpages,i,j,colname
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 bgcolor="#ffffff" align=center border=1 cellPadding=0 cellSpacing=0 width=760 borderColor="<%=border%>" frame=vsides rules=none>
  <!--DWLayoutTable-->
  <TBODY>
    <TR> 
      
    <td width="756" height="78" valign="top" background="img/index_jiao.gif"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="758" height="114">
        <param name="movie" value="img/logo/top4.swf">
          <param name="quality" value="high">
          <embed src="img/logo/top4.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="758" height="114"></embed><param name="wmode" value="transparent"></object></TD>
    </TR>
    <TR> 
      <td height="24" align="right" valign="top"> <%
sql="select * from a_cat"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("cat_id")=cstr(rs2("cat_id")) then
response.write "&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<font color='#ff6600'>"&rs2("cat_name")&"</font>"
else
response.write "&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href='art.asp?cat_id="&rs2("cat_id")&"'>"&rs2("cat_name")&"</a>"
end if
rs2.movenext
loop
if rs2.eof and rs2.bof then
response.write "当前没有分类!"
end if
%> 
        &nbsp; </TD>
    </TR>
    <TR> 
      <td height="2" background="img/menu_bg2.gif"></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE align=center border=1 cellPadding=0 cellSpacing=0 width=760 borderColor="<%=border%>" frame=vsides rules=none>
<TBODY>
<TR>
<td width=553 align=left vAlign=top bgcolor="#ffffff"><%call br%>
<table width='530' height="25" border='0' align="center"cellpadding='2' cellspacing='0' background="img/mainbg.gif">
              <tr> 
                <td>&nbsp;&nbsp;<img src="img/biao.gif" align="absmiddle">&nbsp;
            <%if request("cat_id")<> "" then%>
            本分类共有<span><%=rs.recordcount%></span>篇文章 
            <%elseif request("select")<>"" then%>
            共搜索到<span><%=rs.recordcount%></span>篇文章 
            <%else%>
            当前共有<span><%=rs.recordcount%></span>篇文章 
            <%end if%>
          </td>
        </tr>
      </table>
 <table width="530" border="1" align="center" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF" bordercolor="#C0C0C0" style="border-collapse: collapse">
        <tr> 
          <td bgcolor="#ECECEC" width="73%" align="center" height="22">文章标题</td>
          <td bgcolor="#ECECEC" width="27%" align="center">发表时间</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" >&nbsp;<img src=img/none.gif border=0><img src=img/i4.gif border='0'>&nbsp;<a href="javascript:art('showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>')"><%=rs("art_title")%></a></td>
          <td bgcolor="#FFFFFF" align="center"><%=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="25" colspan="2">当前没有文章!</td>
        </tr>
<%end if
end if
if not request("type")=1 then%>
<form name="form1" method="post" action="art.asp?cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>">
<tr> 
<td align="right" bgcolor="#ECECEC" colspan="3">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR> 
<TD align=middle width="35%" height=25><IMG height=14 src="img/cha.gif" width=14 align=absMiddle> 共[<font color="#FF6666"><%=totalart%></font>]个作品 分[<font color="#FF6666"><%=totalpages%></font>]页</TD>
<TD width="40%" align=middle bgcolor="#e6e6e6"><IMG height=11 src="img/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href=art.asp?page=1&cat_id="&request.querystring("cat_id")&">首页</a> "
response.write "<a href=art.asp?page="&CurrentPage-1&"&cat_id="&request.querystring("cat_id")&">上一页</a> "
end if
if totalpages-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href=art.asp?page="&CurrentPage+1&"&cat_id="&request.querystring("cat_id")
response.write ">下一页</a> <a href=art.asp?page="&totalpages&"&cat_id="&request.querystring("cat_id")&">尾页</a>"
end if
%>
 <IMG height=11 src="img/gt.gif" width=11 align=absMiddle></TD>
<TD align=middle width="25%">
<select name="page" class="lanyu">
<%
i=1
for i=1 to totalpages
if i=currentpage then
%>
<option value=<%=i%> selected>第<%=i%>頁</option> 
<%else%>
<option value=<%=i%>>第<%=i%>頁</option> 
<%end if
next%>
</select><input type="submit" name="Submit2" value="轉向" class="button"> </TD>
</TR>
</FORM>
</TABLE>          
</td>
          </tr>
        </form>
      </table>
      <%end if%>
<%call br%><%call br%>
    </td>
<td width=1 height="190" background="img/xu.gif"></TD>
<td width=204 align=left vAlign=top background=img/left_bg2.gif>
<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR><td width=204><img src=img/left_top2.gif usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="61,11,87,24" href="book.asp?page=1" title="留言本"><area shape="rect" coords="134,11,160,24" href="admin.asp" title="后台管理"></map></td></tr>
</table>
<TABLE width=196 border=0 align=right cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
      <td align=center height="61"><img src="img/two/top.jpg"></td>
</tr>
<tr><td>
<%
rs.close
set rs=nothing
set rs3=server.createobject("adodb.recordset")
if request.querystring("cat_id")<>"" then
sql="select top "&toparticlenum&" art_id,art_title,art_count,cat_id from art where cat_id="&request.querystring("cat_id")&" order by art_count DESC"
else
sql="select top "&toparticlenum&" art_id,art_title,art_count,cat_id from art order by art_count DESC"
end if
rs3.open sql,conn,1,1
do while not rs3.eof
%>&nbsp;<img src=img/none.gif border=0><img src=img/i4.gif border='0'>&nbsp;<a href="javascript:art('showart.asp?art_id=<%=rs3("art_id")%>&cat_id=<%=rs3("cat_id")%>')" title="点击次数:<%=rs3("art_count")%>"> <%if len(Rs3("art_title"))>14 then
response.write left(Rs3("art_title"),12)&"..."
else
response.write Rs3("art_title")
end if%></a><br> 
      <%
   rs3.movenext
   loop
   if rs3.eof and rs3.bof then
   response.write "没有相关文章"
   end if
   rs3.close
   set rs3=nothing
   %>
   <br>
    </td>
        </tr>
<TR>
      <td align=center height="61"><img src=img/two/findwz.jpg></td>
</tr><form name="form2" method="post" action="art.asp"><tr><td height='28' align='center'>
<input type="radio" name="select" value="0" checked><font color=#0000FF>全部</font>&nbsp
<input type="radio" name="select" value="art_title"><font color=#FF00FF>标题</font>&nbsp;
<input type="radio" name="select" value="art_content"><font color=#FF7F50>内容</font>
</td>
</tr><tr><td height='28' align='center'>
<input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onFocus='this.select();' class="lanyu">&nbsp;<input type='submit' name='search'  value='搜索' class="button"></td></tr></form>
</td>
</tr>
 <TR>
    <td align=center height="61"><img src=img/two/sm.jpg></td>
</tr>
<tr><td><%call br%>  本站的大部分资料,文章都来<%call br%>自网上收集,其版权归作者本人所<%call br%>有,如果有任何侵犯您权益的地方,<%call br%>请联系我们,我们将马上进行整理,<%call br%>谢谢。<%call br%><%call br%></td>
        </tr>
      </table>
     </td>
  </tr>
</table>
<%
rs2.close
set rs2=nothing
end sub%>

⌨️ 快捷键说明

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