<!-- #include file="conn.asp" -->
<!-- #include file="cls_main.asp" -->
<!-- #include file="cls_md5.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>会员中心</title>
<link href="User_Style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="800"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td colspan="3"><img src="images/user_top.gif" width="800" height="13"></td>
  </tr>
  <tr>
    <td width="10">&nbsp;</td>
    <td width="190"><img src="images/User_Logo.gif" width="150" height="72"></td>
    <td width="600" align="right"><table  border="0" cellpadding="0" cellspacing="1">
        <tr>
          <td>·<a href="default.html">站点首页</a> ·<a href="downnew/0_1.html">最近更新</a> ·<a href="downtop/1_1.html">下载排行</a> </td>
          <td>·<a href="UserLogin.asp?action=logout">退出登录</a></td>
          <td width="10">&nbsp;</td>
        </tr>
      </table>
        <table  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="52" align="center" background="images/user_bg.gif"><img src="images/user_bg1.gif" width="8" height="52" align="absmiddle">&nbsp;<a href="User_Index.asp">会员中心</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Upload.asp">上传软件</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Resource.asp">添加软件</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Down_Reslist.asp">软件管理</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Cms_Resource.asp">添加文章</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Cms_Reslist.asp">文章管理</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_Modfiy.asp">资料修改</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_BuyPoints.asp">帐号充值</a> <img src="images/bg_dot1.gif" width="3" height="25" align="absmiddle"> <a href="User_List.asp">会员列表</a>&nbsp;<img src="images/user_bg2.gif" width="10" height="52" align="absmiddle"></td>
          </tr>
      </table></td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="400" valign="top">
<% dim obj
set obj = New User_Down_Resource
	obj.AspInit()
set obj = nothing %>
	</td>
  </tr>
</table>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/user_ti.gif" width="800"></td>
  </tr>
</table>
</body>
</html>
<% Class User_Down_Resource

	Private ishion, isEdit, fso
	Private Sub Class_Initialize()
		Set ishion = New Cls_Main
	End Sub
	Private Sub Class_Terminate()
		Set ishion = Nothing
	End Sub
	Public Sub AspInit()
	   
		isEdit = False
		
			If ishion.MemberUserName = "" Then
				ishion.strMsg = "<li>非法操作，您没有登录系统，<a href=""UserLogin.asp"">点击此处进入登录界面</a>。"
				Call ishion.SystemMsg
			Else
				Call Main
			End If			
	
	End Sub

	Private Sub Main()
		Call ishion.LoadSetting
		Select Case Request("action")
		Case "add"
			Call SaveAdd
		Case "modify"
			Call SaveModify
		Case "edit"
			isEdit = True
			Call myform
		Case Else
			Call myform
		End Select
	End Sub
	Private Function myPermission()
		myPermission = False
		If ishion.checkPermission(ishion.adminName, "11") Then myPermission = True: Exit Function
		If ishion.checkPermission(ishion.adminName, "12") Then myPermission = True: Exit Function
		'If ishion.checkPermission(ishion.adminName,"10") Then myPermission = False
	End Function
	Private Sub SaveModify()
		If ishion.ChkPost = False Then
			ishion.strMsg = "非法操作，不要从外部提交数据。"
			Call ishion.SystemMsg
			Exit Sub
		End If
		
		If Not IsObject(Conn) Then ConnectionDatabase
		Dim Rs, sql, splCatalog, y_splCatalog, sID, sContent, i, sKeys
		
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "Select * from ishion_Down_Resource where UserName='" & ishion.MemberUserName & "' and ID=" & CLng(Request.Form("ID"))
		Rs.open sql, Conn, 1, 3
		If Rs.EOF And Rs.BOF Then
			ishion.strMsg = "<li>您没有权限更新其他会员添加的资源。"
			Call ishion.SystemMsg
			Rs.Close
			Set Rs = Nothing
			Exit Sub
		End If
		
		Rs("ResName") = Trim(Request.Form("ResName"))
		Rs("ResVer") = Trim(Request.Form("ResVer"))
		If Trim(Request.Form("Keys")) = "" Then
			sKeys = Trim(Request.Form("ResName"))
		Else
			sKeys = Trim(Request.Form("Keys"))
		End If
		Rs("Keys") = sKeys
		'0=RootID;1=CatalogID;2=Depth;3=CatalogName
		splCatalog = Split(Trim(Request.Form("strCatalog")), ",")
		Rs("RootID") = splCatalog(0)
		Rs("CatalogID") = splCatalog(1)
		Rs("CatalogName") = splCatalog(3)
		Rs("Depth") = splCatalog(2)
		For i = 1 To Request("content1").Count
			sContent = sContent & Request("content1")(i)
		Next
		'sContent = Request.Form("content")
		'Response.Write(sContent)
		Rs("Content") = sContent
		Rs("Excerpt") = ishion.cutStr(ishion.GetTextFromHtml(sContent), 250)
		Rs("IndexKeys") = ishion.GetSpellChar(Trim(Request.Form("ResName")))
		Rs("md5") = MD5(Trim(Request.Form("ResName")), 32)
		Rs("FontColor") = Trim(Request.Form("FontColor"))
		Rs("FontType") = Trim(Request.Form("FontType"))
		Rs("SmallImg") = Trim(Request.Form("SmallImg"))
		Rs("PreviewImg") = Trim(Request.Form("PreviewImg"))
		Rs("authorURL") = Trim(Request.Form("authorURL"))
		Rs("authorEmail") = Trim(Request.Form("authorEmail"))
		Rs("RegURL") = Trim(Request.Form("RegURL"))
		Rs("ResLicence") = Trim(Request.Form("ResLicence"))
		If Trim(Request.Form("SizeUnit")) = "MB" Then
			Rs("ResSize") = Trim(Request.Form("ResSize")) * 1024
		Else
			Rs("ResSize") = Trim(Request.Form("ResSize"))
		End If
		Rs("ResLanguage") = Trim(Request.Form("ResLanguage"))
		Rs("System") = Trim(Request.Form("System"))
		Rs("ResRank") = Trim(Request.Form("ResRank"))
		Rs("ResType") = Trim(Request.Form("ResType"))
		If Request.Form("isHot") = 1 Then
			Rs("isHot") = 1
		Else
			Rs("isHot") = 0
		End If
		If Request.Form("isTop") = 1 Then
			Rs("isTop") = 1
		Else
			Rs("isTop") = 0
		End If
		If Request.Form("isBest") = 1 Then
			Rs("isBest") = 1
		Else
			Rs("isBest") = 0
		End If
		Rs("UserClass") = Request.Form("UserClass")
		Rs("isError") = 0
		Rs("UserPoints") = Trim(Request.Form("UserPoints"))
		Rs("isAuditing") = 1
		Rs("UserName") = ishion.adminName
		If Request.Form("updateTime") = "yes" Then Rs("UpdateTime") = Now()
		Rs("MutualityDown") = ishion.MutualityDownRes(sKeys, 10, CLng(Request.Form("ID")))
		Rs("MutualityCms") = ishion.MutualityCmsRes(sKeys, 10, 0)
		Rs.Update
		Rs.Close
		sID = Trim(Request.Form("ID"))
	
		
		'更新原下载地址
		Dim sply_ID, sply_Name, sply_Url, sply_SiteID
		Dim splName, splUrl, splSiteID, ii, iii
		If Trim(Request.Form("y_ID")) <> "" Then
			sply_ID = Split(Request.Form("y_ID"), ",")
			sply_Name = Split(Request.Form("y_Name"), ",")
			sply_Url = Split(Request.Form("y_Url"), ",")
			sply_SiteID = Split(Request.Form("y_SiteID"), ",")
			For ii = 0 To UBound(sply_ID)
			If Not (sply_Url(ii) = "" Or sply_Url(ii) = " ") Then
				sql = "select * from ishion_Down_Address where ID=" & sply_ID(ii)
				Rs.open sql, Conn, 1, 3
				Rs("Name") = Trim(sply_Name(ii))
				Rs("Url") = Trim(sply_Url(ii))
				Rs("SiteID") = Trim(sply_SiteID(ii))
				Rs.Update
				Rs.Close
			End If
			Next
		End If
	
		'批量删除选择的软件下载地址
		If Request.Form("selID") <> "" Then Conn.Execute ("delete from ishion_Down_Address where ID in (" & Request.Form("selID") & ")")
	
		'添加新的下载地址
		If Request.Form("Url") <> "" Then
			splName = Split(Request.Form("Name"), ",")
			splUrl = Split(Request.Form("Url"), ",")
			splSiteID = Split(Request.Form("siteID"), ",")
			For iii = 0 To UBound(splUrl)
			If Not (splUrl(iii) = "" Or splUrl(iii) = " ") Then
				sql = "select * from ishion_Down_Address where (ID is null)"
				Rs.open sql, Conn, 1, 3
				Rs.AddNew
				Rs("Name") = Trim(splName(iii))
				Rs("Url") = Trim(splUrl(iii))
				Rs("ResourceID") = sID
				Rs("Hits") = 0
				Rs("SiteID") = Trim(splSiteID(iii))
				Rs.Update
				Rs.Close
			End If
			Next
		End If
		Set Rs = Nothing
		'0=RootID;1=CatalogID;2=Depth;3=CatalogName
		y_splCatalog = Split(Trim(Request.Form("y_catalog")), ",")
		
		If splCatalog(1) <> y_splCatalog(1) Then
		
		'更新原分类的资源统计
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum-1 where CatalogId=" & y_splCatalog(1))
		'更新原同根分类的父级资源数统计 '0=RootID;1=CatalogID;2=Depth;3=CatalogName
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum-1 where RootId=" & y_splCatalog(0) & " and Depth>" & y_splCatalog(2) & " and isShowAllRes=1")
		
		
		'更新本分类的资源统计
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where CatalogId=" & splCatalog(1))
		'更新同根分类的父级资源数统计 '0=RootID;1=CatalogID;2=Depth;3=CatalogName
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where RootId=" & splCatalog(0) & " and Depth>" & splCatalog(2) & " and isShowAllRes=1")
		
		End If
		
		ishion.strMsg = "<li>修改下载资源信息操作成功，可以继续以下操作。" & _
		"<li>操作一：<a href=""?s="">继续添加新下载资源</a>" & _
		"<li>操作二：<a href=""?catalogID=" & splCatalog(1) & """>继续在分类[" & splCatalog(3) & "]中添加新下载资源</a>" & _
		"<li>操作三：<a href=""?action=edit&id=" & sID & """>再次修改编辑下载资源[" & Trim(Request.Form("ResName")) & " " & Trim(Request.Form("ResVer")) & "]的信息。</li>"
		Call ishion.SystemMsg
	End Sub
	Private Sub SaveAdd()
		If ishion.ChkPost = False Then
			ishion.strMsg = "非法操作，不要从外部提交数据。"
			Call ishion.SystemMsg
			Exit Sub
		End If
		Dim Rs, sql, splCatalog, sID, sContent, i, sKeys, ResNum
		Set Rs = ishion.Execute("select top 1 ID from ishion_Down_Resource")
		If Rs.EOF And Rs.BOF Then
			ResNum = 0
		Else
			ResNum = CLng(ishion.Execute("select max(id) from ishion_Down_Resource")(0))
		End If
		Set Rs = Nothing
		If ishion.F469e80d32(1) <> "1" Then
			If ResNum > 2000 Then
				ishion.strMsg = "未注册版本最多资源数为2000个。"
				Call ishion.SystemMsg
				Exit Sub
			End If
		End If
		
		If Not IsObject(Conn) Then Call ConnectionDatabase
	
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "select * from ishion_Down_Resource where (ID is null)"
		Rs.open sql, Conn, 1, 3
		Rs.AddNew
		Rs("ResName") = Trim(Request.Form("ResName"))
		Rs("ResVer") = Trim(Request.Form("ResVer"))
		If Trim(Request.Form("Keys")) = "" Then
			sKeys = Trim(Request.Form("ResName"))
		Else
			sKeys = Trim(Request.Form("Keys"))
		End If
		Rs("Keys") = sKeys
		'0=RootID;1=CatalogID;2=Depth;3=CatalogName
		splCatalog = Split(Trim(Request.Form("strCatalog")), ",")
		Rs("RootID") = splCatalog(0)
		Rs("CatalogID") = splCatalog(1)
		Rs("CatalogName") = splCatalog(3)
		Rs("Depth") = splCatalog(2)
		For i = 1 To Request("content1").Count
			sContent = sContent & Request("content1")(i)
		Next
		'sContent = Request.Form("content")
		'Response.Write(sContent)
		Rs("Content") = sContent
		Rs("Excerpt") = ishion.cutStr(ishion.GetTextFromHtml(sContent), 250)
		Rs("IndexKeys") = ishion.GetSpellChar(Trim(Request.Form("ResName")))
		Rs("md5") = MD5(Trim(Request.Form("ResName")), 32)
		Rs("FontColor") = Trim(Request.Form("FontColor"))
		Rs("FontType") = Trim(Request.Form("FontType"))
		Rs("SmallImg") = Trim(Request.Form("SmallImg"))
		Rs("PreviewImg") = Trim(Request.Form("PreviewImg"))
		Rs("authorURL") = Trim(Request.Form("authorURL"))
		Rs("authorEmail") = Trim(Request.Form("authorEmail"))
		Rs("RegURL") = Trim(Request.Form("RegURL"))
		Rs("ResLicence") = Trim(Request.Form("ResLicence"))
		If Trim(Request.Form("SizeUnit")) = "MB" Then
			Rs("ResSize") = Trim(Request.Form("ResSize")) * 1024
		Else
			Rs("ResSize") = Trim(Request.Form("ResSize"))
		End If
		Rs("ResLanguage") = Trim(Request.Form("ResLanguage"))
		Rs("System") = Trim(Request.Form("System"))
		Rs("ResRank") = Trim(Request.Form("ResRank"))
		Rs("ResType") = Trim(Request.Form("ResType"))
		If Request.Form("isHot") = 1 Then
			Rs("isHot") = 1
		Else
			Rs("isHot") = 0
		End If
		If Request.Form("isTop") = 1 Then
			Rs("isTop") = 1
		Else
			Rs("isTop") = 0
		End If
		If Request.Form("isBest") = 1 Then
			Rs("isBest") = 1
		Else
			Rs("isBest") = 0
		End If
		Rs("UserClass") = Request.Form("UserClass")
		Rs("isError") = 0
		Rs("UserPoints") = Trim(Request.Form("UserPoints"))
		Rs("HitsToday") = 0
		Rs("DateToday") = Now()
		Rs("HitsWeek") = 0
		Rs("DateWeek") = Now()
		Rs("HitsMonth") = 0
		Rs("DateMonth") = Now()
		Rs("HitsTotal") = 0
		Rs("isAuditing") = 1
		Rs("UserName") = ishion.adminName
		Rs("DateAndTime") = Now()
		Rs("UpdateTime") = Now()
		Rs("MutualityDown") = ishion.MutualityDownRes(sKeys, 10, ResNum)
		Rs("MutualityCms") = ishion.MutualityCmsRes(sKeys, 10, 0)
		Rs("CommentNum") = 0
		Rs("Grade") = 0
		Rs.Update
		sID = ishion.Execute("select max(id) from ishion_Down_Resource")(0)
		Rs.Close
		
		Dim splName, splUrl, splSiteID, iii
		If Request.Form("Url") <> "" Then
			splName = Split(Request.Form("Name"), ",")
			splUrl = Split(Request.Form("Url"), ",")
			splSiteID = Split(Request.Form("siteID"), ",")
			For iii = 0 To UBound(splUrl)
			If Not (splUrl(iii) = "" Or splUrl(iii) = " ") Then
				sql = "select * from ishion_Down_Address where (ID is null)"
				Rs.open sql, Conn, 1, 3
				Rs.AddNew
				Rs("Name") = Trim(splName(iii))
				Rs("Url") = Trim(splUrl(iii))
				Rs("ResourceID") = sID
				Rs("Hits") = 0
				Rs("SiteID") = Trim(splSiteID(iii))
				Rs.Update
				Rs.Close
			End If
			Next
		End If
		Set Rs = Nothing
	
		'更新本分类的资源统计
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where CatalogId=" & splCatalog(1))
		'更新同根分类的父级资源数统计 '0=RootID;1=CatalogID;2=Depth;3=CatalogName
		ishion.Execute ("update ishion_Down_Catalog set isUpdate=1,ResNum=ResNum+1 where RootId=" & splCatalog(0) & " and Depth>" & splCatalog(2) & " and isShowAllRes=1")
		
		ishion.strMsg = "<li>添加下载资源操作成功，可以继续以下操作。" & _
		"<li>操作一：<a href=""?s="">继续添加新下载资源</a>" & _
		"<li>操作二：<a href=""?catalogID=" & splCatalog(1) & """>继续在分类[" & splCatalog(3) & "]中添加新下载资源</a>" & _
		"<li>操作三：<a href=""?action=edit&id=" & sID & """>修改编辑下载资源[" & Trim(Request.Form("ResName")) & " " & Trim(Request.Form("ResVer")) & "]的信息。</li>"
		Call ishion.SystemMsg
	End Sub
	Private Sub myform()
		Dim eRs, sTitle, i, sql, strArr
		If isEdit Then
			Set eRs = ishion.Execute("select * from ishion_Down_Resource where ID=" & CLng(Request("ID")))
			sTitle = "修改下载资源信息"
			If eRs.EOF And eRs.BOF Then
				ishion.strMsg = "<li>您没有权限更新其他会员添加的资源。"
				Call ishion.SystemMsg
				Set eRs = Nothing
				Exit Sub
			End If
		Else
			sTitle = "添加下载资源信息"
		End If
	   ' Call ishion.LoadSetting
		Response.Write "   <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "<tr><td align=""center"" background=""images/menubg.gif"" colspan=""2"">" & sTitle & "</td></tr>"
		Response.Write "     <COLGROUP>" & vbCrLf
		Response.Write "    <COL width=""65"">" & vbCrLf
		Response.Write "    <COL width=""*"">" & vbCrLf
		Response.Write "<SCRIPT LANGUAGE=javascript>" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "function SelectColor(){" & vbCrLf
		Response.Write "    var arr = showModalDialog(""eWebEditor/Dialog/selcolor.htm"", """", ""dialogWidth:20em; dialogHeight:16em; status:0;help=no"");" & vbCrLf
		Response.Write "    if (arr ==null){" & vbCrLf
		Response.Write "        myform.FontColor.value="""";" & vbCrLf
		Response.Write "        alert(""系统提示：当前没有选择颜色，系统将启用页面默认颜色，或重新选择！"");" & vbCrLf
		Response.Write "        myform.FontColor.focus();" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (arr !=null){" & vbCrLf
		Response.Write "        myform.FontColor.value=arr;" & vbCrLf
		Response.Write "        myform.FontColor.style.backgroundColor=arr;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "function SetSmallImg(){" & vbCrLf
		Response.Write "    var arr = showModalDialog(""eWebEditor/Upload_Images_Dialog.asp?style=s_ishioncn"", """", ""dialogWidth:26em; dialogHeight:10em; status:0;help=no"");" & vbCrLf
		Response.Write "    if (arr ==null){" & vbCrLf
		Response.Write "        myform.SmallImg.value="""";" & vbCrLf
		Response.Write "        alert(""系统提示：当前没有上传图片，资源缩略图为空，用户可以重新上传图片！"");" & vbCrLf
		Response.Write "        //myform.SmallImg.focus();" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (arr !=null){" & vbCrLf
		Response.Write "        myform.SmallImg.value=arr;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "function SetPreviewImg(){" & vbCrLf
		Response.Write "    var arr = showModalDialog(""eWebEditor/Upload_Images_Dialog.asp?style=s_ishioncn"", """", ""dialogWidth:26em; dialogHeight:10em; status:0;help=no"");" & vbCrLf
		Response.Write "    if (arr ==null){" & vbCrLf
		Response.Write "        myform.PreviewImg.value="""";" & vbCrLf
		Response.Write "        alert(""系统提示：当前没有上传图片，界面预览图为空，用户可以重新上传图片！"");" & vbCrLf
		Response.Write "        //myform.PreviewImg.focus();" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (arr !=null){" & vbCrLf
		Response.Write "        myform.PreviewImg.value=arr;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "// 表单提交客户端检测" & vbCrLf
		Response.Write "function VF_myform(){ //v2.0" & vbCrLf
		Response.Write "<!--start_of_saved_settings-->" & vbCrLf
		Response.Write "<!--type,text,name,ResSize,required,true,isNum,errMsg,资源大小必须填写数字格式。-->" & vbCrLf
		Response.Write "<!--type,select,name,strCatalog,isDefault,errMsg,必须设置资源分类！-->" & vbCrLf
		Response.Write "<!--type,text,name,ResName,required,true,errMsg,资源名称必须填写！-->" & vbCrLf
		Response.Write "<!--end_of_saved_settings-->" & vbCrLf
		Response.Write "    var theForm = document.myform;" & vbCrLf
		Response.Write "    var numRE = /^\d+$/;" & vbCrLf
		Response.Write "    var sFlg_strCatalog = false;" & vbCrLf
		Response.Write "    var errMsg = """";" & vbCrLf
		Response.Write "    var setfocus = """";" & vbCrLf
		Response.Write vbCrLf
		Response.Write "    for(var s4=0;s4<theForm['strCatalog'].length;s4++){if(theForm['strCatalog'].options[s4].selected){if(theForm['strCatalog'].options[s4].text==theForm['strCatalog'].options[0].text)sFlg_strCatalog=true;}}" & vbCrLf
		Response.Write vbCrLf
		Response.Write "    if (!numRE.test(theForm['ResSize'].value)){" & vbCrLf
		Response.Write "        errMsg = ""资源大小必须填写数字格式。"";" & vbCrLf
		Response.Write "        setfocus = ""['ResSize']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (sFlg_strCatalog){" & vbCrLf
		Response.Write "        errMsg = ""必须设置资源分类！"";" & vbCrLf
		Response.Write "        setfocus = ""['strCatalog']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (theForm['ResName'].value == """"){" & vbCrLf
		Response.Write "        errMsg = ""资源名称必须填写！"";" & vbCrLf
		Response.Write "        setfocus = ""['ResName']"";" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (eWebEditor1.getHTML()==""""){" & vbCrLf
		Response.Write "        alert(""资源介绍不能为空！"");" & vbCrLf
		Response.Write "        return false;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    if (errMsg != """"){" & vbCrLf
		Response.Write "        alert(errMsg);" & vbCrLf
		Response.Write "        eval(""theForm"" + setfocus + "".focus()"");" & vbCrLf
		Response.Write "        return false;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "    else" & vbCrLf
		Response.Write "    //theForm.content.value=eWebEditor1.getHTML();" & vbCrLf
		Response.Write "    theForm.submit();" & vbCrLf
		Response.Write "}//-->" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Response.Write "<style type=""text/css"">" & vbCrLf
		Response.Write "label{cursor:hand;}" & vbCrLf
		Response.Write "</style>" & vbCrLf
		Response.Write "   <form action=""user_down_resource.asp"" method=""post"" name=""myform"">" & vbCrLf
		Response.Write "        <input type=""Hidden"" name=""action"" value="""
		If isEdit Then
		Response.Write "modify"
		Else
		Response.Write "add"
		End If
		Response.Write """>" & vbCrLf
		If isEdit Then
			Response.Write "        <input type=""Hidden"" name=""ID"" value=""" & CLng(Request("ID")) & """>" & vbCrLf
			Response.Write "        <input type=""Hidden"" name=""y_catalog"" value=""" & eRs("RootID") & "," & eRs("catalogID") & "," & eRs("Depth") & "," & eRs("catalogName") & """>" & vbCrLf
		End If
		Response.Write "          <tr class=""tdbg2"">" & vbCrLf
		Response.Write "            <td align=""right"">资源名称：</td>" & vbCrLf
		Response.Write "            <td ><input type=""text"" name=""ResName"" size=""45"" value="""
		If isEdit Then Response.Write Trim(eRs("ResName"))
		Response.Write """ maxlength=""100"" tabindex=""1""> " & vbCrLf
		Response.Write "              <font color=""#FF0000"">！</font> 版本：<input type=""text"" name=""ResVer"" maxlength=""100"" size=""20"" value=""" & vbCrLf
		If isEdit Then Response.Write Trim(eRs("ResVer"))
		Response.Write """> 颜色：<input type=""text"" name=""FontColor"" id=""titlecolor"" size=""6"" onclick=""SelectColor();"" readonly " & vbCrLf
		If isEdit Then Response.Write "value=""" & eRs("FontColor") & """ style=""background-color:" & eRs("FontColor") & """ "
		Response.Write "> <select name=""FontType"" id=""FontType"">" & vbCrLf
		Response.Write "                <option value=""0"">字形</option> " & vbCrLf
		If isEdit Then
			Response.Write "                <option value=""1"" " & vbCrLf
			If eRs("FontType") = 1 Then Response.Write ("selected")
			Response.Write ">粗体</option>"
			Response.Write "                <option value=""2"" " & vbCrLf
			If eRs("FontType") = 2 Then Response.Write ("selected")
			Response.Write ">斜体</option>"
			Response.Write "                <option value=""3"" " & vbCrLf
			If eRs("FontType") = 3 Then Response.Write ("selected")
			Response.Write ">粗+斜</option>"
		Else
			Response.Write "                <option value=""1"">粗体</option>" & vbCrLf
			Response.Write "                <option value=""2"">斜体</option>" & vbCrLf
			Response.Write "                <option value=""3"">粗+斜</option>" & vbCrLf
		End If
		Response.Write "                <option value=""0"">规则</option>" & vbCrLf
		Response.Write "              </select></td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"">所属分类：</td>" & vbCrLf
		Response.Write "            <td > <select name=""strCatalog"" tabindex=""2"">" & vbCrLf
		Response.Write "                <option value="""">↓请选择栏目↓</option>" & vbCrLf
		If isEdit Then
			Response.Write ishion.GetCatalogSelect(eRs("catalogID"), "ishion_Down_Catalog")
		Else
			If Request.QueryString("catalogID") <> "" Then
				Response.Write ishion.GetCatalogSelect(CLng(Request.QueryString("catalogID")), "ishion_Down_Catalog")
			Else
				Response.Write ishion.GetCatalogSelect(0, "ishion_Down_Catalog")
			End If
		End If
		Response.Write " </select> <font color=""#FF0000"">！</font> 软件大小：<input type=""text"" name=""ResSize"" size=""14"" maxlength=""10""  value="""
		If isEdit Then Response.Write Trim(eRs("ResSize"))
		Response.Write """> " & vbCrLf
		Response.Write "              <input name=""SizeUnit"" type=""radio"" value=""KB"" checked id=""kb""><label for=""kb"">KB</label> " & vbCrLf
		Response.Write "              <input type=""radio"" name=""SizeUnit"" value=""MB"" id=""mb""><label for=""mb"">MB</label> " & vbCrLf
		Response.Write "              <font color=""#FF0000"">！</font>关键字：<input type=""text"" name=""Keys"" size=""25"" maxlength=""100""  value="""
	
		If isEdit Then Response.Write Trim(eRs("Keys"))
		Response.Write """></td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg3"">" & vbCrLf
		Response.Write "            <td align=""right"" nowrap>运行环境：</td>" & vbCrLf
		Response.Write "            <td>"
		strArr = ishion.system
		For i = 0 To UBound(strArr)
			Response.Write "<input type=""checkbox"" name=""System"" value=""" & Trim(strArr(i)) & """ "
			If isEdit Then
				If InStr(eRs("System"), Trim(strArr(i))) > 0 Then
					Response.Write "checked"
				End If
			ElseIf InStr(ishion.Setting(145), Trim(strArr(i))) > 0 Then
				Response.Write "checked"
			End If
			Response.Write " id=""system" & i & """><label for=""system" & i & """>" & Trim(strArr(i)) & "</label> "
			If i = 5 Then Response.Write "<br>"
		Next
		Response.Write "              <font color=""#FF0000"">！</font> </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>资源等级：</td>" & vbCrLf
		Response.Write "            <td>"
		For i = 1 To ishion.Setting(139)
			Response.Write "<input type=""radio"" name=""ResRank"" value=""" & i & """"
			If isEdit Then
				If i = eRs("ResRank") Then Response.Write " checked"
			Else
				If i = ishion.Setting(139) \ 2 + 1 Then Response.Write " checked"
			End If
			Response.Write " id=""stars" & i & """><label for=""stars" & i & """>" & i & "星</label>" & vbCrLf
		Next
		Response.Write "              <font color=""#FF0000""> ！</font> </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg3""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>授权类型：</td>" & vbCrLf
		Response.Write "            <td>"
		strArr = ishion.ResLicence
		For i = 0 To UBound(strArr)
			Response.Write "<input type=""radio"" name=""ResLicence"" value=""" & strArr(i) & """"
			If isEdit Then
				If strArr(i) = eRs("ResLicence") Then Response.Write " checked"
			Else
				If i = 0 Then Response.Write " checked"
			End If
			Response.Write " id=""ResLicence" & i & """><label for=""ResLicence" & i & """>" & strArr(i) & "</label>" & vbCrLf
		Next
		Response.Write "              <font color=""#FF0000"">！</font> </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2"">" & vbCrLf
		Response.Write "            <td align=""right"" nowrap>性质类型：</td>" & vbCrLf
		Response.Write "            <td>"
		strArr = ishion.ResType
		For i = 0 To UBound(strArr)
			Response.Write "<input type=""radio"" name=""ResType"" value=""" & strArr(i) & """"
			If isEdit Then
				If strArr(i) = eRs("ResType") Then Response.Write " checked"
			Else
				If i = 0 Then Response.Write " checked"
			End If
				Response.Write " id=""ResType" & i & """><label for=""ResType" & i & """>" & strArr(i) & "</label>" & vbCrLf
		Next
		Response.Write "              <font color=""#FF0000"">！</font></td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg3""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>语言类型：</td>" & vbCrLf
		Response.Write "            <td>"
		strArr = ishion.ResLanguage
		For i = 0 To UBound(strArr)
			Response.Write "<input type=""radio"" name=""ResLanguage"" value=""" & strArr(i) & """"
			If isEdit Then
				If strArr(i) = eRs("ResLanguage") Then Response.Write " checked"
			Else
				If i = 0 Then Response.Write " checked"
			End If
			Response.Write " id=""ResLanguage" & i & """><label for=""ResLanguage" & i & """>" & strArr(i) & "</label>" & vbCrLf
		Next
		Response.Write "              <font color=""#FF0000"">！</font></td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>其他设置：</td>" & vbCrLf
		Response.Write "            <td >" & vbCrLf
		Response.Write "            <input name=""isHot"" type=""checkbox"" id=""isHot"" value=""1"" "
		If isEdit Then
			If eRs("isHot") = 1 Then Response.Write "checked"
		End If
		Response.Write "><label for=""isHot"">推荐下载</label> " & vbCrLf
		Response.Write "              <input name=""isTop"" type=""checkbox"" id=""isTop"" value=""1"" "
		If isEdit Then
			If eRs("isTop") = 1 Then Response.Write "checked"
		End If
		Response.Write "><label for=""isTop"">固顶下载</label>" & vbCrLf
		Response.Write "            <input name=""isBest"" type=""checkbox"" id=""isBest"" value=""1"" "
		If isEdit Then
			If eRs("isBest") = 1 Then Response.Write "checked"
		End If
		Response.Write "><label for=""isBest"">热门下载</label>" & vbCrLf
		Response.Write "            下载点数：<input type=""text"" name=""UserPoints"" size=""4"" maxlength=""4""  value="""
	
		If isEdit Then
			Response.Write Trim(eRs("UserPoints"))
		Else
			Response.Write ("0")
		End If
		Response.Write """>" & vbCrLf
		Response.Write "            下载级别：<select name=""UserClass"">" & vbCrLf
		strArr = ishion.UserClass
		For i = 0 To UBound(strArr)
			Response.Write "          <option value=""" & i & """"
			If isEdit Then
				If i = eRs("UserClass") Then Response.Write " selected"
			End If
			Response.Write ">" & strArr(i) & "</option>"
		Next
		Response.Write " </select>" & vbCrLf
		Response.Write "            </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg3""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>作者网址：</td>" & vbCrLf
		Response.Write "            <td><input type=""text"" name=""authorURL"" size=""38"" maxlength=""100""  value="""
		If isEdit Then Response.Write Trim(eRs("authorURL"))
		Response.Write """>" & vbCrLf
		Response.Write "            作者邮箱：<input type=""text"" name=""authorEmail"" size=""25"" maxlength=""100""  value="""
		If isEdit Then Response.Write Trim(eRs("authorEmail"))
		Response.Write """> </td>" & vbCrLf
		Response.Write "            </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>注册网址：</td>" & vbCrLf
		Response.Write "            <td ><input type=""text"" name=""RegURL"" size=""38""  value="""
		If isEdit Then Response.Write Trim(eRs("RegURL"))
		Response.Write """>" & vbCrLf
		Response.Write "              共享软件注册的网址链接</td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg3""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>界面预览： </td>" & vbCrLf
		Response.Write "            <td > <input type=""text"" name=""PreviewImg"" size=""38""  value="""
		
		If isEdit Then Response.Write Trim(eRs("PreviewImg"))
		Response.Write """>" & vbCrLf
		Response.Write "              <input type=""button"" value=""设置"" onclick=""SetPreviewImg();""> 资源界面预览图片，大小不定</td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"" nowrap>缩 略 图：</td>" & vbCrLf
		Response.Write "            <td > <input type=""text"" name=""SmallImg"" size=""38""  value="""
	
		If isEdit Then Response.Write Trim(eRs("SmallImg"))
		Response.Write """>" & vbCrLf
		Response.Write "            <input type=""button"" value=""设置"" onclick=""SetSmallImg();"">" & vbCrLf
		Response.Write "              资源的缩略图，建议大小为：135×120 px</td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"">资源介绍：</td>" & vbCrLf
		Response.Write "            <td ><TEXTAREA name=content id=content style=""display:none""></TEXTAREA>" & vbCrLf
		If isEdit Then
			Response.Write "<textarea name=""content1"" id=""content1"" style=""display:none"">" & eRs("Content") & "</textarea>" & vbCrLf
		Else
			Response.Write "<INPUT type=""hidden"" name=""content1"" value="""">" & vbCrLf
		End If
		Response.Write "              <IFRAME ID=""eWebEditor1"" src=""ewebeditor/ewebeditor.asp?id=content1&style=s_ishioncn"" frameborder=""0"" scrolling=""no"" width=""600"" height=""300""></IFRAME> </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		If isEdit Then
			If Not IsObject(Conn) Then ConnectionDatabase
			Dim Rs
			Set Rs = Server.CreateObject("adodb.recordset")
				sql = "select * from ishion_Down_Address where ResourceID=" & eRs("ID")
				Rs.open sql, Conn, 1, 1
				Dim totalPut
				If Not (Rs.EOF And Rs.BOF) Then
					totalPut = Rs.recordcount
				Do While Not Rs.EOF
				Response.Write "   <tr class=""tdbg3""> " & vbCrLf
				Response.Write "            <td colspan=""4""> " & vbCrLf
				Response.Write "              <table width=""100%"" border=""0"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
				Response.Write "                <tr> " & vbCrLf
				Response.Write "                  <td width=""75"" align=""right"">下载名称：</td>" & vbCrLf
				Response.Write "                  <td><input name=""y_Name"" type=""text"" size=""45"" maxlength=""100"" value=""" & Rs("Name") & """> "
				Response.Write "<input type=""checkbox"" name=""selID"" value=""" & Rs("ID") & """>删除此地址"
				Response.Write "<input name=""y_ID"" type=""hidden"" id=""y_ID"" value=""" & Rs("ID") & """>"
				Response.Write " &nbsp;&nbsp;&nbsp;&nbsp;预定义站点：<select name=""y_SiteID"">" & vbCrLf
				Response.Write "                      <option value=""0"">不使用预定义</option>" & vbCrLf
				Dim temRs
				Set temRs = Server.CreateObject("adodb.recordset")
				sql = "select ID,SiteName from ishion_Down_SiteSetting"
				temRs.open sql, Conn, 1, 1
				If Not (temRs.EOF And temRs.BOF) Then
					Do While Not temRs.EOF
					Response.Write "          <option value=""" & temRs(0) & """"
					If temRs(0) = Rs("SiteID") Then Response.Write " selected"
					Response.Write ">→" & temRs(1) & "</option>"
					temRs.MoveNext
					Loop
				End If
				temRs.Close
				Set temRs = Nothing
				Response.Write "                    </select></td>" & vbCrLf
				Response.Write "                </tr>" & vbCrLf
				Response.Write "                <tr> " & vbCrLf
				Response.Write "                  <td width=""75"" align=""right"">下载 URL：</td>" & vbCrLf
				Response.Write "                  <td > <input name=""y_Url"" type=""text"" size=""70"" maxlength=""200"" value=""" & Rs("Url") & """></td>" & vbCrLf
				Response.Write "                </tr>" & vbCrLf
				Response.Write "                <tr bgcolor=""#CCCCCC""> " & vbCrLf
				Response.Write "                  <td height=""1"" colspan=""2""></td>" & vbCrLf
				Response.Write "                </tr>" & vbCrLf
				Response.Write "      </table></td>" & vbCrLf
				Response.Write "          </tr>" & vbCrLf
				Rs.MoveNext
				Loop
			End If
			Rs.Close
			Set Rs = Nothing
			If IsObject(Conn) Then CloseConn
		End If
	
		Dim jsStr
		jsStr = jsStr & "<table width=""100%"" border=""0"" cellpadding=""3"" cellspacing=""1"">"
		jsStr = jsStr & "    <tr> "
		jsStr = jsStr & "      <td width=""70"" align=""right"">下载名称：</td>"
		jsStr = jsStr & "      <td><input name=""Name"" type=""text"" size=""45"" maxlength=""100"">  预定义站点："
		jsStr = jsStr & "<select name=""siteID"">"
		jsStr = jsStr & "          <option value=""0"">不使用预定义</option>"
		
		Set Rs = ishion.Execute("select ID,SiteName,isDefault from ishion_Down_SiteSetting")
		
		If Not (Rs.EOF And Rs.BOF) Then
			Do While Not Rs.EOF
		jsStr = jsStr & "          <option value=""" & Rs(0) & """"
			If Rs(2) = 1 Then jsStr = jsStr & " selected"
		jsStr = jsStr & ">→" & Rs(1) & "</option>"
			Rs.MoveNext
			Loop
		End If
		Rs.Close
		jsStr = jsStr & "        </select></td>"
		jsStr = jsStr & "    </tr>"
		jsStr = jsStr & "    <tr> "
		jsStr = jsStr & "      <td width=""70"" align=""right"">下载 URL：</td>"
		jsStr = jsStr & "      <td> <input name=""Url"" type=""text"" size=""70"" maxlength=""200""></td>"
		jsStr = jsStr & "    </tr>"
		jsStr = jsStr & "    <tr> "
		jsStr = jsStr & "    <tr bgcolor=""#CCCCCC""> "
		jsStr = jsStr & "      <td height=""1"" colspan=""2""></td>"
		jsStr = jsStr & "    </tr>"
		jsStr = jsStr & "    <tr> "
		jsStr = jsStr & "      <td height=""5"" colspan=""2""></td>"
		jsStr = jsStr & "    </tr>"
		jsStr = jsStr & "  </table>"
		
		Response.Write "<tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right""> <SCRIPT>" & vbCrLf
		Response.Write "function setid()" & vbCrLf
		Response.Write "{" & vbCrLf
		Response.Write "str='';" & vbCrLf
		Response.Write "if(!window.myform.no.value)" & vbCrLf
		Response.Write "window.myform.no.value="
		If isEdit Then
			Response.Write (totalPut + 1)
		Else
			Response.Write ("1")
		End If
		Response.Write ";" & vbCrLf
		Response.Write "for(i="
		If isEdit Then
			Response.Write (totalPut + 1)
		Else
			Response.Write ("1")
		End If
		Response.Write ";i<=window.myform.no.value;i++)" & vbCrLf
		Response.Write "str+='" & jsStr & "';" & vbCrLf
		Response.Write "window.upid.innerHTML=str;" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "</SCRIPT>" & vbCrLf
		Response.Write "      下载地址数</td>" & vbCrLf
		Response.Write "            <td > <INPUT size=""2"" value="""
		If isEdit Then
			Response.Write (totalPut + 1)
		Else
			Response.Write ("1")
		End If
		
		Response.Write """ name=""no""> " & vbCrLf
		Response.Write "              <INPUT class=""buttonface"" onclick=""setid();"" type=""button"" value=""设定"" name=""Button"">" & vbCrLf
		Response.Write "              在点击“设定”按钮后才可输入软件的对应地址) <font color=""#FF0000"">*</font></td>" & vbCrLf
		Response.Write "     </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td colspan=""4"" align=""right"" id=upid></td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "          <tr class=""tdbg2""> " & vbCrLf
		Response.Write "            <td align=""right"">&nbsp;</td>" & vbCrLf
		Response.Write "            <td > <input type=""button"" name=""btnSubmit"" value="" 提 交 "" onclick=""VF_myform()"">" & vbCrLf
		
		If isEdit Then Response.Write "<input name=""updateTime"" type=""checkbox"" value=""yes"" checked>重置更新时间"
		Set eRs = Nothing
		
		Response.Write "       </td>" & vbCrLf
		Response.Write "          </tr>" & vbCrLf
		Response.Write "     </form>" & vbCrLf
		Response.Write "        </table>" & vbCrLf
	
	End Sub

End Class %>

