<table class="singleborder" cellspacing=1 width="100%" height=180 align=center>
        <tr>
          <th valign=middle height=25 width="100%">本周下载Top<%=weektop%>
</th>
</tr>
<tr>
<td class=tablebody1 valign=top><%
	dim OldWeek,NewWeek,rs_week,u
	OldWeek = WeekDay(Date())-1
	If OldWeek = 0 Then OldWeek = 7
	OldWeek = Date()-OldWeek
	NewWeek = Date()+(9-WeekDay(Date()))
	set rs_week=server.createobject("adodb.recordset")

	sql="select top "&weektop&" id,showname,weekhits from download where "

	'sql=sql&"stop=0 and weekhits>0 "
if vipshow=2 then 
sqlvip="select * from [DV_user] where username='"&DVBBS.membername&"' and vip=5"
    rs.open sqlvip,conn,1,3
     if not(rs.bof and rs.eof) then
	sql=sql&"  (lasthits < #" & NewWeek & "#) And (lasthits > #" & OldWeek & "#) and stop=0 and weekhits>0 "
   else
   sql=sql&"  (lasthits < #" & NewWeek & "#) And (lasthits > #" & OldWeek & "#) and stop=0 and weekhits>0 and downshow<>6 "
  end if
rs.close
else
 sql=sql&"  (lasthits < #" & NewWeek & "#) And (lasthits > #" & OldWeek & "#) and stop=0 and weekhits>0 "
end if

	sql=sql&" order by weekhits desc"
	rs_week.open sql,conndown,0,1
	if rs_week.eof and rs_week.bof then

for topcount=1 to weektop
%>
本周暂时没有下载<BR>
<%
next
else
u=0
%>
<%do while not rs_week.eof and u<weektop%>
<a href="down_list.asp?id=<%=rs_week("id")%>" title="<%=rs_week("showname")%>"><img src="down_images/s001.gif" border="0"> <%=left(cstr(rs_week("showname")),10)%><font color=red>[<%=rs_week("weekhits")%>]</font></a><br>
<%
	rs_week.movenext
u=u+1
	loop
     
	end if
	rs_week.close
%></td>
        </tr>
</table>