<%@language=vbscript codepage=936 %> <% option explicit response.buffer=true '强制浏览器重新访问服务器下载页面,而不是从缓存读取页面 Response.Buffer = True Response.Expires = -1 Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" %> <% dim strChannel,sqlChannel,rsChannel,ChannelUrl,ChannelName dim SoftID,SoftTitle dim FileName,strFileName,MaxPerPage,ShowSmallClassType dim totalPut,CurrentPage,TotalPages dim BeginTime,EndTime dim founderr, errmsg dim ClassID,SpecialID,keyword,strField,SpecialName dim rs,sql,sqlSoft,rsSoft,sqlSearch,rsSearch,rsPic,sqlSpecial,rsSpecial,sqlUser,rsUser dim tClass,ClassName,RootID,ParentID,Depth,ParentPath,Child,SkinID,LayoutID,LayoutFileName,ChildID,tID,tChild dim tSpecial dim strPic,AnnounceCount dim PageTitle,strPath,strPageTitle dim strClassTree BeginTime=Timer SoftID=trim(request("SoftID")) ClassID=trim(request("ClassID")) SpecialID=trim(request("SpecialID")) strField=trim(request("Field")) keyword=trim(request("keyword")) UserLogined=CheckUserLogined() if SoftId="" then SoftID=0 else SoftID=Clng(SoftID) end if if ClassID<>"" then ClassID=CLng(ClassID) else ClassID=0 end if if SpecialID="" then SpecialID=0 else SpecialID=CLng(SpecialID) end if if UserLevel="" then UserLevel=5000 else UserLevel=Cint(UserLevel) end if strPath= " 您现在的位置: " & SiteName & "" strPageTitle= SiteTitle if ShowSiteChannel="Yes" then strChannel= "| " sqlChannel="select * from Channel order by OrderID" set rsChannel=server.CreateObject("adodb.recordset") rsChannel.open sqlChannel,conn,1,1 do while not rsChannel.eof if rsChannel("ChannelID")=ChannelID then ChannelUrl=rsChannel("LinkUrl") ChannelName=rsChannel("ChannelName") strChannel=strChannel & "" & ChannelName & " | " else strChannel=strChannel & "" & rsChannel("ChannelName") & " | " end if rsChannel.movenext loop rsChannel.close set rsChannel=nothing strPath=strPath & " >> " & ChannelName & "" strPageTitle=strPageTitle & " >> " & ChannelName end if if SoftID>0 then sql="select * from Soft where SoftID=" & SoftID & "" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,3 if rs.bof and rs.eof then FoundErr=True ErrMsg=ErrMsg & "
  • 你要找的文件不存在,或者已经被管理员删除!
  • " else ClassID=rs("ClassID") 'SpecialID=rs("SpecialID") 'SkinID=rs("SkinID") 'LayoutID=rs("LayoutID") SoftTitle=rs("SoftName") & " " & rs("SoftVersion") end if end if if ClassID>0 then sql="select C.ClassName,C.RootID,C.ParentID,C.Depth,C.ParentPath,C.Child,C.SkinID,L.LayoutID,L.LayoutFileName,C.BrowsePurview From SoftClass C" sql=sql & " inner join Layout L on C.LayoutID=L.LayoutID where C.ClassID=" & ClassID set tClass=conn.execute(sql) if tClass.bof and tClass.eof then FoundErr=True ErrMsg=ErrMsg & "
  • 找不到指定的栏目
  • " Call WriteErrMsg() response.end else if tClass(9)
  • 对不起,你没有浏览本栏目的权限!
  • " ErrMsg=ErrMsg & "你不是" & CheckLevel(tClass(9)) & "!" Call WriteErrMsg() response.end else ClassName=tClass(0) RootID=tClass(1) ParentID=tClass(2) Depth=tClass(3) ParentPath=tClass(4) Child=tClass(5) if SoftID<=0 then SkinID=tClass(6) LayoutID=tClass(7) end if LayoutFileName=tClass(8) strPath=strPath & " >> " strPageTitle=strPageTitle & " >> " if ParentID>0 then dim sqlPath,rsPath sqlPath="select SoftClass.ClassID,SoftClass.ClassName,Layout.LayoutFileName,Layout.LayoutID From SoftClass" sqlPath= sqlPath & " inner join Layout on SoftClass.LayoutID=Layout.LayoutID where SoftClass.ClassID in (" & ParentPath & ") order by SoftClass.Depth" set rsPath=server.createobject("adodb.recordset") rsPath.open sqlPath,conn,1,1 do while not rsPath.eof strPath=strPath & "" & rsPath(1) & " >> " strPageTitle=strPageTitle & rsPath(1) & " >> " rsPath.movenext loop rsPath.close set rsPath=nothing end if strPath=strPath & "" & ClassName & "" strPageTitle=strPageTitle & ClassName end if end if end if if SpecialID>0 then sql="select S.SpecialID,S.SpecialName,S.SkinID,S.LayoutID,L.LayoutFileName,S.BrowsePurview from Special S inner join Layout L on L.LayoutID=S.LayoutID where S.SpecialID=" & SpecialID set tSpecial=conn.execute(sql) if tSpecial.bof and tSpecial.eof then founderr=True ErrMsg=ErrMsg & "
  • 找不到指定的栏目
  • " Call WriteErrMsg() response.end else if tSpecial(5)
  • 对不起,你没有浏览本专题的权限!
  • " ErrMsg=ErrMsg & "你不是" & CheckLevel(tSpecial(5)) & "!" Call WriteErrMsg() response.end else SpecialName=tSpecial(1) if SoftID<=0 then SkinID=tSpecial(2) LayoutID=tSpecial(3) end if LayoutFilename=tSpecial(4) strPath=strPath & " >> [专题]" & SpecialName & "" strPageTitle=strPageTitle & " >> [专题]" & SpecialName end if end if end if if keyword<>"" then keyword=ReplaceBadChar(keyword) end if if request("page")<>"" then currentPage=cint(request("page")) else currentPage=1 end if '================================================= '过程名:ShowRootClass '作 用:显示一级栏目(无特殊效果) '参 数:无 '================================================= sub ShowRootClass() dim sqlRoot,rsRoot sqlRoot="select C.ClassID,C.ClassName,C.RootID,L.LayoutFileName,C.LinkUrl From SoftClass C" sqlRoot= sqlRoot & " inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=0 and C.ShowOnTop=True order by C.RootID" Set rsRoot= Server.CreateObject("ADODB.Recordset") rsRoot.open sqlRoot,conn,1,1 if rsRoot.bof and rsRoot.eof then response.Write("还没有任何栏目,请首先添加栏目。") else if ClassID>0 then response.write "| "&ChannelName&"首页 |" else response.write "| "&ChannelName&"首页 |" end if do while not rsRoot.eof if rsRoot(4)<>"" then response.write " " & rsRoot(1) & " |" else if rsRoot(2)=RootID then response.Write " " & rsRoot(1) & " |" else response.Write " " & rsRoot(1) & " |" end if end if rsRoot.movenext loop end if rsRoot.close set rsRoot=nothing if ShowMyStyle="Yes" then response.write " 自选风格 |" end if end sub dim pNum,pNum2 pNum=1 pNum2=0 '================================================= '过程名:ShowRootClass_Menu '作 用:显示一级栏目(下拉菜单效果) '参 数:无 '================================================= sub ShowRootClass_Menu() response.write "" & vbcrlf end sub sub GetClassMenu(ID,ShowType) dim sqlClass,rsClass,k if pNum=1 then response.write "stm_bp('p" & pNum & "',[1,4,0,0,2,3,6,7,100,'progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.43)',-2,'',-2,67,2,3,'#999999','#ffffff','',3,1,1,'#aca899']);" & vbcrlf else if ShowType=0 then response.write "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,4,0,0,2,3,6]);" & vbcrlf else response.write "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,2,-2,-3,2,3,0]);" & vbcrlf end if end if k=0 sqlClass="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child,C.Readme From SoftClass C" sqlClass= sqlClass & " inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=" & ID & " order by C.OrderID asc" Set rsClass= Server.CreateObject("ADODB.Recordset") rsClass.open sqlClass,conn,1,1 do while not rsClass.eof if rsClass(5)<>"" then if rsClass(6)>0 then response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rsClass(1) & "','','',-1,-1,0,'" & rsClass(5) & "','_blank','" & rsClass(5) & "','" & rsClass(7) & "','','',6,0,0,'images/arrow_r.gif','images/arrow_w.gif',7,7,0,0,1,'#ffffff',0,'#cccccc',0,'','',3,3,0,0,'#fffff7','#000000','#000000','#ffffff','9pt 宋体']);" & vbcrlf pNum=pNum+1 pNum2=pNum2+1 call GetClassMenu(rsClass(0),1) else response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rsClass(1) & "','','',-1,-1,0,'" & rsClass(5) & "','_blank','" & rsClass(5) & "','" & rsClass(7) & "','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',0,'','',3,3,0,0,'#fffff7','#ff0000','#000000','#cc0000','9pt 宋体']);" & vbcrlf end if else if rsClass(6)>0 then response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rsClass(1) & "','','',-1,-1,0,'" & rsClass(3) & "?ClassID=" & rsClass(0) & "','_self','" & rsClass(3) & "?ClassID=" & rsClass(0) & "','" & rsClass(7) & "','','',6,0,0,'images/arrow_r.gif','images/arrow_w.gif',7,7,0,0,1,'#ffffff',0,'#cccccc',0,'','',3,3,0,0,'#fffff7','#000000','#000000','#ffffff','9pt 宋体']);" & vbcrlf pNum=pNum+1 pNum2=pNum2+1 call GetClassMenu(rsClass(0),1) else response.write "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & rsClass(1) & "','','',-1,-1,0,'" & rsClass(3) & "?ClassID=" & rsClass(0) & "','_self','" & rsClass(3) & "?ClassID=" & rsClass(0) & "','" & rsClass(7) & "','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',0,'','',3,3,0,0,'#fffff7','#ff0000','#000000','#cc0000','9pt 宋体']);" & vbcrlf end if end if k=k+1 rsClass.movenext loop rsClass.close set rsClass=nothing response.write "stm_ep();" & vbcrlf end sub '================================================= '过程名:ShowJumpClass '作 用:显示“跳转栏目到…”下拉列表框 '参 数:无 '================================================= sub ShowJumpClass() response.write "
    " end sub '================================================= '过程名:ShowClass_Tree '作 用:显示所有栏目(树形目录效果) '参 数:无 '================================================= sub ShowClass_Tree() dim arrShowLine(20) for i=0 to ubound(arrShowLine) arrShowLine(i)=False next dim rsClass,sqlClass,tmpDepth,i sqlClass="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child From SoftClass C" sqlClass= sqlClass & " inner join Layout L on C.LayoutID=L.LayoutID order by C.RootID,C.OrderID" set rsClass=server.CreateObject("adodb.recordset") rsClass.open sqlClass,conn,1,1 if rsClass.bof and rsClass.bof then strClassTree="没有任何栏目" else strClassTree="" do while not rsClass.eof tmpDepth=rsClass(2) if rsClass(4)>0 then arrShowLine(tmpDepth)=True else arrShowLine(tmpDepth)=False end if if tmpDepth>0 then for i=1 to tmpDepth if i=tmpDepth then if rsClass(4)>0 then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if else if arrShowLine(i)=True then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if end if next end if if rsClass(6)>0 then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if if rsClass(5)="" then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if if rsClass(2)=0 then strClassTree=strClassTree & "" & rsClass(1) & "" else strClassTree=strClassTree & rsClass(1) end if 'if rsClass(5)<>"" then ' strClassTree=strClassTree & "(外)" 'end if strClassTree=strClassTree & "" if rsClass(6)>0 then strClassTree=strClassTree & "(" & rsClass(6) & ")" end if strClassTree=strClassTree & "
    " rsClass.movenext loop end if rsClass.close set rsClass=nothing response.write strClassTree end sub '================================================= '过程名:ShowChildClass '作 用:显示当前栏目的下一级子栏目 '参 数:ShowType--------显示方式,1为竖向列表,2为横向列表 '================================================= sub ShowChildClass(ShowType) dim sqlChild,rsChild,i sqlChild="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.NextID,C.LinkUrl,C.Child From SoftClass C" sqlChild= sqlChild & " inner join Layout L on C.LayoutID=L.LayoutID where C.ParentID=" & ClassID & " order by C.OrderID" Set rsChild= Server.CreateObject("ADODB.Recordset") rsChild.open sqlChild,conn,1,1 if rsChild.bof and rsChild.eof then response.write "没有任何子栏目" else if ShowType=1 then do while not rsChild.eof if rsChild(5)<>"" then response.write "
  • " & rsChild(1) & "
  • " else response.Write "
  • " & rsChild(1) & "
  • " end if if rsChild(6)>0 then response.write "(" & rsChild(6) & ")" end if response.write "
    " rsChild.movenext loop else i=0 do while not rsChild.eof if rsChild(5)<>"" then response.write "  " & rsChild(1) & "" else response.Write "  " & rsChild(1) & "" end if if rsChild(6)>0 then response.write "(" & rsChild(6) & ")" end if rsChild.movenext i=i+1 if i mod 5=0 then response.write "
    " end if loop end if end if rsChild.close set rsChild=nothing end sub '================================================= '过程名:ShowClassNavigation '作 用:显示栏目导航 '参 数:无 '================================================= sub ShowClassNavigation() dim rsNavigation,sqlNavigation,strNavigation,PrevRootID,i sqlNavigation="select C.ClassID,C.ClassName,C.Depth,L.LayoutFileName,C.RootID,C.LinkUrl,C.Child,C.Readme From SoftClass C" sqlNavigation= sqlNavigation & " inner join Layout L on C.LayoutID=L.LayoutID where C.Depth<=1 order by C.RootID,C.OrderID" Set rsNavigation= Server.CreateObject("ADODB.Recordset") rsNavigation.open sqlNavigation,conn,1,1 if rsNavigation.bof and rsNavigation.eof then response.write "没有任何栏目" else strNavigation="
    " & rsNavigation(1) & "" PrevRootID=rsNavigation(4) rsNavigation.movenext i=1 do while not rsNavigation.eof if PrevRootID=rsNavigation(4) then if i mod 6=0 then strNavigation=strNavigation & "
    " end if strNavigation=strNavigation & "" & rsNavigation(1) & "  " i=i+1 else strNavigation=strNavigation & "
    " & rsNavigation(1) & "" i=1 end if PrevRootID=rsNavigation(4) rsNavigation.movenext loop strNavigation=strNavigation & "
    " response.write strNavigation end if rsNavigation.close set rsNavigation=nothing end sub '================================================= '过程名:ShowSiteCount '作 用:显示站点统计信息 '参 数:无 '================================================= sub ShowSiteCount() dim sqlCount,rsCount Set rsCount= Server.CreateObject("ADODB.Recordset") sqlCount="select count(SoftID) from Soft where Deleted=False" rsCount.open sqlCount,conn,1,1 response.write "下载总数:" & rsCount(0) & "个
    " rsCount.close sqlCount="select count(SoftID) from Soft where Passed=False and Deleted=False" rsCount.open sqlCount,conn,1,1 response.write "待审下载:" & rsCount(0) & "个
    " rsCount.close sqlCount="select count(CommentID) from SoftComment" rsCount.open sqlCount,conn,1,1 response.write "下载评论:" & rsCount(0) & "条
    " rsCount.close 'sqlCount="select count(SpecialID) from Special" 'rsCount.open sqlCount,conn,1,1 'response.write "下载专题:" & rsCount(0) & "个
    " 'rsCount.close sqlCount="select sum(Hits) from Soft" rsCount.open sqlCount,conn,1,1 response.write "文件下载:" & rsCount(0) & "人次
    " rsCount.close sqlCount="select count(" & db_User_ID & ") from " & db_User_Table & "" rsCount.open sqlCount,Conn_User,1,1 response.write "注册用户:" & rsCount(0) & "名
    " rsCount.close set rsCount=nothing end sub '================================================= '过程名:ShowSoft '作 用:分页显示软件标题等信息 '参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowSoft(TitleLen,strClassID) if TitleLen<0 or TitleLen>200 then TitleLen=50 end if sqlSoft="select S.SoftID,S.ClassID,C.ClassName,L.LayoutFileName,S.SoftName,S.SoftVersion,S.Author,S.AuthorEmail,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.OnTop,S.Elite,S.Passed,S.Stars,S.SoftLevel,S.SoftPoint from Soft S" sqlSoft=sqlSoft & " inner join (SoftClass C inner join Layout L on C.LayoutID=L.LayoutID) on S.ClassID=C.ClassID where S.Deleted=False and S.Passed=True " 'if SpecialID>0 then ' sqlSoft=sqlSoft & " and S.SpecialID=" & SpecialID 'end if if instr(strClassID,",")>0 then sqlSoft=sqlSoft & " and S.ClassID in (" & strClassID & ")" else sqlSoft=sqlSoft & " and S.ClassID=" & Clng(strClassID) end if sqlSoft=sqlSoft & " order by S.OnTop,S.SoftID desc" Set rsSoft= Server.CreateObject("ADODB.Recordset") rsSoft.open sqlSoft,conn,1,1 if rsSoft.bof and rsSoft.eof then totalput=0 response.Write("
  • 没有任何下载
  • ") else totalput=rsSoft.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then call SoftContent(TitleLen,True,True,True,2,True,True) else if (currentPage-1)*MaxPerPage" strTemp="" do while not rsSoft.eof 'strTemp=strTemp & "" if ShowProperty=True then 'strTemp=strTemp & "" if rsSoft("OnTop")=true then strTemp = strTemp & "固顶下载 " elseif rsSoft("Elite")=true then strTemp = strTemp & "推荐下载 " else strTemp = strTemp & "普通下载 " end if 'strTemp=strTemp & "" end if 'strTemp=strTemp & "" if ShowClassName=True and rsSoft("ClassID")<>ClassID then strTemp=strTemp & "[" & rsSoft("ClassName") & "] " end if strTemp=strTemp & "" strTemp=strTemp & gotTopic(rsSoft("SoftName") & " " & rsSoft("SoftVersion"),intTitleLen) & "" if ShowAuthor=True or ShowDateType>0 or ShowHits=True then strTemp = strTemp & " (" if ShowAuthor=True then if rsSoft("AuthorEmail")="" then strTemp=strTemp & rsSoft("Author") else strTemp=strTemp & "" & rsSoft("Author") & "" end if end if if ShowDateType>0 then if ShowAuthor=True then strTemp=strTemp & "," end if if CDate(FormatDateTime(rsSoft("UpdateTime"),2))=date() then strTemp = strTemp & "" else strTemp= strTemp & "" end if if ShowDateType=1 then strTemp=strTemp & FormatDateTime(rsSoft("UpdateTime"),1) & "" else strTemp= strTemp & month(rsSoft("UpdateTime")) & "月" & day(rsSoft("UpdateTime")) & "日" end if end if if ShowHits=True then if ShowAuthor=True or ShowDateType>0 then strTemp=strTemp & "," end if strTemp=strTemp & rsSoft("Hits") end if strTemp=strTemp & ")" end if if ShowHot=True and rsSoft("Hits")>=HitsOfHot then strTemp= strTemp & "热门下载" end if strTemp= strTemp & "
    " rsSoft.movenext i=i+1 if i>=MaxPerPage then exit do loop 'strTemp=strTemp & "" response.write strTemp end sub '================================================= '过程名:ShowNewSoft '作 用:显示最新更新 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowNewSoft(SoftNum,TitleLen) dim sqlNew,rsNew if SoftNum>0 and SoftNum<=100 then sqlNew="select top " & SoftNum else sqlNew="select top 10 " end if sqlNew=sqlNew & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True " sqlNew=sqlNew & " order by S.SoftID desc" Set rsNew= Server.CreateObject("ADODB.Recordset") rsNew.open sqlNew,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=100 if rsNew.bof and rsNew.eof then response.write "
  • 没有下载
  • " else do while not rsNew.eof response.Write "
  • " & gotTopic(rsNew("SoftName") & " " & rsNew("SoftVersion"),TitleLen) & "

  • " rsNew.movenext loop end if rsNew.close set rsNew=nothing end sub '================================================= '过程名:ShowTop '作 用:显示累计下载TOP N,N由参数SoftNum指定 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowTop(SoftNum,TitleLen,strClassID) dim sqlTop,rsTop,i if SoftNum>0 and SoftNum<=100 then sqlTop="select top " & SoftNum else sqlTop="select top 10 " end if sqlTop=sqlTop & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True " if instr(strClassID,",")>0 then sqlTop=sqlTop & " and S.ClassID in (" & strClassID & ")" else if CLng(strClassID)>0 then sqlTop=sqlTop & " and S.ClassID=" & strClassID end if end if sqlTop=sqlTop & " order by S.Hits desc,S.SoftID desc" Set rsTop= Server.CreateObject("ADODB.Recordset") rsTop.open sqlTop,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=100 if rsTop.bof and rsTop.eof then response.write "
  • 今日没有下载
  • " else i=1 response.write "" do while not rsTop.eof response.Write "" rsTop.movenext i=i+1 loop response.write "
    " & i & "" & gotTopic(rsTop("SoftName") & " " & rsTop("SoftVersion"),TitleLen) & "
    " end if rsTop.close set rsTop=nothing end sub '================================================= '过程名:ShowTopDay '作 用:显示本日下载TOP N,N由参数SoftNum指定 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowTopDay(SoftNum,TitleLen) dim sqlTop,rsTop,i if SoftNum>0 and SoftNum<=100 then sqlTop="select top " & SoftNum else sqlTop="select top 10 " end if sqlTop=sqlTop & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True And datediff('D',LastHitTime,now())<=0 order by S.DayHits desc,S.SoftID desc" Set rsTop= Server.CreateObject("ADODB.Recordset") rsTop.open sqlTop,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=100 if rsTop.bof and rsTop.eof then response.write "
  • 今日没有下载
  • " else i=1 response.write "" do while not rsTop.eof response.Write "" rsTop.movenext i=i+1 loop response.write "
    " & i & "" & gotTopic(rsTop("SoftName") & " " & rsTop("SoftVersion"),TitleLen) & "
    " end if rsTop.close set rsTop=nothing end sub '================================================= '过程名:ShowTopWeek '作 用:显示本周下载TOP N,N由参数SoftNum指定 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowTopWeek(SoftNum,TitleLen) dim sqlTop,rsTop,i if SoftNum>0 and SoftNum<=100 then sqlTop="select top " & SoftNum else sqlTop="select top 10 " end if sqlTop=sqlTop & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True And datediff('ww',LastHitTime,now())<=0 order by S.WeekHits desc,S.SoftID desc" Set rsTop= Server.CreateObject("ADODB.Recordset") rsTop.open sqlTop,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=100 if rsTop.bof and rsTop.eof then response.write "
  • 今日没有下载
  • " else i=1 response.write "" do while not rsTop.eof response.Write "" rsTop.movenext i=i+1 loop response.write "
    " & i & "" & gotTopic(rsTop("SoftName") & " " & rsTop("SoftVersion"),TitleLen) & "
    " end if rsTop.close set rsTop=nothing end sub '================================================= '过程名:ShowTopMonth '作 用:显示本月下载TOP N,N由参数SoftNum指定 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowTopMonth(SoftNum,TitleLen) dim sqlTop,rsTop,i if SoftNum>0 and SoftNum<=100 then sqlTop="select top " & SoftNum else sqlTop="select top 10 " end if sqlTop=sqlTop & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True And datediff('m',LastHitTime,now())<=0 order by S.MonthHits desc,S.SoftID desc" Set rsTop= Server.CreateObject("ADODB.Recordset") rsTop.open sqlTop,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=100 if rsTop.bof and rsTop.eof then response.write "
  • 今日没有下载
  • " else i=1 response.write "" do while not rsTop.eof response.Write "" rsTop.movenext i=i+1 loop response.write "
    " & i & "" & gotTopic(rsTop("SoftName") & " " & rsTop("SoftVersion"),TitleLen) & "
    " end if rsTop.close set rsTop=nothing end sub '================================================= '过程名:ShowHot '作 用:显示热门下载 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowHot(SoftNum,TitleLen) dim sqlHot,rsHot if SoftNum>0 and SoftNum<=100 then sqlHot="select top " & SoftNum else sqlHot="select top 10 " end if sqlHot=sqlHot & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True And S.Hits>=" & HitsOfHot & " order by S.SoftID desc" Set rsHot= Server.CreateObject("ADODB.Recordset") rsHot.open sqlHot,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=50 if rsHot.bof and rsHot.eof then response.write "
  • 无热门下载
  • " else do while not rsHot.eof response.Write "
  • [" & rsHot("hits") & "]

  • " rsHot.movenext loop end if rsHot.close set rsHot=nothing end sub '================================================= '过程名:ShowElite '作 用:显示推荐软件 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowElite(SoftNum,TitleLen) dim sqlElite,rsElite if SoftNum>0 and SoftNum<=100 then sqlElite="select top " & SoftNum else sqlElite="select top 10 " end if sqlElite=sqlElite & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True And S.Elite=True order by S.SoftID desc" Set rsElite= Server.CreateObject("ADODB.Recordset") rsElite.open sqlElite,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=50 if rsElite.bof and rsElite.eof then response.write "
  • 无推荐下载
  • " else do while not rsElite.eof response.Write "
  • " & gotTopic(rsElite("SoftName")& " " & rsElite("SoftVersion"),TitleLen) & "[" & rsElite("hits") & "]

  • " rsElite.movenext loop end if rsElite.close set rsElite=nothing end sub '================================================= '过程名:ShowCorrelative '作 用:显示相关软件 '参 数:SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 '================================================= sub ShowCorrelative(SoftNum,TitleLen) dim rsCorrelative,sqlCorrelative dim strKey,arrKey,i if SoftNum>0 and SoftNum<=100 then sqlCorrelative="select top " & SoftNum else sqlCorrelative="Select Top 5 " end if strKey=mid(rs("Keyword"),2,len(rs("Keyword"))-2) if instr(strkey,"|")>1 then arrKey=split(strKey,"|") strKey="((S.Keyword like '%|" & arrKey(0) & "|%')" for i=1 to ubound(arrKey) strKey=strKey & " or (S.Keyword like '%|" & arrKey(i) & "|%')" next strKey=strKey & ")" else strKey="(S.Keyword like '%|" & strKey & "|%')" end if sqlCorrelative=sqlCorrelative & " S.SoftID,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.SoftSize,S.SoftLevel,S.SoftPoint from Soft S Where S.Deleted=False and S.Passed=True and " & strKey & " and S.SoftID<>" & SoftID & " Order by S.SoftID desc" Set rsCorrelative= Server.CreateObject("ADODB.Recordset") rsCorrelative.open sqlCorrelative,conn,1,1 if TitleLen<0 or TitleLen>255 then TitleLen=50 if rsCorrelative.bof and rsCorrelative.Eof then response.write "没有相关下载" else do while not rsCorrelative.eof response.Write "
  • " & gotTopic(rsCorrelative("SoftName") & " " & rsCorrelative("SoftVersion"),TitleLen) & "[" & rsCorrelative("hits") & "]

  • " rsCorrelative.movenext loop end if rsCorrelative.close set rsCorrelative=nothing end sub '================================================= '过程名:ShowComment '作 用:显示相关评论 '参 数:CommentNum ----最多显示多少个评论 '================================================= sub ShowComment(CommentNum) dim rsComment,sqlComment,rsCommentUser if CommentNum>0 and CommentNum<=100 then sqlComment="select top " & CommentNum else sqlComment="select top 10 " end if sqlComment=sqlComment & " * from SoftComment where SoftID=" & SoftID & " order by CommentID desc" Set rsComment= Server.CreateObject("ADODB.Recordset") rsComment.open sqlComment,conn,1,1 if rsComment.bof and rsComment.eof then response.write "    没有任何评论" else response.write "" do while not rsComment.eof response.write "" response.write "" rsComment.movenext loop response.write "
    " if rsComment("UserType")=1 then response.write "
  • 会员" set rsCommentUser=Conn_User.execute("select " & db_User_ID & "," & db_User_Name & "," & db_User_Email & "," & db_User_QQ & "," & db_User_Homepage & " from " & db_User_Table & " where " & db_User_Name & "='" & rsComment("UserName") & "'") if rsCommentUser.bof and rsCommentUser.eof then response.write rsComment("UserName") else response.write "『" & rsComment("UserName") & "』" end if else response.write "
  • 游客『" & rsComment("UserName") & "』" end if response.write "于" & rsComment("WriteTime") & "发表评论:
  • " response.write "
    评分:"&rsComment("Score")&"分
    " response.write "    " & rsComment("Content") & "
    " if rsComment("ReplyContent")<>"" then response.write "     管理员『" & rsComment("ReplyName") & "』于 " & rsComment("ReplyTime") & " 回复道:    " & rsComment("ReplyContent") & "
    " end if response.write "
    " response.write "查看关于此文章的所有评论" response.write "
    " end if end sub '================================================= '过程名:ShowPicSoft '作 用:显示图片软件 '参 数:intClassID ----栏目ID,0为所有栏目,若大于0,则显示指定栏目及其子栏目的图片软件 ' SoftNum ----最多显示多少个软件 ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 ' ShowType ----显示方式。1为只有图片+标题,2为图片+标题+内容简介 ' Cols ----列数。超过此列数就换行。 ' ImgWidth ----图片宽度 ' ImgHeight ----图片高度 ' ContentLen ----内容最多字符数 ' Hot ----是否是热门软件 ' Elite ----是否是推荐软件 '================================================= sub ShowPicSoft(intClassID,SoftNum,TitleLen,ShowType,Cols,ImgWidth,ImgHeight,ContentLen,Hot,Elite) dim sqlPic,i,tClass,trs,arrClassID if SoftNum<0 or SoftNum>=50 then SoftNum=5 end if if ShowType<>1 and ShowType<>2 then ShowType=1 end if if Cols<=0 or Cols>=10 then Cols=5 end if if ImgWidth<0 or ImgWidth>500 then ImgWidth=150 end if if ImgHeight<0 or ImgHeight>500 then ImgHeight=150 end if if Hot<>True and Hot<>False then Hot=False end if if Elite<>True and Elite<>False then Elite=False end if sqlPic="select top " & SoftNum sqlPic=sqlPic & " S.SoftID,S.SoftName,S.SoftVersion,S.SoftSize,S.Keyword,S.Author,S.UpdateTime,S.Editor," if ShowType=2 then sqlPic=sqlPic & "S.SoftIntro," end if sqlPic=sqlPic & " S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.OnTop,S.Elite,S.SoftPicUrl,S.Stars,S.SoftLevel,S.SoftPoint from Soft S where S.Deleted=False and S.Passed=True and SoftPicUrl<>''" if intClassID>0 then set tClass=conn.execute("select ClassID,Child,ParentPath from SoftClass where ClassID=" & intClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then arrClassID=ClassID set trs=conn.execute("select ClassID from SoftClass where ParentID=" & tClass(0) & " or ParentPath like '%" & tClass(2) & "," & tClass(0) & ",%' and Child=0 and LinkUrl=''") do while not trs.eof arrClassID=arrClassID & "," & trs(0) trs.movenext loop set trs=nothing sqlPic=sqlPic & " and S.ClassID in (" & arrClassID & ")" else sqlPic=sqlPic & " and S.ClassID=" & tClass(0) end if set trs=nothing else sqlPic=sqlPic & " and S.ClassID=" & tClass(0) end if set tClass=nothing end if if Hot=True then sqlPic=sqlPic & " and S.Hits>=" & HitsOfHot end if if Elite=True then sqlPic=sqlPic & " and S.Elite=True " end if sqlPic=sqlPic & " order by S.OnTop,S.SoftID desc" set rsPic=Server.CreateObject("ADODB.Recordset") rsPic.open sqlPic,conn,1,1 strPic= "" if rsPic.bof and rsPic.eof then for i=1 to cols strPic= strPic & "" next else i=0 if ShowType=1 then do while not rsPic.eof strPic=strPic & "" rsPic.movenext i=i+1 if ((i mod Cols=0) and (not rsPic.eof)) then strPic=strPic & "" loop elseif ShowType=2 then do while not rsPic.eof strPic=strPic & "" rsPic.movenext i=i+1 if ((i mod Cols=0) and (not rsPic.eof)) then strPic=strPic & "" loop end if end if strPic=strPic & "

    没有任何推荐下载
    " call GetPicSoftTitle(TitleLen,ImgWidth,ImgHeight) strPic=strPic & "
    " call GetPicSoftTitle(TitleLen,ImgWidth,ImgHeight) strPic=strPic & "" & left(nohtml(rsPic("SoftIntro")),ContentLen) & "……
    " response.write strPic rsPic.close end sub '================================================= '过程名:GetPicSoftTitle '作 用:显示图片软件的标题 '参 数:intTitleLen ----标题最多字符数,一个汉字=两个英文字符 ' intImgWidth ----图片宽度 ' intImgHeight ----图片高度 '================================================= sub GetPicSoftTitle(intTitleLen,intImgWidth,intImgHeight) dim FileType,TitleStr FileType=right(lcase(rsPic("SoftPicUrl")),3) TitleStr=gotTopic(rsPic("SoftName") & " " & rsPic("SoftVersion"),intTitleLen) strPic=strPic & "
    " if FileType="swf" then strPic=strPic & "" elseif fileType="jpg" or fileType="bmp" or fileType="png" or fileType="gif" then strPic=strPic & "" else strPic=strPic & "" end if strPic=strPic & "
    " & TitleStr & "
    " end sub %>