<%@language=vbscript codepage=936 %> <% option explicit response.buffer=true Const PurviewLevel=2 Const CheckChannelID=3 Const PurviewLevel_Soft=3 %> <% dim Action,rs,sql,ErrMsg,FoundErr,ObjInstalled dim SoftID,ClassID,SoftName,SoftVersion,SoftType,SoftLanguage,CopyrightType,OperatingSystem,Author,AuthorEmail,AuthorHomepage dim DemoUrl,RegUrl,SoftPicUrl,SoftIntro,Keyword,OnTop,Elite,Stars,UpdateTime,Editor,Hits,DayHits,WeekHits,MonthHits dim SoftLevel,SoftPoint,Passed,DecompressPassword,SoftSize,DownloadUrl1,DownloadUrl2,DownloadUrl3,DownloadUrl4 dim tClass,ClassName,Depth,ParentPath,Child,i ObjInstalled=IsObjInstalled("Scripting.FileSystemObject") FoundErr=false Action=trim(request("Action")) SoftID=Trim(Request.Form("SoftID")) ClassID=trim(request.form("ClassID")) 'SpecialID=trim(request.Form("SpecialID")) SoftName=trim(request.form("SoftName")) SoftVersion=trim(request.form("SoftVersion")) SoftType=trim(request.form("SoftType")) SoftLanguage=trim(request.form("SoftLanguage")) CopyrightType=trim(request.form("CopyrightType")) OperatingSystem=trim(request.form("OperatingSystem")) Author=trim(request.form("Author")) AuthorEmail=trim(request.form("AuthorEmail")) AuthorHomepage=trim(request.form("AuthorHomePage")) DemoUrl=trim(request.form("DemoUrl")) RegUrl=trim(request.form("RegUrl")) SoftPicUrl=trim(request.form("SoftPicUrl")) SoftIntro=trim(request.form("SoftIntro")) Keyword=trim(request.form("Keyword")) OnTop=trim(request.form("OnTop")) Elite=trim(request.form("Elite")) Stars=trim(request.form("Stars")) UpdateTime=trim(request.form("UpdateTime")) Editor=AdminName Hits=trim(request.form("Hits")) DayHits=trim(request.form("DayHits")) WeekHits=trim(request.form("WeekHits")) MonthHits=trim(request.form("MonthHits")) SoftLevel=trim(request.form("SoftLevel")) SoftPoint=trim(request.form("SoftPoint")) Passed=trim(request.form("Passed")) DecompressPassword=trim(request.form("DecompressPassword")) SoftSize=trim(request.form("SoftSize")) DownloadUrl1=trim(request.form("DownloadUrl1")) DownloadUrl2=trim(request.form("DownloadUrl2")) DownloadUrl3=trim(request.form("DownloadUrl3")) DownloadUrl4=trim(request.form("DownloadUrl4")) if Action="" then FoundErr=True ErrMsg=ErrMsg & "
  • 参数不足
  • " else call SaveSoft() end if if founderr=true then call WriteErrMsg() else call SaveSuccess() end if call CloseConn() sub SaveSoft() dim PurviewChecked if ClassID="" then founderr=true errmsg=errmsg & "
  • 未指定软件所属栏目或者指定的栏目有下属子栏目
  • " else ClassID=CLng(ClassID) if ClassID<=0 then FoundErr=True ErrMsg=ErrMsg & "
  • 指定了非法的栏目(外部栏目或不存在的栏目)
  • " else set tClass=conn.execute("select ClassName,Depth,ParentPath,Child,LinkUrl From SoftClass where ClassID=" & ClassID) if tClass.bof and tClass.eof then founderr=True ErrMsg=ErrMsg & "
  • 找不到指定的栏目
  • " else ClassName=tClass(0) Depth=tClass(1) ParentPath=tClass(2) Child=tClass(3) if Child>0 then FoundErr=True ErrMsg=ErrMsg & "
  • 指定的栏目有下属子栏目
  • " end if if tClass(4)<>"" then FoundErr=True ErrMsg=ErrMsg & "
  • 不能指定外部栏目
  • " end if if AdminPurview=2 and AdminPurview_Soft=3 then PurviewChecked=CheckClassMaster(tClass(6),AdminName) if PurviewChecked=False and tClass(5)>0 then set tClass=conn.execute("select ClassInputer from SoftClass where ClassID in (" & ParentPath & ")") do while not tClass.eof PurviewChecked=CheckClassMaster(tClass(0),AdminName) if PurviewChecked=True then exit do tClass.movenext loop end if if PurviewChecked=False then FoundErr=True ErrMsg=ErrMsg & "
  • 对不起,你没有在此栏目添加图片的权限!
  • " end if end if end if end if end if if SoftName="" then founderr=true errmsg=ErrMsg & "
  • 软件名称不能为空
  • " end if if SoftVersion="" then founderr=true errmsg=ErrMsg & "
  • 软件版本不能为空
  • " end if if Author="" then founderr=true errmsg=errmsg & "
  • 请输入软件作者/开发商
  • " end if if Keyword="" then founderr=true errmsg=errmsg & "
  • 请输入软件关键字
  • " end if if SoftIntro="" then founderr=true errmsg=errmsg & "
  • 软件简介不能为空
  • " end if if DownloadUrl1="" then founderr=true errmsg=errmsg & "
  • 软件下载地址1不能为空
  • " end if if FoundErr=True then exit sub end if if SoftType<>"" then SoftType=CLng(SoftType) else SoftType=0 end if if SoftLanguage<>"" then SoftLanguage=CLng(SoftLanguage) else SoftLanguage=0 end if if CopyrightType<>"" then CopyrightType=CLng(CopyrightType) else CopyrightType=0 end if Keyword="|" & ReplaceBadChar(Keyword) & "|" if UpdateTime<>"" and IsDate(UpdateTime)=true then UpdateTime=CDate(UpdateTime) else UpdateTime=now() end if if Hits<>"" then Hits=CLng(Hits) else Hits=0 end if if DayHits<>"" then DayHits=CLng(DayHits) else DayHits=0 end if if WeekHits<>"" then WeekHits=CLng(WeekHits) else WeekHits=0 end if if MonthHits<>"" then MonthHits=CLng(MonthHits) else MonthHits=0 end if if SoftLevel="" then SoftLevel=9999 else SoftLevel=CInt(SoftLevel) end if if SoftPoint="" then SoftPoint=0 else SoftPoint=Cint(SoftPoint) end if if Stars="" then Stars=0 else Stars=CInt(Stars) end if if SoftSize="" then SoftSize=0 else SoftSize=Clng(SoftSize) end if set rs=server.createobject("adodb.recordset") if Action="Add" then sql="select top 1 * from Soft" rs.open sql,conn,1,3 rs.addnew call SaveData() rs("Editor")=Editor rs.update SoftID=rs("SoftID") Passed=rs("Passed") rs.close elseif Action="Modify" then if SoftID="" then founderr=true errmsg=errmsg & "
  • 不能确定SoftID的值
  • " else SoftID=Clng(SoftID) sql="select * from Soft where Softid=" & SoftID rs.open sql,conn,1,3 if rs.bof and rs.eof then founderr=true errmsg=errmsg & "
  • 找不到此软件,可能已经被其他人删除。
  • " else call SaveData() rs.update Passed=rs("Passed") rs.close end if end if else FoundErr=True ErrMsg="
  • 参数错误!
  • " end if set rs=nothing end sub sub SaveData() rs("ClassID")=ClassID 'rs("SpecialID")=SpecialID rs("SoftName")=SoftName rs("SoftVersion")=SoftVersion rs("SoftType")=SoftType rs("SoftLanguage")=SoftLanguage rs("CopyrightType")=CopyrightType rs("OperatingSystem")=OperatingSystem rs("Author")=Author rs("AuthorEmail")=AuthorEmail rs("AuthorHomepage")=AuthorHomepage rs("DemoUrl")=DemoUrl rs("RegUrl")=RegUrl rs("SoftPicUrl")=SoftPicUrl rs("SoftIntro")=SoftIntro rs("Keyword")=Keyword rs("Hits")=Hits rs("DayHits")=DayHits rs("WeekHits")=WeekHits rs("MonthHits")=MonthHits rs("SoftLevel")=SoftLevel rs("SoftPoint")=SoftPoint rs("Stars")=Stars rs("UpdateTime")=UpdateTime if Passed="yes" then rs("Passed")=True else rs("Passed")=False end if if OnTop="yes" then rs("OnTop")=True else rs("OnTop")=False end if if Elite="yes" then rs("Elite")=True else rs("Elite")=False end if rs("DecompressPassword")=DecompressPassword rs("SoftSize")=SoftSize rs("DownloadUrl1")=DownloadUrl1 rs("DownloadUrl2")=DownloadUrl2 rs("DownloadUrl3")=DownloadUrl3 rs("DownloadUrl4")=DownloadUrl4 end sub sub SaveSuccess() %>

    <%if Passed=False then%> <%end if%>
    <%if action="Add"then%> 添加 <%else%> 修改 <%end if%> 软件成功
    注意:
        你的软件尚未真正发表!只有等管理员审核并通过了你的软件后,你所添加的软件才会发表。
    所属栏目: <%call Admin_ShowPath2(ParentPath,ClassName,Depth)%>
    软件名称: <%= dvHtmlEncode(SoftName) %>
    软件版本: <%= dvHtmlEncode(SoftVersion) %>
    软件作者: <%= dvHtmlEncode(Author) %>
    关 键 字: <%= mid(Keyword,2,len(Keyword)-2) %>
    修改此软件】 【继续添加软件】 【软件管理】 【预览软件下载页面
    <% session("ClassID_Soft")=ClassID end sub %>