ATB Source Codes

Like webmaster forums Show viewfile.asp Source code

Return Download Like webmaster forums: download viewfile.asp Source code - Download Like webmaster forums Source code - Type:.asp
  1. <!-- #include file="conn.asp" -->
  2. <!-- #include file="inc/const.asp" -->
  3. <!-- #include file="inc/Dv_ClsOther.asp" -->
  4. <%
  5.         Dim Str
  6.         Dvbbs.Stats="查看文件"
  7.         Dim Downid,Rs
  8.         If CInt(Dvbbs.GroupSetting(49))=0 Then Dvbbs.AddErrCode(54)
  9.         If request("id")="" Then
  10.                 Dvbbs.AddErrCode(35)
  11.         ElseIf Not IsNumeric(request("id")) Then
  12.                 Dvbbs.AddErrCode(35)
  13.         Else
  14.                 DownID=Clng(request("id"))
  15.         End If
  16.         Dvbbs.ShowErr()
  17.  
  18.         '论坛下载限制(包括文章、积分、金钱、魅力、威望、精华、被删数、注册时间)
  19.         Dim BoardUserLimited
  20.         BoardUserLimited = Split(Dvbbs.Board_Setting(55),"|")
  21.         If Ubound(BoardUserLimited)=8 Then
  22.                 '文章
  23.                 If Trim(BoardUserLimited(0))<>"0" And IsNumeric(BoardUserLimited(0)) Then
  24.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户发贴最少为 <B>"&BoardUserLimited(0)&"</B> 才能下载&action=OtherErr"
  25.                         If Clng(Dvbbs.MyUserInfo(8))<Clng(BoardUserLimited(0)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户发贴最少为 <B>"&BoardUserLimited(0)&"</B> 才能下载&action=OtherErr"
  26.                 End If
  27.                 '积分
  28.                 If Trim(BoardUserLimited(1))<>"0" And IsNumeric(BoardUserLimited(1)) Then
  29.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户积分最少为 <B>"&BoardUserLimited(1)&"</B> 才能下载&action=OtherErr"
  30.                         If Clng(Dvbbs.MyUserInfo(22))<Clng(BoardUserLimited(1)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户积分最少为 <B>"&BoardUserLimited(1)&"</B> 才能下载&action=OtherErr"
  31.                 End If
  32.                 '金钱
  33.                 If Trim(BoardUserLimited(2))<>"0" And IsNumeric(BoardUserLimited(2)) Then
  34.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户金钱最少为 <B>"&BoardUserLimited(2)&"</B> 才能下载&action=OtherErr"
  35.                         If Clng(Dvbbs.MyUserInfo(21))<Clng(BoardUserLimited(2)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户金钱最少为 <B>"&BoardUserLimited(2)&"</B> 才能下载&action=OtherErr"
  36.                 End If
  37.                 '魅力
  38.                 If Trim(BoardUserLimited(3))<>"0" And IsNumeric(BoardUserLimited(3)) Then
  39.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户魅力最少为 <B>"&BoardUserLimited(3)&"</B> 才能下载&action=OtherErr"
  40.                         If Clng(Dvbbs.MyUserInfo(23))<Clng(BoardUserLimited(3)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户魅力最少为 <B>"&BoardUserLimited(3)&"</B> 才能下载&action=OtherErr"
  41.                 End If
  42.                 '威望
  43.                 If Trim(BoardUserLimited(4))<>"0" And IsNumeric(BoardUserLimited(4)) Then
  44.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户威望最少为 <B>"&BoardUserLimited(4)&"</B> 才能下载&action=OtherErr"
  45.                         If Clng(Dvbbs.MyUserInfo(24))<Clng(BoardUserLimited(4)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户威望最少为 <B>"&BoardUserLimited(4)&"</B> 才能下载&action=OtherErr"
  46.                 End If
  47.                 '精华
  48.                 If Trim(BoardUserLimited(5))<>"0" And IsNumeric(BoardUserLimited(5)) Then
  49.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户精华最少为 <B>"&BoardUserLimited(5)&"</B> 才能下载&action=OtherErr"
  50.                         If Clng(Dvbbs.MyUserInfo(28))<Clng(BoardUserLimited(5)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户精华最少为 <B>"&BoardUserLimited(5)&"</B> 才能下载&action=OtherErr"
  51.                 End If
  52.                 '删贴
  53.                 If Trim(BoardUserLimited(6))<>"0" And IsNumeric(BoardUserLimited(6)) Then
  54.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户被删贴少于 <B>"&BoardUserLimited(6)&"</B> 才能下载&action=OtherErr"
  55.                         If Clng(Dvbbs.MyUserInfo(27))>Clng(BoardUserLimited(6)) Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户被删贴少于 <B>"&BoardUserLimited(6)&"</B> 才能下载&action=OtherErr"
  56.                 End If
  57.                 '注册时间
  58.                 If Trim(BoardUserLimited(7))<>"0" And IsNumeric(BoardUserLimited(7)) Then
  59.                         If Dvbbs.UserID = 0 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户注册时间大于 <B>"&BoardUserLimited(7)&"</B> 分钟才能下载&action=OtherErr"
  60.                         If DateDiff("s",Dvbbs.MyUserInfo(14),Now)<Clng(BoardUserLimited(7))*60 Then Response.redirect "showerr.asp?ErrCodes=<li>本版面设置了用户注册时间大于 <B>"&BoardUserLimited(7)&"</B> 分钟才能下载&action=OtherErr"
  61.                 End If
  62.         End If
  63.         If Dvbbs.Forum_Setting(76)="" Or Dvbbs.Forum_Setting(76)="0" Then Dvbbs.Forum_Setting(76)="UploadFile/"
  64.         If right(Dvbbs.Forum_Setting(76),1)<>"/" Then Dvbbs.Forum_Setting(76)=Dvbbs.Forum_Setting(76)&"/"
  65.         Dim uploadpath,filename
  66.         uploadpath=Dvbbs.Forum_Setting(76)
  67.         Set Rs=Dvbbs.Execute("Select * From dv_upfile Where F_id="&downid)
  68.         If Rs.Eof And Rs.Bof Then
  69.                 Dvbbs.AddErrCode(32)
  70.         Else
  71.                 If Dvbbs.Forum_Setting(75)="0" Then
  72.                         Dvbbs.Execute("Update dv_upfile Set F_DownNum=F_DownNum+1 Where F_ID="&DownID)
  73.                         Response.Redirect uploadpath&rs("F_filename")
  74.                 Else
  75.                         filename=Replace(rs("F_filename"),"..","")&""
  76.                         If Request.ServerVariables("HTTP_REFERER")="" Or InStr(Request.ServerVariables("HTTP_REFERER"),Request.ServerVariables("SERVER_NAME"))=0 Or filename="" Then
  77.                                 Response.Redirect "index.asp"
  78.                         Else
  79.                                 Call downloadFile(Server.MapPath(Dvbbs.Forum_Setting(76)&filename))
  80.                                
  81.                         End If
  82.                 End If
  83.         End If
  84.         Rs.close
  85.         Set Rs=Nothing
  86.         Dvbbs.ShowErr()
  87. Sub downloadFile(strFile)
  88.         On error resume next
  89.         Server.ScriptTimeOut=999999
  90.         Dim S,fso,f,intFilelength,strFilename
  91.         strFilename = strFile
  92.         Response.Clear
  93.         Set s = Server.CreateObject("ADODB.Stream")
  94.         s.Open
  95.         s.Type = 1
  96.         Set fso = Server.CreateObject("Scripting.FileSystemObject")
  97.         If Not fso.FileExists(strFilename) Then
  98.                 Response.Write("<h1>错误: </h1><br>系统找不到指定文件")
  99.                 Exit Sub               
  100.         End If
  101.         Set f = fso.GetFile(strFilename)
  102.                 intFilelength = f.size
  103.                 s.LoadFromFile(strFilename)
  104.                 If err Then
  105.                         Response.Write("<h1>错误: </h1>" & err.Description & "<p>")
  106.                         Response.End
  107.                 End If
  108.                 Set fso=Nothing
  109.                 Dim Data
  110.                 Data=s.Read
  111.                 s.Close
  112.                 Set s=Nothing
  113.                 If Response.IsClientConnected Then
  114.                         Response.AddHeader "Content-Disposition", "attachment; filename=" & f.name
  115.                         Response.AddHeader "Content-Length", intFilelength
  116.                         Response.CharSet = "UTF-8"
  117.                         Response.ContentType = "application/octet-stream"
  118.                         Response.BinaryWrite Data
  119.                         Response.Flush
  120.                 End If
  121. End Sub
  122. %>
downloadviewfile.asp Source code - Download Like webmaster forums Source code
Related Source Codes/Software:
Quanzhou China networks limited - Admin admin admin 21.45KB
Love agent shop navigation friendship China buffet chain V1.0 - Fully functional, application link, points into on... 4.34KB
Source of party and Government official open source Government TS version v1.0 - I am a Government webmaster, not a computer traini... 10.95KB
Sunzhuang town government - Simple and practical! 5.15KB
160 Shenzhen rental rental information network - Rental information network-a very good site, which... 79.99KB
Journey of legends ASP.NET version system - Abbreviation for Cms is a Content Management Syste... 18.45KB
M media corporate website system v3.5.2 - M media on the powerful systems in addition to foc... 5.69KB
M media enterprise open source Web System v1.0.0 - M media on the powerful systems in addition to foc... 4.9KB
M media management system voted v2.1.0 - As computer and electronic communications technolo... 6.01KB
Chinese women's network the entire station source code - A woman's Web site package download, and a present... 22.95KB
China source download System v1.0 - This 3-to beautify the program downloaded by the i... 5.26KB
Ganzhou Windows network - Cover feature:Windows Home | News vertical and... 34.61KB
Strains of strain of beautiful personal home page Build20061004 - -----------Modified part-------------1: added ... 7.7KB
Southwest agricultural information network - Southwest agricultural information network, an agr... 98.89KB
ZWMOBI 3G mobile station system - Powerful business modules, including mobile B2C mo... 3.89KB
As a campus site system v2.0 - For most school,, to built features powerful of ma... 44.88KB
Evening student seating system 7 - Evening student seating system is facilitated the ... 26.4KB
94KK be reluctant network community beautification bate3 (new year Edition) - Kernel KB 94kkBBS Forum, new landscaping, further ... 24.82KB
QQ Flash Word - 1. powerful DIY feature, which is now immeasurably... 67KB
Zoomla! Eall CMS v2.0 - Waves CMS is committed to providing our webmasters... 11.31KB

 Back to top