📄 article_body.asp
字号:
<%sub article_body()
dim totalart,Currentpage,totalpages,i,colname
openarticle
sql="select top 25 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
%>
<link href="../site_css.css" rel="stylesheet" type="text/css">
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td colspan="3" height="10"></td>
</tr>
<tr>
<td width="74%" align="center" valign="top"><table width="96%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"> </td>
</tr>
</table>
<table width="75%" height="6" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5"></td>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="chinese">
<%if request("cat_id")<> "" then%>
<font color="#666666">本分类共有<span class="newshead"><%=rs.recordcount%></span>篇文章
<%elseif request("select")<>"" then%>
共搜索到<span class="newshead"><%=rs.recordcount%></span>篇文章
<%else%>
最新发表的25篇文章 </font>
<%end if%>
</td>
</tr>
</table>
<br>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="2" background="image/dotlineh.gif">
<tr bgcolor="#FFFFFF" align="center">
<td height="22" bgcolor="#66CCFF" class="chinese"><font color="#666666"><strong>文章标题</strong></font></td>
<td width="27%" bgcolor="#66CCFF" class="chinese"><font color="#666666"><strong>发表时间</strong></font></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 bgcolor="#FFFFFF">
<td height="25"> <a href="showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>"><%=rs("art_title")%></a></td>
<td 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" bgcolor="#FFFFFF">
<td height="22" colspan="2" class="chinese">当前没有文章!</td>
</tr>
<%end if
end if%>
</table>
<%if request("cat_id")<>"" or request("select")<>"" then%>
<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"><font color="#666666"><%=currentpage%>
/<%=totalpages%>页,<%=totalart%>条记录/<%=articleperpage%>篇每页.</font>
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="article.asp?page=<%=i%>&cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="article.asp?page=<%=page%>&cat_id=<%=request("cat_id")%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>" title="下一页">>></a>
<%end if%>
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button">
</td>
</tr>
</form>
</table>
<%end if%>
<br>
<br>
</td>
<td background="images/dotlinev.gif" width="1"></td>
<td width="25%" valign="top" align="center">
<%call articlecat()%>
<br><table width="90%" border="0" align="center" cellpadding="5" cellspacing="0" class="chinese">
<tr>
<td align="right" class="chinese"> <p align="left" style="LINE-HEIGHT: 150%"><strong><font color="#666666">本
站 声 明</font></strong><br>
</p></td>
</tr>
<tr>
<td align="right">
<div align="left"><font color="#999999"> 本站的大部分资料,文章都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我,我将马上进行整理,谢谢。
</font> </div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" height="1"></td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -