28,391
社区成员
发帖
与我相关
我的任务
分享
<div id="Layer35">
<%
Dim ndate
sql="SELECT * FROM Category ORDER BY CateId"
Set rsCate = conn.Execute(sql)
If rsCate.BOF = False Then
rsCate.MoveFirst
End If
Do while not rsCate.EOF
cid = rsCate("CateId")
cnt = 0
Response.Write " <table width='100%' cellspacing=1 cellpadding=2> <tr><td>"
Response.Write rsCate("CateName") + " == </td></tr>"
Response.Write "<tr><td><table width='100%' border=0 cellspacing=0 ceppadding=0>"
sql = "SELECT * FROM News WHERE CateId=" & cid & "order by Posttime desc"
rs.Open sql,conn,1,1
Do while not rs.eof
cnt = cnt + 2
if cnt < 11 Then
response.write "<tr>"
for j=1 to 2
Response.Write "<td width='50%'>
if not rs.eof then
ndate = DateAdd("d",-3,date())
Response.Write "<td width='50%'> <a onclick='return newwin(this.href);' href='NewsView.asp?id=" + cstr(rs("id")) + "'> "+ rs("Title")+ ""
if rs("Attpic") Then
Response.Write "(附图)"
End If
Response.Write "</a>"
If datediff("d",rs("Posttime"),ndate+time()) <= 0 Then
Response.Write " <img src='pic/new.gif' ALT='最新的信息!' border=0> "
End IF
end if
response write "</td>"
next
response.write "</tr>"
End If
rs.MoveNext
Loop
Response.Write " </table>"
Response.Write " <p align='right'> <a href='#top'>top </a>"
Response.Write " "
Response.Write " <a target='_self' href='Category.asp?flag="+ CStr(cid) +"'>更多信息... </a> </p>"
Response.Write " </td> </tr> </table> </td> </table>"
rs.Close
rsCate.MoveNext
loop
%>
</div>
<%
sql="SELECT * FROM Category ORDER BY CateId"
Set rsCate = conn.Execute(sql)
%>
<%
If rsCate.BOF = False Then
rsCate.MoveFirst
End If
Response.Write " <table width='100%' cellspacing=1 cellpadding=2> <tr>"
Do while not rsCate.EOF
stitle = rsCate("CateName")
cid = rsCate("CateId")
cnt = 0
Response.Write " <td>"
Response.Write " <table width='100%' border=0 cellspacing=0 ceppadding=0>"
Response.Write "<tr><td>"
Response.Write stitle + " == </td></tr>"
sql = "SELECT * FROM News WHERE CateId=" & cid & "order by Posttime desc"
rs.Open sql,conn,1,1
Do while not rs.eof
cnt = cnt + 1
if cnt < 11 Then
Dim ndate
ndate = DateAdd("d",-3,date())
Response.Write " <tr> <td width='50%'> <a onclick='return newwin(this.href);' href='NewsView.asp?id=" + cstr(rs("id")) + "'> "+ rs("Title")+ ""
if rs("Attpic") Then
Response.Write "(附图)"
Response.Write " </a>"
End If
If datediff("d",rs("Posttime"),ndate+time()) <= 0 Then
Response.Write " <img src='pic/new.gif' ALT='最新的信息!' border=0>"
End IF
response.Write " </td></tr>"
End If
rs.MoveNext
Loop
Response.Write " </table></td><td align='right'>"
Response.Write "<a href='#top'>top </a>"
Response.Write " "
Response.Write " <a target='_self' href='Category.asp?flag="+ CStr(cid) +"'>更多信息... </a> </td>"
rs.Close
rsCate.MoveNext
loop
Response.Write "</tr></table>"
%>
</div>