<!--#include file="../setting/conn.asp"--><!--#include file="../Inc/UploadCls.asp"-->
<%:SoonBiz.chkadmin:act=SoonBiz.ract():fid="user":cid=0:Select Case act:Case "" : main:Case "addnew" : addnew:Case "save" : Dosave:Case "list" : uplist:Case "del" : delimg:Case "recycle" : recycle:Case "moveout" : moveout :Case "changeuser" : changeuser :Case "clear" : Doclear :End Select:SoonBiz.AdFoot():Setallnothing:Function myupsize():Dim tempstr,upsize:Dim rs:Set rs=SoonBiz.execute("select sum(filesize) from "& sheethead &"_uplist where uid="&SoonBiz.user_id):upsize=rs(0):Rs.close:set Rs=Nothing
If Not IsNumeric (upsize) Then
upsize=0
End If:Dim xmlgroup,upset:Set xmlgroup=application(CacheName & "_group").documentElement.selectSingleNode("group[@id='" & User_gid & "']")
If xmlgroup Is Nothing Then
ShowErr("非法操作"):exit Function
Else:upset=xmlgroup.getAttribute("upset")&"":upset=split(upset,"|")
End If:Set xmlgroup=Nothing:tempstr="<div><ul><li>我的上传空间:"& upset(1) &"M,已使用:"&FormatNumber(upsize/1024/1024,2,-1)&"M.</li><li>单个上传文件最大限制:"& upset(2) &"K.</li><li>允许上传文件类型:"& upset(3) &".</li>"
If CSng(upsize)>CSng(upset(1)*1024*1024) Then
tempstr=tempstr & "<li style='color:#ff0000;'>达到了上传限制<script type=""text/javascript"">getobj('uploadbutton').disabled=true;</script></li>"
End If:tempstr=tempstr & "</ul></div>":chkupsize=tempstr:End Function:Sub nav():Response.Write "<table cellspacing=""1"" class=tableborder1>":Response.Write " <tr>":Response.Write " <th colspan=2 height=22>上传管理</th>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td width=75 height=30><b>管理导航:</b></td>":Response.Write " <td width=* height=30>":Response.Write " <a href=""?"">上传管理首页</a> |":Response.Write " <a href=""?act=addnew"">上传文件</a> |":Response.Write " <a href=""../fckeditor/editor/filemanager/browser/default/browser.html?Connector=%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fasp%2Fconnector.asp"" onclick=""return showinnew(this,580,550)"">编辑器上传的文件</a> |":Response.Write " <a href=""?act=list"">管理已上传文件</a> |":Response.Write " <a href=""?act=recycle"">文件回收站</a>":Response.Write " </td>":Response.Write " </tr>":Response.Write "</table>":Response.Write "<br />":End Sub:Sub main():SoonBiz.title="上传文件管理":SoonBiz.adhead:SoonBiz.nstate ("上传文件管理"):nav:Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<tr>":Response.Write "<td>":Response.Write "1.上传文件管理,在这里可以上传图片文件,并管理通过频道添加内容时上传的所有文件.除此之外,您也可以在添加文章,产品时单独上传文件.":Response.Write "<br />2.上传的图片自动生成缩略图,并添加水印,您也可以在上传设置中修改上传参数":Response.Write "</td>":Response.Write "</tr>":Response.Write "</table>":End Sub:Sub addnew():SoonBiz.title="上传文件":SoonBiz.adhead:SoonBiz.nstate("上传文件"):nav:Response.Write "<table cellspacing=1 class=tableborder1>":Response.Write "<form action=""?act=save&cid=0&fid=0"" method=post name=myform enctype=""multipart/form-data"">":Response.Write "<tr>":Response.Write "<th>选择上传文件</th>":Response.Write "</tr>":Response.Write "<tr>":Response.Write "<td>":Response.Write "<input type=""file"" name=""file1"" size=""60"">":Response.Write "</td>":Response.Write "</tr>":Response.Write "</table>":Response.Write "<div class=""operate""><input type=""submit"" value=""提交""></div></td>":Response.Write "</form>":End Sub:Sub uplist():Dim astr:Dim tr,thiscid:astr=SoonBiz.PlusSQL("select * from ["& sheethead &"_uplist] where isdel=0","?act="& act):thiscid=SoonBiz.rid("thiscid")
If thiscid>0 Then'"said::::beenhereonly]hadfromthese::that`himbecause
astr(0)=astr(0) & " and cid="&thiscid:astr(1)=astr(1) & "&amp;thiscid="&thiscid:astr(2)=astr(2) & "CheckSel(""thiscid"","& thiscid &");"
End If:astr(0)=astr(0) & " order by id desc":tr="<tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" align='center'> <td>{$id}</td> <td align='left'><a href=""{$ufilename}"" target=""new"" class=""ahover"">{$ufilename}<script type=""text/javascript"">hoverview(""{$ufilename}"");</script></a></td> <td><script type=""text/javascript"">document.write(channelname['{$cid}']);</script></td> <td>{$nickname}</td> <td style='text-align:right;'>{$ufilewidth}*{$ufileheight} <script type=""text/javascript"">getsize({$filesize});</script></td> <td>{$stime_short}</td> <td><input type='checkbox' name='id' value='{$id}'></td></tr>":SoonBiz.adhead():SoonBiz.nstate("上传文件管理"):nav:listfilter:Response.Write SoonBiz.JsChannel:Response.Write "<div class=""adminup"">":Response.Write " <form method=post action=""?"" id=""myform"" name=""myform"">":Response.Write " <table cellspacing=1 class=tableborder1>":Response.Write " <tr>":Response.Write " <th width=40>ID</th>":Response.Write " <th>文件名</th>":Response.Write " <th>频道</th>":Response.Write " <th>用户</th>":Response.Write " <th width=100 style='text-align:right;'>属性</th>":Response.Write " <th>时间</th>":Response.Write " <th width=30>选择</th>":Response.Write " </tr>":Response.Write SoonBiz.ReplaceMdb("admin_img",astr(0),tr,16,0):Response.Write "</table>":Response.Write "<div class=""operate"">":Response.Write " <input type=""button"" onClick=""CheckAll(myform)"" value=""全选"">":Response.Write " <input type=""button"" onClick=""ContraSel(myform)"" value=""反选"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=del&fid="& fid &"','确定要删除选择的文件么?\n此操作不可以恢复!')"" value=""删除"">":Response.Write "</div>":Response.Write "</form>":Response.Write "</div>":Response.Write SoonBiz.pagelist(""):Response.Write "<script type=""text/javascript"">"& astr(2) &"</script>":End Sub:Sub recycle() :Dim sql:Dim tr:sql="select * from ["& sheethead &"_uplist] where isdel=1 order by id desc":SoonBiz.topplus="<script src=""../inc/admin_up.js"" type=""text/javascript""></script>":SoonBiz.adhead():SoonBiz.nstate("上传文件回收站"):nav:Response.Write SoonBiz.JsChannel:Response.Write "<div class=""adminup"">":Response.Write " <form method=post action=""?"" id=""myform"" name=""myform"">":Response.Write " <table cellspacing=1 class=tableborder1>":Response.Write " <tr>":Response.Write " <th width=40>ID</th>":Response.Write " <th>文件名</th>":Response.Write " <th>频道</th>":Response.Write " <th>用户</th>":Response.Write " <th width=100 style='text-align:right;'>属性</th>":Response.Write " <th>时间</th>":Response.Write " <th width=30>选择</th>":Response.Write " </tr>":tr="<tr onmouseover=""this.style.backgroundColor='#e2e8f4';"" onmouseout=""this.style.backgroundColor='';"" align='center'> <td>{$id}</td> <td align='left'><a href=""{$ufilename}"" target=""new"" class=""ahover"">{$ufilename}<script type=""text/javascript"">hoverview(""{$ufilename}"");</script></a></td> <td><script type=""text/javascript"">document.write(channelname['{$cid}']);</script></td> <td>{$nickname}</td> <td style='text-align:right;'>{$ufilewidth}*{$ufileheight} <script type=""text/javascript"">getsize({$filesize});</script></td> <td>{$stime_short}</td> <td><input type='checkbox' name='id' value='{$id}'></td></tr>":Response.Write SoonBiz.ReplaceMdb("admin_img",sql,tr,16,0):Response.Write "</table>":Response.Write "<div class=""operate"">":Response.Write " <input type=""button"" onClick=""CheckAll(myform)"" value=""全选"">":Response.Write " <input type=""button"" onClick=""ContraSel(myform)"" value=""反选"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=restore&fid="& fid &"','')"" value=""恢复"">":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=moveout&fid="& fid &"','确定要清除选定的文件吗!')"" value=""清除"">":Response.Write " <input type=""button"" onClick=""changeuser();"" value=""恢复"" />":Response.Write " <input type=""button"" onClick=""Csubmit('myform','?act=clear','确定要清空回收站吗!')"" value=""清空回收站"">":Response.Write "</div>":Response.Write "<div class=""edit"" id=""changeuser"">":Response.Write " <span class='close'><a href='javascript:closediv(""changeuser"")'><img src='../images/close.gif' align='absmiddle' /></a></span>":Response.Write " <h1>恢复上传文件</h1>":Response.Write " <p>":Response.Write " 有可能原用户不需要这个文件,所以请输入要恢复到用户的昵称":Response.Write " <input type=""text"" id="""" name=""nickname"" size=""20""/>":Response.Write " <div class=""operate""><input type=""submit"" value=""提交"" /></div>":Response.Write " </p>":Response.Write "</div>":Response.Write "</form>":Response.Write "</div>":Response.Write SoonBiz.pagelist(""):Response.Write "<div id=""bg""></div>":End Sub:Sub delimg():SoonBiz.execute("update "& sheethead &"_uplist set isdel=1 where id in ("& SoonBiz.rids &")"):SoonBiz.ok:End Sub:Sub moveout():Dim ids,sql,arrs,rs,i:ids=SoonBiz.rids():sql="select id,ufilename from "& sheethead &"_uplist where isdel=1 and id in("&ids&")":Set rs=SoonBiz.execute(sql)
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)
End If:Rs.Close:Set Rs=Nothing'"stillthen'since~::our:byby:"any:":an
If isarray(arrs) Then
For i=0 To UBound(arrs,2):SoonBiz.DelFile(arrs(1,i)):Next
End If:SoonBiz.execute("delete from "& sheethead &"_uplist where isdel=1 and id in("&ids&")"):SoonBiz.ok:End Sub:Sub Doclear :Dim sql,arrs,rs,i:sql="select id,ufilename from "& sheethead &"_uplist where isdel=1":Set rs=SoonBiz.execute(sql)
If rs.eof Then
arrs=""
Else:arrs=rs.getrows(-1)'out'out:these'@{:'}'betweensuch:'&be%
End If:Rs.Close:Set Rs=Nothing
If isarray(arrs) Then
For i=0 To UBound(arrs,2):SoonBiz.DelFile(arrs(1,i)):Next
End If:SoonBiz.execute("delete from "& sheethead &"_uplist where isdel=1"):SoonBiz.ok:End Sub:Sub changeuser() :Dim nickname,sql,rs,uid:nickname=SoonBiz.Requeststr("恢复到哪个用户","nickname","post",1,2,20,30,1):ShowErr(""):Set rs=SoonBiz.execute("select id from "& sheethead &"_user where user_nickname='"& nickname &"'")
If rs.eof Then
ShowErr("此用户不存在")'still\also:"didmorebeing:::::see::/!they
Else:uid=rs(0)
End If:Rs.Close:Set Rs=Nothing:sql="update "& sheethead &"_uplist set isdel=0,uid="& uid &",nickname='"& nickname &"' where id in("& SoonBiz.rids &")":SoonBiz.execute(sql):SoonBiz.ok:End Sub:Sub listfilter():Response.Write "<div class=""listfilter"">":Response.Write "<form method=""get"" action=""?act="& act &""">":Response.write "<input type=""hidden"" name=""act"" value="""& act &""">":Response.Write " <input type=""text"" name=""keyword"" class=""inputsearch"" id=""keyword"">":Response.Write " <select name=""thiscid"" id=""thiscid"">":Response.Write " <option value=""-1"">全部频道</option>":Response.Write SoonBiz.ReplaceMdb("","select * from ["& sheethead &"_channel] order by id desc","<option value=""{$id}"">{$cha_name}</option>","",1):Response.Write " </select>":Response.Write " <select name=""myfield"" id=""myfield"">":Response.Write " <option value=""ufilename"">按文件名搜索</option>":Response.Write " <option value=""nickname"">按昵称搜索</option>":Response.Write " </select>":Response.Write " <input type=""text"" name=""date1"" id=""date1"" size=""11"" maxlength=""11""> - <input type=""text"" name=""date2"" id=""date2"" value="""& soonbiz.format_time(now(),4) &""" size=""11"" maxlength=""11""> ":Response.Write " <input type='submit' name=""submit"" class=""submit"" value='搜索'>":Response.Write " </form>":Response.Write "</div>":End Sub
%>