<!-- #include file="config.asp" -->
<!-- #include file="config_nsort.asp" -->
<!-- #include file="skin.asp" -->
<!-- #include file="jk_ubb.asp" -->
<%
dim nid,sqladd,name,n_jt
n_jt=img_skins()
index_url="down"
n_sort="down"
tit_fir=objv7.format_menu(web_menu,index_url)

sub down_new_hot(nnhead,nmore,nsql,nt,n_num,n_m,c_num,et,tt,lr)
  dim mpic,rs,sql,di,temp1,tim,counter,nhead:nhead=nnhead
  temp1=vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=2>"
  sql="select top "&n_num+n_m&" id,name,username,tim,counter from down where hidden=1"&nsql
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
    if nhead="" then nhead="下载排行"
  case "good"
    sql=sql&" and types=5 order by id desc"
    if nhead="" then nhead="软件推荐"
  case else
    sql=sql&" order by id desc"
    if nhead="" then nhead="软件更新"
  end select
  set rs=conn.execute(sql)
  for di=1 to n_m
    if rs.eof or rs.bof then exit for
    rs.movenext
  next
  'if n_m>0 then rs.move(n_m)
  do while not rs.eof
    name=rs("name"):tim=rs("tim"):counter=rs("counter")
    temp1=temp1&vbcrlf&"<tr><td height="&space_mod&" class=bw>"&n_jt&"<a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&rs("id")&"',1);"" title='软件名称："&objv7.code_html(name,1,0)&"<br>发 布 人："&rs("username")&"<br>下载人次："&counter&"<br>整理时间："&objv7.time_type(tim,88)&"'>"&objv7.code_html(name,1,c_num)&"</a>"
    if tt>0 then temp1=temp1&objv7.format_end(et,objv7.time_type(tim,tt)&",<font class=blue>"&counter&"</font>")
    temp1=temp1&"</td></tr>"
    rs.movenext
  loop
  rs.close:set rs=nothing
  temp1=temp1&vbcrlf&"</table>"
  response.write kong&main_bar(lr,nhead,temp1,lr,"100%",nmore)
end sub

sub down_pic(nnhead,dsql,nt,n_num,c_num)
  dim rs,sql,temp1,nhead:nhead=nnhead
  temp1="<table border=0 width='100%' cellspacing=0 cellpadding=2><tr><td height=3></td></tr><tr align=center valign=top>"
  sql="select top "&n_num&" id,name,tim,pic from down where hidden=1"&dsql
  select case nt
  case "hot"
    sql=sql&" order by counter desc,id desc"
    if nhead="" then nhead="热点排行"
  case "good"
    sql=sql&" and types=5 order by id desc"
    if nhead="" then nhead="酷软推荐"
  case else
    sql=sql&" order by id desc"
    if nhead="" then nhead="最新软件"
  end select
  set rs=conn.execute(sql)
  do while not rs.eof
    name=rs("name"):nid=rs("id")
    temp1=temp1&vbcrlf&"<td width='"&int(100\n_num)&"%'><table border=0 cellspacing=0 cellpadding=2 width='100%' class=tf><tr><td align=center><a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&nid&"',1);""><script language=javascript>pic_url('"&rs("pic")&"',1)</script></a></td></tr>" & _
	  vbcrlf&"<tr><td align=center class=bw><a href='javascript:;' onclick=""javascript:open_view('down_view.asp?id="&nid&"',1);"" class=time_3><b>"&objv7.code_html(name,1,c_num)&"</b></a></td></tr></table></td>"
    rs.movenext
  loop
  rs.close:set rs=nothing
  temp1=temp1&"</tr></table>"
  response.write kong&main_bar(1,nhead,temp1,0,"100%","")
end sub

sub down_remark()
  dim temp1
  temp1=vbcrlf&"<table border=0 width='98%' align=center>" & _
	vbcrlf&"<tr><td>"&n_jt&"本站推荐使用 <a href='down_view.asp?id='>网际快车</a> 或 <a href='down_view.asp?id='>网络蚂蚁</a> 下载软件，一般均可正常下载。</td></tr>" & _
	vbcrlf&"<tr><td>"&n_jt&"如果您发现本站有任何死链或错链问题，请<a href='gbook.asp?action=write'>留言通知管理员</a>，谢谢！</td></tr>" & _
	vbcrlf&"<tr><td>"&n_jt&"本站大多数软件采用 <a href='down_view.asp?id='>WinRAR</a> 及 <a href='down_view.asp?id='>Winzip</a> 压缩，请在此下载最新版本。</td></tr>" & _
	vbcrlf&"<tr><td class=time>"&n_jt&"如果您链接本站本地软件，请注明来自：<a href='"&objv7.web_var(web_config,2)&"'>"&objv7.web_var(web_config,1)&"</a>，谢谢您的支持！</td></tr>" & _
	vbcrlf&"<tr><td>"&n_jt&"本站提供的软件下载仅供使用！如有侵权，请及时 <a href='gbook.asp?action=write'>告知我们</a> 将之移除！</td></tr>" & _
	vbcrlf&"<tr><td>"&n_jt&"欢迎大家到本站论坛：<a href='forum.asp'>"&objv7.format_menu(web_menu,"forum")&"</a> 发表和交流您的见解。多谢您的访问！</td></tr>" & _
	vbcrlf&"</table>"
  response.write kong&main_bar(1,"软件下载说明",temp1,0,"100%","")&kong
end sub

sub down_tool()
  dim temp1
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=3 class=tf><tr><td height=5></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_winrar.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=10'>WinRAR中文版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_qq.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=54'>QQ去广告显IP版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_winamp.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=17'>Winamp中文版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_realone.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=56'>RealOnePlay</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_wmp.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=57'>Midia Player</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_flashget.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=15'>Flashget中文版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_cuteftp.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=12'>CuteFtp中文版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_acdsee.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=58'>ACDSee中文版</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_supperrabbit.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=59'>超级兔子设置</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_wopti.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=8'>Windows优化</a></td></tr>" & _
	vbcrlf&"<tr><td><img src='images/down/tool_norton.gif' border=0 align=absmiddle>&nbsp;<a href='down_view.asp?id=55'>Norton中文版</a></td></tr>" & _
	vbcrlf&"</table>"
  response.write kong&main_bar(1,"常用工具",temp1,0,"100%","")
end sub

sub down_atat()
  dim temp1,num1,num2,num3,sq,rs
  sql="select count(id) from down where hidden=1 and tim>=#"&formatdatetime(formatdatetime(now_time,2))&"#"
  set rs=conn.execute(sql)
  num1=rs(0)
  rs.close
  'sql="select num_down from configs where id=1"
  sql="select count(id) from down where hidden=1"
  set rs=conn.execute(sql)
  num2=rs(0)
  rs.close
  sql="select sum(counter) from down where hidden=1"
  set rs=conn.execute(sql)
  num3=rs(0)
  rs.close:set rs=nothing
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=3><tr><td height=5></td></tr>" & _
	vbcrlf&"<tr><td>今日更新：<font class=time>"&num1&"</font>个软件</td></tr>" & _
	vbcrlf&"<tr><td>软件总数：<font class=time>"&num2&"</font>个软件</td></tr>" & _
	vbcrlf&"<tr><td>总下载：<font class=time>"&num3&"</font>人次</td></tr>" & _
	vbcrlf&"<tr><td>[ <a href='down_list.asp'>→ 浏览软件分类</a> ]</td></tr>" & _
	vbcrlf&"<tr><td>[ <a href='gbook.asp?action=write'>→ 下载链接报错</a> ]</td></tr>" & _
	vbcrlf&"<tr><td>"&put_type("down")&"</td></tr>" & _
	vbcrlf&"</table>"
  response.write kong&main_bar(1,"栏目统计",temp1,0,"100%","")
end sub

sub down_main()
  dim rs2,sql2
  if cid=0 then
    sql2="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
    set rs2=conn.execute(sql2)
    do while not rs2.eof
      nid=rs2("c_id"):sqladd=" and c_id="&nid
%>
<tr align=center valign=top>
<td><%call down_new_hot("<a href='down_list.asp?c_id="&nid&"'>"&rs2("c_name")&"</a>","<a href='down_list.asp?c_id="&nid&"&action=more'>"&morepic&"</a>",sqladd,"new",15,0,30,1,1,0)%></td>
<td></td>
<td><%
call down_new_hot("本类排行","",sqladd,"hot",5,0,11,1,0,0)
call down_pic("本类推荐",sqladd,"good",1,10)
%></td>
</tr>
<%
      rs2.movenext
    loop
    rs2.close:set rs2=nothing
  else
    if sid=0 then
      sql2="select s_id,s_name from jk_sort where c_id="&cid&" order by s_order"
      set rs2=conn.execute(sql2)
      do while not rs2.eof
        nid=rs2("s_id"):sqladd=" and c_id="&cid&" and s_id="&nid
%>
<tr align=center valign=top>
<td><%call down_new_hot("<a href='down_list.asp?c_id="&cid&"&s_id="&nid&"'>"&rs2("s_name")&"</a>","<a href='down_list.asp?c_id="&cid&"&s_id="&nid&"&action=more'>"&morepic&"</a>",sqladd,"new",10,0,30,1,1,1)%></td>
<td></td>
<td><%
call down_new_hot("本类排行","",sqladd,"hot",10,0,11,1,0,1)
'call down_pic("本类推荐",sqladd,"good",1,10)
%></td>
</tr>
<%
        rs2.movenext
      loop
      rs2.close:set rs2=nothing
    else
      sql2="select jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
      set rs2=conn.execute(sql2)
      if rs2.eof and rs2.bof then
        rs2.close:set rs2=nothing
        cid=0:sid=0
        call down_main():exit sub
      end if
      sqladd=" and c_id="&cid&" and s_id="&sid
%>
<tr align=center>
<td colspan=3><%call down_pic("本类推荐",sqladd,"good",5,20)%></td>
</tr>
<tr align=center valign=top>
<td><%call down_new_hot("<a href='down_list.asp?c_id="&cid&"'>"&rs2("c_name")&"</a> → <a href='down_list.asp?c_id="&cid&"&s_id="&sid&"'>"&rs2("s_name")&"</a>","<a href='down_list.asp?c_id="&cid&"&s_id="&sid&"&action=more'>"&morepic&"</a>",sqladd,"new",20,0,30,1,1,1)%></td>
<td></td>
<td><%
call down_new_hot("本类排行","",sqladd,"hot",20,0,11,1,0,1)
%></td>
</tr>
<%
      rs2.close:set rs2=nothing
    end if
  end if
end sub

sub down_more2(c_num,tt)
  dim temp1,tim,cnum,sql2,mhead,topic,sql,rs,cname,sname,remark
  pageurl="?action=more&"
  keyword=objv7.code_form(request.querystring("keyword"))
  sea_type=trim(request.querystring("sea_type"))
  if sea_type<>"username" then sea_type="topic"
  call cid_sid_sql(2,sea_type)
  
  temp1=vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=2><tr><td colspan=5 height=5></td></tr>" & _
	vbcrlf&"<tr><td colspan=5 height=1 background='images/bg_dian.gif'></td></tr>" & _
	vbcrlf&"<tr align=center height=15 class=summary-title>" & _
	vbcrlf&"<td width='6%'>序号</td>" & _
	vbcrlf&"<td width='52%'>软件名称</td>" & _
	vbcrlf&"<td width='20%'>整理日期</td>" & _
	vbcrlf&"<td width='12%'>推荐等级</td>" & _
	vbcrlf&"<td width='10%'>下载次数</td>" & _
	vbcrlf&"</tr>" & _
	vbcrlf&"<tr><td colspan=5 height=1 background='images/bg_dian.gif'></td></tr>"
  sql="select id,topic,username,tim,counter,types,remark from down where hidden=1 "&sqladd
  if cid>0 then
    sql=sql&" and c_id="&cid
    if sid>0 then
      sql=sql&" and s_id="&sid
      sql2="select jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
    else
      sql2="select c_name from jk_class where c_id="&cid
    end if
  end if
  sql=sql&" order by id desc"
  
  if cid>0 then
    set rs=conn.execute(sql2)
    if rs.eof and rs.bof then rs.close:set rs=nothing:call down_main():exit sub
    cname=objv7.code_html(rs("c_name"),1,0)
    if sid>0 then sname=objv7.code_html(rs("s_name"),1,0)
    rs.close
  else
    cname="搜索结果"
  end if
  mhead="<a href='down_list.asp?c_id="&cid&"'>"&cname&"</a>"
  if cid>0 and sid>0 then mhead=mhead&"&nbsp;→&nbsp;<a href='down_list.asp?c_id="&cid&"&s_id="&sid&"'>"&sname&"</a>"
  
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  call format_pagecute()
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
    topic=rs("topic"):tim=rs("tim")
    temp1=temp1&vbcrlf&"<tr><td>"&i+(viewpage-1)*nummer&".</td>" & _
	  vbcrlf&"<td><a href='down_view.asp?id="&rs("id")&"'"&atb&" title='软件名称："&code_html(topic,1,0)&"<br>发 布 人："&rs("username")&"<br>整理时间："&tim&"'>"&code_html(topic,1,c_num)&"</a></td>" & _
	  vbcrlf&"<td>"&time_type(tim,tt)&"</td>" & _
	  vbcrlf&"<td><img src='images/down/star"&rs("types")&".gif' border=0></td>" & _
	  vbcrlf&"<td align=center class=blue>"&rs("counter")&"</td></tr>" & _
	  vbcrlf&"<tr><td colspan=5 height=1 background='images/bg_dian.gif'></td></tr>" & _
	  vbcrlf&"<tr><td height=10 colspan=5><li>"&code_jk(rs("remark"))&"</td></tr>" & _
	  vbcrlf&"<tr><td colspan=5 height=1 background='images/bg_dian.gif'></td></tr>"
    rs.movenext
  next
  rs.close:set rs=nothing
  temp1=temp1&vbcrlf&"<tr class=summary-title><td colspan=5 height=25 valign=bottom>" & _
	vbcrlf&"本栏共有&nbsp;<font class=time>"&rssum&"</font>&nbsp;个软件&nbsp;" & _
	vbcrlf&"页次：<font class=time>"&viewpage&"</font>/<font class=time>"&thepages&"</font>&nbsp;" & _
	vbcrlf&"分页："&objv7.jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")& _
	vbcrlf&"</td></tr></table>"
  response.write "<tr><td colspan=3 align=center>"&kong&main_bar(1,mhead,temp1,0,"100%","")&"</td></tr>"
end sub


sub down_more(c_num,tt)
  dim temp1,tim,cnum,sql2,mhead,name,sql,rs,cname,sname
  pageurl="?action=more&"
  keyword=objv7.code_form(request.querystring("keyword"))
  sea_type=trim(request.querystring("sea_type"))
  if sea_type<>"username" then sea_type="name"
  call cid_sid_sql(2,sea_type)
  
  temp1=vbcrlf&"<table border=0 width='100%' cellspacing=1 cellpadding=2>" & _
	vbcrlf&"<tr align=center valign=bottom class=tdbg-tree>" & _
	vbcrlf&"<td width='5%'>序号</td>" & _
	vbcrlf&"<td width='53%'>软件名称</td>" & _
	vbcrlf&"<td width='20%'>更新时间</td>" & _
	vbcrlf&"<td width='12%'>软件评价</td>" & _
	vbcrlf&"<td width='10%'>下载次数</td>" & _
	vbcrlf&"</tr>"
  sql="select id,name,username,tim,counter,types,remark,os,genre from down where hidden=1 "&sqladd
  if cid>0 then
    sql=sql&" and c_id="&cid
    if sid>0 then
      sql=sql&" and s_id="&sid
      sql2="select jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
    else
      sql2="select c_name from jk_class where c_id="&cid
    end if
  end if
  sql=sql&" order by id desc"
  
  if cid>0 then
    set rs=conn.execute(sql2)
    if rs.eof and rs.bof then rs.close:set rs=nothing:call down_main():exit sub
    cname=objv7.code_html(rs("c_name"),1,0)
    if sid>0 then sname=objv7.code_html(rs("s_name"),1,0)
    rs.close
  else
    cname="搜索结果"
  end if
  mhead="<a href='down_list.asp?c_id="&cid&"'>"&cname&"</a>"
  if cid>0 and sid>0 then mhead=mhead&"&nbsp;→&nbsp;<a href='down_list.asp?c_id="&cid&"&s_id="&sid&"'>"&sname&"</a>"
  
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  call format_pagecute()
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
    name=rs("name"):tim=rs("tim")
    temp1=temp1&vbcrlf&"<tr class=tdbg-dark><td>"&i+(viewpage-1)*nummer&".</td>" & _
	  vbcrlf&"<td><a href='down_view.asp?id="&rs("id")&"'><font class=hit>"&objv7.code_html(name,1,c_num)&"</font></a></td>" & _
	  vbcrlf&"<td>"&objv7.time_type(tim,tt)&"</td>" & _
	  vbcrlf&"<td><img src='images/down/star"&rs("types")&".gif' border=0></td>" & _
	  vbcrlf&"<td align=center class=hit>"&rs("counter")&"</td></tr>" & _
	  vbcrlf&"<tr><td colspan=5 height=3></td></tr>" & _
	  vbcrlf&"<tr><td height=10 colspan=5><li>&nbsp;"&objv7.code_html(rs("remark"),1,50)&"</td></tr>" & _
	  vbcrlf&"<tr><td colspan=5 height=3></td></tr>" & _
	  vbcrlf&"<tr><td height=10 colspan=5 class=gray>软件类别：<a href='down_list.asp?c_id="&cid&"&s_id="&sid&"'>"&sname&"</a>&nbsp;&nbsp;运行环境："&rs("os")&"&nbsp;&nbsp;授权方式："&rs("genre")&"</td></tr>" & _
	  vbcrlf&"<tr><td colspan=5 height=1 background='images/bg_dian.gif'></td></tr>"
    rs.movenext
  next
  rs.close:set rs=nothing
  temp1=temp1&vbcrlf&"<tr><td colspan=5 height=25 valign=bottom>" & _
	vbcrlf&"本栏共有&nbsp;<font class=time>"&rssum&"</font>&nbsp;个软件&nbsp;" & _
	vbcrlf&"页次：<font class=time>"&viewpage&"</font>/<font class=time>"&thepages&"</font>&nbsp;" & _
	vbcrlf&"分页："&objv7.jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")& _
	vbcrlf&"</td></tr></table>"
  response.write "<tr><td colspan=3 align=center>"&kong&main_bar(1,mhead,temp1,0,"100%","")&"</td></tr>"
end sub

sub down_sea()
  dim temp1,nid,nid2,rs,sql,rs2,sql2
  temp1=vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 align=center>" & _
        vbcrlf&"<script language=javascript><!--" & _
        vbcrlf&"function down_sea()" & _
        vbcrlf&"{" & _
        vbcrlf&"  if (down_sea_frm.keyword.value==""请输入关键字"")" & _
        vbcrlf&"  {" & _
        vbcrlf&"    alert(""请在搜索软件前先输入要查询的 关键字 ！"");" & _
        vbcrlf&"    down_sea_frm.keyword.focus();" & _
        vbcrlf&"    return false;" & _
        vbcrlf&"  }" & _
        vbcrlf&"}" & _
        vbcrlf&"--></script>" & _
        vbcrlf&"<form name=down_sea_frm action='down_list.asp' method=get onsubmit=""return down_sea()"">" & _
        vbcrlf&"<input type=hidden name=action value='more'><tr><td height=3></td></tr>" & _
        vbcrlf&"<tr><td>" & _
        vbcrlf&"  <table border=0><tr>" & _
        vbcrlf&"  <td><select name=sea_type sizs=1><option value='name'>软件名称</option><option value='username'>发布人</option></seelct></td>" & _
        vbcrlf&"  <td><input type=text name=keyword value='请输入关键字' onfocus=""if (value =='请输入关键字'){value =''}"" onblur=""if (value ==''){value='请输入关键字'}"" size=12 maxlength=20></td>" & _
        vbcrlf&"  </tr></table>" & _
        vbcrlf&"</td></tr><tr><td>" & _
        vbcrlf&"  <table border=0><tr>" & _
        vbcrlf&"  <td><script language=javascript src='style/select_down.js'></script></td>" & _
        vbcrlf&"  <td><input type=image src='images/small/search_go.gif' border=0></td>" & _
        vbcrlf&"  </tr></table>" & _
        vbcrlf&"</td></tr>" & _
        vbcrlf&"</form><tr><td height=1></td></tr></table>"
  response.write kong&main_bar(0,"软件搜索",temp1,0,"100%","")
end sub
%>