📄 down_save.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<!--#include file="../Inc/Config.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim rs,sql,ErrMsg,FoundErr
dim ArticleID,Product_Id,BigClassName,SmallClassName,Title,Content,key,infotime,Hits
dim IncludePic,PhotoUrl,Elite,Passed,arrUploadFiles
dim ObjInstalled
ObjInstalled=IsObjInstalled("Scripting.FileSystemObject")
FoundErr=false
ID=Trim(Request.Form("ArticleID"))
Product_Id=trim(request.form("Product_Id"))
BigClassName=trim(request.form("BigClassName"))
SmallClassName=trim(request.form("SmallClassName"))
Title=trim(request.form("Title"))
Key=request.form("Key")
Content=trim(request.form("Content"))
infotime=trim(request.form("UpdateTime"))
IncludePic=trim(request.form("IncludePic"))
PhotoUrl=trim(request.form("UploadFiles"))
Passed=trim(request.form("Passed"))
Elite=trim(request.form("Elite"))
Hits=trim(request.form("Hits"))
if BigClassName="" then
founderr=true
errmsg=errmsg+"<li>未指定下载所属大类</li>"
end if
if Title="" then
founderr=true
errmsg="<li>下载标题不能为空</li>"
end if
if Key="" then
founderr=true
errmsg=errmsg+"<li>请输入文章关键字</li>"
end if
if Content="" then
founderr=true
errmsg=errmsg+"<li>文章内容不能为空</li>"
end if
if founderr=false then
Title=dvhtmlencode(Title)
Key=Key & " "
Content=ubbcode(Content)
if infotime<>"" and IsDate(infotime)=true then
infotime=CDate(infotime)
else
infotime=now()
end if
if Hits<>"" then
Hits=CLng(Hits)
else
Hits=0
end if
set rs=server.createobject("adodb.recordset")
if request("action")="add" then
sql="select top 1 * from Download"
rs.open sql,conn,1,3
rs.addnew
call SaveData()
'rs("Editor")=Editor
rs.update
ID=rs("ID")
rs.close
set rs=nothing
elseif request("action")="Modify" then
if ID<>"" then
sql="select * from Download where Id=" & ID
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
call SaveData()
rs.update
rs.close
set rs=nothing
else
founderr=true
errmsg=errmsg+"<li>找不到此文章,可能已经被其他人删除。</li>"
call WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>不能确定ArticleID的值</li>"
call WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>没有选定参数</li>"
call WriteErrMsg()
end if
call CloseConn()
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" align="center" valign="top"> <table width="150" height="100%" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">
<tr>
<td align="center" valign="top"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">功能菜单</td>
</tr>
</table>
<table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0" class="MenuBg">
<tr>
<td align="center" valign="top"><br> <table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16%"><img src="../Img/Left_1.gif" width="28" height="11"></td>
<td width="84%" height="20"><font color="#FFFF00">系统管理</font></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Down_admin_add.asp">添加下载程序</a><a href="Manage_Admin.asp"></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Down_Manage.asp">管理下载程序</a><a href="Manage_backup.asp"></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Down_ClassManage.asp">下载程序类别</a></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="862" align="center" valign="top">
<br>
<br>
<b> </b><br>
<br>
<br>
<table class="border" align=center width="50%" border="0" cellpadding="0" cellspacing="2" bordercolor="#999999">
<tr align=center bgcolor="#999999">
<td height="25" colspan="2" class="title"><b>
<%if request("action")="add" then%>
添加
<%else%>
修改
<%end if%>
产品成功</b></td>
</tr>
<tr>
<td width="19%" height="22" bgcolor="#C0C0C0" class="tdbg"> <p align="right">产品序号:</p></td>
<td width="81%" bgcolor="#E3E3E3" class="tdbg"><%=ID%></td>
</tr>
<tr>
<td height="22" bgcolor="#C0C0C0" class="tdbg"><div align="right">产品编号:</div></td>
<td bgcolor="#E3E3E3" class="tdbg"><%=Product_Id%></td>
</tr>
<tr>
<td height="22" bgcolor="#C0C0C0" class="tdbg"><div align="right">产品名称:</div></td>
<td bgcolor="#E3E3E3" class="tdbg"><%=Title%></td>
</tr>
<tr>
<td height="22" bgcolor="#C0C0C0" class="tdbg"><div align="right">所属类别:</div></td>
<td bgcolor="#E3E3E3" class="tdbg">
<%response.write BigClassName
if SmallClassName<>"" then response.write " >> " & SmallClassName
if SpecialName<>"" then response.write "<br>所属专题:" & SpecialName
%>
</td>
</tr>
<tr>
<td height="22" bgcolor="#C0C0C0" class="tdbg"><div align="right">下载地址:</div></td>
<td bgcolor="#E3E3E3" class="tdbg"><%=key%></td>
</tr>
<tr>
<td height="22" colspan="2" bgcolor="#E3E3E3" class="tdbg">
<p align="center"> 【<a href="Down_admin_modi.asp?ID=<%=ID%>">修改软件</a>】
【<a href="Down_admin_add.asp">继续添加软件</a>】
【<a href="Down_Manage.asp">软件管理</a>】
【<a href="../DownloadShow.asp?ID=<%=ID%>" target="_blank">预览软件内容</a>】</p></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
<%
else
WriteErrMsg
end if
sub SaveData()
rs("Product_Id")=Product_Id
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("Title")=Title
rs("Content")=Content
rs("DownloadUrl")=Key
rs("Hits")=Hits
if IncludePic="yes" then
rs("IncludePic")=True
else
rs("IncludePic")=False
end if
if Passed="yes" then
rs("Passed")=True
else
if EnableArticleCheck="No" then
rs("Passed")=True
else
rs("Passed")=False
end if
end if
rs("infotime")=infotime
'***************************************
'删除无用的上传文件
if ObjInstalled=True and PhotoUrl<>"" then
dim fso,strRubbishFile
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if instr(PhotoUrl,"|")>1 then
dim arrUploadFiles,intTemp
arrUploadFiles=split(PhotoUrl,"|")
PhotoUrl=""
for intTemp=0 to ubound(arrUploadFiles)
if instr(Content,arrUploadFiles(intTemp))<=0 then
strRubbishFile=server.MapPath("../" & arrUploadFiles(intTemp))
if fso.FileExists(strRubbishFile) then
fso.DeleteFile(strRubbishFile)
response.write "<br><li>" & arrUploadFiles(intTemp) & "在下载中没有用到,也没有被设为首页图片,所以已经被删除!</li>"
end if
else
if intTemp=0 then
PhotoUrl=arrUploadFiles(intTemp)
else
PhotoUrl=PhotoUrl & "|" & arrUploadFiles(intTemp)
end if
end if
next
else
end if
set fso=nothing
end If
'结束
'***************************************
if PhotoUrl<>"" then
rs("PhotoUrl")=PhotoUrl
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -