我想吧下面代码改成2行4列显示 20
subindex_newsno(num,fontnum,classid,classyes,NewWindows,ImgWidth,ImgHeight)'ImgWidth,...
sub index_newsno(num,fontnum,classid,classyes,NewWindows,ImgWidth,ImgHeight)'ImgWidth,ImgHeight新加
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='100%'>"
if classid=0 then
sql="select top "&num&" * from news where passed=0 ORDER by istop desc,news_id DESC"
else
sql="select top "&num&" * from news where passed=0 and (cat_id="&classid&" or cat_id in(select cat_id from newcat where sid="&classid&")) order by istop desc,news_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""
end if
dim uclass
if classyes=True then
uclass="<a href='news.asp?cat_id="&rs("cat_id")&"'>『"&rscat("cat_name")&"』</a>"
else
uclass=""
end if
Response.Write "<tr><td><a href='shownews.asp?news_id="&rs("news_id")&"' "& nnn &" Title='新闻名称:"&rs("news_title")&" 上传时间:"&rs("news_date")&" 浏览指数:"&rs("news_count")&"'><font color="&rs("news_color")&">"&gotTopic(rs("news_title"),fontnum)&"</font></a>" & vbCrLf
if DateDiff("h",rs("news_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内新闻'>" & vbCrLf
end if
if rs("isimg")=1 then
'''''Response.Write "<img src='img/img.gif' alt='图片新闻' align=absmiddle border=0>" & vbCrLf
Response.Write "</td><td align=center>" & vbCrLf '*****
Response.Write "<a href='Shownews.asp?news_id="&rs("news_id")&"'><img src='"&rs("images")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a> " '****
Response.Write "</td></tr>" & vbcrlf
else
response.Write "暂无图片" '****
end if
Response.Write "</td><td align=right>" & vbCrLf
'Response.Write ""&Right("0"&year(rs("news_date")),4)&"-"&Right("0"&month(rs("news_date")),2)&"-"&right("0"&day(rs("news_date")),2)&"" & vbCrLf
Response.Write "</td></tr>" & vbCrLf
rscat.close
set rscat=nothing
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<font color=""#666666"">目前尚无任何新闻!</font>"
end if
if not rs.eof or not rs.bof then
end if
rs.close
set rs=nothing
Response.Write "</table>"
end sub 展开
Response.Write "<table border=0 cellspacing=0 cellpadding=0 width='100%'>"
if classid=0 then
sql="select top "&num&" * from news where passed=0 ORDER by istop desc,news_id DESC"
else
sql="select top "&num&" * from news where passed=0 and (cat_id="&classid&" or cat_id in(select cat_id from newcat where sid="&classid&")) order by istop desc,news_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""
end if
dim uclass
if classyes=True then
uclass="<a href='news.asp?cat_id="&rs("cat_id")&"'>『"&rscat("cat_name")&"』</a>"
else
uclass=""
end if
Response.Write "<tr><td><a href='shownews.asp?news_id="&rs("news_id")&"' "& nnn &" Title='新闻名称:"&rs("news_title")&" 上传时间:"&rs("news_date")&" 浏览指数:"&rs("news_count")&"'><font color="&rs("news_color")&">"&gotTopic(rs("news_title"),fontnum)&"</font></a>" & vbCrLf
if DateDiff("h",rs("news_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内新闻'>" & vbCrLf
end if
if rs("isimg")=1 then
'''''Response.Write "<img src='img/img.gif' alt='图片新闻' align=absmiddle border=0>" & vbCrLf
Response.Write "</td><td align=center>" & vbCrLf '*****
Response.Write "<a href='Shownews.asp?news_id="&rs("news_id")&"'><img src='"&rs("images")&"' width='"&ImgWidth&"' height='"&ImgHeight&"'></a> " '****
Response.Write "</td></tr>" & vbcrlf
else
response.Write "暂无图片" '****
end if
Response.Write "</td><td align=right>" & vbCrLf
'Response.Write ""&Right("0"&year(rs("news_date")),4)&"-"&Right("0"&month(rs("news_date")),2)&"-"&right("0"&day(rs("news_date")),2)&"" & vbCrLf
Response.Write "</td></tr>" & vbCrLf
rscat.close
set rscat=nothing
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<font color=""#666666"">目前尚无任何新闻!</font>"
end if
if not rs.eof or not rs.bof then
end if
rs.close
set rs=nothing
Response.Write "</table>"
end sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询