|
楼主 |
发表于 2003-8-20 00:53:50
|
来自 中国
12yes.com文章系统“热门文章”方案
修改articlecat.asp
<%
sub articlecat()
sql="select * from a_cat"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
%>
<table width="90%" border="1" cellspacing="0" cellpadding="8" bgcolor="#293863" class="chinese" bordercolor="#808080" style="border-collapse: collapse">
<tr>
<td bgcolor="#EFEFEF" width="84%" align="center">
<p style="LINE-HEIGHT: 150%">
<%
do while not rs2.eof
if request("cat_id")=cstr(rs2("cat_id")) then
response.write "<font color='#ff6600'>"&rs2("cat_name")&"</font>
"
else
response.write "<a href='article.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
%>
</p>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/dotlineh.gif" height="1"></td>
</tr>
</table>
<table width="90%" border="1" cellspacing="0" cellpadding="0" bgcolor="#293863" bordercolor="#808080" style="border-collapse: collapse">
<tr>
<td bgcolor="#EFEFEF" align="center" height="22" class="chinese">本类热门文章</td>
</tr>
<tr>
<td align="left" bgcolor="#ffffff">
<%
set rs3=server.createobject("adodb.recordset")
if request.querystring("cat_id")<>"" then
sql="select top 15 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 15 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
%>
<a href="showart.asp?art_id=<%=rs3("art_id")%>&cat_id=<%=rs3("cat_id")%>">
<font color="#808080">
<%if len(Rs3("art_title"))>14 then
response.write left(Rs3("art_title"),12)&"..."
else
response.write Rs3("art_title")
end if%></font></a><span style='font-size: 7pt;color=000000'>(<%=rs3("art_count")%>)</span>
<%
rs3.movenext
loop
if rs3.eof and rs3.bof then
response.write "没有相关文章"
end if
rs3.close
set rs3=nothing
%>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/dotlineh.gif" height="1"></td>
</tr>
</table>
<table width="90%" border="1" cellspacing="0" cellpadding="0" bgcolor="#293863" bordercolor="#808080" style="border-collapse: collapse">
<form name="form2" method="post" action="article.asp">
<tr>
<td bgcolor="#EFEFEF" align="center" height="22" class="chinese">文章搜索</td>
</tr>
<tr>
<td bgcolor="#EFEFEF" align="center">
<select name="select">
<option value="art_title">搜索文章标题</option>
<option value="art_content">搜索文章内容</option>
</select>
<input type="text" name="keyword" class="textarea" size="20">
<input type="submit" name="search" value=" 搜索 " class="button">
</td>
</tr>
</form>
</table>
<table class="chinese" height="1" cellSpacing="0" cellPadding="5" width="85%" align="center" border="0">
<tr>
<td class="chinese" align="right" height="1">
<p style="LINE-HEIGHT: 150%" align="center"><strong><font color="#666666">本
站 声 明</font></strong></td>
</tr>
<tr>
<td align="right" height="1">
<div align="left">
<font color="#999999">
本站的大部分资料,文章都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我<span lang="zh-cn">们</span>,我<span lang="zh-cn">们</span>将马上进行整理,谢谢。 </font>
</div>
</td>
</tr>
</table>
<%rs2.close
set rs2=nothing
end sub%> |
|