<!--#include file="setup.asp" -->
<!--#include file="../inc/NC_HtmlEditCls.Asp" -->
<%
Dim NC_SoftInfo
Const MaxPerPage = 25
Dim i,CurrentPage,TotalPages,j
Dim SoftDownName,updown,img,isEdit
Dim totalnumber,filename,maxpagecount,Pcount
Dim sortid,rootid,SoftTitle,TxtContent
Dim pubSoftID,strSortid
Response.Write "<SCRIPT language = ""JavaScript"">" & vbCrLf
Response.Write "<!--//" & vbCrLf
Response.Write "function SelectAll() {" & vbCrLf
Response.Write "for (var i=0;i<document.myform.selSoftID.length;i++) {" & vbCrLf
Response.Write "var e=document.myform.selSoftID[i];" & vbCrLf
Response.Write "e.checked=!e.checked;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->" & vbCrLf
Response.Write "</script>" & vbCrLf
NC_Admin.AdminChk = "15"
NC_Admin.Check
DownsysClass.admin_header
Select Case Trim(Request("Action"))
	Case "accept"
		Call Acceptsoft
	Case "save"
		Call savenew
	Case Else
		Call SoftMain
End Select
If Founderr = True Then
	NC_Admin.Error_Msg (ErrMsg)
End If
DownsysClass.admin_footer
NothingObject

Private Sub SoftMain()
	Dim selSoftID
	Dim bookmark
	Dim n
	If Not IsEmpty(Request("page")) Then
		CurrentPage = CInt(Request("page"))
	Else
		CurrentPage = 1
	End If
	If Not IsEmpty(Request.Form("selSoftID")) Then
		selSoftID = Request.Form("selSoftID")
		If Request("action") = "Del" Then
			DownsysClass.Execute ("delete from NC_SoftPublish where softid in (" & selSoftID & ")")
			Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
			 Err.Raise -19691969
		End If
	End If
	filename = "Admin_Publish.asp"
	Set Rs = CreateObject("adodb.recordset")
	SQL = "select softid,sortid,rootid,SoftName,SoftVer,SoftSize,SoftTime,UserName,isAccept from NC_SoftPublish "
	SQL = SQL & " order by SoftTime desc,softid desc"
	Rs.Open SQL, conn, 1, 1
	DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
	Response.Write "<table cellpadding=""3"" cellspacing=""1"" border=""0"" width=""99%"" class=""tableBorder"" align=center>" & vbCrLf
	Response.Write "<form name=""myform"" method=""post"" action="""">" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <th width=""100%"" height=""22"">软件名称</th>" & vbCrLf
	Response.Write " <th nowrap>发布用户</th>" & vbCrLf
	Response.Write "<th nowrap>操 作</th>" & vbCrLf
	Response.Write " <th nowrap>收 录</th>" & vbCrLf
	Response.Write " <th nowrap>发布时间</th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	If Rs.EOF And Rs.bof Then
		Response.Write "<tr><td border=""0"" colspan=""5"" class=""forumRow""><p align='center'>没有发布或没有找到任何软件!</p></td></tr>"
	Else
		totalnumber = Rs.recordcount
		If Not IsEmpty(Request("page")) Then
			CurrentPage = CInt(Request("page"))
		Else
			CurrentPage = 1
		End If
		If (totalnumber Mod MaxPerPage) = 0 Then
			Pcount = totalnumber \ MaxPerPage
		Else
			Pcount = totalnumber \ MaxPerPage + 1
		End If
		Rs.Move (CurrentPage - 1) * MaxPerPage
		bookmark = Rs.bookmark
		If CurrentPage > Pcount Then CurrentPage = Pcount
		If CurrentPage < 1 Then CurrentPage = 1
		i = 0
		Do While Not Rs.EOF And i < CLng(MaxPerPage)
			Response.Write "<tr>" & vbCrLf
			Response.Write "<td class=""forumRow""><input type=""checkbox"" name=""selSoftID"" value="""
			Response.Write Rs("softid")
			Response.Write """>"
			Response.Write Rs("SoftName")
			Response.Write " "
			Response.Write Rs("SoftVer")
			Response.Write "</td>" & vbCrLf
			Response.Write "<td class=""forumRow"" align=center nowrap>"
			Response.Write Rs("UserName")
			Response.Write "</td>" & vbCrLf
			Response.Write "<td class=""forumRow"" align=center nowrap><a href=admin_Publish.asp?action=accept&softid="
			Response.Write Rs("softid")
			Response.Write "&sortid="
			Response.Write Rs("sortid")
			Response.Write ">收录软件</a></td>" & vbCrLf
			Response.Write "<td class=""forumRow"" align=center nowrap>"
			If Rs("isAccept") = 0 Then
				Response.Write ("未收录")
			Else
				Response.Write ("已收录")
			End If
			Response.Write "</td>" & vbCrLf
			Response.Write "<td class=""forumRow"" align=center nowrap>"
			If Rs("SoftTime") = Date Then
				Response.Write "<font color=red>" & Rs("SoftTime") & "</font>"
			Else
				Response.Write Rs("SoftTime")
			End If
			Response.Write "</td>" & vbCrLf
			Response.Write "</tr>" & vbCrLf
			Response.Write " "
			i = i + 1
			If i >= MaxPerPage Then Exit Do
			Rs.movenext
		Loop
		Response.Write "<tr><td border=""0"" colspan=""5"" class=""forumRow"">"
		Response.Write "<input name=""selSoftID"" type=""checkbox"" value=""on"" onclick=SelectAll(this.form)><a href=""javascript:SelectAll()"">全选/反选</a>　" & vbCrLf
		Response.Write " 批量删除<input name=""Action"" type=""hidden"" id=""Action"" value=""Del"">" & vbCrLf
		Response.Write " <input type=""submit"" class=button name=""Submit"" value=""删除选中的文件"">" & vbCrLf
		Response.Write "</td></tr></form><tr><td border=""0"" colspan=""5"" class=""forumRow"">"
		If totalnumber Mod MaxPerPage = 0 Then
			n = totalnumber \ MaxPerPage
		Else
			n = totalnumber \ MaxPerPage + 1
		End If
		Response.Write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action=" & filename & "?CateID=" & Request("CateID") & "&SubID=" & Request("SubID") & "><tr><td align=center> "
		Response.Write "<p><font color='red'>" & SoftDownName & "</font> "
		If CurrentPage < 2 Then
			Response.Write "" & totalnumber & "个&nbsp;首页 上一页&nbsp;"
		Else
			Response.Write "" & totalnumber & "个&nbsp;<a href=" & filename & "?page=1&CateID=" & Request("CateID") & "&SubID=" & Request("SubID") & ">首页</a>&nbsp;"
			Response.Write "<a href=" & filename & "?page=" & CurrentPage - 1 & "&CateID=" & Request("CateID") & "&SubID=" & Request("SubID") & ">上一页</a>&nbsp;"
		End If
		If n - CurrentPage < 1 Then
			Response.Write "下一页 尾页"
		Else
			Response.Write "<a href=" & filename & "?page=" & (CurrentPage + 1) & "&CateID=" & Request("CateID") & "&SubID=" & Request("SubID") & ">"
			Response.Write "下一页</a> <a href=" & filename & "?page=" & n & "&CateID=" & Request("CateID") & "&SubID=" & Request("SubID") & ">尾页</a>"
		End If
		Response.Write "&nbsp;页次：<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
		Response.Write "&nbsp;<b>" & MaxPerPage & "</b>个软件/页 "
		Response.Write "  转到： "
		Response.Write "  <select name=page size=1 style=""font-size: 9pt"" onChange='javascript:submit()'>"
		For i = 1 To n
			Response.Write "    <option value=""" & i & """ "
			If CurrentPage = CInt(i) Then
				Response.Write " selected "
			End If
			Response.Write ">第" & i & "页</option>"
		Next
		Response.Write "  </select> "
		Response.Write "</td></tr></FORM></table>"
		Response.Write "</td></tr>" & vbCrLf
	End If
	Response.Write "</table>" & vbCrLf
End Sub


Private Sub Acceptsoft()
	Dim Count
	Dim Rs1
	Dim sel
	Dim NC_HtmlEdit
	Dim srtSortingList
	Dim RunSystem
	Dim SoftType
	Set Rs = CreateObject("adodb.recordset")
	Set Rs1 = CreateObject("adodb.recordset")
	Response.Write "<script language=""javascript"">" & vbCrLf
	Response.Write "<!--//" & vbCrLf
	Response.Write "function ToRunsystem(addTitle) { " & vbCrLf
	Response.Write "var revisedTitle; " & vbCrLf
	Response.Write "var currentTitle;" & vbCrLf
	Response.Write "currentTitle = document.myform.RunSystem.value; " & vbCrLf
	Response.Write "revisedTitle = currentTitle+addTitle; " & vbCrLf
	Response.Write "document.myform.RunSystem.value=revisedTitle; " & vbCrLf
	Response.Write "document.myform.RunSystem.focus(); " & vbCrLf
	Response.Write "return; }" & vbCrLf
	Response.Write "//-->"
	Response.Write "</script>" & vbCrLf
	Set NC_HtmlEdit = New HtmlEditor_Cls
	SQL = "select * from NC_SoftPublish where softid=" & Request("softid")
	Rs.Open SQL, conn, 1, 1
	DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
	sortid = CStr(Rs("sortid"))
	rootid = CStr(Rs("rootid"))
	SoftTitle = "收录软件"
	Response.Write "<form name=""myform"" method=""post"" action=""admin_publish.asp"">" & vbCrLf
	Response.Write " <input type=""Hidden"" name=""action"" value='save'>" & vbCrLf
	Response.Write " <input type=""Hidden"" name=""sid"" value='"
	Response.Write Request("softid")
	Response.Write "'>" & vbCrLf
	Response.Write " <input type=""Hidden"" name=""username"" value='"
	Response.Write Rs("username")
	Response.Write "'>" & vbCrLf
	If CInt(DownsysClass.Setting(19)) = 1 Then
		Response.Write " <input type=""hidden"" name=""content1"" id=body value="""
		Response.Write Server.HTMLEncode(Rs("Content"))
		Response.Write """>" & vbCrLf
		Response.Write " "
	End If
	Response.Write "<table width=""99%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" class=""tableBorder"">" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <th colspan=""2"">"
	Response.Write SoftTitle
	Response.Write "</th>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td width=""15%"" height=""22"" align=""right"" nowrap class=""forumRowHighlight"">软件分类：</td>" & vbCrLf
	Response.Write " <td width=""85%"" class=""forumRow"">" & vbCrLf
	srtSortingList = DownsysClass.SortingJumpList
	srtSortingList = Replace(srtSortingList, "{SortID=" & Request("sortid") & "}", "selected")
	Response.Write srtSortingList
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件名称：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><input name=""softname"" type=""text"" size=""25"" value="""
	Response.Write Rs("softname")
	Response.Write """> 版本: <input name=""softver"" type=""text"" size=""20"" value="""
	Response.Write Rs("softver")
	Response.Write """></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">运行环境：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><input name=""RunSystem"" type=""text"" size=""50"" value="""
	Response.Write Rs("RunSystem")
	Response.Write """><BR>" & vbCrLf
	RunSystem = Split(DownsysClass.Setting(34), ",")
	For i = 0 To UBound(RunSystem)
		Response.Write "<a href='javascript:ToRunsystem(""" & Trim(RunSystem(i)) & "/"")'><u>" & Trim(RunSystem(i)) & "</u></a> | "
		If i = 7 Then Response.Write "<br>"
	Next
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件类型：</td>" & vbCrLf
	Response.Write " <td class=""forumRow"">" & vbCrLf
	SoftType = Split(DownsysClass.Setting(35), ",")
	For i = 0 To UBound(SoftType)
		Response.Write "<input type=""radio"" name=""SoftType"" value=""" & Trim(SoftType(i)) & """ "
		If SoftType(i) = Rs("SoftType") Then Response.Write " checked"
		Response.Write ">" & Trim(SoftType(i)) & " "
		If i = 6 Then Response.Write "<br>"
	Next
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">界面预览：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><input id=image2 name=""PreviewImg"" type=""text"" size=""40"" value="""
	Response.Write Rs("PreviewImg")
	Response.Write """><font color=""#808080""> 软件界面预览图片，大小不定</font></td>" & vbCrLf
	Response.Write " </tr" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">缩略图：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><input id=image1 name=""Softimg"" type=""text"" size=""30""><font color=""#808080""> 软件的缩略图，建议大小为：120×95 px</font></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">图片上传：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><iframe name=""image"" frameborder=0 width=100% height=40 scrolling=no src=upfile.asp?type=image&upnum=2></iframe></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件大小：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""> <input type=""text"" name=""SoftSize"" size=""14"" maxlength=""10"" value='"
	Response.Write Trim(Rs("SoftSize"))
	Response.Write "'> <input name=""SizeUnit"" type=""radio"" value=""KB"" checked>" & vbCrLf
	Response.Write " KB " & vbCrLf
	Response.Write " <input type=""radio"" name=""SizeUnit"" value=""MB"">" & vbCrLf
	Response.Write " MB <font color=""#FF0000"">！</font>" & vbCrLf
	Response.Write " 解压密码:<input type=""text"" name=""Decode"" size=""15"" maxlength=""100"" value='"
	Response.Write Trim(Rs("Decode"))
	Response.Write "'> <font color=""#808080"">没有请留空</font> </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" nowrap class=""forumRowHighlight"">授权方式：</td>" & vbCrLf
	Response.Write " <td class=""forumRow"" nowrap> <select name=""impower"">" & vbCrLf
	Response.Write " "
	Response.Write "<option value=""" & Rs("impower") & """>" & Rs("impower") & "</option>"
	Response.Write " <option value=""共享软件"">共享软件</option>" & vbCrLf
	Response.Write " <option value=""免费软件"">免费软件</option>" & vbCrLf
	Response.Write " <option value=""自由软件"">自由软件</option>" & vbCrLf
	Response.Write " <option value=""试用软件"">试用软件</option>" & vbCrLf
	Response.Write " <option value=""演示软件"">演示软件</option>" & vbCrLf
	Response.Write " <option value=""商业软件"">商业软件</option>" & vbCrLf
	Response.Write " </select>" & vbCrLf
	Response.Write " 软件语言: <select name=""Language"">" & vbCrLf
	Response.Write " "
	Response.Write "<option value=""" & Rs("Language") & """>" & Rs("Language") & "</option>"
	Response.Write " <option value=""简体中文"">简体中文</option>" & vbCrLf
	Response.Write " <option value=""繁体中文"">繁体中文</option>" & vbCrLf
	Response.Write " <option value=""英文"">英文</option>" & vbCrLf
	Response.Write " </select>" & vbCrLf
	Response.Write " 软件等级: <select name=""Grades"" size=""1"">" & vbCrLf
	Response.Write " <option value=""1"" name=""Grades"" "
	If Trim(Rs("Grades")) = "1" Then
		Response.Write "selected"
	End If
	Response.Write ">一星级</option>" & vbCrLf
	Response.Write " <option value=""2"" name=""Grades"" "
	If Trim(Rs("Grades")) = "2" Then
		Response.Write "selected"
	End If
	Response.Write ">二星级</option>" & vbCrLf
	Response.Write " <option value=""3"" name=""Grades"" "
	If Trim(Rs("Grades")) = "3" Then
		Response.Write "selected"
	End If
	Response.Write ">三星级</option>" & vbCrLf
	Response.Write " <option value=""4"" name=""Grades"" "
	If Trim(Rs("Grades")) = "4" Then
		Response.Write "selected"
	End If
	Response.Write ">四星级</option>" & vbCrLf
	Response.Write " <option value=""5"" name=""Grades"" "
	If Trim(Rs("Grades")) = "5" Then
		Response.Write "selected"
	End If
	Response.Write ">五星级</option>" & vbCrLf
	Response.Write " </select>" & vbCrLf
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">联系作者：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><input name=""Contact"" type=""text"" size=""25"" value="""
	Response.Write Rs("Contact")
	Response.Write """>" & vbCrLf
	Response.Write " 作者主页: <input name=""Homepage"" type=""text"" size=""30"" value="""
	Response.Write Rs("Homepage")
	Response.Write """>" & vbCrLf
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write "<TR height=""22"">" & vbCrLf
	Response.Write "<TD colspan=4 class=forumHeaderBackgroundAlternate><B>软件简介</B></TD>" & vbCrLf
	Response.Write "</TR>" & vbCrLf
	Response.Write "<TR height=""22"">" & vbCrLf
	Response.Write "<TD colspan=4 class=forumRow> "
	If CInt(DownsysClass.Setting(19)) = 1 Then
		NC_HtmlEdit.Init_HtmlEdit
	Else
		Response.Write "<textarea name=content1 style=""width:100%;"" rows=12>"
		Response.Write Rs("Content")
		Response.Write "</textarea>"
	End If
	Response.Write "</TD>" & vbCrLf
	Response.Write "</TR>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td height=""21"" align=""right"" class=""forumRowHighlight"">是否推荐：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""> <input name=""isCommend"" type=""radio"" value=""0"" checked>" & vbCrLf
	Response.Write " 不推荐　<input type=""radio"" name=""isCommend"" value=""1"">" & vbCrLf
	Response.Write " 推荐　</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr height=""22"">" & vbCrLf
	Response.Write " <td align=""right"" noWrap class=""forumRowHighlight"">是否推荐置顶：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""> <input name=""isCommend"" type=""radio"" value=""0"" checked>" & vbCrLf
	Response.Write " 不推荐　<input type=""radio"" name=""isCommend"" value=""1"">" & vbCrLf
	Response.Write " 软件推荐　<input name=""isTop"" type=""radio"" value=""0"" checked>" & vbCrLf
	Response.Write " 不置顶　<input type=""radio"" name=""isTop"" value=""1"">" & vbCrLf
	Response.Write " 软件置顶　</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr height=""22"">" & vbCrLf
	Response.Write " <td align=""right"" class=""forumRowHighlight"">会员软件设置：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""> <select name=""isMember"" size=""1"">" & vbCrLf
	Set Rs1 = DownsysClass.Execute("select * from NC_UserGroup order by groupid")
	Do While Not Rs1.EOF
		Response.Write "<option value="""
		Response.Write Rs1("Grades")
		Response.Write """>"
		Response.Write Rs1("GroupName")
		Response.Write "</option>" & vbCrLf
		Rs1.movenext
	Loop
	Rs1.Close
	Set Rs1 = Nothing
	Response.Write " </select>&nbsp;&nbsp;" & vbCrLf
	Response.Write "下载软件所需的点数：<input name=""MoneyNum"" type=""text"" size=""6"" value=""20"">&nbsp;&nbsp;" & vbCrLf
	If CInt(DownsysClass.Setting(5)) = 0 Then Response.Write "<input type=checkbox name='isCreateHtml' value='yes' checked> 同时生成（HTML）"
	Response.Write "</td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td class=""forumRowHighlight"">下载地址：<br> <font color=""#FF0000"">请复制到下面的下载地址框！</font></td>" & vbCrLf
	Response.Write " <td class=""forumRow"">下载地址1：<input type=""text"" value="""
	Response.Write Rs("Site_1")
	Response.Write """ size=""60""><BR>下载地址2：<input type=""text"" value="""
	Response.Write Rs("Site_2")
	Response.Write """ size=""60""><BR>下载地址3：<input type=""text"" value="""
	Response.Write Rs("Site_3")
	Response.Write """ size=""60""></td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr height=""22"">" & vbCrLf
	Response.Write " <td colspan=""2"" class=""forumRow"">" & vbCrLf
	Response.Write " <script language=""javascript"">" & 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=1;" & vbCrLf
	Response.Write " " & " for(i=1;i<=window.myform.no.value;i++)" & vbCrLf
	Response.Write " str+=''+'<input type=""text"" name=""SiteName'+i+'"" value=""下载地址'+i+'"" size=12>&nbsp;URL：<input type=""text"" name=""DownSite'+i+'"" size=40 value="""">&nbsp;"
	i = "'+i+'"
	SelDownServer 0, "serverid" & i
	Response.Write "<BR>';" & vbCrLf
	Response.Write " window.upid.innerHTML=str+' <font color=red>* 如果选择了下载服务器，请根据相应的下载地址输入软件名称，前面请不要添加“/”。</font>';" & vbCrLf
	Response.Write " }" & vbCrLf
	Response.Write " </script>设置添加地址的数量:&nbsp;<input type=""text"" name=""no"" value=""1"" size=2>&nbsp;&nbsp;<input type=""button"" name=""Button"" class=button onclick=""setid();"" value=""添加下载地址数"">" & vbCrLf
	Response.Write " <font color=red>* 如果没有选择下载服务器请输入完整的下载路径</font> " & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr height=""22"">" & vbCrLf
	Response.Write " <td colspan=""2"" id=""upid"" class=""forumRow""> </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write " <tr> " & vbCrLf
	Response.Write " <td class=""forumRowHighlight"">软件上传：</td>" & vbCrLf
	Response.Write " <td class=""forumRow""><iframe name=""ad"" frameborder=0 width=100% height=45 scrolling=no src=upfile.asp?type=file></iframe> </td></tr>" & vbCrLf
	Response.Write " <tr>" & vbCrLf
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">&nbsp;</td>" & vbCrLf
	Response.Write " <td align=""center"" class=""forumRow"">" & vbCrLf
	Response.Write "　<input type=button class=button value=""查看内容长度"" name=Button onclick=""checklength(document.myform);"">" & vbCrLf
	Response.Write "　<input type=button class=button value=""复制到剪贴板"" name=Button onclick=""HighlightAll('myform.TxtContent');"">" & vbCrLf
	Response.Write " <input type=reset name=Submit2 class=button value=""清 除"">　" & vbCrLf
	Response.Write " <input type=Submit class=button value=""提 交"" name=Submit>" & vbCrLf
	Response.Write " </td>" & vbCrLf
	Response.Write " </tr>" & vbCrLf
	Response.Write "</table>" & vbCrLf
	Response.Write "</form>" & vbCrLf
	Response.Write "</div>" & vbCrLf
	Rs.Close
	Set Rs = Nothing
	If CInt(DownsysClass.Setting(19)) = 0 Then
		Response.Write "<Script language=javascript>" & vbCrLf
		Response.Write "<!--//" & vbCrLf
		Response.Write "document.myform.content1.value = ubbcode(document.myform.content1.value);" & vbCrLf
		Response.Write "function ubbcode(temp) {" & vbCrLf
		Response.Write "temp = temp.replace(/<br>/ig,""\n"");" & vbCrLf
		Response.Write "temp = temp.replace(/<p>/ig,""\n"");" & vbCrLf
		Response.Write "temp = temp.replace(/<\/p>/ig,""\n"");" & vbCrLf
		Response.Write "return (temp);" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "function ClearReset()" & vbCrLf
		Response.Write "{" & vbCrLf
		Response.Write " document.myform.content1.value = '';" & vbCrLf
		Response.Write " focus();" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "function checklength(theform)" & vbCrLf
		Response.Write "{" & vbCrLf
		Response.Write " alert(""您的内容目前有 ""+theform.content1.value.length+"" 字节。"");" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "</Script>" & vbCrLf
	End If
	Set NC_HtmlEdit = Nothing
End Sub

Private Function SelDownServer(intServerid, snid)
	Dim Rs_site
	Response.Write " <select name=""" & snid & """ size=""1"">"
	Response.Write "<option value=""0"""
	If intServerid = 0 Then Response.Write " selected"
	Response.Write ">↓请选择下载服务器↓</option>"
	Set Rs_site = CreateObject("adodb.recordset")
	SQL = "select serverid,ServerName,depth,rootid from NC_ServerSite where depth=0"
	Rs_site.Open SQL, conn, 1, 1
	Do While Not Rs_site.EOF
		Response.Write "<option value=""" & Rs_site("rootid") & """"
		If intServerid = Rs_site("rootid") Then Response.Write " selected"
		Response.Write ">" & Rs_site(1) & "</option>"
		Rs_site.movenext
	Loop
	Rs_site.Close
	Set Rs_site = Nothing
	Response.Write "</select>"
End Function

Private Sub checksave()
	If Len(Request.Form("softname")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件名称不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("sortid")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件分类不能为空！</li>"
		Exit Sub
	Else
		strSortid = Split(Trim(Request.Form("sortid")), ",")
	End If
	If Len(Request.Form("content1")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件简介不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("RunSystem")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>运行环境不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("SoftSize")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>大小不能为空！</li>"
		Exit Sub
	End If
	If CInt(DownsysClass.Setting(19)) = 1 Then
		TxtContent = Request.Form("content1")
	Else
		TxtContent = DownsysClass.HtmlEncodes(Request.Form("content1"))
	End If
End Sub

Private Sub savenew()
	Dim SiteRs
	Call checksave
	If Founderr = False Then
		SQL = "select * from NC_SoftInfo where (softid is null)"
		Rs.Open SQL, conn, 1, 3
		Rs.addnew
		Rs("softname") = Server.HtmlEncode(Request.Form("softname"))
		Rs("SoftVer") = server.HtmlEncode(Request.Form("SoftVer"))
		Rs("rootid") = strSortid(0)
		Rs("sortid") = strSortid(1)
		Rs("SortName") = strSortid(2)
		Rs("content") = TxtContent
		Rs("Language") = Request.Form("Language")
		Rs("SoftType") = Request.Form("SoftType")
		Rs("isCommend") = Request.Form("isCommend")
		Rs("RunSystem") = DownsysClass.HtmlEncodes(Request.Form("RunSystem"))
		Rs("impower") = Request.Form("impower")
		If Trim(Request.Form("SizeUnit")) = "MB" Then
			Rs("SoftSize") = CLng(Request.Form("SoftSize") * 1024)
		Else
			Rs("SoftSize") = CLng(Request.Form("SoftSize"))
		End If
		Rs("RunSystem") = Request.Form("RunSystem")
		Rs("Grades") = Request.Form("Grades")
		Rs("Decode") = Request.Form("Decode")
		Rs("isMember") = Request.Form("isMember")
		Rs("Homepage") = Request.Form("Homepage")
		Rs("Contact") = Request.Form("Contact")
		Rs("PreviewImg") = Request.Form("PreviewImg")
		Rs("Softimg") = Request.Form("Softimg")
		Rs("Errcode") = 0
		Rs("username") = Request.Form("username")
		If Len(Request.Form("MoneyNum")) = 0 Then
			Rs("MoneyNum") = 0
		Else
			Rs("MoneyNum") = Request.Form("MoneyNum")
		End If
		Rs("isTop") = Request.Form("isTop")
		Rs("DayHits") = 0
		Rs("WeekHits") = 0
		Rs("MonthHits") = 0
		Rs("Hits") = 0
		Rs("HitsTime") = DownsysClass.NowTime
		Rs("SoftTime") = DownsysClass.NowTime
		Rs("isUpdate") = 1
		Rs("isLock") = 0
		Rs.Update
		Rs.Close
				Response.Flush
		Rs.Open "select top 1 softid from NC_SoftInfo order by softid desc", conn, 1, 1
		pubSoftID = Rs("softid")
		Rs.Close
				Response.Flush
		SQL = "update NC_SoftSort set SoftNum=SoftNum+1,isUpdate=1 where depth<>0 and sortid=" & CInt(strSortid(1))
		DownsysClass.Execute SQL
		SQL = "update NC_SoftSort set SoftNum=SoftNum+1,isUpdate=1 where depth=0 and rootid=" & CInt(strSortid(0))
		DownsysClass.Execute SQL
		'//////添加下载连接地址//////
				Response.Flush
		Set SiteRs = CreateObject("adodb.recordset")
		If Request.Form("no") <> "" And pubSoftID <> "" Then
			For i = 1 To Request("no")
				If Request("DownSite" & i & "") <> "" Then
					SQL = "select * from NC_SoftSite where (ID is null)"
					SiteRs.Open SQL, conn, 1, 3
					SiteRs.addnew
					SiteRs("SiteName") = Request.Form("SiteName" & i & "")
					SiteRs("DownSite") = Request.Form("DownSite" & i & "")
					SiteRs("sortid") = strSortid(1)
					SiteRs("SoftID") = pubSoftID
					SiteRs("serverid") = Request.Form("serverid" & i & "")
					SiteRs.Update
					SiteRs.Close
				End If
			Next
						
		End If
		Set SiteRs = Nothing
				Response.Flush
		DownsysClass.Execute ("update NC_SoftPublish set isAccept=1 where softid=" & Trim(Request.Form("sid")))
				Response.Flush
		NC_Admin.Succeed_Msg ("<li>添加" & Request.Form("softname") & "成功!</li>")
		Rs.Open "select top 1 SoftID from NC_SoftSite order by id desc", conn, 1, 1
		If Request.Form("isCreateHtml") = "yes" Then NC_SoftInfo.CreateSoftInfo (Rs("softid"))
		Rs.Close
		Set Rs = Nothing
				Set NC_SoftInfo = Nothing
		Response.Write "<meta http-equiv=""refresh"" content=""2;url='" & Request.ServerVariables("HTTP_REFERER") & "'"">" & vbCrLf
				Response.Flush
	End If
End Sub
%>
