#52004/11/19 17:20:32
下面是代码帮我看怎么改?
<table width="599" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" valign="middle">
<%call ShowNewPhoto(8,True,18)%>
</td>
</tr>
</table>
----------------------------------------------------------------------------------------------------
sub ShowNewPhoto(PhotoNum,ShowTitle,TitleLen)
dim sqlNew,rsNew,i
if PhotoNum>0 and PhotoNum<=100 then
sqlNew="select top " & PhotoNum
else
sqlNew="select top 10 "
end if
sqlNew=sqlNew & " P.PhotoID,P.PhotoName,P.PhotoUrl_Thumb,P.Author,P.Keyword,P.UpdateTime,P.Editor,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.PhotoSize,P.PhotoLevel,P.PhotoPoint from Photo P where P.Deleted=False and P.Passed=True "
sqlNew=sqlNew & " order by P.PhotoID desc"
Set rsNew= Server.CreateObject("ADODB.Recordset")
rsNew.open sqlNew,conn,1,1
if TitleLen<0 or TitleLen>255 then TitleLen=100
response.write "<table border='0' cellpadding='0' cellspacing='5'><tr>"
if rsNew.bof and rsNew.eof then
response.write "<td width='135' align='center'>没有图片</td>"
else
i=1
do while not rsNew.eof
if i mod 9=0 then
resposne.write "</tr><tr>"
end if
response.Write "<td align='center' width='142'>"
response.Write "<TABLE cellSpacing=0 cellPadding=0 align=center border=0>"
response.Write "<TBODY><TR><TD height=8><IMG height=8 src='image/bg_0ltop.gif' width=8></TD>"
response.Write "<TD background='image/bg_01.gif' height=8></TD>"
response.Write "<TD height=8><IMG height=8 src='image/bg_0rtop.gif' width=8></TD></TR>"
response.Write "<TR>"
response.Write "<TD width=8 background='image/bg_03.gif'> </TD>"
response.Write "<TD vAlign=center align=middle bgColor=#ffffff><a href='Photo_Show.asp?PhotoID=" & rsNew("Photoid") & "' title='图片名称:" & rsNew("PhotoName") & vbcrlf & "图片大小:" & rsNew("PhotoSize") & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "下载次数:今日:" & rsNew("DayHits") & " 本周:" & rsNew("WeekHits") & " 本月:" & rsNew("MonthHits") & " 总计:" & rsNew("Hits") & "' target='_blank'><img width='115' height='80' border='0' src='" & rsNew("PhotoUrl_Thumb") & "'></a></TD>"
response.Write "<TD width=8 background='image/bg_04.gif'> </TD></TR>"
response.Write "<TR><TD height=8><IMG height=8 src='image/bg_0lbottom.gif' width=8></TD>"
response.Write "<TD background='image/bg_02.gif' height=8></TD>"
response.Write "<TD height=8><IMG height=8 src='image/bg_0rbottom.gif' width=8></TD></TR></TBODY></TABLE>"
if ShowTitle=True then
response.write "<a href='Photo_Show.asp?PhotoID=" & rsNew("Photoid") & "' title='图片名称:" & rsNew("PhotoName") & vbcrlf & "图片大小:" & rsNew("PhotoSize") & vbcrlf & "作 者:" & rsNew("Author") & vbcrlf & "更新时间:" & rsNew("UpdateTime") & vbcrlf & "下载次数:今日:" & rsNew("DayHits") & " 本周:" & rsNew("WeekHits") & " 本月:" & rsNew("MonthHits") & " 总计:" & rsNew("Hits") & "' target='_blank'>" & gotTopic(rsNew("PhotoName"),TitleLen) & "</a>"
end if
response.write "</td>"
i=i+1
rsNew.movenext
loop
end if
response.write "</tr></table>"
rsNew.close
set rsNew=nothing
end sub