www.gusucode.com > 艺术签名文章资讯网源代码 > 艺术签名文章资讯网源代码/624/adminhtry/admin_soft.asp

    <!--#include file="setup.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/ubbcode.asp"-->
<!--#include file="../inc/cls_editor.asp"-->
<%
Server.ScriptTimeout = 99999
Admin_header
'=====================================================================
' 软件名称:新云网站管理系统
' 当前版本:NewAsp Site Management System Version 3.0
' 文件名称:admin_Soft.asp
' 更新日期:2006-11-20
' 官方网站:新云网络(www.newasp.net www.newasp.cn) QQ:94022511
'=====================================================================
' Copyright 2003-2007 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
Dim Action
Dim i,ii,isEdit,RsObj
Dim keyword,FindWord,strClass,AlphaSoftName
Dim maxperpage,CurrentPage,totalnumber,TotalPageNum
Dim s_ClassName,ClassID,ChildStr,FoundSQL,isAccept,selSoftID
Dim TextContent,SoftTop,SoftBest,SoftID,ForbidEssay,showreg,SoftAccept
Dim DownAddress,findsize
Dim InstallDir_ChannelDir
InstallDir_ChannelDir = Trim(Newasp.InstallDir & Newasp.ChannelDir)
ubb.BasePath = InstallDir_ChannelDir
ubb.setUbbcode = Join(Newasp.setUserEditor,"|")
ubb.Keyword = Newasp.ContentKeyword

Dim isxmltext,xmlfilename,xmlFilePath,m_xmlFilePath,xmlFilePrefix,xmlFileExt
Dim Channel_Setting,m_strXmlFilePath
Channel_Setting = Split(Newasp.Channel_Setting & "|||||||||||||||", "|||")

xmlFilePrefix = Trim(Channel_Setting(10))
xmlFileExt = Trim(Channel_Setting(11))
m_xmlFilePath = Trim(Channel_Setting(12))
If Len(m_xmlFilePath) > 2 And InStr(m_xmlFilePath, ":") > 0 Then
	xmlFilePath = m_xmlFilePath &"\"
Else
	xmlFilePath = Server.MapPath(InstallDir_ChannelDir & m_xmlFilePath) & "\"
End If
xmlFilePath = Replace(xmlFilePath, "\\", "\")
If Len(xmlFileExt) < 3 Then xmlFileExt = ".xml"
If Left(xmlFileExt,1) <> "." Then xmlFileExt = "." & xmlFileExt

ChannelID = Newasp.ChkNumeric(Request("ChannelID"))
findsize = 0
If Trim(Request("isAccept")) <> "" Then
	isAccept = 0
Else
	isAccept = 1
End If
If CInt(ChannelID) = 0 Then ChannelID = 2
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "save"
	Call SaveSoft
Case "modify"
	Call ModifySoft
Case "add"
	isEdit = False
	Call SoftEdit(isEdit)
Case "edit"
	isEdit = True
	Call SoftEdit(isEdit)
Case "del"
	Call SoftDel
Case "batdel"
	Call PageTop
	Call BatcDelete
Case "alldel"
	Call AllDelSoft
Case "view"
	Call SoftView
Case "renew"
	Call SoftRenew
Case "setting"
	Call BatchSetting
Case "saveset"
	Call SaveSetting
Case "move"
	Call PageTop
	Call BatchMove
Case "savemove"
	Call SaveMove
Case "reset"
	Call ResetDateTime
Case "sdel"
	Call DelDownAddress
Case Else
	Call showmain
End Select
If FoundErr = True Then
	ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Sub PageTop()
	Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
	Response.Write "	<tr>"
	Response.Write "	  <th colspan=2>" & sModuleName & "管理选项</th>"
	Response.Write "	</tr>"
	Response.Write "	<tr><form method=get name=myform action='admin_Soft.asp' onSubmit='return JugeQuery(this);'>"
	Response.Write "<input type=hidden name=ChannelID value='" & ChannelID & "'>"
	Response.Write "<td class=TableRow1>搜索:"
	Response.Write "	  <input name=keyword type=text size=20>"
	Response.Write "	  条件:"
	Response.Write "	  <select name=queryopt>"
	Response.Write "		<option value='1' selected>" & sModuleName & "名称</option>"
	Response.Write "		<option value='2'>录 入 者</option>"
	Response.Write "		<option value='3'>不限条件</option>"
	Response.Write "	  </select> <input type=submit name=Submit value='开始搜索' class=Button></td>"
	Response.Write "	  <td class=TableRow1>软件导航:"
	Dim srtClassMenu
	Response.Write "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & vbCrLf
	Response.Write "<option value='admin_Soft.asp?ChannelID=" & ChannelID & "'>≡全部" & sModuleName & "列表≡</option>" & vbCrLf
	srtClassMenu = Newasp.ClassJumpMenu(ChannelID)
	srtClassMenu = Replace(srtClassMenu, "{ClassID=" & Request("sortid") & "}", "selected")
	Response.Write srtClassMenu
	Response.Write "</select>"
	Response.Write "	  </td></form>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "	  <td colspan=2 class=TableRow2><b>操作选项:</b> <a href='admin_Soft.asp?ChannelID=" & ChannelID & "'>管理首页</a> | "
	Response.Write "	  <a href='admin_Soft.asp?ChannelID=" & ChannelID & "&action=add'>添加软件</a> | "
	Response.Write "	  <a href='admin_classify.asp?ChannelID=" & ChannelID & "&action=add'>添加软件分类</a> | "
	Response.Write "	  <a href='admin_classify.asp?ChannelID=" & ChannelID & "'>软件分类管理</a> | "
	Response.Write "	  <a href='?ChannelID=" & ChannelID & "&specialID=0'>" & sModuleName & "专题列表</a> | "
	Response.Write "	  <a href='?ChannelID=" & ChannelID & "&isAccept=0'>待审" & sModuleName & "</a> | "
	Response.Write "	  <a href='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "'>生成HTML</a></td>"
	Response.Write "	</tr>"
	Response.Write "</table>"
	Response.Write "<br>"
End Sub

Sub showmain()
	If Not ChkAdmin("AdminSoft" & ChannelID) Then
		Server.Transfer("showerr.asp")
		Response.End
	End If
	Dim strListName
	If Not IsEmpty(Request("selSoftID")) Then
		selSoftID = Request("selSoftID")
		Select Case Newasp.CheckStr(Request("act"))
		Case "批量删除":Call batdel
		Case "批量推荐":Call isCommend
		Case "取消推荐":Call noCommend
		Case "批量置顶":Call isTop
		Case "取消置顶":Call noTop
		Case "批量审核":Call BatAccept
		Case "取消审核":Call NotAccept
		Case "更新时间":Call upindate
		Case "生成HTML":Call BatCreateHtml
		Case Else
			Response.Write "无效参数!"
		End Select
	End If
	Call PageTop
	Dim specialID,sortid,Cmd,child
	Response.Write chr(0)
	Response.Write "<script language=""JavaScript"" src=""include/showpage.js""></script>" & vbNewLine
	Response.Write "<table  border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
	Response.Write "	<tr>"
	Response.Write "	  <th width='5%' nowrap>选择</th>"
	Response.Write "	  <th width='60%'>" & sModuleName & "名称</th>"
	Response.Write "	  <th width='8%' nowrap>文件大小</th>"
	Response.Write "	  <th width='9%' nowrap>管理操作</th>"
	Response.Write "	  <th width='5%' nowrap>审核</th>"
	Response.Write "	  <th width='9%' nowrap>录 入 者</th>"
	Response.Write "	  <th width='9%' nowrap>整理日期</th>"
	Response.Write "	</tr>"
	strListName = "&channelid="& ChannelID &"&sortid="& Request("sortid") &"&specialID="& Request("specialID") &"&isAccept="& Request("isAccept") &"&keyword=" & Request("keyword") 
	If Trim(Request("sortid")) <> "" Then
		SQL = "select ClassID,ChannelID,ClassName,child,ChildStr from [NC_Classify] where ChannelID = " & ChannelID & " And ClassID=" & Request("sortid")
		Set Rs = Newasp.Execute(SQL)
		If Rs.BOF And Rs.EOF Then
			Response.Write "Sorry!没有找到任何软件分类。或者您选择了错误的系统参数!"
			Response.End
		Else
			s_ClassName = Rs("ClassName")
			ClassID = Rs("ClassID")
			child = Rs("child")
			ChildStr = Rs("ChildStr")
			sortid = CLng(Request("sortid"))
		End If
		Rs.Close
	Else
		s_ClassName = "全部" & sModuleName
		sortid = 0
		child = 0
	End If
	maxperpage = 30 '###每页显示数
	
	If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
		Response.Write ("错误的系统参数!请输入整数")
		Response.End
	End If
	If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
		CurrentPage = CLng(Request("page"))
	Else
		CurrentPage = 1
	End If
	If CInt(CurrentPage) = 0 Then CurrentPage = 1
	If Not IsNull(Request("keyword")) And Request("keyword") <> "" Then
		keyword = Trim(Newasp.ChkQueryStr(Trim(Request("keyword"))))
		If CInt(Request("queryopt")) = 1 Then
			findword = "A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%'"
		ElseIf CInt(Request("queryopt")) = 2 Then
			findword = "A.username like '%" & keyword & "%'"
		Else
			findword = "A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%' Or A.username like '%" & keyword & "%'"
		End If
		FoundSQL = findword
		s_ClassName = "查询" & sModuleName
	Else
		specialID = 99999
		If Trim(Request("sortid")) <> "" Then
			FoundSQL = "A.isAccept="& isAccept & " And A.ClassID in (" & ChildStr & ")"
		Else
			If Trim(Request("specialID")) <> "" Then
				specialID = CLng(Request("specialID"))
				If Request("specialID") <> 0 Then
					FoundSQL = "A.isAccept = " & isAccept & " And specialID =" & Request("specialID")
				Else
					FoundSQL = "A.isAccept = " & isAccept & " And specialID > 0"
				End If
			Else
				If findsize > 0 Then
					FoundSQL = "A.isAccept = " & isAccept
				Else
					FoundSQL = "A.isAccept = " & isAccept
				End If
			End If
		End If
	End If
	On Error Resume Next
	TotalNumber = Newasp.Execute("SELECT COUNT(softid) FROM NC_SoftList A WHERE A.ChannelID = " & ChannelID & " And "& FoundSQL &"")(0)
	TotalPageNum = CLng(TotalNumber / maxperpage)  '得到总页数
	If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
	If CurrentPage < 1 Then CurrentPage = 1
	If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
	Set Rs = Server.CreateObject("ADODB.Recordset")
	SQL = "select A.SoftID,A.ChannelID,A.ClassID,A.SpecialID,A.SoftName,A.SoftVer,A.ColorMode,A.FontMode,A.username,A.SoftTime,A.isTop,A.isBest,A.isAccept,A.SoftSize,C.ClassName from [NC_SoftList] A inner join [NC_Classify] C on A.ClassID=C.ClassID where A.ChannelID = " & ChannelID & " And "& FoundSQL &" order by A.isTop desc, A.SoftTime desc,A.SoftID desc"
	If IsSqlDataBase = 1 Then
		If CurrentPage > 100 Then
			Rs.Open SQL, Conn, 1, 1
		Else
			Set Rs = Conn.Execute(SQL)
		End If
	Else
		Rs.Open SQL, Conn, 1,1
	End If
	
	Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
	If Rs.BOF And Rs.EOF Then
		Response.Write "<form name=selform method=post action="""">"
		Response.Write "<input type=hidden name=ChannelID value='" & ChannelID & "'>"
		Response.Write "<input type=hidden name=action value=''>"
		Response.Write "<tr><td align=center colspan=7 class=TableRow2>还没有找到任何" & sModuleName & "!</td></tr>"
	Else
		Rs.MoveFirst
		If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
		SQL=Rs.GetRows(maxperpage)
		Response.Write "	<tr>"
		Response.Write "	  <td colspan=7 class=TableRow2>"
		ShowListPage CurrentPage,TotalPageNum,totalnumber,maxperpage,strListName,s_ClassName
		Response.Write "</td>"
		Response.Write "	</tr>"
		Response.Write "	<form name=selform method=post action="""">"
		Response.Write "	<input type=hidden name=ChannelID value='" & ChannelID & "'>"
		Response.Write "	<input type=hidden name=action value=''>"
		For i=0 To Ubound(SQL,2)
			If Not Response.IsClientConnected Then Response.End
			If (i mod 2) = 0 Then
				strClass = "class=TableRow1"
			Else
				strClass = "class=TableRow2"
			End If
			Admin_Soft_list SQL(0,i),SQL(1,i),SQL(2,i),SQL(4,i),SQL(5,i),SQL(6,i),SQL(7,i),SQL(8,i),SQL(9,i),SQL(10,i),SQL(11,i),SQL(12,i),SQL(13,i),SQL(14,i),strClass
		Next
		SQL=Null
	End If
	Rs.Close:Set Rs = Nothing
%>
	<tr>
	  <td colspan="7" class="TableRow1">
	  <input class=Button type="button" name="chkall" value="全选" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
	  管理选项:
	  <select name="act">
		<option value="0">请选择操作选项</option>
		<option value="批量删除">批量删除</option>
		<option value="批量置顶">批量置顶</option>
		<option value="取消置顶">取消置顶</option>
		<option value="批量推荐">批量推荐</option>
		<option value="取消推荐">取消推荐</option>
		<option value="批量审核">批量审核</option>
		<option value="取消审核">取消审核</option>
		<option value="更新时间">更新时间</option>
		<option value="生成HTML">生成HTML</option>
	  </select>
	  <input class="Button" type="submit" name="Submit2" value="执行操作" onclick="return confirm('您确定执行该操作吗?');">
	  <input class="Button" type="submit" name="Submit3" value="批量设置" onclick="document.selform.action.value='setting';">
	  <input class="Button" type="submit" name="Submit4" value="批量移动" onclick="document.selform.action.value='move';">
	  <input class="Button" type="submit" name="Submit4" value="批量删除" onclick="document.selform.action.value='batdel';"></td>
	</tr>
	</form>
	<tr>
	  <td colspan="7" align="right" class="TableRow2"><%ShowListPage CurrentPage,TotalPageNum,totalnumber,maxperpage,strListName,s_ClassName %></td>
	</tr>
</table>
<%

End Sub

Function Admin_Soft_list(SoftID,ChannelID,ClassID,SoftName,SoftVer,ColorMode,FontMode,username,SoftTime,isTop,isBest,isAccept,SoftSize,ClassName,strClass)
	Response.Write "	<tr>"
	Response.Write "	  <td align=center " & strClass & "><input type=checkbox name=selSoftID value=" & SoftID & "></td>"
	Response.Write "	  <td " & strClass & ">"
	
	If isTop <> 0 Then
		Response.Write "<img src=""images/istop.gif"" width=15 height=17 border=0 alt=置顶软件>"
	End If

	Response.Write "[<a href=?ChannelID=" & ChannelID & "&sortid="
	Response.Write ClassID
	Response.Write ">"
	Response.Write ClassName
	Response.Write "</a>] "
	Response.Write "<a href=?action=view&ChannelID=" & ChannelID & "&SoftID="
	Response.Write SoftID
	Response.Write ">"
	Response.Write Newasp.ReadFontMode(SoftName &" "& SoftVer,ColorMode,FontMode)
	Response.Write "</a>" 
	
	If isBest <> 0 Then
		Response.Write "&nbsp;&nbsp;<font color=blue>荐</font>"
	End If

	Response.Write "	  </td>"
	Response.Write "	  <td align=""center"" nowrap "& strClass &"><span class='style3'>"& ReadSoftsize(SoftSize) &"</span></td>"
	Response.Write "	  <td align=""center"" nowrap "& strClass &"><a href=?action=edit&ChannelID="& ChannelID &"&SoftID="& SoftID &">编辑</a> | <a href=?action=del&ChannelID="& ChannelID &"&SoftID="& SoftID &" onclick=""{if(confirm('软件删除后将不能恢复,您确定要删除该软件吗?')){return true;}return false;}"">删除</a></td>"
	Response.Write "	  <td align=""center"" nowrap "& strClass &">"
	
	If isAccept = 1 Then
		Response.Write "<font color=blue>√</font>"
	Else
		Response.Write "<font color=red>×</font>"
	End If

	Response.Write "	  </td>"
	Response.Write "	  <td align=""center"" nowrap "& strClass &">"& UserName &"</td>"
	Response.Write "	  <td align=""center"" nowrap "& strClass &">"

	If SoftTime >= Date Then
		Response.Write "<font color=red>"
		Response.Write Newasp.FormatDate(SoftTime, 2)
		Response.Write "</font>"
	Else
		Response.Write Newasp.FormatDate(SoftTime, 2)
	End If

	Response.Write "	  </td>"
	Response.Write "	</tr>"
End Function

Sub SoftEdit(isEdit)
	Dim EditTitle,SoftNameColor,downid
	Dim m_intPlugin
	m_intPlugin = 0
	If isEdit Then
		If Not ChkAdmin("AddSoft" & ChannelID) Then
			Server.Transfer("showerr.asp")
			Response.End
		End If
		SQL = "select * from NC_SoftList where SoftID=" & CLng(Request("SoftID"))
		Set Rs = Newasp.Execute(SQL)
		ClassID = Rs("ClassID")
		softid = Rs("softid")
		isxmltext = Newasp.ChkNumeric(Rs("isxmltext"))
		xmlfilename = Trim(Rs("xmlfilename") & "")
		m_intPlugin = Newasp.ChkNumeric(Rs("plugin"))
		EditTitle = "编辑" & sModuleName
	Else
		If Not ChkAdmin("AddSoft" & ChannelID) Then
			Server.Transfer("showerr.asp")
			Response.End
		End If
		EditTitle = "添加" & sModuleName
		ClassID = Request("ClassID")
		softid = 0
		isxmltext = 0
		xmlfilename = ""
	End If
%>
<script src="include/checksoft.js" type="text/javascript"></script>
<script language= JavaScript>
function SelectPhoto(){
    var arr=showModalDialog('Admin_selFile.asp?ChannelID=<%=ChannelID%>&UploadDir=UploadPic', '', 'dialogWidth:800px; dialogHeight:600px; help: no; scroll: yes; status: no');
    if(arr!=null){
        var ss=arr.split('|');
        document.myform.SoftImage.value=ss[0];
    }
}
function SelectFile(){
    var arr=showModalDialog('Admin_selFile.asp?ChannelID=<%=ChannelID%>&UploadDir=UploadFile', '', 'dialogWidth:800px; dialogHeight:600px; help: no; scroll: yes; status: no');
    if(arr!=null){
        var ss=arr.split('|');
        document.myform.DownAddress1.value=ss[0];
        document.myform.filesize.value=ss[1];
    }
}

function ChangeTableR(e,n){
    for (i=1;i<=3;i++){
        document.getElementById('spanR'+i).className='HighLightR';
    }
    if(n==1){
        TableR1.style.display='';
        TableR2.style.display='none';
	spanR1.className='DisabledR';
        document.myform.B1.disabled = true;
        document.myform.B2.disabled = false;
    }
    if(n==2){
        TableR1.style.display='none';
        TableR2.style.display='';
        spanR2.className='DisabledR';
    }
    if(n==3){
        TableR1.style.display='';
        TableR2.style.display='';
        document.myform.B1.disabled = false;
        document.myform.B2.disabled = true;
    }
}

</script>
<div onkeydown="CtrlEnter()">
<form method="Post" name="myform" action="admin_Soft.asp" onsubmit="return checkPost()">
<table  border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorders1">
        <tr>
          <th><%=EditTitle%></th>
        </tr>
        <tr>
          <td class="TableRow"><span id="spanR1" class="DisabledR" onclick="ChangeTableR(this,1)">常规信息</span>
	  <span id="spanR2" class="HighLightR" onclick="ChangeTableR(this,2)" title="点击查看其它属性">其它属性</span>
	  <span id="spanR3" class="HighLightR" onclick="doSubmit();" title="保存">保存<%=sModuleName%></span></td>
        </tr>
</table>
<table id="TableR1" border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorders3">
<%
	If isEdit Then
		Response.Write "<input type=""Hidden"" name=""action"" value=""modify"">"
		Response.Write "<input type=""Hidden"" name=""SoftID"" value="""& Request("SoftID") &""">"
	Else
		Response.Write "<input type=""Hidden"" name=""action"" value=""save"">"
	End If
	Response.Write "<input type=hidden name=ChannelID value='" & ChannelID & "'>"
%>
        <tr>
          <td width="15%" align="right" nowrap class="TableRow2"><b>所属分类:</b></td>
          <td width="35%" class="TableRow1">
<%
	Dim sClassSelect
	Response.Write "<select name=""ClassID"" id=""ClassID"">"
	sClassSelect = Newasp.LoadSelectClass(ChannelID)
	sClassSelect = Replace(sClassSelect, "{ClassID=" & ClassID & "}", "selected")
	Response.Write sClassSelect
	Response.Write "</select>"
%>
		  </td>
          <td width="15%" align="right" nowrap class="TableRow2"><b>所属专题:</b></td>
          <td width="35%" class="TableRow1"><%
	Response.Write "<select name=""SpecialID"" id=""SpecialID"">" & vbNewLine
	Response.Write "<option value=""0"">不指定" & sModuleName & "专题</option>" & vbNewLine
	Set RsObj = Newasp.Execute("SELECT SpecialID,SpecialName FROM NC_Special WHERE ChannelID="& ChannelID &" And ChangeLink=0 ORDER BY orders")
	Do While Not RsObj.EOF
		Response.Write Chr(9) & Chr(9) & "<option value=""" & RsObj("SpecialID") & """"
		If isEdit Then
			If Rs("SpecialID") = RsObj("SpecialID") Then Response.Write " selected"
		End If
		Response.Write ">"
		Response.Write RsObj("SpecialName")
		Response.Write "</option>" & vbCrLf
		RsObj.movenext
	Loop
	Set RsObj = Nothing
%>
          </select></td>
        </tr>
        <tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>名称:</b></td>
          <td class="TableRow1"><input name="SoftName" type="text" id="SoftName" size="35" value="<%If isEdit Then Response.Write Rs("SoftName")%>"> 
          <font color=red>*</font></td>
	  <td align="right" class="TableRow2"><b><%=sModuleName%>版本:</b></td>
          <td class="TableRow1"><input name="SoftVer" type="text" id="SoftVer" size="25" value="<%If isEdit Then Response.Write Rs("SoftVer")%>"></td>
        </tr>

        <tr>
          <td align="right" class="TableRow2"><b>软件运行环境:</b></td>
          <td colspan="3" class="TableRow1"><input name="RunSystem" type="text" size="60" value="<%If isEdit Then Response.Write Rs("RunSystem") Else Response.Write Channel_Setting(1) End If%>"><br>
<%
	Dim RunSystem
	If Len(Channel_Setting(0)) < 3 Then Channel_Setting(0) = "Win9X/|ME/|NT/|2000/|XP/|2003/|Vista/|Linux/|Unix/|Mac/"
	RunSystem = Split(Channel_Setting(0), "|")
	For i = 0 To UBound(RunSystem)
		Response.Write "<a href='javascript:ToRunsystem(""" & Trim(RunSystem(i)) & """)'><u>" & Trim(RunSystem(i)) & "</u></a> | "
		If i = 10 Then Response.Write "<br>"
	Next
%>
		    </td>
        </tr>
	<tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>性质:</b></td>
          <td class="TableRow1" colspan="3">
<%
	Dim ArraySoftType
	If Len(Channel_Setting(2)) < 3 Then Channel_Setting(2) = "国产软件,国外软件,汉化补丁,源码程序"
	ArraySoftType = Split(Channel_Setting(2), ",")
	Response.Write "<input name=""SoftType"" type=""text"" size=""10"" value="""
	If isEdit Then
		Response.Write Server.HTMLEncode(Rs("SoftType"))
	Else
		Response.Write Server.HTMLEncode(ArraySoftType(0))
	End If
	Response.Write """>"
	Response.Write " <select name=""ArraySoftType2""  onChange=""SoftType.value=this.value;"">"
	Response.Write " <option value=""" & ArraySoftType(0) & """>选择" & sModuleName & "类型</option>"
	For i = 0 To UBound(ArraySoftType)
		Response.Write " <option value=""" & ArraySoftType(i) & """>" & ArraySoftType(i) & "</option>"
	Next
	Response.Write " </select>&nbsp;"
	
	Dim ImpowerStr
	If Len(Channel_Setting(3)) < 3 Then Channel_Setting(3) = "共享版,免费版,自由版,试用版,演示版,商业版"
	ImpowerStr = Split(Channel_Setting(3), ",")
	Response.Write "<input name=""impower"" type=""text"" size=""10"" value="""
	If isEdit Then
		Response.Write Server.HTMLEncode(Rs("impower"))
	Else
		Response.Write Server.HTMLEncode(ImpowerStr(0))
	End If
	Response.Write """>"
	Response.Write " <select name=""impower2""  onChange=""impower.value=this.value;"">"
	Response.Write " <option value=""" & ImpowerStr(0) & """>选择授权方式</option>"
	For i = 0 To UBound(ImpowerStr)
		Response.Write " <option value=""" & ImpowerStr(i) & """>" & ImpowerStr(i) & "</option>"
	Next
	Response.Write " </select>&nbsp;"

	Dim LanguagesStr
	If Len(Channel_Setting(4)) < 3 Then Channel_Setting(4) = "简体中文,繁体中文,英文,多国语言"
	LanguagesStr = Split(Channel_Setting(4), ",")
	Response.Write "<input name=""Languages"" type=""text"" size=""10"" value="""
	If isEdit Then
		Response.Write Server.HTMLEncode(Rs("Languages"))
	Else
		Response.Write Server.HTMLEncode(LanguagesStr(0))
	End If
	Response.Write """>"
	Response.Write " <select name=""Languages2""  onChange=""Languages.value=this.value;"">"
	Response.Write " <option value=""" & LanguagesStr(0) & """>请选择语言</option>"
	For i = 0 To UBound(LanguagesStr)
		Response.Write " <option value=""" & LanguagesStr(i) & """>" & LanguagesStr(i) & "</option>"
	Next
	Response.Write " </select>"
	
%>
	  </td>
	</tr>
	<tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>大小:</b></td>
          <td class="TableRow1">
<%
	Response.Write " <input type=""text"" name=""SoftSize"" id=""filesize"" size=""14"" onkeyup=if(isNaN(this.value))this.value='' value='"
	If isEdit Then
		Response.Write Trim(Rs("SoftSize"))
	Else
		Response.Write 0
	End If
	Response.Write "'> <input name=""SizeUnit"" type=""radio"" value=""KB"" checked>"
	Response.Write " KB"
	Response.Write " <input type=""radio"" name=""SizeUnit"" value=""MB"">"
	Response.Write " MB <font color=""#FF0000"">!</font>"
%>
          </td>
          <td align="right" class="TableRow2"><b><%=sModuleName%>星级:</b></td>
          <td class="TableRow1"><select name="star">
		<%If isEdit Then%>
			<option value="5"<%If Rs("star") = 5 Then Response.Write (" selected")%>>★★★★★</option>
			<option value="4"<%If Rs("star") = 4 Then Response.Write (" selected")%>>★★★★</option>
			<option value="3"<%If Rs("star") = 3 Then Response.Write (" selected")%>>★★★</option>
			<option value="2"<%If Rs("star") = 2 Then Response.Write (" selected")%>>★★</option>
			<option value="1"<%If Rs("star") = 1 Then Response.Write (" selected")%>>★</option>
		<%Else%>
			<option value="5"<%If Trim(Channel_Setting(14)) = "5" Then Response.Write " selected"%>>★★★★★</option>
			<option value="4"<%If Trim(Channel_Setting(14)) = "4" Then Response.Write " selected"%>>★★★★</option>
			<option value="3"<%If Trim(Channel_Setting(14)) = "3" Then Response.Write " selected"%>>★★★</option>
			<option value="2"<%If Trim(Channel_Setting(14)) = "2" Then Response.Write " selected"%>>★★</option>
			<option value="1"<%If Trim(Channel_Setting(14)) = "1" Then Response.Write " selected"%>>★</option>
		<%End If%>
          </select></td>
	</tr>
	<tr>
          <td align="right" class="TableRow2"><b>联系方式:</b></td>
          <td class="TableRow1">
<%
	Response.Write "<input name=""Contact"" type=""text"" size=""33"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Contact")
		Response.Write """"
	End If
	Response.Write ">"
%>
	  </td>
          <td align="right" class="TableRow2"><b>程序主页:</b></td>
          <td class="TableRow1">
<%
	Response.Write "<input name=""Homepage"" type=""text"" size=""30"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Homepage")
		Response.Write """"
	End If
	Response.Write ">"
%>
	  </td>
	</tr>

        <tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>简介:</b></td>
          <td colspan="3" class="TableRow1">
<%
Dim oEditor
Set oEditor = New Editor_Cls
oEditor.UserMode	= 0
oEditor.setEditMode	= Newasp.setAdminEditor(0)
oEditor.ChannelID	= ChannelID
oEditor.Width		= Newasp.setAdminEditor(2)
oEditor.Height		= Newasp.setAdminEditor(3)
oEditor.BasePath	= "../" & Newasp.setAdminEditor(4)
oEditor.ToolbarSet	= Newasp.setAdminEditor(1)'Default,AdminMode,Simple,UserMode,Basic
If isEdit Then
	If isxmltext = 1 Then
		m_strXmlFilePath = xmlFilePath & xmlfilename
		TextContent = Newasp.ReadXMLDocument(m_strXmlFilePath,"softinfo/@content")
		If TextContent = "" Then TextContent = Rs("content") & ""
	Else
		TextContent = Rs("content") & ""
		If Len(Trim(TextContent)) < 2 Then
			m_strXmlFilePath = xmlFilePath & xmlfilename
			TextContent = Newasp.ReadXMLDocument(m_strXmlFilePath,"softinfo/@content")
		End If
	End If
	oEditor.Value		= Re_Replace(TextContent, "[InstallDir_ChannelDir]", InstallDir_ChannelDir)
End If
oEditor.InstanceName	= "content"
oEditor.Execute()
Set oEditor = Nothing
%>
		  </td>
        </tr>
<%
	If isEdit Then
%>
	<tr>
          <td align="right" class="TableRow2"><b>修改下载地址:</b></td>
          <td colspan="3" class="TableRow1">
	  <%
	  Response.Write ReadDownAddress(softid)
	  %></td>
        </tr>
<%
	End If
%>
 <script language="javascript">
 function setid() {
	 str='';
	 if(!window.myform.no.value)
	 window.myform.no.value=1;
	 for(i=2;i<=window.myform.no.value;i++)
	 str+=''+'<%=SelDownServer(1,"downsid")%><input type="text" name="DownAddress" size="50" value="">-<input type="text" name="SiteName" value="下载地址'+i+'" size="15"><br>';
	 window.upid.innerHTML=str;
	 /*if (i==1) {
		downsite.style.display='none';
	 }else{
		downsite.style.display='';
	 }*/
 }
 </script>
	<tr>
          <td align="right" class="TableRow2"><b>设置下载数量:</b></td>
          <td colspan="3" class="TableRow1"><input type="text" name="no" value="1" size=2>&nbsp;&nbsp;<input type="button" name="Button" class="button" onclick="setid();" value="添加下载地址数"> 
	  <input type='button' name='selectfile' value='从已上传文件中选择' onclick='SelectFile()' class="button">
	  <input type='button' name='DownFile' value=' 上传文件 ' onclick="setUploadFile.style.display='';" class="button">&nbsp;&nbsp;
	  </td>
        </tr>
	<tr>
	  <td align="right" class="TableRow2"><b>添加下载地址:</b></td>
          <td colspan="3" class="TableRow1"><span><font color=red>如果选择了使用下载服务器,请在下面↓输入文件名称。</font>
	  <font color=blue>下载服务器路径 + 下载文件名称 = 完整下载地址</font><br>
<%
	Response.Write SelDownServer(1,"downsid")
	Response.Write "<input name=""DownAddress"" id=""DownAddress1"" type=""text"" size=""50"">-"
	Response.Write "<input name=""SiteName"" type=""text"" size=""15"" value=""下载地址1"">"
	Response.Write "<br>"
%>
	  </span>
	  <span id="upid"></span></td>
    </tr>
	<tr id="setUploadFile" style="display='none';">
          <td align="right" class="TableRow2"><b>文件上传:</b></td>
          <td colspan="3" class="TableRow1"><iframe name="file" frameborder="0" width='100%' height="45" scrolling="no" src="upload.asp?ChannelID=<%=ChannelID%>&stype=file&m=soft&inst=content&s=1"></iframe></td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b>更新时间:</b></td>
          <td class="TableRow1"><input name="SoftTime" type="text" id="SoftTime" size="25" value="<%If isEdit Then Response.Write Rs("SoftTime"):Else Response.Write (Now())%>"> 
          <font color="red">*</font><%If isEdit Then%>
	    <input name="Update" type="checkbox" value="1"<%If Trim(Channel_Setting(13))="1" Then Response.Write (" checked")%>> 
            更新时间<%End If%></td>
	    <td align="right" class="TableRow2"><b>插件情况:</b></td>
          <td class="TableRow1"> <select name="plugin">
	  	<option value="0"<%If m_intPlugin = 0 Then Response.Write (" selected")%>>↓插件使用情况↓</option>
	  	<option value="1"<%If m_intPlugin = 1 Then Response.Write (" selected")%>>无插件-无病毒</option>
	  	<option value="2"<%If m_intPlugin = 2 Then Response.Write (" selected")%>>有插件-可选择</option>
		<option value="3"<%If m_intPlugin = 3 Then Response.Write (" selected")%>>凝有毒-未确认</option>
		<option value="4"<%If m_intPlugin = 4 Then Response.Write (" selected")%>>有插件-无选择</option>
		<option value="5"<%If m_intPlugin = 5 Then Response.Write (" selected")%>>有病毒-已确认</option>
		<option value="6"<%If m_intPlugin = 6 Then Response.Write (" selected")%>>尚未认证</option>
		<option value="7"<%If m_intPlugin = 7 Then Response.Write (" selected")%>>未通过-暂停下载</option>
	  </select></td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b>其它选项:</b></td>
          <td class="TableRow1" colspan="3"><input name="isTop" type="checkbox" id="isTop" value="1"<%If isEdit Then:If Rs("isTop") <> 0 Then Response.Write (" checked")%>>
            <%=sModuleName%>置顶 
            <input name="isBest" type="checkbox" id="isBest" value="1"<%If isEdit Then:If Rs("isBest") <> 0 Then Response.Write (" checked")%>> 
            <%=sModuleName%>推荐
		<%If isEdit Then%>
	    <input name="ForbidEssay" type="checkbox" id="ForbidEssay" value="1"<%If Rs("ForbidEssay") <> 0 Then Response.Write (" checked")%>> 
		<%Else%>
		<input name="ForbidEssay" type="checkbox" id="ForbidEssay" value="1"<%If Trim(Channel_Setting(15))="1" Then Response.Write (" checked")%>> 
		<%End If%>
            禁止发表评论
	    <input name="isAccept" type="checkbox" id="isAccept" value="1" checked> 
            立即发布(<font color="blue">否则审核后才能发布。</font>)
		<%If isEdit Then%>
	    <input name="isxmltext" type="checkbox" id="isxmltext" value="1"<%If Rs("isxmltext") <> 0 Then Response.Write (" checked")%>> 
		<%Else%>
		<input name="isxmltext" type="checkbox" id="isxmltext" value="1"<%If Trim(Channel_Setting(9))="1" Then Response.Write (" checked")%>>
		<%End If%>
            <font color="red">保存内容为XML文件</font>
	    </td>
    </tr>
</table>

<table id="TableR2" style="display:none" border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorders3">
                <tr>
          <td align="right" class="TableRow2"><b>名称模式:</b></td>
          <td colspan="3" class="TableRow1">颜色:
            <select size="1" name="ColorMode">
		<option value="0">请选择颜色</option>
<%
	SoftNameColor = "," & Newasp.InitTitleColor
	SoftNameColor = Split(SoftNameColor, ",")
	For i = 1 To UBound(SoftNameColor)
		Response.Write ("<option style=""background-color:"& SoftNameColor(i) &";color: "& SoftNameColor(i) &""" value='"& i &"'")
		If isEdit Then
			If Rs("ColorMode") = i Then Response.Write (" selected")
		End If
		Response.Write (">"& SoftNameColor(i) &"</option>")
	Next
%>
		</select> 字体:
		<select size="1" name="FontMode">
		<%If isEdit Then%>
		<option value="0"<%If Rs("FontMode") = 0 Then Response.Write (" selected")%>>请选择字体</option>
		<option value="1"<%If Rs("FontMode") = 1 Then Response.Write (" selected")%>>粗体</option>
		<option value="2"<%If Rs("FontMode") = 2 Then Response.Write (" selected")%>>斜体</option>
		<option value="3"<%If Rs("FontMode") = 3 Then Response.Write (" selected")%>>下划线</option>
		<option value="4"<%If Rs("FontMode") = 4 Then Response.Write (" selected")%>>粗体+斜体</option>
		<option value="5"<%If Rs("FontMode") = 5 Then Response.Write (" selected")%>>粗体+下划线</option>
		<option value="6"<%If Rs("FontMode") = 6 Then Response.Write (" selected")%>>斜体+下划线</option>
		<%Else%>
		<option value="0">请选择字体</option>
		<option value="1">粗体</option>
		<option value="2">斜体</option>
		<option value="3">下划线</option>
		<option value="4">粗体+斜体</option>
		<option value="5">粗体+下划线</option>
		<option value="6">斜体+下划线</option>
		<%End If%>
		</select></td>
        </tr>
	<tr>
          <td align="right" class="TableRow2"><b>副 标 题:</b></td>
          <td colspan="3" class="TableRow1"><input name="subtitle" type="text" id="subtitle" size="60" value="<%If isEdit Then Response.Write Rs("subtitle") & ""%>"></td>
        </tr>
        <tr>
          <td align="right" class="TableRow2"><b>相关<%=sModuleName%>:</b></td>
          <td colspan="3" class="TableRow1"><input name="Related" type="text" id="Related" size="60" value="<%If isEdit Then Response.Write Rs("Related") & ""%>"> <font color=red>*</font></td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>预览图:</b></td>
          <td colspan="3" class="TableRow1"><input name="Previewimg" id="Previewimg" type="text" size="60" value="<%If isEdit Then Response.Write Rs("Previewimg")%>"></td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b><%=sModuleName%>缩略图:</b></td>
          <td colspan="3" class="TableRow1"><input name="SoftImage" id="ImageUrl" type="text" size="60" value="<%If isEdit Then Response.Write Rs("SoftImage")%>">
	  <input type='button' name='selectpic' value='从已上传图片中选择' onclick='SelectPhoto()' class="button"></td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b>上传图片:</b></td>
          <td colspan="3" class="TableRow1"><iframe name="image" frameborder="0" width='100%' height="45" scrolling="no" src="upload.asp?ChannelID=<%=ChannelID%>&stype=image&m=soft&inst=content&s=0"></iframe></td>
        </tr>
		<tr>
          <td align="right" class="TableRow2"><b>软件作者:</b></td>
          <td class="TableRow1">
<%
	Response.Write "<input name=""Author"" type=""text"" size=""20"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Author")
		Response.Write """"
	End If
	Response.Write ">"
%>
		<select name=font2 onChange="Author.value=this.value;">
			<option selected value="">选择作者</option>
			<option value='佚名'>佚名</option>
			<option value='本站原创'>本站原创</option>
			<option value='不详'>不详</option>
			<option value='未知'>未知</option>
			<option value='<%=AdminName%>'><%=AdminName%></option>
		</select>
	  </td>
          <td align="right" class="TableRow2"><b>注册网址:</b></td>
          <td class="TableRow1">
<%
	Response.Write "<input name=""Regsite"" type=""text"" size=""30"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Regsite")
		Response.Write """"
	End If
	Response.Write ">"
%>
	  </td>
	</tr>
	<tr>
          <td align="right" class="TableRow2"><b>下载等级:</b></td>
          <td class="TableRow1"><select name="UserGroup">
<%
	Set RsObj = Newasp.Execute("Select GroupName,Grades From NC_UserGroup order by Groupid")
	Do While Not RsObj.EOF
		Response.Write Chr(9) & Chr(9) & "<option value=""" & RsObj("Grades") & """"
		If isEdit Then
			If Rs("UserGroup") = RsObj("Grades") Then Response.Write " selected"
		Else
			If RsObj("Grades") = 0 Then Response.Write " selected"
		End If
		Response.Write ">"
		Response.Write RsObj("GroupName")
		Response.Write "</option>" & vbCrLf
		RsObj.movenext
	Loop
	Set RsObj = Nothing
%>
          </select></td>
          <td align="right" class="TableRow2"><b>所需点数:</b></td>
          <td class="TableRow1"><input name="PointNum" type="text" size="10" value="<%If isEdit Then Response.Write Rs("PointNum"):Else Response.Write 0:End If%>"> 
            对匿名用户和管理员无效 </td>
    </tr>
    <tr>
          <td align="right" class="TableRow2"><b>初始点击数:</b></td>
          <td class="TableRow1"><input name="AllHits" type="text" id="AllHits" size="15" value="<%If isEdit Then Response.Write Rs("AllHits"):Else Response.Write 0%>"> 
          <font color=red>*</font></td>
          <td align="right" class="TableRow2"><b><%=sModuleName%>价格:</b></td>
          <td class="TableRow1"><input name="SoftPrice" type="text" size="10" value="<%If isEdit Then Response.Write Rs("SoftPrice"):Else Response.Write 0:End If%>"> 元</td>
    </tr>
	<tr>
          <td align="right" class="TableRow2"><b></b></td>
          <td class="TableRow1"></td>
	    <td align="right" class="TableRow2"><b>解压密码:</b></td>
          <td class="TableRow1"><%Response.Write "<input type=""text"" name=""Decode"" size=""15"" maxlength=""100"" value='"
	If isEdit Then
		Response.Write Trim(Rs("Decode"))
	End If
	Response.Write "'> <font color=""#808080"">没有请留空</font>"%></td>
    </tr>
</table>

<table border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorders2">
        <tr align="center">
          <td class="TableRow2">
	  <input type="button" name="B1" onclick="ChangeTableR(this,1)" value="常规设置" class="Button" disabled>
	  <input type="button" name="B2" onclick="ChangeTableR(this,3)" value="更多设置" class="Button">
	  <input type="button" name="Submit2" onclick="CheckLength();" value="查看内容长度" class="Button">
	  <input type="button" name="Submit4" onclick="javascript:history.go(-1)" value="返回上一页" class="Button">
	  <input type="submit" name="Submit1" value="保存<%=sModuleName%>" class="Button"></td>
        </tr>
</table></form></div>
<%
	If isEdit Then
		Rs.Close
		Set Rs = Nothing
	End If
End Sub

Function ReadDownAddress(ByVal softid)
	If softid < 1 Then Exit Function
	Dim rsDown,strDownText,ii
	ii = 0
	Set rsDown = Newasp.Execute("SELECT id,downid,DownFileName,DownText FROM NC_DownAddress WHERE softid="& CLng(softid))
	Do While Not rsDown.EOF
		strDownText = Trim(rsDown("DownText") & "")
		Response.Write "<input name=""id"" type=""hidden"" value='"
		Response.Write rsDown("id")
		Response.Write "'>" & vbCrLf
		Response.Write SelDownServer(rsDown("downid"),"downid")
		Response.Write "<input name=""DownFileName"" type=""text"" size=""45"" value='"
		Response.Write Server.HTMLEncode(rsDown("DownFileName") & "")
		Response.Write "'>-"
		Response.Write "<input name=""DownText"" type=""text"" size=""15"" value='"
		If Len(strDownText) = 0 Then
			Response.Write "立即下载"
		Else
			Response.Write Server.HTMLEncode(rsDown("DownText"))
		End If
		Response.Write "'>"
		Response.Write " <a href='?action=sdel&ChannelID="
		Response.Write ChannelID
		Response.Write "&id="
		Response.Write rsDown("id")
		Response.Write "' class=showmenu onclick=""return confirm('您确定要删除吗?');"">删 除</a><br>"  & vbCrLf
		rsDown.movenext
		ii = ii + 1
	Loop
	Set rsDown = Nothing
	Response.Write "<b>说明:</b><font color=""blue"">如果要删除下载地址,</font><font color=""red"">请在上面的↑输入框输入“del”或者直接点击删除按钮。</font><br>"
End Function
Function SelDownServer(intdownid,strname)
	Dim rsobj
	If Not IsNumeric(intdownid) Then intdownid = 0
	Response.Write "<select name=""" & strname & """ size=""1"">"
	'Response.Write "<option value=""0"""
	'If intdownid = 0 Then Response.Write " selected"
	'Response.Write ">↓请选择下载服务器↓</option>"
	SQL = "SELECT downid,DownloadName,depth,rootid FROM NC_DownServer WHERE depth=0 And ChannelID="& ChannelID
	Set rsobj = Newasp.Execute(SQL)
	Do While Not rsobj.EOF
		Response.Write "<option value=""" & rsobj("rootid") & """"
		If intdownid = rsobj("rootid") Then Response.Write " selected"
		Response.Write ">" & rsobj(1) & "</option>"
		rsobj.movenext
	Loop
	rsobj.Close
	Set rsobj = Nothing
	Response.Write "<option value=""0"""
	If intdownid = 0 Then Response.Write " selected"
	Response.Write ">↓不使用下载服务器↓</option>"
	Response.Write "</select>"
End Function


Sub CheckSave()

	If Trim(Request.Form("SoftName")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "名称不能为空!</li>"
	Else
		AlphaSoftName = ubb.CheckSpecialChar(Trim(Request.Form("SoftName")))
	End If
	If Len(Request.Form("SoftName")) => 200 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "名称不能超过200个字符!</li>"
	End If
	If Trim(Request.Form("ColorMode")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>标题颜色参数错误!</li>"
	End If
	If Trim(Request.Form("FontMode")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>标题字体参数错误!</li>"
	End If
	If Len(Request.Form("Related")) => 220 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>相关" & sModuleName & "不能超过220个字符!</li>"
	End If
	If Trim(Request.Form("PointNum")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>下载所需的点数不能为空!如果不想设置请输入零。</li>"
	End If
	If Not IsNumeric(Request.Form("star")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "星级不能为空。</li>"
		Exit Sub
	End If
	If Not IsNumeric(Request.Form("UserGroup")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "等级参数错误!</li>"
	End If
	If Not IsNumeric(Request.Form("ClassID")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>该一级分类已经有下属分类,不能添加" & sModuleName & "!</li>"
		Exit Sub
	End If
	If CLng(Request.Form("ClassID")) = 0 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>该分类是外部连接,不能添加" & sModuleName & "!</li>"
	End If
	If Trim(Request.Form("SoftType")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "类型!</li>"
	End If
	If Trim(Request.Form("impower")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "授权方式!</li>"
	End If
	If Trim(Request.Form("Languages")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "语言!</li>"
	End If
	If Trim(Request.Form("AllHits")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>初始点击数不能为空!</li>"
	End If
	If Not IsNumeric(Request.Form("AllHits")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>初始点击数请输入整数!</li>"
	End If
	If Not IsNumeric(Request.Form("SpecialID")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>专题ID参数错误!</li>"
		Exit Sub
	End If
	TextContent = ""
	For i = 1 To Request.Form("content").Count
		TextContent = TextContent & Request.Form("content")(i)
	Next
	If Trim(TextContent) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "简介不能为空!</li>"
	End If
	If Newasp.setAdminEditor(0) <> 0 Then
		TextContent = Newasp.HTMLEncodes(TextContent)
	End If
	TextContent = Re_Replace(TextContent, InstallDir_ChannelDir, "[InstallDir_ChannelDir]")

	SoftTop = Newasp.ChkNumeric(Request.Form("isTop"))
	SoftBest = Newasp.ChkNumeric(Request.Form("isBest"))
	ForbidEssay = Newasp.ChkNumeric(Request.Form("ForbidEssay"))
	showreg = Newasp.ChkNumeric(Request.Form("showreg"))
	SoftAccept = Newasp.ChkNumeric(Request.Form("isAccept"))
	isxmltext = Newasp.ChkNumeric(Request.Form("isxmltext"))
	If Len(Request.Form("RunSystem")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>运行环境不能为空!</li>"
	End If
	If Not IsNumeric(Request.Form("SoftSize")) Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>" & sModuleName & "大小请输入整数!</li>"
		Exit Sub
	End If
End Sub

Sub SaveSoft()
	CheckSave
	If Founderr = True Then Exit Sub
	Set Rs = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT * FROM NC_SoftList WHERE (SoftID is null)"
	Rs.Open SQL,Conn,1,3
	Rs.Addnew
		Rs("ChannelID") = ChannelID
		Rs("ClassID") = Trim(Request.Form("ClassID"))
		Rs("SpecialID") = Trim(Request.Form("SpecialID"))
		Rs("SoftName") = Newasp.ChkFormStr(Request.Form("SoftName"))
		Rs("SoftVer") = Newasp.ChkFormStr(Request.Form("SoftVer"))
		Rs("subtitle") = Newasp.ChkFormStr(Request.Form("subtitle"))
		Rs("ColorMode") = Trim(Request.Form("ColorMode"))
		Rs("FontMode") = Trim(Request.Form("FontMode"))
		Rs("Related") = Newasp.ChkFormStr(Request.Form("Related"))
		If isxmltext=1 Then
			Rs("content") = "0"
		Else
			Rs("content") = TextContent
		End If
		Rs("Languages") = Newasp.ChkFormStr(Request.Form("Languages"))
		Rs("SoftType") = Newasp.ChkFormStr(Request.Form("SoftType"))
		Rs("RunSystem") = Newasp.ChkFormStr(Replace(Replace(Request.Form("RunSystem"), ", ", "/"), ",", "/"))
		Rs("impower") = Newasp.ChkFormStr(Request.Form("impower"))
		If UCase(Request.Form("SizeUnit")) = "MB" Then
			Rs("SoftSize") = CLng(Request.Form("SoftSize") * 1024)
		Else
			Rs("SoftSize") = CLng(Request.Form("SoftSize"))
		End If
		Rs("star") = Trim(Request.Form("star"))
		Rs("Homepage") = Trim(Request.Form("Homepage"))
		Rs("Contact") = Trim(Request.Form("Contact"))
		Rs("Author") = Newasp.ChkFormStr(Request.Form("Author"))
		Rs("Regsite") = Newasp.ChkFormStr(Request.Form("Regsite"))
		Rs("showreg") = CInt(showreg)
		Rs("username") = Trim(AdminName)
		Rs("PointNum") = Newasp.CheckNumeric(Request.Form("PointNum"))
		Rs("SoftPrice") = Newasp.CheckNumeric(Request.Form("SoftPrice"))
		Rs("SoftTime") = Formatime(Trim(Request.Form("SoftTime")))
		Rs("isTop") = SoftTop
		Rs("AllHits") = Newasp.CheckNumeric(Request.Form("AllHits"))
		Rs("DayHits") = Newasp.CheckNumeric(Request.Form("AllHits"))
		Rs("WeekHits") = Newasp.CheckNumeric(Request.Form("AllHits"))
		Rs("MonthHits") = Newasp.CheckNumeric(Request.Form("AllHits"))
		Rs("HitsTime") = Now()
		Rs("HtmlFileDate") = Trim(Newasp.HtmlRndFileName)
		Rs("SoftImage") = Trim(Request.Form("SoftImage"))
		Rs("Previewimg") = Trim(Request.Form("Previewimg"))
		Rs("plugin") = Newasp.ChkNumeric(Request.Form("plugin"))
		Rs("Decode") = Trim(Request.Form("Decode"))
		Rs("isBest") = SoftBest
		Rs("UserGroup") = Newasp.ChkNumeric(Request.Form("UserGroup"))
		Rs("isUpdate") = 1
		Rs("ErrCode") = 0
		Rs("isAccept") = SoftAccept
		Rs("ForbidEssay") = ForbidEssay
		Rs("AlphaIndex") = Newasp.ReadAlpha(AlphaSoftName)
		If Newasp.ChkNumeric(Request.Form("plugin")) = 7 Then
			Rs("PauseDown") = 1
		Else
			Rs("PauseDown") = 0
		End If
		Rs("isxmltext") = isxmltext
		Rs("xmlfilename") = ""
	Rs.update
	Rs.Close
	Dim rsxml
	Rs.Open "SELECT TOP 1 softid,ChannelID,softname,[content] FROM NC_SoftList WHERE ChannelID=" & ChannelID & " ORDER BY softid DESC", Conn, 1, 1
	softid = Rs("softid")
	Set rsxml=Newasp.RecordsetToxml(rs,"softinfo","xml")
	Rs.Close:Set Rs = Nothing
	'---- 开始批量添加下载地址
	Dim TempAddress,TempSiteName
	If Trim(Request.Form("DownAddress")) <> "" Then
		For i = 1 To Request.Form("DownAddress").Count
			TempAddress = Trim(Request.Form("DownAddress")(i))
			TempSiteName = Trim(Request.Form("SiteName")(i))
			If LCase(TempAddress) <> "del" And Trim(TempAddress) <> "" Then
				AddDownAddress Request.Form("downsid")(i),softid,TempAddress,TempSiteName
			End If
		Next
	End If
	'---- 批量添加下载地址完成
	ClassUpdateCount Request.Form("ClassID"),1
	Call RemoveCache
	'--生成XML文件
	If isxmltext=1 Then
		rsxml.documentElement.selectSingleNode("softinfo/@content").text=TextContent
		Newasp.CreatPathEx(xmlFilePath)
		xmlfilename = Newasp.CreateFileName(xmlFileExt,xmlFilePrefix,softid)
		m_strXmlFilePath = xmlFilePath & xmlfilename
		If Newasp.SaveXMLDocument(m_strXmlFilePath,rsxml.xml)=False Then
			Newasp.Execute ("UPDATE NC_SoftList SET [content]='" & Newasp.CheckStr(TextContent) & "',isxmltext=0 WHERE softid="&softid)
		End If
		Newasp.Execute ("UPDATE NC_SoftList SET xmlfilename='" & Replace(xmlfilename, "'", "") & "' WHERE softid="&softid)
	End If
	Set rsxml = Nothing
	If CInt(Newasp.IsCreateHtml) <> 0 Then
		Dim url
		Response.Write "<IE:Download ID=CreationID STYLE=""behavior:url(#default#download)"" />" & vbCrLf
		url = "admin_makesoft.asp?ChannelID=" & ChannelID & "&softid=" & softid & "&showid=0"	
		Call ScriptCreation(url,softid)
		SQL = "SELECT TOP 1 SoftID FROM NC_SoftList WHERE ChannelID=" & ChannelID & " And isAccept <> 0 And SoftID < " & SoftID & " ORDER BY SoftID DESC"
		Set Rs = Newasp.Execute(SQL)
		If Not (Rs.EOF And Rs.BOF) Then
			url = "admin_makesoft.asp?ChannelID=" & ChannelID & "&softid=" & Rs("SoftID") & "&showid=0"	
			Call ScriptCreation(url,Rs("SoftID"))
		End If
		Rs.Close
		Set Rs = Nothing
	End If
	Succeed("<li>恭喜您!添加新的" & sModuleName & "成功。</li><li><a href=?action=view&ChannelID=" & ChannelID & "&SoftID=" & SoftID & ">点击此处查看该" & sModuleName & "</a></li><li><a href=?action=add&ChannelID=" & ChannelID & "&classid=" & Request.Form("ClassID") & "><font color=blue>点击此处继续添加" & sModuleName & "</font></a></li>")
End Sub

Function AddDownAddress(downid,softid,DownFileName,DownText)
	If Len(DownText) = 0 Then DownText = "立即下载"
	downid = Newasp.ChkNumeric(downid)
	DownFileName = Replace(Replace(Replace(DownFileName, "&amp;", "&"), "<", "&lt;"), ">", "&gt;")
	DownText = Server.HTMLEncode(Replace(DownText, "&amp;", "&"))
	If Trim(DownFileName) <> "" Then
		SQL = "INSERT INTO NC_DownAddress (ChannelID,softid,downid,DownFileName,DownText) VALUES (" & ChannelID & "," & softid & "," & downid & ",'" & Replace(DownFileName, "'", "") & "','" & Replace(DownText, "'", "") & "')"
		Conn.Execute(SQL)
	End If
End Function

Function UpdateDownAddress(softid)
	Dim tmpAddress,tmpDownText
	Dim tmpdownid,tmpid
	If Trim(Request.Form("DownFileName")) <> "" Then
		For i = 1 To Request.Form("DownFileName").Count
			tmpAddress = Replace(Trim(Request.Form("DownFileName")(i)), "'", "")
			tmpDownText = Replace(Trim(Request.Form("DownText")(i)), "'", "")
			tmpAddress = Replace(Replace(Replace(tmpAddress, "&amp;", "&"), "<", "&lt;"), ">", "&gt;")
			tmpDownText = Server.HTMLEncode(Replace(tmpDownText, "&amp;", "&"))
			tmpdownid = Newasp.ChkNumeric(Request.Form("downid")(i))
			tmpid = Newasp.ChkNumeric(Request.Form("id")(i))
			If Len(tmpDownText) = 0 Then tmpDownText = "立即下载"
			If LCase(tmpAddress) <> "del" And Trim(tmpAddress) <> "" And LCase(tmpDownText) <> "del" Then
				Newasp.Execute ("UPDATE NC_DownAddress SET downid=" & tmpdownid & ",DownFileName='" & tmpAddress & "',DownText='" & tmpDownText & "' WHERE softid=" & softid & " And id="& CLng(tmpid))
			Else
				If LCase(tmpAddress) = "del" Or LCase(tmpDownText) = "del" Then
					Newasp.Execute("DELETE FROM NC_DownAddress WHERE softid=" & softid & " And id="& CLng(tmpid))
				End If
			End If
		Next
	End If
End Function

Sub ModifySoft()
	CheckSave
	If Founderr = True Then Exit Sub
	Dim Auditing
	Set Rs = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT * FROM NC_SoftList WHERE SoftID=" & CLng(Request("SoftID"))
	Rs.Open SQL,Conn,1,3
		Auditing = Rs("isAccept")
		Rs("ChannelID") = ChannelID
		Rs("ClassID") = Trim(Request.Form("ClassID"))
		Rs("SpecialID") = Trim(Request.Form("SpecialID"))
		Rs("SoftName") = Newasp.ChkFormStr(Request.Form("SoftName"))
		Rs("SoftVer") = Newasp.ChkFormStr(Request.Form("SoftVer"))
		Rs("subtitle") = Newasp.ChkFormStr(Request.Form("subtitle"))
		Rs("ColorMode") = Trim(Request.Form("ColorMode"))
		Rs("FontMode") = Trim(Request.Form("FontMode"))
		Rs("Related") = Newasp.ChkFormStr(Request.Form("Related"))
		If isxmltext=1 Then
			Rs("content") = "0"
		Else
			Rs("content") = TextContent
		End If
		Rs("Languages") = Newasp.ChkFormStr(Request.Form("Languages"))
		Rs("SoftType") = Newasp.ChkFormStr(Request.Form("SoftType"))
		Rs("RunSystem") = Newasp.ChkFormStr(Replace(Replace(Request.Form("RunSystem"), ", ", "/"), ",", "/"))
		Rs("impower") = Newasp.ChkFormStr(Request.Form("impower"))
		If UCase(Request.Form("SizeUnit")) = "MB" Then
			Rs("SoftSize") = CLng(Request.Form("SoftSize") * 1024)
		Else
			Rs("SoftSize") = CLng(Request.Form("SoftSize"))
		End If
		Rs("star") = Trim(Request.Form("star"))
		Rs("Homepage") = Trim(Request.Form("Homepage"))
		Rs("Contact") = Trim(Request.Form("Contact"))
		Rs("Author") = Newasp.ChkFormStr(Request.Form("Author"))
		Rs("Regsite") = Newasp.ChkFormStr(Request.Form("Regsite"))
		Rs("showreg") = CInt(showreg)
		Rs("PointNum") = Newasp.CheckNumeric(Request.Form("PointNum"))
		Rs("SoftPrice") = Newasp.CheckNumeric(Request.Form("SoftPrice"))
		If CInt(Request.Form("Update")) = 1 Then 
			Rs("SoftTime") = Now()
		Else
			Rs("SoftTime") = Formatime(Trim(Request.Form("SoftTime")))
		End If
		Rs("isTop") = SoftTop
		Rs("AllHits") = Newasp.CheckNumeric(Request.Form("AllHits"))
		Rs("SoftImage") = Trim(Request.Form("SoftImage"))
		Rs("Previewimg") = Trim(Request.Form("Previewimg"))
		Rs("plugin") = Newasp.ChkNumeric(Request.Form("plugin"))
		Rs("Decode") = Trim(Request.Form("Decode"))
		Rs("isBest") = SoftBest
		Rs("UserGroup") = Newasp.CheckNumeric(Request.Form("UserGroup"))
		Rs("isUpdate") = 1
		Rs("ErrCode") = 0
		Rs("isAccept") = SoftAccept
		Rs("ForbidEssay") = ForbidEssay
		Rs("AlphaIndex") = Newasp.ReadAlpha(AlphaSoftName)
		If Newasp.ChkNumeric(Request.Form("plugin")) = 7 Then
			Rs("PauseDown") = 1
		Else
			Rs("PauseDown") = 0
		End If
		Rs("isxmltext") = isxmltext
	Rs.update
	softid = Rs("softid")
	xmlfilename = Rs("xmlfilename") & ""
	If SoftAccept = 1 And Auditing = 0 Then
		AddUserPointNum Rs("username"),1
	End If
	If SoftAccept = 0 And Auditing = 1 Then
		AddUserPointNum Rs("username"),0
	End If
	Rs.Close:Set Rs = Nothing
	If Len(Request("DownFileName")) > 0 Then
		UpdateDownAddress(softid)
	End If
	'---- 开始批量添加下载地址
	Dim TempAddress,TempSiteName
	If Trim(Request.Form("DownAddress")) <> "" Then
		For i = 1 To Request.Form("DownAddress").Count
			TempAddress = Trim(Request.Form("DownAddress")(i))
			TempSiteName = Trim(Request.Form("SiteName")(i))
			If LCase(TempAddress) <> "del" And Trim(TempAddress) <> "" Then
				AddDownAddress Request.Form("downsid")(i),softid,TempAddress,TempSiteName
			End If
		Next
	End If
	'---- 批量添加下载地址完成
	'--生成XML文件
	If isxmltext = 1 Then
		Dim rsxml,isxmlName
		isxmlName = True
		Set Rs = Newasp.Execute("SELECT softid,ChannelID,softname,Content FROM NC_SoftList WHERE softid=" & softid)
		Set rsxml=Newasp.RecordsetToxml(rs,"softinfo","xml")
		rsxml.documentElement.selectSingleNode("softinfo/@content").text=TextContent
		If Len(xmlfilename) < 5 Then
			xmlfilename = Newasp.CreateFileName(xmlFileExt,xmlFilePrefix,softid)
			isxmlName = False
		End If
		m_strXmlFilePath = xmlFilePath & xmlfilename
		If Newasp.SaveXMLDocument(m_strXmlFilePath,rsxml.xml)=False Then
			Newasp.Execute ("UPDATE NC_SoftList SET [content]='" & Newasp.CheckStr(TextContent) & "',isxmltext=0 WHERE softid="&softid)
		End If
		Set rsxml = Nothing
		Set Rs = Nothing
		If isxmlName = False Then
			Newasp.Execute ("UPDATE NC_SoftList SET xmlfilename='" & Replace(xmlfilename, "'", "") & "' WHERE softid="&softid)
		End If
	Else
		If Len(xmlfilename) > 5 Then Call DeleteXmlFiles(softid)
	End If
	'---------------------------------------------------------------
	Call RemoveCache
	If CInt(Newasp.IsCreateHtml) <> 0 Then
		Dim url
		Response.Write "<IE:Download ID=CreationID STYLE=""behavior:url(#default#download)"" />" & vbCrLf
		url = "admin_makesoft.asp?ChannelID=" & ChannelID & "&softid=" & softid & "&showid=0"	
		Call ScriptCreation(url,softid)
	End If
	Succeed("<li>恭喜您!修改" & sModuleName & "成功。</li><li><a href=admin_Soft.asp?action=view&ChannelID=" & ChannelID & "&SoftID=" & SoftID & ">点击此处查看该" & sModuleName & "</a></li>")
End Sub
Function SoftDownAddress(softid)
	Dim rsAddress, sqlAddress, rsDown
	Dim strDownAddress,sDownAddress
	strDownAddress = ""
	On Error Resume Next
	Set rsDown = Newasp.Execute("SELECT downid,DownFileName FROM [NC_DownAddress] WHERE softid=" & CLng(softid))
	If Not (rsDown.BOF And rsDown.EOF) Then
		Do While Not rsDown.EOF
			If rsDown("downid") > 0 Then
				sqlAddress = "SELECT downid,DownloadName,DownloadPath FROM NC_DownServer WHERE ChannelID=" & ChannelID & " And depth=1 And rootid =" & rsDown("downid") & " And isLock=0 ORDER BY orders ASC"
				Set rsAddress = Newasp.Execute(sqlAddress)
				If Not(rsAddress.EOF And rsAddress.BOF) Then
					Do While Not rsAddress.EOF
						strDownAddress = rsAddress("DownloadPath") & Server.HTMLEncode(rsDown("DownFileName"))
						sDownAddress = sDownAddress & "<li><a href=""" & strDownAddress & """ target=_blank>" & strDownAddress & "</a></li>" & vbNewLine
						rsAddress.movenext
					Loop
				End If
				Set rsAddress = Nothing
			Else
				strDownAddress = Server.HTMLEncode(rsDown("DownFileName")) & ""
				sDownAddress = sDownAddress & "<li><a href=""" & strDownAddress & """ target=_blank>" & strDownAddress & "</a></li>" & vbNewLine
			End If
			rsDown.movenext
		Loop
	End If
	Set rsDown = Nothing
	SoftDownAddress = sDownAddress
End Function
Sub SoftView()
	Call PageTop
	If Request("SoftID") = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>Sorry!您选择了错误的系统参数。</li>"
		Exit Sub
	End If
	On Error Resume Next
	SQL = "SELECT * FROM NC_SoftList WHERE ChannelID=" & ChannelID & " And SoftID=" & CLng(Request("SoftID"))
	Set Rs = Newasp.Execute(SQL)
	If Rs.BOF And Rs.EOF Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>Sorry!没有找到任何" & sModuleName & "。或者您选择了错误的系统参数!</li>"
		Exit Sub
	Else
		If Rs("isxmltext")=1 Then
			m_strXmlFilePath = xmlFilePath & Rs("xmlfilename")
			TextContent = Newasp.ReadXMLDocument(m_strXmlFilePath,"softinfo/@content")
		Else
			TextContent = Rs("content") & ""
		End If
%>

<table border="0" align="center" cellpadding="3" cellspacing="1" class="TableBorder">
	<tr>
	  <th colspan="2">查看<%=sModuleName%></th>
	</tr>
	<tr>
	  <td align="center" class="TableRow2" colspan="2"><a href=?action=edit&ChannelID=<%=ChannelID%>&SoftID=<%=Rs("SoftID")%>><font size=4><%=Rs("SoftName") & " " & Rs("SoftVer")%></font></a></td>
	</tr>
	<tr>
	  <td class="TableRow1"><b><%=sModuleName%>运行环境:</b> <%=Rs("RunSystem")%></td>
	  <td class="TableRow1"><b><%=sModuleName%>类型:</b> <%=Rs("SoftType")%></td>
	</tr>
	<tr>
	  <td class="TableRow1"><b><%=sModuleName%>大小:</b> <%=Rs("SoftSize")%> <b>KB</b></td>
	  <td class="TableRow1"><b><%=sModuleName%>星级:</b> 
<%
Response.Write "<font color=red>"
For i = 1 to Rs("star")
	Response.Write "★"
Next
Response.Write "</font>"
%>
	  </td>
	</tr>
	<tr>
	  <td class="TableRow1"><b><%=sModuleName%>语言:</b> <%=Rs("Languages")%></td>
	  <td class="TableRow1"><b>授权方式:</b> <%=Rs("impower")%></td>
	</tr>
	<tr>
	  <td class="TableRow1"><b>更新时间:</b> <%=Rs("SoftTime")%></td>
	  <td class="TableRow1"><b>程序主页:</b> <%=Rs("Homepage")%></td>
	</tr>
	<tr>
	  <td class="TableRow1"><b>发 布 人:</b> <font color=blue><%=Rs("username")%></font></td>
	  <td class="TableRow1"><b>审核状态:</b> <%If Rs("isAccept") > 0 Then%>
	  <font color=blue>已审核</font>
	  <%Else%>
	  <font color=red>未审核</font>
	  <%End If%>
	  </td>
	</tr>
	<tr>
	  <td colspan="2" class="TableRow1"><b><%=sModuleName%>简介:</b><br><%=Replace(ubb.UbbCode(TextContent), "[page_break]", "")%></td>
	</tr>
	<tr>
	  <td colspan="2" class="TableRow1"><b>下载地址:</b><br>
<%
	Response.Write SoftDownAddress(Rs("softid"))
%>
	  </td>
	</tr>
	<tr>
	  <td colspan="2" class="TableRow1">上一<%=sModuleName%>:<%=FrontSoft(Rs("SoftID"))%>
	  <br>下一<%=sModuleName%>:<%=NextSoft(Rs("SoftID"))%></td>
	</tr>
	<tr>
	  <td align="center" colspan="2" class="TableRow2"><input type="button" onclick="{if(confirm('您确定要删除此软件吗?')){location.href='?action=del&ChannelID=<%=ChannelID%>&softid=<%=Rs("softid")%>';return true;}return false;}" value="删除软件" name="B2" class=Button>&nbsp;&nbsp;
	  <input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B1" class=Button>&nbsp;&nbsp; 
	  <input type="button" name="Submit1" onclick="javascript:location.href='#'" value="返回顶部" class=button>&nbsp;&nbsp;
	  <input type="button" name="Submit2" onclick="javascript:location.href='?action=edit&ChannelID=<%=ChannelID%>&SoftID=<%=Rs("SoftID")%>'" value="编辑软件" class=button>&nbsp;&nbsp;
	  [<a href="?act=批量审核&ChannelID=<%=ChannelID%>&selSoftID=<%=Rs("SoftID")%>" onclick="return confirm('您确定执行审核操作吗?');" ><font color=blue>直接审核</font></a>]</td>
	</tr>
</table>
<%
	End If
	Rs.Close
	Set Rs = Nothing 
End Sub

Function FrontSoft(SoftID)
	Dim Rss, SQL
	SQL = "select Top 1 SoftID,classid,SoftName from NC_SoftList where ChannelID=" & ChannelID & " And isAccept <> 0 And SoftID < " & SoftID & " order by SoftID desc"
	Set Rss = Newasp.Execute(SQL)
	If Rss.EOF And Rss.bof Then
		FrontSoft = "已经没有了"
	Else
		FrontSoft = "<a href=admin_Soft.asp?action=view&ChannelID=" & ChannelID & "&SoftID=" & Rss("SoftID") & ">" & Rss("SoftName") & "</a>"
	End If
	Rss.Close
	Set Rss = Nothing
End Function
Function NextSoft(SoftID)
	Dim Rss, SQL
	SQL = "select Top 1 SoftID,classid,SoftName from NC_SoftList where ChannelID=" & ChannelID & " And isAccept <> 0 And SoftID > " & SoftID & " order by SoftID asc"
	Set Rss = Newasp.Execute(SQL)
	If Rss.EOF And Rss.bof Then
		NextSoft = "已经没有了"
	Else
		NextSoft = "<a href=admin_Soft.asp?action=view&ChannelID=" & ChannelID & "&SoftID=" & Rss("SoftID") & ">" & Rss("SoftName") & "</a>"
	End If
	Rss.Close
	Set Rss = Nothing
End Function
Sub BatCreateHtml()
	Dim AllSoftID,url
	Response.Write "<IE:Download ID=CreationID STYLE=""behavior:url(#default#download)"" />" & vbCrLf
	Response.Write "<ol>"
	AllSoftID = Split(selSoftID, ",")
	For i = 0 To UBound(AllSoftID)
		softid = CLng(AllSoftID(i))
		url = "admin_makesoft.asp?ChannelID=" & ChannelID & "&softid=" & softid & "&showid=1"	
		Call ScriptCreation(url,softid)
	Next
	Response.Write "</ol>"
	OutHintScript("开始生成HTML,共有" & i & "个HTML页面需要生成!")
End Sub
Function ClassUpdateCount(sortid,stype)
	Dim rscount,Parentstr
	On Error Resume Next
	Set rscount = Newasp.Execute("SELECT ClassID,Parentstr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID=" & CLng(sortid))
	If Not (rscount.BOF And rscount.EOF) Then
		Parentstr = rscount("Parentstr") &","& rscount("ClassID")
		If CInt(stype) = 1 Then
			Newasp.Execute ("UPDATE [NC_Classify] SET ShowCount=ShowCount+1,isUpdate=1 WHERE ChannelID = "& ChannelID &" And ClassID in (" & Parentstr & ")")
		Else
			Newasp.Execute ("UPDATE [NC_Classify] SET ShowCount=ShowCount-1,isUpdate=1 WHERE ChannelID = "& ChannelID &" And ClassID in (" & Parentstr & ")")
		End If
	End If
	Set rscount = Nothing
End Function

Sub DeleteXmlFiles(sid)
	Dim oRs,m_strXmlName,m_strXmlPath
	Set oRs=Newasp.Execute("SELECT softid,xmlfilename FROM NC_SoftList WHERE softid in (" & sid & ")")
	If Not(oRs.BOF And oRs.EOF) Then
		Do While Not oRs.EOF
			m_strXmlName = oRs("xmlfilename") & ""
			If Len(m_strXmlName) > 5 Then
				m_strXmlPath = xmlFilePath & m_strXmlName
				Newasp.FileDelete(m_strXmlPath)
			End If
			oRs.movenext
		Loop
	End If
	Set oRs = Nothing
End Sub

Sub DelDownAddress()
	If Not IsNumeric(Request("id")) Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>ID参数错误!</li>"
		Exit Sub
	End If
	Newasp.Execute("DELETE FROM NC_DownAddress WHERE ChannelID = "& ChannelID &" And id=" & CLng(Request("id")))
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Sub SoftDel()
	softid = Clng(Request("softid"))
	If softid = 0 Then
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If

	On Error Resume Next
	Set Rs = Newasp.Execute("SELECT softid,classid,username,HtmlFileDate FROM NC_SoftList WHERE ChannelID="& ChannelID &" And softid= " & softid)
	If Not(Rs.BOF And Rs.EOF) Then
		ClassUpdateCount Rs("classid"),0
		AddUserPointNum Rs("username"),0
		DeleteHtmlFile Rs("classid"),Rs("softid"),Rs("HtmlFileDate")
		Call DeleteXmlFiles(Rs("softid"))
	End If
	Rs.Close:Set Rs = Nothing
	
	Conn.Execute("DELETE FROM NC_DownAddress WHERE ChannelID="& ChannelID &" And softid=" & softid)
	Conn.Execute("DELETE FROM NC_SoftList WHERE ChannelID="& ChannelID &" And softid=" & softid)
	Conn.Execute ("DELETE FROM NC_Comment WHERE ChannelID="& ChannelID &" And PostID=" & softid)
	Call RemoveCache
	'Response.redirect ("admin_soft.asp?ChannelID=" & ChannelID)
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub batdel()
	Set Rs = Newasp.Execute("SELECT softid,classid,username,HtmlFileDate FROM NC_SoftList WHERE ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
	Do While Not Rs.EOF
		ClassUpdateCount Rs("classid"),0
		AddUserPointNum Rs("username"),0
		DeleteHtmlFile Rs("classid"),Rs("softid"),Rs("HtmlFileDate")
		Call DeleteXmlFiles(Rs("softid"))
		Rs.movenext
	Loop
	Rs.Close:Set Rs = Nothing
	Conn.Execute ("DELETE FROM NC_SoftList WHERE ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
	Conn.Execute ("DELETE FROM NC_DownAddress WHERE ChannelID = "& ChannelID &" And SoftID in (" & selSoftID & ")")
	Conn.Execute ("DELETE FROM NC_Comment WHERE ChannelID = "& ChannelID &" And PostID in (" & selSoftID & ")")
	Call RemoveCache
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub isCommend()
	Newasp.Execute ("update NC_SoftList set isBest=1 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub noCommend()
	Newasp.Execute ("update NC_SoftList set isBest=0 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub isTop()
	Newasp.Execute ("update NC_SoftList set isTop=1 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Sub noTop()
	Newasp.Execute ("update NC_SoftList set isTop=0 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Sub upindate()
	Newasp.Execute ("update [NC_SoftList] set SoftTime = " & NowString & " where softid in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
'----批量审核
Sub BatAccept()
	Set Rs = Newasp.Execute("SELECT username FROM NC_SoftList WHERE isAccept=0 And SoftID in (" & selSoftID & ")")
	Do While Not Rs.EOF
		AddUserPointNum Rs("username"),1
		Rs.movenext
	Loop
	Rs.Close:Set Rs = Nothing
	Newasp.Execute ("update NC_SoftList set isAccept=1 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Sub NotAccept()
	Set Rs = Newasp.Execute("SELECT username FROM NC_SoftList WHERE isAccept>0 And SoftID in (" & selSoftID & ")")
	Do While Not Rs.EOF
		AddUserPointNum Rs("username"),0
		Rs.movenext
	Loop
	Rs.Close:Set Rs = Nothing
	Newasp.Execute ("update NC_SoftList set isAccept=0 where SoftID in (" & selSoftID & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
Function AddUserPointNum(username,stype)
	On Error Resume Next
	Dim rsuser,GroupSetting,userpoint
	Set rsuser = Newasp.Execute("SELECT userid,UserGrade,userpoint FROM NC_User WHERE username='"& username &"'")
	If Not(rsuser.BOF And rsuser.EOF) Then
		GroupSetting = Split(Newasp.UserGroupSetting(rsuser("UserGrade")), "|||")(13)
		If CInt(stype) = 1 Then
			userpoint = CLng(rsuser("userpoint") + GroupSetting)
			Newasp.Execute ("UPDATE NC_User SET userpoint="& userpoint &",experience=experience+2,charm=charm+1 WHERE userid="& rsuser("userid"))
		Else
			userpoint = CLng(rsuser("userpoint") - GroupSetting)
			Newasp.Execute ("UPDATE NC_User SET userpoint="& userpoint &",experience=experience-2,charm=charm-1 WHERE userid="& rsuser("userid"))
		End If
	End If
	Set rsuser = Nothing
End Function


Sub BatchSetting()
	If Not ChkAdmin("AdminSoft" & ChannelID) Then
		Server.Transfer("showerr.asp")
		Response.End
	End If
	Response.Write "<script src=""include/checksoft.js"" type=""text/javascript""></script>" & vbNewLine
	Response.Write "<table cellspacing=1 align=center cellpadding=3 border=0 class=tableborder>"
	Response.Write "	<tr>"
	Response.Write "		<th colspan=4>" & sModuleName & "批量设置</th>"
	Response.Write "	</tr>"
	Response.Write "	<form name=myform method=post action=?action=saveset>"
	Response.Write "	<input type=hidden name=ChannelID value='"& ChannelID &"'>"
	Response.Write "	<tr>"
	Response.Write "		<td width=""20%"" rowspan=""19"" class=tablerow2 valign=""top"" id=choose2 style=""display:none""><b>请选择" & sModuleName & "分类</b><br>"
	Response.Write "<select name=""ClassID"" size='2' multiple style='height:420px;width:180px;'>"
	Dim strSelectClass,re
	strSelectClass = Newasp.LoadSelectClass(ChannelID)
	Set re = New RegExp
        re.IgnoreCase = True
        re.Global = True
	Re.Pattern="(value=)(.*)("" )"
	strSelectClass = Re.Replace(strSelectClass,"")
	Re.Pattern="({ClassID=)(.*)(}>)"
	strSelectClass = Re.Replace(strSelectClass,"value=""$2"">")
	Response.Write strSelectClass
	Set Re = Nothing
	Response.Write "<option value=""-1"">指定所有分类</option>"
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "		<td class=tablerow1 colspan=2 align=right><b>设置选择:</b></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "		<input type=radio name=choose value='0' checked onClick=""choose1.style.display='';choose2.style.display='none';""> 按" & sModuleName & "ID&nbsp;&nbsp;"
	Response.Write "		<input type=radio name=choose value='1' onClick=""choose2.style.display='';choose1.style.display='none';""> 按" & sModuleName & "分类</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr id=choose1>"
	Response.Write "		<td class=tablerow1 colspan=2 align=right><b>" & sModuleName & "ID:</b>多个ID请用“,”分开</td>"
	Response.Write "		<td class=tablerow1><input type=""text"" name=""SoftID"" size=70 value='"& Request("selSoftID") &"'></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 width=""15%"" align=right><b>相关" & sModuleName & ":</b></td>"
	Response.Write "		<td class=tablerow1 width=""5%"" align=center><input type=checkbox name=selRelated value='1'></td>"
	Response.Write "		<td class=tablerow1 width=""60%""><input name=Related type=text size=60></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>运行环境:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selRunSystem value='1'></td>"
	Response.Write "		<td class=tablerow1 ><input name=RunSystem type=text size=60><br>"
	Dim RunSystem
	If Len(Channel_Setting(0)) < 3 Then Channel_Setting(0) = "Win9X/|ME/|NT/|2000/|XP/|2003/|Vista/|Linux/|Unix/|Mac/"
	RunSystem = Split(Channel_Setting(0), "|")
	For i = 0 To UBound(RunSystem)
		Response.Write "<a href='javascript:ToRunsystem(""" & Trim(RunSystem(i)) & """)'><u>" & Trim(RunSystem(i)) & "</u></a> | "
		If i = 10 Then Response.Write "<br>"
	Next
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "类型:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selSoftType value='1'></td>"
	Response.Write "		<td class=tablerow1 >"
	Dim SoftType
	If Len(Channel_Setting(2)) < 3 Then Channel_Setting(2) = "国产软件,国外软件,汉化补丁,源码程序"
	SoftType = Split(Channel_Setting(2), ",")
	For i = 0 To UBound(SoftType)
		Response.Write "	<input type=""radio"" name=""SoftType"" value=""" & Trim(SoftType(i)) & """ "
		If i = 0 Then Response.Write " checked"
		Response.Write ">" & Trim(SoftType(i)) & " "
		If i = 6 Then Response.Write "<br>"
	Next
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "作者:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selAuthor value='1'></td>"
	Response.Write "		<td class=tablerow1><input name=Author type=text size=20>"
	Response.Write "		<select name=font2 onChange=""Author.value=this.value;"">"
	Response.Write "		<option selected value=''>选择作者</option>"
	Response.Write "		<option value='佚名'>佚名</option>"
	Response.Write "		<option value='本站'>本站</option>"
	Response.Write "		<option value='不详'>不详</option>"
	Response.Write "		<option value='未知'>未知</option>"
	Response.Write "		</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>授权方式:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selImpower value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "		<select name=Impower>"
	Dim ImpowerStr
	If Len(Channel_Setting(3)) < 3 Then Channel_Setting(3) = "共享版,免费版,自由版,试用版,演示版,商业版"
	ImpowerStr = Split(Channel_Setting(3), ",")
	For i = 0 To UBound(ImpowerStr)
		Response.Write "	<option value=""" & ImpowerStr(i) & """>" & ImpowerStr(i) & "</option>"
	Next
	Response.Write "		</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "语言:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selLanguages value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "		<select name=Languages>"
	Dim LanguagesStr
	If Len(Channel_Setting(4)) < 3 Then Channel_Setting(4) = "简体中文,繁体中文,英文,多国语言"
	LanguagesStr = Split(Channel_Setting(4), ",")
	For i = 0 To UBound(LanguagesStr)
		Response.Write "	<option value=""" & LanguagesStr(i) & """>" & LanguagesStr(i) & "</option>"
	Next
	Response.Write "		</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>所需点数:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selPointNum value='1'></td>"
	Response.Write "		<td class=tablerow1><input name=PointNum type=text size=10 value=0></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>点击数:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selAllHits value='1'></td>"
	Response.Write "		<td class=tablerow1><input name=AllHits type=text size=10 value=0></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>阅览等级:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selUserGroup value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "		<select name=UserGroup size='1'>"
	Set RsObj = Newasp.Execute("SELECT GroupName,Grades FROM NC_UserGroup ORDER BY Groupid")
	Do While Not RsObj.EOF
		Response.Write "	<option value=""" & RsObj("Grades") & """"
		If RsObj("Grades") = 0 Then Response.Write " selected"
		Response.Write ">"
		Response.Write RsObj("GroupName")
		Response.Write "</option>" & vbCrLf
		RsObj.movenext
	Loop
	Set RsObj = Nothing
	Response.Write "		</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "星级:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selstar value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "	<select name=star>"
	Response.Write "		<option value=5>★★★★★</option>"
	Response.Write "		<option value=4>★★★★</option>"
	Response.Write "		<option value=3 selected>★★★</option>"
	Response.Write "		<option value=2>★★</option>"
	Response.Write "		<option value=1>★</option>"
	Response.Write "	</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "置顶:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selTop value='1'></td>"
	Response.Write "		<td class=tablerow1><input type=radio name=istop value='0' checked> 否&nbsp;&nbsp;<input type=radio name=istop value='1'> 是</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>" & sModuleName & "推荐:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selBest value='1'></td>"
	Response.Write "		<td class=tablerow1><input type=radio name=isbest value='0' checked> 否&nbsp;&nbsp;<input type=radio name=isbest value='1'> 是</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>禁止评论:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selForbidEssay value='1'></td>"
	Response.Write "		<td class=tablerow1><input type=radio name=ForbidEssay value='0' checked> 否&nbsp;&nbsp;<input type=radio name=ForbidEssay value='1'> 是</td>"
	Response.Write "	</tr>"
	'--专题设置
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>专题设置:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=selSpecial value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "<select name=""SpecialID"" id=""SpecialID"">" & vbNewLine
	Response.Write "<option value=""0"">不指定" & sModuleName & "专题</option>" & vbNewLine
	Set RsObj = Newasp.Execute("SELECT SpecialID,SpecialName FROM NC_Special WHERE ChannelID="& ChannelID &" And ChangeLink=0 ORDER BY orders")
	Do While Not RsObj.EOF
		Response.Write Chr(9) & Chr(9) & "<option value=""" & RsObj("SpecialID") & """>"
		Response.Write RsObj("SpecialName")
		Response.Write "</option>" & vbCrLf
		RsObj.movenext
	Loop
	Set RsObj = Nothing
	Response.Write "		</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	'-- 设置下载服务器
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 align=right><b>下载服务器设置:</b></td>"
	Response.Write "		<td class=tablerow1 align=center><input type=checkbox name=seldownid value='1'></td>"
	Response.Write "		<td class=tablerow1>"
	SelDownServer 1,"downid"
	Response.Write "</td>	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 colspan=3><b>说明:</b>若要批量修改某个属性的值,请先选中其左侧的复选框,然后再设定属性值。"
	Response.Write " <a href=?action=reset&ChannelID="& ChannelID & " onclick=""return confirm('您确定要重置所有时间吗?')"">重置时间</a></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr align=center>"
	Response.Write "		<td class=tablerow1 colspan=3><input type=""button"" onclick=""javascript:history.go(-1)"" value=""返回上一页"" name=""B1"" class=Button>&nbsp;&nbsp;"
	Response.Write "		<input type=submit name=submit2 value=""确定设置"" class=Button onclick=""return confirm('您确定执行批量设置吗?')"">"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	</form>"
	Response.Write "</table>"
End Sub
Sub BatchMove()
	If Not ChkAdmin("AdminSoft" & ChannelID) Then
		Server.Transfer("showerr.asp")
		Response.End
	End If
	Response.Write "<table cellspacing=1 align=center cellpadding=3 border=0 class=tableborder>"
	Response.Write "	<tr>"
	Response.Write "		<th colspan=3>" & sModuleName & "批量移动</th>"
	Response.Write "	</tr>"
	Response.Write "	<form name=myform method=post action=?action=savemove>"
	Response.Write "	<input type=hidden name=ChannelID value='"& ChannelID &"'>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 colspan=3><input type=radio name=Appointed value='0' checked>"
	Response.Write " <b>指定" & sModuleName & "ID:</b> <input type=""text"" name=""SoftID"" size=80 value='"& Request("selSoftID") &"'></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 width=""35%""><input type=radio name=Appointed value='1'> <b>指定" & sModuleName & "分类:</b></td>"
	Response.Write "		<td class=tablerow1 width=""10%""></td>"
	Response.Write "		<td class=tablerow1 width=""55%""><b>" & sModuleName & "目标分类:</b><font color=red>(不能指定外部分类)</font></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "<select name='ClassID' size='2' multiple style='height:350px;width:260px;'>"
	Dim strSelectClass,re
	strSelectClass = Newasp.LoadSelectClass(ChannelID)
	Set re = New RegExp
        re.IgnoreCase = True
        re.Global = True
	Re.Pattern="(value=)(.*)("" )"
	strSelectClass = Re.Replace(strSelectClass,"")
	Re.Pattern="({ClassID=)(.*)(}>)"
	strSelectClass = Re.Replace(strSelectClass,"value=""$2"">")
	Response.Write strSelectClass
	Set Re = Nothing
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "		<td class=tablerow1 align=center noWrap>移动到→</td>"
	Response.Write "		<td class=tablerow1>"
	Response.Write "<select name='tClassID' size='2' style='height:350px;width:260px;'>"
	Response.Write strSelectClass
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr align=center>"
	Response.Write "		<td class=tablerow1 colspan=3><input type=""button"" onclick=""javascript:history.go(-1)"" value=""返回上一页"" name=""B1"" class=Button>&nbsp;&nbsp;"
	Response.Write "		<input type=submit name=submit2 value=""批量移动"" class=Button onclick=""return confirm('您确定执行批量移动吗?')"">"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	</form>"
	Response.Write "</table>"
End Sub
Sub SaveMove()
	If Trim(Request.Form("tClassID")) = "" Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>请选择目标分类。</li>"
		Exit Sub
	End If
	If Trim(Request.Form("tClassID")) = 0 Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>不能移动到外部分类。</li>"
		Exit Sub
	End If
	Set Rs = Newasp.Execute("SELECT child FROM NC_Classify WHERE TurnLink=0 And ChannelID = "& ChannelID &" And ClassID="& CLng(Request.Form("tClassID")))
	If Rs.BOF And Rs.EOF Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>错误的系统参数!不能移动到外部分类。</li>"
		Set Rs = Nothing
		Exit Sub
	Else
		If Rs("child") > 0 Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>此分类还有子分类,请选择子分类再移动。</li>"
			Set Rs = Nothing
			Exit Sub
		End If
	End If
	Set Rs = Nothing
	If CInt(Request.Form("Appointed")) = 0 Then
		If Trim(Request.Form("SoftID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "ID。</li>"
			Exit Sub
		Else
			SQL = "UPDATE NC_SoftList SET ClassID="& CLng(Request.Form("tClassID")) &" WHERE isAccept>0 And ChannelID = "& ChannelID &" And SoftID in ("& Request("SoftID") &")"
		End If
	Else
		If Trim(Request.Form("ClassID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择分类。</li>"
			Exit Sub
		Else
			SQL = "UPDATE NC_SoftList SET ClassID="& CLng(Request.Form("tClassID")) &" WHERE isAccept>0 And ChannelID = "& ChannelID &" And ClassID in ("& Request("ClassID") &")"
		End If
	End If
	Newasp.Execute(SQL)
	Succeed("<li>恭喜您!批量移动完成。</li>")
End Sub

Sub BatcDelete()
	If Not ChkAdmin("AdminSoft" & ChannelID) Then
		Server.Transfer("showerr.asp")
		Response.End
	End If
	Response.Write "<table cellspacing=1 align=center cellpadding=3 border=0 class=tableborder>"
	Response.Write "	<tr>"
	Response.Write "		<th>" & sModuleName & "批量删除</th>"
	Response.Write "	</tr>"
	Response.Write "	<form name=myform method=post action=?action=alldel>"
	Response.Write "	<input type=hidden name=ChannelID value='"& ChannelID &"'>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1 colspan=3><input type=radio name=Appointed value='0' checked onClick=""choose1.style.display='';choose2.style.display='none';"">"
	Response.Write " <b>指定" & sModuleName & "ID:</b> "
	Response.Write "<input type=radio name=Appointed value='1' onClick=""choose2.style.display='';choose1.style.display='none';""> <b>指定" & sModuleName & "分类:</b>"
	Response.Write "<input type=radio name=Appointed value='2'> <b>删除所有" & sModuleName & "</b>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr id=choose1>"
	Response.Write "		<td class=tablerow1><b>分类ID:</b><input type=""text"" name=""SoftID"" size=80 value='"& Request("selSoftID") &"'></td>"
	Response.Write "	</tr>"
	Response.Write "	<tr id=choose2 style=""display:none"">"
	Response.Write "		<td class=tablerow1>"
	Response.Write "<select name='ClassID' size='2' multiple style='height:350px;width:260px;'>"
	Dim strSelectClass,re
	strSelectClass = Newasp.LoadSelectClass(ChannelID)
	Set re = New RegExp
        re.IgnoreCase = True
        re.Global = True
	Re.Pattern="(value=)(.*)("" )"
	strSelectClass = Re.Replace(strSelectClass,"")
	Re.Pattern="({ClassID=)(.*)(}>)"
	strSelectClass = Re.Replace(strSelectClass,"value=""$2"">")
	Response.Write strSelectClass
	Set Re = Nothing
	Response.Write "</select>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr>"
	Response.Write "		<td class=tablerow1><font color=""red"">注意:删除后将无法恢复,请确定无误后再进行删除操作,强烈建议操作前请备份数据库。</font><br/>"
	Response.Write "<b>说明:</b><br/>1.指定ID删除:请在输入框内输入相应的ID进行删除,多个ID请用英文逗号(,)分开;<br/>"
	Response.Write "2.指定分类删除:选择相应的分类进行删除操作,将删除所属分类下的所有内容;<br/>"
	Response.Write "3.删除所有:此选项将会删除此频道下的所有内容,请注意操作。<br/>"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	<tr align=center>"
	Response.Write "		<td class=tablerow1><input type=""button"" onclick=""javascript:history.go(-1)"" value=""返回上一页"" name=""B1"" class=Button>&nbsp;&nbsp;"
	Response.Write "		<input type=submit name=submit2 value=""批量删除"" class=Button onclick=""return confirm('您确定执行批量删除操作吗?')"">"
	Response.Write "</td>"
	Response.Write "	</tr>"
	Response.Write "	</form>"
	Response.Write "</table>"
End Sub
Sub AllDelSoft()
	On Error Resume Next
	If CInt(Request.Form("Appointed")) = 1 Then
		If Trim(Request.Form("ClassID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择分类。</li>"
			Exit Sub
		End If
		Newasp.Execute ("DELETE NC_DownAddress FROM NC_SoftList A INNER JOIN NC_DownAddress D ON D.SoftID=A.SoftID WHERE A.ChannelID = "& ChannelID &" And A.ClassID IN (" & Request("ClassID") & ")")
		Newasp.Execute ("DELETE NC_Comment FROM NC_SoftList A INNER JOIN NC_Comment C ON C.PostID=A.SoftID WHERE A.ChannelID = "& ChannelID &" And A.ClassID IN (" & Request("ClassID") & ")")
		Newasp.Execute ("DELETE FROM NC_SoftList WHERE ChannelID = "& ChannelID &" And ClassID IN (" & Request("ClassID") & ")")
	ElseIf CInt(Request.Form("Appointed")) = 2 Then
		Newasp.Execute ("DELETE FROM NC_SoftList WHERE ChannelID = "& ChannelID)
		Newasp.Execute ("DELETE FROM NC_DownAddress WHERE ChannelID = "& ChannelID)
		Newasp.Execute ("DELETE FROM NC_Comment WHERE ChannelID = "& ChannelID)
	Else
		If Trim(Request.Form("SoftID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "ID。</li>"
			Exit Sub
		End If
		Newasp.Execute ("DELETE FROM NC_SoftList WHERE ChannelID = "& ChannelID &" And SoftID IN (" & Request("SoftID") & ")")
		Newasp.Execute ("DELETE FROM NC_DownAddress WHERE ChannelID = "& ChannelID &" And SoftID IN (" & Request("SoftID") & ")")
		Newasp.Execute ("DELETE FROM NC_Comment WHERE ChannelID = "& ChannelID &" And PostID IN (" & Request("SoftID") & ")")
		Call DeleteXmlFiles(Request("SoftID"))
	End If
	Call RemoveCache
	Succeed("<li>批量删除成功!</li>")
End Sub

Sub SaveSetting()
	If Founderr = True Then Exit Sub
	Dim strTempValue,strSQL,downid
	downid = Newasp.ChkNumeric(Request.Form("downid"))
	strTempValue = ""
	If Trim(Request.Form("selSpecial")) <> "" Then strTempValue = strTempValue & "SpecialID="& CLng(Request.Form("SpecialID")) &","
	If Trim(Request.Form("selRelated")) <> "" Then strTempValue = strTempValue & "Related='"& Newasp.ChkFormStr(Request.Form("Related")) &"',"
	If Trim(Request.Form("selRunSystem")) <> "" Then strTempValue = strTempValue & "RunSystem='"& Newasp.ChkFormStr(Request.Form("RunSystem")) &"',"
	If Trim(Request.Form("selSoftType")) <> "" Then strTempValue = strTempValue & "SoftType='"& Newasp.ChkFormStr(Request.Form("SoftType")) &"',"
	If Trim(Request.Form("selAuthor")) <> "" Then strTempValue = strTempValue & "Author='"& Newasp.ChkFormStr(Request.Form("Author")) &"',"
	If Trim(Request.Form("selImpower")) <> "" Then strTempValue = strTempValue & "Impower='"& Newasp.ChkFormStr(Request.Form("Impower")) &"',"
	If Trim(Request.Form("selLanguages")) <> "" Then strTempValue = strTempValue & "Languages='"& Newasp.ChkFormStr(Request.Form("Languages")) &"',"
	If Trim(Request.Form("selPointNum")) <> "" Then strTempValue = strTempValue & "PointNum="& CLng(Request.Form("PointNum")) &","
	If Trim(Request.Form("selAllHits")) <> "" Then strTempValue = strTempValue & "AllHits="& CLng(Request.Form("AllHits")) &","
	If Trim(Request.Form("selUserGroup")) <> "" Then strTempValue = strTempValue & "UserGroup="& CInt(Request.Form("UserGroup")) &","
	If Trim(Request.Form("selstar")) <> "" Then strTempValue = strTempValue & "star="& CInt(Request.Form("star")) &","
	If Trim(Request.Form("selTop")) <> "" Then strTempValue = strTempValue & "istop="& CInt(Request.Form("istop")) &","
	If Trim(Request.Form("selBest")) <> "" Then strTempValue = strTempValue & "isbest="& CInt(Request.Form("isbest")) &","
	If Trim(Request.Form("selForbidEssay")) <> "" Then strTempValue = strTempValue & "ForbidEssay="& CInt(Request.Form("ForbidEssay")) &","
	If Trim(strTempValue) <> "" Then
		strTempValue = Replace(Left(strTempValue,Len(strTempValue)-1), " ", "")
	End If
	
	If CInt(Request.Form("choose")) = 0 Then
		If Trim(Request.Form("SoftID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择" & sModuleName & "ID。</li>"
			Exit Sub
		Else
			SQL = "UPDATE NC_SoftList SET "& strTempValue &" WHERE isAccept>0 And ChannelID="& ChannelID &" And softid in ("& Request("softid") &")"
			strSQL = "UPDATE NC_DownAddress SET downid=" & downid & " WHERE ChannelID="& ChannelID &" And softid in ("& Request("softid") &")"
		End If
	Else
		If Trim(Request.Form("ClassID")) = "" Then
			FoundErr = True
			ErrMsg = ErrMsg + "<li>请选择分类。</li>"
			Exit Sub
		ElseIf Trim(Request.Form("ClassID")) = "-1" Then
			SQL = "UPDATE NC_SoftList SET "& strTempValue &" WHERE ChannelID = "& ChannelID &" And isAccept>0"
			strSQL = "UPDATE NC_DownAddress SET downid=" & downid & " WHERE ChannelID="& ChannelID
		Else
			SQL = "UPDATE NC_SoftList SET "& strTempValue &" WHERE isAccept>0 And ChannelID="& ChannelID &" And ClassID in ("& Request("classid") &")"
		End If
	End If
	If Trim(strTempValue) <> "" Then
		Newasp.Execute(SQL)
	End If
	If Trim(Request.Form("seldownid")) <> "" And strSQL <> "" Then
		Newasp.Execute(strSQL)
	End If
	Succeed("<li>恭喜您!批量设置完成。</li>")
End Sub
Sub ResetDateTime()
	Server.ScriptTimeOut = 9999
	Response.Write "<br><table width='400' align=center border=0 cellspacing=1 cellpadding=1>" & vbCrLf
	Response.Write "<tr> " & vbCrLf
	Response.Write "<td style=""border: 1px #384780 solid ;background-color: #FFFFFF;"">" & vbCrLf
	Response.Write "<table width=0 id=table2 name=table2 border=0 cellspacing=0 cellpadding=0>" & vbCrLf
	Response.Write "<tr height=12><td bgcolor=#36D91A>" & vbCrLf
	Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
	Response.Write "<td align=center> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span> <span style=""font-size:9pt"">%</span></td></tr>" & vbCrLf
	Response.Write "</table><br>" & vbCrLf
	Response.Flush
	Dim totalrec,SoftTime,page_count,pagelist
	i = 0
	page_count = 0
	totalrec = Newasp.Execute("SELECT COUNT(SoftID) FROM [NC_SoftList] WHERE ChannelID = "& ChannelID &" And isAccept>0")(0)
	Set Rs = Newasp.Execute("SELECT SoftID,SoftTime FROM [NC_SoftList] WHERE ChannelID = "& ChannelID &" And isAccept>0 ORDER BY SoftTime DESC")
	If Not (Rs.BOF And Rs.EOF) Then
		SQL=Rs.GetRows(-1)
		For pagelist=0 To Ubound(SQL,2)
			If Not Response.IsClientConnected Then Response.End
			Response.Write "<script>"
			Response.Write "table2.style.width=" & Fix((page_count / totalrec) * 400) & ";"
			Response.Write "txt2.innerHTML=""完成:" & FormatNumber(page_count / totalrec * 100, 2, -1) & """;"
			Response.Write "</script>" & vbCrLf
			Response.Flush
			SoftTime = DateAdd("s", -i, SQL(1,pagelist))
			Newasp.Execute ("UPDATE [NC_SoftList] SET SoftTime='" & SoftTime & "' WHERE SoftID="& SQL(0,pagelist))
			i = i + 5
			page_count = page_count + 1
		Next
		SQL=Null
	End If
	Set Rs = Nothing
	Response.Write "<script>table2.style.width=400;txt2.innerHTML=""完成:100"";</script>"
End Sub

Sub RemoveCache()
	Newasp.DelCahe "RenewStatistics"
	Newasp.DelCahe "TotalStatistics"
End Sub
'================================================
'函数名:ReadSoftsize
'作  用:读取软件的大小
'================================================
Function ReadSoftsize(ByVal para)
	On Error Resume Next
	Dim parasize
	parasize = Clng(para)
	
	If parasize = 0 Then
		ReadSoftsize = "未知"
		Exit Function
	End If
	If parasize > 1024*1024+5200 Then
		ReadSoftsize = FormatRound(Round(parasize / (1024*1024), 2)) & " GB"
		Exit Function
	ElseIf parasize > 1024+5 Then
		ReadSoftsize = FormatRound(Round(parasize / 1024, 2)) & " MB"
		Exit Function
	Else
		ReadSoftsize = FormatRound(parasize) & " KB"
		Exit Function
	End If
	ReadSoftsize = "未知"
End Function
%>