<!--#include file="const.asp"-->
<!--#include file="../../inc/ubbcode.asp"-->
<%
Admin_header
'=====================================================================
' 软件名称：新云网站管理系统
' 当前版本：NewAsp Content Management System Version 4.0
' 文件名称：admin_list.asp
' 更新日期：2008-06-16
' 官方网站：新云网络(www.newasp.net www.newasp.cn) QQ：94022511
'=====================================================================
' Copyright 2003-2008 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
%>
<table class="table1" cellspacing="1" cellpadding="3" align="center" border="0">
	<tr>
		<td class="tableline linetitle" width="80" align="left" noWrap="noWrap"><%=NewAsp.ModuleName%>列表</td>
		<td class="tableline" width="*" align="right"><a href="admin_index.asp?ChannelID=<%=ChannelID%>">管理首页</a>
			 - <a href="admin_post.asp?action=add&ChannelID=<%=ChannelID%>">添加<%=NewAsp.ModuleName%></a>
			 - <a href="../sys/admin_class.asp?ChannelID=<%=ChannelID%>">分类管理</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>&order=0">时间排序</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>"><%=NewAsp.ModuleName%>管理</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>&showmode=1">专题列表</a>
			 - <a href="admin_list.asp?ChannelID=<%=ChannelID%>&isaccept=1">审核列表</a>
			 <%
			 Call selectMenu(ChannelID,NewAsp.ChkNumeric(Request("classid")))
			 %>
		</td>
	</tr>
</table>
<%
Dim maxperpage,totalrec,Pcount,pagelinks,showmode,pagenow,topcount,count
Dim classid,specialid,isaccept,softidlist,softid,CurrentPage,TextContent
Dim m_intOrder,m_strOrder,SQLQuery,SQLField
Dim ChildData,ischild,childstr,classname
Dim Action,Insoftid,MainTopic,TopTopic

Const IsDispToplist = True	'--是否显示置顶列表；True=是；False=否

If Not ChkAdmin("List_"&ChannelID) Then
	Call Transfer_error()
End If

Action=LCase(Request("action"))
softidlist = NewAsp.CheckIDlist(Request("softid"))
Select Case Trim(Action)
	Case "view":Call viewsoft()
	Case Else
		Call showmain()
End Select
If FoundErr=True Then
	ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
NewAsp.PageEnd

Sub showmain()
	Dim i,iCount,lCount,iIndex
	maxperpage=30
	iIndex = 0 : topcount = 0
	pagenow=NewAsp.ChkNumeric(Request("page"))
	If pagenow=0 Then pagenow=1
	showmode=NewAsp.ChkNumeric(Request("showmode"))
	classid=NewAsp.ChkNumeric(Request("classid"))
	specialid=NewAsp.ChkNumeric(Request("specialid"))
	isaccept=NewAsp.ChkNumeric(Request("isaccept"))
	m_intOrder=NewAsp.ChkNumeric(Request("order"))
	count=NewAsp.ChkNumeric(Request("count"))

	If classid>0 Then
		ChildData=NewAsp.GetChildData(ChannelID,classid,0)
		childstr=ChildData(0)
		classname=ChildData(1)
		ischild=CLng(ChildData(2))
	End If
	SQLField = "A.softid,A.ChannelID,A.classid,A.SpecialID,A.SoftName,A.SoftVer,A.ColorMode,A.FontMode,A.username,A.SoftTime,A.AllHits,A.isTop,A.isBest,A.isAccept,A.SoftSize,C.ClassName"
%>
<table id="tablehovered" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th width="5%" noWrap="noWrap">选择</th>
	<th width="57%"><%=NewAsp.ModuleName%>标题</th>
	<th width="9%" noWrap="noWrap">管理操作</th>
	<th width="8%" noWrap="noWrap">文件大小</th>
	<th width="9%" noWrap="noWrap">用户&评论</th>
	<th width="12%" noWrap="noWrap">整理日期</th>
</tr>
<tr>
	<td class="tablerow1" colspan="6"><form name="search_form" id="search_form" method="get" action="admin_search.asp">
		<span style="position:relative">
		<input type="hidden" name="ChannelID" value="<%=ChannelID%>">
		<input type="text" class="alingmid" id="searchwordbox" name="word" size="45" onfocus="if(this.value=='请输入关键字')this.value=''" />
		<select name="searchfield" class="alingmid">
			<option value="0" selected="selected">标题</option>
			<option value="1">录入者</option>
			<option value="2">版本</option>
			<option value="3">主页</option>
			<option value="9">标签</option>
		</select>
		<input type="submit" value="开始搜索" name="search_submit" class="button alingmid" />
		<input type="checkbox" id="searchmode" name="searchmode" value="1" class="alingmid" /><label for="searchmode">分词搜索</label>
		<div style="display:none" id="sugAutoComplete" onselectstart="return false">&nbsp;</div></span>
		</form>
	</td>
</tr>
<form name="selform" id="selform" method="post" action="admin_setting.asp?ChannelID=<%=ChannelID%>">
<input type="hidden" name="action" value="batch">
<%
	Call showToplist()
	iCount=2:lCount=2
	If IsArray(TopTopic) Then
		For i=0 To Ubound(TopTopic,2)
			If Not Response.IsClientConnected Then Response.End
			If (iIndex mod 2) = 0 Then
				iCount=2:lCount=1
			Else
				iCount=1:lCount=2
			End If
%>
<tr align="center">
	<td class="tablerow<%=iCount%> hovered"><input type="checkbox" name="softid" value="<%=TopTopic(0,i)%>"/></td>
	<td class="tablerow<%=iCount%> hovered" align="left">[<a href="?ChannelID=<%=ChannelID%>&classid=<%=TopTopic(2,i)%>"><%=TopTopic(15,i)%></a>]
	<a href="?action=view&ChannelID=<%=ChannelID%>&softid=<%=TopTopic(0,i)%>"><%=NewAsp.ReadFontMode(Trim(TopTopic(4,i)&" "&TopTopic(5,i)),TopTopic(6,i),TopTopic(7,i))%></a>
	<%
	If TopTopic(11,i)>0 Then Response.Write "<font color=""red""><b>顶</b></font>"
	If TopTopic(12,i)>0 Then Response.Write "<font color=""blue""><b>精</b></font>"
	%>
	</td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><a href="admin_post.asp?action=edit&ChannelID=<%=ChannelID%>&softid=<%=TopTopic(0,i)%>">编辑</a> | <a href="admin_setting.asp?action=del&ChannelID=<%=ChannelID%>&softid=<%=TopTopic(0,i)%>" onclick="return confirm('<%=NewAsp.ModuleName%>删除后将不能恢复，您确定要删除吗?')">删除</a></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap" title="人气：<%=TopTopic(10,i)%>"><%=NewAsp.BytesToString(CLng(TopTopic(14,i))*1024)%></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><a href="admin_comment.asp?ChannelID=<%=ChannelID%>&softid=<%=TopTopic(0,i)%>"><%=TopTopic(8,i)%></a></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><%=showDateTime(TopTopic(9,i),"yyyy-MM-dd")%></td>
</tr>
<%
			iIndex=iIndex+1 : topcount = topcount + 1
		Next
%>
<tr>
	<td class="tablerow<%=lCount%>" colspan="6" align="center">&nbsp;<b>全部<%=NewAsp.ModuleName%>列表</b></td>
</tr>
<%
		iIndex=iIndex+1
	End If
	TopTopic=Null
%>

<%
	Call showTopiclist()
	iCount=2:lCount=2
	If IsArray(MainTopic) Then
		For i=0 To Ubound(MainTopic,2)
			If Not Response.IsClientConnected Then Response.End
			If (iIndex mod 2) = 0 Then
				iCount=2:lCount=1
			Else
				iCount=1:lCount=2
			End If
%>
<tr align="center">
	<td class="tablerow<%=iCount%> hovered"><input type="checkbox" name="softid" value="<%=MainTopic(0,i)%>"/></td>
	<td class="tablerow<%=iCount%> hovered" align="left">[<a href="?ChannelID=<%=ChannelID%>&classid=<%=MainTopic(2,i)%>"><%=MainTopic(15,i)%></a>]
	<a href="?action=view&ChannelID=<%=ChannelID%>&softid=<%=MainTopic(0,i)%>"><%=NewAsp.ReadFontMode(Trim(MainTopic(4,i)&" " &MainTopic(5,i)),MainTopic(6,i),MainTopic(7,i))%></a>
	<%
	If MainTopic(11,i)>0 Then Response.Write "<font color=""red""><b>顶</b></font>"
	If MainTopic(12,i)>0 Then Response.Write "<font color=""blue""><b>精</b></font>"
	%>
	</td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><a href="admin_post.asp?action=edit&ChannelID=<%=ChannelID%>&softid=<%=MainTopic(0,i)%>">编辑</a> | <a href="admin_setting.asp?action=del&ChannelID=<%=ChannelID%>&softid=<%=MainTopic(0,i)%>" onclick="return confirm('<%=NewAsp.ModuleName%>删除后将不能恢复，您确定要删除吗?')">删除</a></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap" title="人气：<%=MainTopic(10,i)%>"><%=NewAsp.BytesToString(CLng(MainTopic(14,i))*1024)%></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap" title="点击查看用户评论"><a href="admin_comment.asp?ChannelID=<%=ChannelID%>&softid=<%=MainTopic(0,i)%>"><%=MainTopic(8,i)%></a></td>
	<td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><%=showDateTime(MainTopic(9,i),"yyyy-MM-dd")%></td>
</tr>
<%
			iIndex=iIndex+1
		Next
	End If
	MainTopic=Null
%>
<tr>
	<td class="tablerow<%=lCount%>" colspan="6"><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="submit_button1" value="执行操作" onclick="return confirm('您确定执行该操作吗?');">
		<input class="button" type="submit" name="submit_button2" value="批量设置" onclick="document.selform.action.value='setting';">
		<input class="button" type="submit" name="submit_button3" value="批量移动" onclick="document.selform.action.value='move';">
	</td>
</tr>
</form>
<tr>
	<td class="tablerow<%=iCount%>" align="right" colspan="6" id="NextPageText"><div style="float:left;">
	<select onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&showmode=0&order=0">≡选择排序方式≡</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=<%=showmode%>&order=0"<%If m_intOrder=0 Then Response.Write " selected=""selected"""%>>按时间排列</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=<%=showmode%>&order=1"<%If m_intOrder=1 Then Response.Write " selected=""selected"""%>>按 ID 排列</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=<%=showmode%>&order=2"<%If m_intOrder=2 Then Response.Write " selected=""selected"""%>>按人气排列</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=<%=showmode%>&order=3"<%If m_intOrder=3 Then Response.Write " selected=""selected"""%>>按大小排列</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=2&order=0">所有置顶列表</option>
		<option value="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=classid%>&specialid=<%=specialid%>&isAccept=<%=isAccept%>&showmode=1&order=0">所有专题列表</option>
	</select>
	</div>
	<var class="morePage"><%=showlistpage(pagenow,Pcount,maxperpage,totalrec,pagelinks)%></var></td>
</tr>
</table>
<%
	Call LoadAutoComplete("search_form")
End Sub

Sub showToplist()
	Dim Rs
	SQLQuery=""
	If pagenow=1 And showmode=0 And IsDispToplist Then
		If classid>0 Then
			If ischild>0 Then
				SQLQuery=" And A.isAccept=1 And A.classid in (" & childstr & ") And A.IsTop>0"
			Else
				SQLQuery=" And A.isAccept=1 And A.classid="&classid&" And A.IsTop>0"
			End If
		Else
			SQLQuery=" And A.isAccept=1 And A.IsTop>0"
		End If

		Set Rs=NewAsp.Execute("SELECT TOP 20 "& SQLField &" FROM [NC_SoftList] A INNER JOIN [NC_Classify] C on A.classid=C.classid WHERE A.ChannelID=" &ChannelID& " "&SQLQuery&" ORDER BY A.IsTop DESC,A.SoftTime DESC")
		If Not Rs.EOF Then
			TopTopic=Rs.GetRows(-1)
		Else
			TopTopic=Null
		End If
		Set Rs=Nothing
	End If
End Sub

Sub showTopiclist()
	If Not IsObject(Conn) Then ConnectionDatabase
	Dim Rs,SQL,m_isAccept

	If isaccept=0 Then m_isAccept=1 Else m_isAccept=0
	SQLQuery=""
	If showmode=1 Then
		If specialid=0 Then
			SQLQuery=" And A.isAccept="&m_isAccept&" And A.specialID>0"
		Else
			SQLQuery=" And A.isAccept="&m_isAccept&" And A.specialID="&specialid
		End If
	Else
		If showmode=2 Then SQLQuery = " And A.IsTop>0" Else SQLQuery = " And A.IsTop=0"
		If classid>0 Then
			If ischild>0 Then
				SQLQuery=" And A.isAccept="&m_isAccept & " And A.classid in (" & childstr & ")"&SQLQuery
			Else
				SQLQuery=" And A.isAccept="&m_isAccept&" And A.classid="&classid&SQLQuery
			End If
		Else
			SQLQuery=" And A.isAccept="&m_isAccept&SQLQuery
		End If
	End If

	On Error Resume Next

	Select Case m_intOrder
		Case 1	:	m_strOrder="A.softid"
		Case 2	:	m_strOrder="A.Allhits"
		Case 3	:	m_strOrder="A.SoftSize"
		Case Else
			m_strOrder="A.SoftTime"
	End Select
	If count=0 Then
		totalrec=NewAsp.Execute("SELECT COUNT(softid) FROM NC_SoftList A WHERE A.ChannelID="&ChannelID&" "&SQLQuery&"")(0)
	Else
		totalrec=count
	End If
	Pcount = CLng(totalrec / maxperpage)
	If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
	If pagenow>Pcount Then pagenow=1
	Set Rs=NewAsp.CreateAXObject("ADODB.Recordset")
	SQL="SELECT "& SQLField &" FROM [NC_SoftList] A INNER JOIN [NC_Classify] C on A.classid=C.classid WHERE A.ChannelID=" &ChannelID& " "&SQLQuery&" ORDER BY "&m_strOrder&" DESC"
	Rs.Open SQL,Conn,1,1
	If pagenow >1 Then
		Rs.Move (pagenow-1) * maxperpage
	End If
	If Not (Rs.BOF And Rs.EOF) Then
		MainTopic=Rs.GetRows(maxperpage)
	Else
		MainTopic=Null
	End If
	Rs.close()
	Set Rs=Nothing
	pagelinks="admin_list.asp?channelid="& ChannelID &"&classid="& Request("classid")&"&specialid="&Request("specialid")&"&isAccept="&Request("isAccept")&"&showmode="&Request("showmode")&"&order="&Request("order")&"&count="&totalrec&"&"
End Sub

Sub ErrDescriptione()
	If Err<>0 Then
		Response.Write "<li>错误码："& Err.Number &"</li>"
		Response.Write "<li>"& Err.description &"</li>"
		Response.Write "<li>"& Err.Source &" 错误</li>"
		Err.Clear
	End If
End Sub

Sub viewsoft()
	Dim Rs,SQL,i
	ubb.BasePath = InstallDir_ChannelDir
	ubb.setUbbcode = Join(NewAsp.setUserEditor,"|")
	ubb.Keyword = NewAsp.KeywordList
	ubb.Pagination = False

	softid=NewAsp.ChkNumeric(Request("softid"))
	CurrentPage=NewAsp.ChkNumeric(Request("page"))
	SQL = "SELECT * FROM NC_SoftList WHERE ChannelID="& ChannelID &" And softid="& softid
	Set Rs = NewAsp.Execute(SQL)
	If Rs.BOF And Rs.EOF Then
		FoundErr = True
		ErrMsg = ErrMsg + "<li>Sorry！没有找到相关信息。或者您选择了错误的系统参数！</li>"
		Set Rs = Nothing
		Exit Sub
	End If
	TextContent=Rs("content") & ""
	ubb.CurrentID=Rs("softid")
	TextContent=ubb.UbbCode(TextContent)
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="2">标题：<%=Rs("SoftName")&" " &Rs("SoftVer")%></th>
</tr>
<tr>
	<td class="tablerow1" width="50%"><b>运行环境：</b> <%=Rs("RunSystem")%></td>
	<td class="tablerow1" width="50%"><b>软件类型：</b> <%=Rs("SoftType")%></td>
</tr>
<tr>
	<td class="tablerow2"><b>文件大小：</b> <%=NewAsp.BytesToString(CLng(Rs("SoftSize"))*1024)%></td>
	<td class="tablerow2"><b>推荐星级：</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>软件语言：</b> <%=Rs("Languages")%></td>
	<td class="tablerow1"><b>授权方式：</b> <%=Rs("impower")%></td>
</tr>
<tr>
	<td class="tablerow2"><b>更新时间：</b> <%=showDateTime(Rs("SoftTime"),"yyyy-MM-dd hh:mm:ss")%></td>
	<td class="tablerow2"><b>程序主页：</b> <%=HomepageLinks(Rs("Homepage"))%></td>
</tr>
<tr>
	<td class="tablerow1"><b>下载统计：</b> <%=Rs("AllHits")%></td>
	<td class="tablerow1"><b>联系方式：</b> <%=Rs("Contact")%></td>
</tr>
<tr>
	<td class="tablerow2"><b>发 布 人：</b> <font color="blue"><%=Rs("username")%></font></td>
	<td class="tablerow2"><b>审核状态：</b> <%If Rs("isAccept") > 0 Then%>
	<font color="blue">已审核</font>
	<%Else%>
	<font color="red">未审核</font>
	<%End If%>
	</td>
</tr>
<tr>
	<td class="tablerow1" colspan="2"><b>软件简介</b></td>
</tr>
<tr>
	<td class="tablerow2" colspan="2" style="word-break:normal;word-wrap:normal;">
		<div style="margin:5px;font-size:14px" id="ContentBody" class="ContentBody" style="word-break:normal;word-wrap:normal;"><%=TextContent%></div>
	</td>
</tr>
<tr>
	<td colspan="2" class="tablerow1"><b>下载地址：</b><br>
	<%
		Response.Write SoftDownAddress(Rs("softid"))
	%>
	</td>
</tr>
<tr>
	<td class="tablerow2" colspan="2">
		<li>上一软件：<%=FrontSoft(Rs("softid"))%></li>
		<li>下一软件：<%=NextSoft(Rs("softid"))%></li>
	</td>
</tr>
<tr>
	<td class="tablerow1" colspan="2" align="center">
		<input type="button" onclick="{if(confirm('您确定要删除吗?')){location.href='admin_setting.asp?action=del&ChannelID=<%=ChannelID%>&softid=<%=softid%>';return true;}return false;}" value=" 删 除 " name="B1" class="button">&nbsp;&nbsp;
		<input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B2" class="button">&nbsp;&nbsp;
		<input type="button" name="B3" onclick="javascript:location.href='#'" value="返回顶部" class="button">&nbsp;&nbsp;
		<input type="button" name="B4" onclick="javascript:location.href='admin_post.asp?action=edit&ChannelID=<%=ChannelID%>&softid=<%=softid%>'" value=" 编 辑 " class="button">&nbsp;&nbsp;
		<input type="button" onclick="{if(confirm('您确定要审核吗?')){location.href='admin_setting.asp?action=audit&ChannelID=<%=ChannelID%>&softid=<%=softid%>';return true;}return false;}" value="直接审核" name="B6" class="button">&nbsp;&nbsp;
	</td>
</tr>
</table>
<%
	Rs.Close()
	Set Rs = Nothing
End Sub

Function FrontSoft(softid)
	Dim Rss, SQL
	SQL = "SELECT TOP 1 softid,classid,SoftName,SoftVer 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=""?action=view&ChannelID=" & ChannelID & "&softid=" & Rss("softid") & """>" & Rss("SoftName") & " " & Rss("SoftVer") & "</a>"
	End If
	Rss.Close
	Set Rss = Nothing
End Function
Function NextSoft(softid)
	Dim Rss, SQL
	SQL = "SELECT TOP 1 softid,classid,SoftName,SoftVer 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=""?action=view&ChannelID=" & ChannelID & "&softid=" & Rss("softid") & """>" & Rss("SoftName") & " " & Rss("SoftVer") & "</a>"
	End If
	Rss.Close
	Set Rss = Nothing
End Function

Function SoftDownAddress(softid)
	Dim rsAddress, sqlAddress, rsDown,i
	Dim strDownAddress,sDownAddress,sDownFileName,strDownFileName
	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
				sDownFileName = rsDown("DownFileName") & ""
				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
					i = 0
					Do While Not rsAddress.EOF
						i = i + 1
						If InStr(sDownFileName, "*") > 0 Then
							strDownFileName=Replace(sDownFileName, "*", i)
						End If
						strDownAddress = rsAddress("DownloadPath") & Server.HTMLEncode(sDownFileName)
						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

Function HomepageLinks(str)
	HomepageLinks=""
	If Not IsNull(str) And str<>"" Then
		If LCase(str)<>"http://" Then
			If InStr(str,"://")=0 Then
				HomepageLinks="<a href=""http://"&str&""" target=""_blank"">"&str&"</a>"
			Else
				HomepageLinks="<a href="""&str&""" target=""_blank"">"&str&"</a>"
			End If
		End If
	End If
End Function

%>