首页新闻有显示推荐内容功能,但是我先实现这样的效果...
asp吧
全部回复
仅看楼主
level 13
金鳌 楼主
首页读取国际新闻一条。
如果国际新闻里面在后台有推荐的新闻,则显示推荐中最新的一条。
如果没有推荐的新闻那么就默认显示最新的一条。
请问大家如何实现那?
代码如下:isGood=true时为推荐的。
---------------------------------------------------------
<%
set rs=server.CreateObject("adodb.recordset")
str="select top 12 * from news where classId=5 order by id desc"
rs.open str,conn,3,1
if not rs.eof and not rs.bof then
i=1
do while not rs.eof
%>
<li>
<a href="/xinwen/article.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>">
<%=rs("title")%>
</a>
</li>
<%
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
%>
2015年05月10日 02点05分 1
1