<!--#include file="Admin_Const.asp"-->
<%
if ChannelID=0 then Admin_ShowErr("参数错误！")
if Not Cl.TrueChannelPurview(3,ChannelID) then Admin_ShowErr("<li>您无此操作权限！</li>")
const MaxPerPage=20
dim ManageType,Action
dim keyword,strField
dim rsList,sPath
dim ClassID,Passed,SpecialID,SpecialName
dim tClass,ClassName,RootID,ParentID,Depth,ParentPath,Child,arrChildID
'=========================================
dim PhotoID,PhotoName,Author,AuthorEmail,AuthorHomepage
dim PhotoPicUrl,PhotoUrl,PhotoSize,IsDownLoad
dim PhotoIntro,OnTop,Hot,Elite,Stars,Hits,DayHits,WeekHits,MonthHits
dim PhotoLevel,PhotoPoint,PhotoMoney,UpdateTime
dim sMaxLimit,sAddPoint,sAddIsChk,NowCreate,UploadFiles,Editor
dim TmpPicUrl,TmpUrl,BeginID,EndID,batchi,NumLen
dim BackPoint,BackPointRate,BackMoney,BackMoneyRate
'============================================
Cl.GetChannelSetting(ChannelID)
Action		= Trim(request("Action"))
Header
Select Case Action
Case "Add"
	AddMain
Case "Modify"
	ModifyMain
Case "SaveAdd", "SaveModify"
	DoSaveRecord
Case "AddMore"
	AddMoreMain
Case "SaveAddMore"
	SaveAddMore
Case "Show"
	ShowInfoMain
Case Else
	ManageMain
End Select

Footer

Sub ManageMain()
	ManageType	= Trim(request("ManageType"))
	ClassID		= Cl.ChkClng(request("ClassID"))
	SpecialID	= Cl.ChkClng(request("SpecialID"))
	'=============
	OnTop		= Cl.ChkCBool(request("OnTop"))
	Hot			= Cl.ChkCBool(request("Hot"))
	Elite		= Cl.ChkCBool(request("Elite"))
	'=============
	keyword		= Trim(request("keyword"))
	'Property	= Trim(request("Property"))
	strField	= Trim(request("Field"))
	Passed		= Trim(request("Passed"))
	CurrentPage	= Cl.ChkClng(request("page"))
	if keyword="" then keyword="关键字"
	FileName	= "Admin_Photo.Asp?ChannelID="&ChannelID&"&Action="&Action&""
	if ManageType="MyInfo" then
		FileName=FileName & "&ManageType=" & ManageType
	end if
	'======================1
	strFileName	= FileName & "&ClassID=" & ClassID & "&SpecialID=" & SpecialID & "&Field=" & strField & "&keyword=" & keyword
	'======================1
	if Passed="" then
		Passed="All"
		Select Case Action
		Case "Check"
			Passed=FalseType
		Case "Make"
			Passed=TrueType
		Case ""
			if ManageType<>"MyInfo" then Passed=TrueType
		End Select
	end if
	if ClassID>0 then
		set tClass=Cl.Execute("select ClassName,RootID,ParentID,Depth,ParentPath,Child,arrChildID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & ClassID)
		if tClass.bof and tClass.eof then
			tClass.Close :Set tClass=Nothing
			Admin_ShowErr("<br /><li>找不到指定的栏目</li>")
		else
			ClassName=tClass(0):RootID=tClass(1):ParentID=tClass(2)
			Depth=tClass(3):ParentPath=tClass(4):Child=tClass(5):arrChildID=tClass(6)
			tClass.Close :Set tClass=Nothing
			if Not Cl.TrueChannelPurview(2,ChannelID) and ManageType<>"MyInfo" then
				Dim sTr,sTPurview
				sTPurview=False
				sTr=Split(ParentPath & "," & ClassID,",")
				if Action="Check" then
					for i=1 to Ubound(sTr)
						sTPurview=Cl.TrueClassPurview(2,ChannelID,sTr(i))
						if sTPurview=True then Exit For
					Next
				Else
					for i=1 to Ubound(sTr)
						sTPurview=Cl.TrueClassPurview(1,ChannelID,sTr(i))
						if sTPurview=True then Exit For
					Next
				End if
				If sTPurview=False then Admin_ShowErr("<br /><li>找不到指定的栏目或您无此操作权限</li>")
			End if
			if ParentID>0 then
				dim sqlPath,rsPath
				sqlPath="select ClassID,ClassName From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth"
				set rsPath=Cl.Execute(sqlPath)
				if Not rsPath.eof then
					sqlPath=rsPath.GetRows(-1)
					for i=0 to Ubound(sqlPath,2)
						sPath = sPath & "<a href=""" & FileName & "&ClassID=" & sqlPath(0,i) & """><font color=#0000ff>" & sqlPath(1,i) & "</font></a>&nbsp;&gt;&gt;&nbsp;"
					Next
					sqlPath=Empty
				End if
				rsPath.Close:Set rsPath=Nothing
			end if
			sPath = sPath & "<a href=""" & FileName & "&ClassID=" & ClassID & """><font color=#0000ff>" & ClassName & "</font></a>"
		end if
	end if
%>
<script language="JavaScript" type="text/javascript">
function unselectall()
{
    if(document.myform.chkAll.checked){
	document.myform.chkAll.checked = document.myform.chkAll.checked&0;
    } 	
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.Name != "chkAll"&&e.disabled==false)
       e.checked = form.chkAll.checked;
    }
  }
function ConfirmDel()
{
	switch(document.myform.Action.value){
	case "Del":
		if(confirm("确定要删除选中的<%=Cl.Channel_Setting(2)%>吗？本操作将把选中的<%=Cl.Channel_Setting(2)%>移到回收站中。必要时您可从回收站中恢复！"))
		    return true;
		else
			return false;
	case "MoveMore":
		document.myform.action="Admin_InfoMove.asp";
		return true;
	case "MoveToSpecial":
		document.myform.action="Admin_InfoMove.asp";
		if(confirm("确定要将选中的<%=Cl.Channel_Setting(2)%>移动到指定的专题吗？"))
		    return true;
		else
			return false;
	case "SetPassed":
		document.myform.action="Admin_Property.asp";
		return true;
	case "CancelPassed":
		document.myform.action="Admin_Property.asp";
		return true;
	case "DelFromSpecial":
		document.myform.action="Admin_InfoDel.asp";
		if(confirm("确定要选中的<%=Cl.Channel_Setting(2)%>的专题吗？"))
		    return true;
		else
			return false;
	case "ConfirmDel":
		document.myform.action="Admin_InfoDel.asp";
		if(confirm("确定要将选中的<%=Cl.Channel_Setting(2)%>彻底删除吗？本操作将不可恢复！"))
		    return true;
		else
			return false;
	case "ClearRecyclebin":
		document.myform.action="Admin_InfoDel.asp";
		if(confirm("确定要清空回收站吗？本操作将不可恢复！"))
		    return true;
		else
			return false;
	case "Restore":
		document.myform.action="Admin_InfoDel.asp";
		if(confirm("确定要还原选中的<%=Cl.Channel_Setting(2)%>吗？"))
		    return true;
		else
			return false;
	case "RestoreAll":
		document.myform.action="Admin_InfoDel.asp";
		if(confirm("确定要还原所有<%=Cl.Channel_Setting(2)%>吗？"))
		    return true;
		else
			return false;
	case "CreatePhoto":
		document.myform.action="Admin_Create_Photo.asp";
		if(confirm("确定要生成选中<%=Cl.Channel_Setting(2)%>吗？"))
		    return true;
		else
			return false;
	case "CreatePhotoAll":
		document.myform.action="Admin_Create_Photo.asp";
		if(confirm("确定要生成所有<%=Cl.Channel_Setting(2)%>吗？此操作可能将消耗服务器资源很大！"))
		    return true;
		else
			return false;
	case "DelPhotoHTML":
		document.myform.action="Admin_Create_Photo.asp";
		if(confirm("确定要生成选中<%=Cl.Channel_Setting(2)%>的HTML文件吗？"))
		    return true;
		else
			return false;
	case "DelPhotoHTMLAll":
		document.myform.action="Admin_Create_Photo.asp";
		if(confirm("确定要删除所有<%=Cl.Channel_Setting(2)%>的HTML文件吗？"))
		    return true;
		else
			return false;
	default:
		return false;
	}
	return true;
}
</script>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
  <tr class="title"> 
    <td height="22" colspan="2"  align="center"><strong><%=Cl.Channel_Setting(2)%>管理</strong></td>
  </tr>
  <tr class="tdbg"> 
    <td width="70" height="30" ><strong>管理导航：</strong></td>
    <td><a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>"><%=Cl.Channel_Setting(2)%>管理首页</a>&nbsp;|&nbsp;<a href="Admin_Photo.Asp?Action=Add&ChannelID=<%=ChannelID%>">添加<%=Cl.Channel_Setting(2)%></a>&nbsp;|&nbsp;<a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>&Action=Check">审核<%=Cl.Channel_Setting(2)%></a>&nbsp;|&nbsp;<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>" target=main><%=Cl.Channel_Setting(2)%>评论管理</a>&nbsp;|&nbsp;<a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>&Action=Special" target=main>专题管理</a>&nbsp;|&nbsp;<a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>&Action=RecycleBin" target=main>回收站管理</a>
	</td>
  </tr>
<form name="FormProperty" method="Post" action="<%=strFileName%>">
  <tr class="tdbg"> 
    <td width="70" height="30"><strong><%=Cl.Channel_Setting(2)%>选项：</strong></td>
    <td>
	<a href="<%=strFileName%>&Passed=All"><%
	if Passed<>FalseType and Passed<>TrueType then
	%><font color=red><b>所有<%=Cl.Channel_Setting(2)%></b></font><%
	else
	%>所有<%=Cl.Channel_Setting(2)%><%
	end if%></a>&nbsp;|&nbsp;<a href="<%=strFileName%>&Passed=<%=FalseType%>"><%
	if Passed=FalseType then
	%><font color=red><b>未审核<%=Cl.Channel_Setting(2)%></b></font><%
	else
	%>未审核<%=Cl.Channel_Setting(2)%><%
	end if
	%></a>&nbsp;|&nbsp;<a href="<%=strFileName%>&Passed=<%=TrueType%>"><%
	if Passed=TrueType then
	%><font color=red><b>已审核<%=Cl.Channel_Setting(2)%></b></font><%
	else
	%>已审核<%=Cl.Channel_Setting(2)%><%
	end if%></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="OnTop" type="checkbox" onclick="submit()" value="True" <%if OnTop then%>checked<%end if%>>
	固顶<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="Elite" type="checkbox" onclick="submit()" value="True" <%if Elite then%>checked<%end if%>>
	推荐<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="Hot" type="checkbox" onclick="submit()" value="True" <%if Hot then%>checked<%end if%>>
	热门<%=Cl.Channel_Setting(2)%>
	</td>
  </tr>
  </form>
  <tr class="tdbg">
    <td width="70"><strong>高级搜索：</strong></td>
    <td>
	<table border=0 cellpadding=0 cellspacing=0>
	<form method="Post" name="SearchForm" action="<%=FileName%>">
	<tr><td height=28 align="center">
		<select name="Field" size="1" ID="Field">
		<option value="ID"><%=Cl.Channel_Setting(2)%>ID</option>
		<option value="Title" selected><%=Cl.Channel_Setting(2)%>名称</option>
		<option value="Keyword">关 键 字</option>
		<option value="Intro"><%=Cl.Channel_Setting(2)%>简介</option>
		<option value="Author"><%=Cl.Channel_Setting(2)%>作者</option>
		<option value="Editor">添加用户</option>
		<option value="Censor">审核用户</option>
		<option value="Point"><%=Cl.Channel_Setting(2)%><%=Cl.Web_Setting(28)%></option>
		</select>&nbsp;
		<select name="ClassID" ID="ClassID">
		<option value="">所有栏目</option>
		<%=ShowClass_Option(ChannelID,0,2,3)%>
		</select>&nbsp;
		<select name="SpecialID" ID="SpecialID">
		<%=ShowSpecial_Option(ChannelID,0,1)%>
		</select>&nbsp;
		<select name="Passed" ID="Passed">
		<option value="All">资料选项</option>
		<option value="<%=FalseType%>">未审<%=Cl.Channel_Setting(2)%></option>
		<option value="<%=TrueType%>">已审<%=Cl.Channel_Setting(2)%></option>
		</select>&nbsp;
		<input name="OnTop" type="checkbox" value="True" <%if OnTop then%>checked<%end if%>>顶&nbsp;<input name="Elite" type="checkbox" value="True" <%if Elite then%>checked<%end if%>>荐&nbsp;<input name="Hot" type="checkbox" value="True" <%if Hot then%>checked<%end if%>>热&nbsp;
		<input type="text" name="keyword"  size="20" value="<%=keyword%>" maxlength="50" onFocus="this.select();">&nbsp;
		<input type="submit" name="Submit"  value=" 搜索 "></td>
	</tr>
	</form></table>
    </td>
  </tr>
<%if Action="Special" then%>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>专题选项：</strong></td>
    <td>
	<%if SpecialID=0 then
	%>
	<a href="<%=FileName%>&SpecialID=0&Passed=<%=Passed%>"><font color=red><b>所有专题</b></font></a><%
	else
	%>
	<a href="<%=FileName%>&SpecialID=0&Passed=<%=Passed%>">所有专题</a><%
	end if
	%>&nbsp;|&nbsp;<%=ShowRootSpecial(ChannelID,SpecialID)%>
	</td>
  </tr>
<%else%>
  <tr class="tdbg"> 
    <td width="70" height="30"><strong>栏目选项：</strong></td>
    <td>
	<%if ClassID=0 then%>
	<a href="<%=FileName%>&ClassID=0&Passed=<%=Passed%>"><font color=red><b>所有栏目</b></font></a><%
	else
	%>
	<a href="<%=FileName%>&ClassID=0&Passed=<%=Passed%>">所有栏目</a><%
	end if
	%>&nbsp;|&nbsp;<%=ShowRootClass(ChannelID,RootID)%>
	</td>
  </tr>
<%
end if
if ParentID>0 or Child>0 then
%>
  <tr class="tdbg">
    <td width="70" height="30"><strong>子 栏 目：</strong></td>
    <td><%=sPath%><%=ShowManageChild(ChannelID,ClassID)%></td>
  </tr>
<%
end if
%>
</table>
<script language="JavaScript" type="text/javascript">
CheckSel('Field','<%=strField%>');
CheckSel('ClassID','<%=ClassID%>');
CheckSel('SpecialID','<%=SpecialID%>');
CheckSel('Passed','<%=Passed%>');
</script>
<%
	sql="select P.PhotoID,P.ClassID,C.ClassName,P.PhotoName,P.Keyword,P.Author,P.UpdateTime,P.Editor,P.Hits,P.PhotoPicUrl,P.PhotoSize,P.OnTop,P.Hot,P.Elite,P.Passed,P.Stars,P.PhotoLevel,P.PhotoPoint,P.IsHTML,P.HtmlFileUrl,P.NoPass,P.Censor,P.CensorTime from Cl_Photo P Inner Join Cl_Class C On P.ClassID=C.ClassID where  P.ChannelID="&ChannelID&" "
	Select Case Action
	Case "RecycleBin"
		sql=sql & " and (P.NoPass=True or P.Deleted=True)"
	Case "NoPass"
		sql=sql & " and P.NoPass=True and P.Deleted=False"
	Case else
		sql=sql & " and P.NoPass=False and P.Deleted=False"
	end Select
	if Passed<>"All" then sql=sql & " and P.Passed=" & Passed
	if ClassID>0 then
		if Child>0 then
			sql=sql & " and P.ClassID in (" & arrChildID & ")"
		else
			sql=sql & " and P.ClassID=" & ClassID
		end if
	elseif Not Cl.TrueChannelPurview(2,ChannelID) and ManageType<>"MyInfo" then
		dim arrIDStr,TempID
		arrIDStr=","
		if Action="Check" then
			if Cl.Admin_Info(5)<>"" then
				TempID = Split(Cl.Admin_Info(5),",")
				for i=0 to ubound(TempID)
					set tClass=Cl.Execute("select arrChildID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & Cl.ChkClng(TempID(i)))
					if Not (tClass.bof and tClass.eof) then
						arrIDStr=arrIDStr & "," & tClass(0)
					End if
					tClass.Close : Set tClass=Nothing
				Next
			end if
			if Cl.Admin_Info(6)<>"" then
				TempID = Split(Cl.Admin_Info(6),",")
				for i=0 to ubound(TempID)
					set tClass=Cl.Execute("select arrChildID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & Cl.ChkClng(TempID(i)))
					if Not (tClass.bof and tClass.eof) then
						arrIDStr=arrIDStr & "," & tClass(0)
					End if
					tClass.Close : Set tClass=Nothing
				Next
			End if
		else
			if Cl.Admin_Info(5)<>"" then
				TempID = Split(Cl.Admin_Info(5),",")
				for i=0 to ubound(TempID)
					set tClass=Cl.Execute("select arrChildID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & Cl.ChkClng(TempID(i)))
					if Not (tClass.bof and tClass.eof) then
						arrIDStr=arrIDStr & "," & tClass(0)
					End if
					tClass.Close : Set tClass=Nothing
				Next
			end if
		end if
		TempID=Empty
		if arrIDStr="," then
			sql=sql & " and P.ClassID=0"
		else
			sql=sql & " and P.ClassID in (" & Replace(arrIDStr,",,","") & ")"
		end if
	end if
	if Action="Special" then
		if SpecialID>0 then
			sql=sql & " and P.SpecialID Like '%," & SpecialID & ",%'"
		else
			sql=sql & " and P.SpecialID<>'0'"
		end if
	end if
	if ManageType="MyInfo" then
		sql=sql & " and P.Editor='" & Cl.User_Info(5) & "' "
	else
		if keyword<>"" and keyword<>"关键字" then
			keyword = Cl.ReplaceBadChar(keyword&"")
			select case strField
			case "ID"
				sql=sql & " and P.PhotoID = "&Cl.ChkClng(keyword)&" "
			case "Title"
				sql=sql & " and P.PhotoName like '%" & keyword & "%' "
			case "Keyword"
				sql=sql & " and P.Keyword like '%" & keyword & "%' "
			case "Intro"
				sql=sql & " and P.PhotoIntro like '%" & keyword & "%' "
			case "Author"
				sql=sql & " and P.Author like '%" & keyword & "%' "
			case "Editor"
				sql=sql & " and P.Editor='" & keyword & "' "
			case "Censor"
				sql=sql & " and P.Censor='" & keyword & "' "
			case "Point"
				sql=sql & " and P.PhotoPoint <= "&Cl.ChkClng(keyword)&" "
			case else
				sql=sql & " and P.PhotoName like '%" & keyword & "%' "
			end select
		end if
	end if
	'==================
	If OnTop then sql=sql & " and P.ontop=True "
	If Elite then sql=sql & " and P.elite=True "
	If Hot then sql=sql & " and P.hot=True "
	'===================
	sql=sql & " order by P.UpdateTime Desc,P.PhotoID desc"
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="22" align="right">
	<select name='JumpClass' id="JumpClass" onchange="if(this.options[this.selectedIndex].value!=''){location='<%=FileName & "&ClassID="%>'+this.options[this.selectedIndex].value;}">
      <option value='' selected>跳转栏目至…</option>
	  <%=ShowClass_Option(ChannelID,0,2,1)%>
	</select>
    &nbsp;</td>
  </tr>
</table>
<%
	Set rsList= Server.CreateObject("ADODB.Recordset")
	OpenConn : rsList.open sql,Conn,1,1
	if rsList.eof and rsList.bof then
		TotalPut=0
		if Child=0 then
			response.write "<p align='center'><br />没有任何"&Cl.Channel_Setting(2)&"！</p>"
		else
			response.write "<p align='center'><br />此栏目下没有任何"&Cl.Channel_Setting(2)&"！</p>"
		end if
		rsList.close:set rsList=Nothing  
	else
		TotalPut=rsList.recordcount
		if (TotalPut mod MaxPerPage)=0 then
			TotalPages = TotalPut \ MaxPerPage
		else
			TotalPages = TotalPut \ MaxPerPage + 1
		end if
		if CurrentPage > TotalPages then CurrentPage=TotalPages
		if CurrentPage < 1 then
			CurrentPage=1
		else
			rsList.move (CurrentPage-1)*MaxPerPage
		end if
		SQL=rsList.GetRows(MaxPerPage)
		rsList.close:set rsList=Nothing  
		ShowContent
		'==================
		Response.write Cl.ShowPage(strFileName & "&OnTop="&OnTop&"&Hot="&Hot&"&Elite="&Elite&"&Passed="&Passed,TotalPut,MaxPerPage,Cl.Channel_Setting(3),Cl.Channel_Setting(2))
		'==================
	end if
%>
<br />
<br /><b>说明：</b><br />&nbsp;&nbsp;&nbsp;&nbsp;
属性中的各项含义：<font color=blue>顶</font>---固顶，<font color=red>热</font>---热门，<font color=green>荐</font>---推荐，<font color=blue>图</font>---图片，<font color=blue>H</font>---已生成HTML文件
<br /><br />
<%
SQL=Empty
End Sub

Sub ShowContent()
%>
	 <table class="border" border="0" cellspacing="1" cellpadding="0" align="center">
	  <form name="myform" method="Get" action="Admin_InfoDel.asp" onsubmit="return ConfirmDel();">
          <tr class="title" height="22"> 
            <td height="22" width="30" align="center"><strong>选中</strong></td>
            <td width="60" align="center" height="22"><strong>ID</strong></td>
            <td width="100" align="center"><strong>缩略图</strong></td>
            <td align="center"><strong><%=Cl.Channel_Setting(2)%>名称</strong></td>
            <td width="80" align="center"><strong>添加人</strong></td>
            <td width="80" align="center"><strong>审核人</strong></td>
            <td width="60" align="center"><strong>查看次数</strong></td>
            <td width="60" align="center"><strong><%=Cl.Channel_Setting(2)%>属性</strong></td>
            <td width="150" align="center"><strong>操作</strong></td>
          </tr>
          <%for i=0 to Ubound(SQL,2)%>
          <tr class="tdbg" onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbg2'"> 
            <td width="30" align="center"><input name="InfoID" type="checkbox" onclick="unselectall()" id="InfoID" value="<%=SQL(0,i)%>"></td>
            <td width="60" align="center"><%=SQL(0,i)%></td>
            <td width="100" align="center"><%
			response.write "<a href='Admin_Photo.Asp?Action=Modify&ChannelID="&ChannelID&"&PhotoID=" & SQL(0,i) & "'><img src='" & Cl.ReplaceDir(SQL(9,i)) & "' width='98' height='80' border='0'></a>"
			%></td>
            <td><%
			if SQL(1,i)<>ClassID then
				response.write "<a href='"&FileName&"?ClassID=" & SQL(1,i) & "'><font color='#0000FF'>[" & SQL(2,i) & "]</font></a>&nbsp;"
			end if
			response.write "<a href='Admin_Photo.Asp?Action=Modify&PhotoID=" & SQL(0,i) & "'"
			response.write " title='名称：" & SQL(3,i) & vbcrlf & "作者：" & SQL(5,i) & vbcrlf & "更新：" & SQL(6,i) & vbcrlf
			response.write "查看：" & SQL(8,i) & vbcrlf & "等级：" & String(SQL(15,i),"★") & "'>" & SQL(3,i) & "</a>"
			%></td>
			<!------------------------>
            <td width="80" align="center"><a href="<%=FileName%>&Passed=All&Field=Editor&Keyword=<%=SQL(7,i)%>" title="点击将查看此用户添加的所有<%=Cl.Channel_Setting(2)%>"><%=SQL(7,i)%></a><br />(<font color=#0000ff><%=formatdatetime(SQL(6,i),2)%></font>)</td>
            <td width="80" align="center"><%
			if SQL(14,i)=True then
				response.write "<a href='"&FileName&"&Passed=All&Field=Censor&Keyword="&SQL(21,i)&"' title='点击将查看此用户审核的所有"&Cl.Channel_Setting(2)&"'>" & SQL(21,i) & "</a><br />(<font color=#0000ff>" & SQL(22,i) & "</font>)"
			else
				if SQL(20,i)=False then
				response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetPassed&InfoID=" & SQL(0,i) & "' title='点击审核通过'><font color=""#ff0033"">审核通过</font></a>&nbsp;<a href='Admin_NoPass.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "'>退回</a>"
				else
				response.write "<font color=""#ff0033"">已退回</font>("&SQL(21,i)&")"
				end if
			end if%></td>
			<!------------------------>
            <td width="60" align="center"><%=SQL(8,i)%></td>
            <td width="60" align="center"><%
			if SQL(11,i)=True then
				response.Write "<font color=blue>顶</font> "
			else
				response.write "&nbsp;&nbsp; "
			end if
			if SQL(12,i)=True then
				response.write "<font color=red>热</font> "
			else
				response.write "&nbsp;&nbsp; "
			end if
			if SQL(13,i)=True then
				response.write "<font color=green>荐</font> "
			else
				response.write "&nbsp;&nbsp; "
			end if
			if SQL(18,i)=True then
				response.write "<font color=blue>H</font>"
			else
				response.write "&nbsp;&nbsp;"
			end if
			%></td>
            <td width="150" align="lift"> &nbsp;<% Call ManegeOption() %></td>
          </tr>
          <%
	Next
%>
  <tr class="tdbg">
    <td colspan=2 height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">选中本页所有</td>
    <td colspan=7><% Call ManegeOptionBottom() %></td>
  </tr>
</form>
</table>
<%
end sub

Sub ManegeOption()
	Select Case Action
	Case "Check"
	  	If SQL(14,i)=False Then
        	response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetPassed&InfoID=" & SQL(0,i) & "'>通过审核</a>"
			response.write "&nbsp;<a href='Admin_NoPass.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "'>退回</a>"
		Else
	        response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=CancelPassed&InfoID=" & SQL(0,i) & "'>取消通过</a>"
      	End If
		response.write "&nbsp;&nbsp;<a href='Admin_Photo.Asp?Action=Modify&ChannelID="&ChannelID&"&PhotoID=" & SQL(0,i) &"'>修改</a>"
		response.write "&nbsp;<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=deleted&PhotoID=" & SQL(0,i) & "'>删除</a>"
	Case "RecycleBin"
		response.write "<a href=""Admin_InfoDel.asp?ChannelID="&ChannelID&"&Action=ConfirmDel&InfoID="&SQL(0,i)&""" onclick=""return confirm('确定要彻底删除此"&Cl.Channel_Setting(2)&"吗？本操作将不可恢复！');"">彻底删除</a> &nbsp;&nbsp; <a href=""Admin_InfoDel.asp?ChannelID="&ChannelID&"&Action=Restore&InfoID="&SQL(0,i)&""">还原</a>"
	'Case "Special"

	Case "Make"
		if SQL(14,i)=True then
			response.write "<a href='Admin_Create_Photo.asp?ChannelID="&ChannelID&"&Action=CreatePhoto&InfoID=" & SQL(0,i) & "'>生成</a>&nbsp;"
		else
			response.write "生成&nbsp; "
		end if
		if SQL(18,i)=True then	
			response.write "<a href='Admin_Create_Photo.asp?ChannelID="&ChannelID&"&Action=DelPhotoHTML&InfoID=" & SQL(0,i) & "'>删除HTML</a>&nbsp;"
			response.write "<a href='" & Cl.WebDir & SQL(19,i) & "' target='_blank'>浏览HTML</a>&nbsp;"
		end if
	Case Else
		response.write "<a href='Admin_Photo.Asp?Action=Modify&ChannelID="&ChannelID&"&PhotoID=" & SQL(0,i) &"'>改</a>&nbsp;"
		response.write "<a href='Admin_InfoDel.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "&Action=Del' onclick='return ConfirmDel();'>删</a>&nbsp;"
		'if Clng(Cl.Admin_Purview(0))=1 or Clng(Cl.Admin_Purview(1))<=1 then
			response.write "<a href='Admin_InfoMove.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "'>移</a>&nbsp;"
		'end if
		if SQL(11,i)=False then	
			response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "&Action=SetOnTop'>固顶</a>&nbsp;"
		else
			response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "&Action=CancelOnTop'>解固</a>&nbsp;"
		end if
		if SQL(13,i)=False then	
			response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "&Action=SetElite'>设为推荐</a>"
		else
			response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&InfoID=" & SQL(0,i) & "&Action=CancelElite'>取消推荐</a>"
		end if
	End Select
End Sub

Sub ManegeOptionBottom()
	Response.write "<input name=""ChannelID"" type=""hidden"" id=""ChannelID"" value="""&ChannelID&""">"
	Response.write "<input name=""Action"" type=""hidden"" id=""Action"" value=""Del"">"
	Select Case Action
	Case "Check"
		if Passed=FalseType then
			Response.write "<input name=""submit"" type=""submit"" value=""审核选定的"&Cl.Channel_Setting(2)&""" onClick=""document.myform.Action.value='SetPassed'"">"
			Response.write "&nbsp;&nbsp;<input name=""submit"" type=""submit"" value=""删除选定的"&Cl.Channel_Setting(2)&""" onClick=""document.myform.Action.value='Del'"">"
		else
			Response.write "<input name=""submit"" type=""submit"" value=""取消审核选定的"&Cl.Channel_Setting(2)&""" onClick=""document.myform.Action.value='CancelPassed'"">"
			Response.write "&nbsp;&nbsp;<input name=""submit"" type=""submit"" value=""删除选定的"&Cl.Channel_Setting(2)&""" onClick=""document.myform.Action.value='Del'"">"
		end if
	Case "RecycleBin"
		Response.write "<input name=""submit1"" type=""submit"" id=""submit1"" onClick=""document.myform.Action.value='ConfirmDel'"" value=""彻底删除选定的"&Cl.Channel_Setting(2)&""">"
		Response.write "<input type=""submit"" name=""Submit2"" value=""清空回收站""  onClick=""document.myform.Action.value='ClearRecyclebin'"">"
		Response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input name=""Submit3"" type=""submit"" id=""Submit3""  onClick=""document.myform.Action.value='Restore'"" value=""还原选定的"&Cl.Channel_Setting(2)&""">"
		Response.write "<input name=""Submit4"" type=""submit"" id=""Submit4"" onClick=""document.myform.Action.value='RestoreAll'"" value=""还原所有"&Cl.Channel_Setting(2)&""">"
	Case "Special"
		Response.write "<input name=""submit"" type=""submit"" value=""将选定的"&Cl.Channel_Setting(2)&"从所属专题中删除"" onClick=""document.myform.Action.value='DelFromSpecial'"">"
		Response.write "&nbsp;&nbsp;&nbsp;&nbsp; <input type=""submit"" name=""Submit"" value=""将选定的"&Cl.Channel_Setting(2)&"移动到"" onClick=""document.myform.Action.value='MoveToSpecial'"">"
		Response.write "<select name=""SpecialID"">"&ShowSpecial_Option(ChannelID,SpecialID,1)&"</select>"
	Case "Make"
		'Response.write "<br />"
		Response.write "<input name=""submit1"" type=""submit"" id=""submit1"" onClick=""document.myform.Action.value='CreatePhoto'"" value=""生成选定"&Cl.Channel_Setting(2)&""">"
		Response.write "<input name=""Submit4"" type=""submit"" id=""Submit4"" onClick=""document.myform.Action.value='DelPhotoHTML'"" value=""删除选定"&Cl.Channel_Setting(2)&"HTML"">"
		Response.write "&nbsp;&nbsp;&nbsp;&nbsp;<input name=""Submit3"" type=""submit"" id=""Submit3""  onClick=""document.myform.Action.value='CreatePhotoAll'"" value=""生成所有"&Cl.Channel_Setting(2)&""">"
		Response.write "<input name=""Submit4"" type=""submit"" id=""Submit4"" onClick=""document.myform.Action.value='DelPhotoHTMLAll'"" value=""删除所有"&Cl.Channel_Setting(2)&"HTML"">"
	Case Else
		Response.write "<input name=""submit"" type=""submit"" value=""删除选定"&Cl.Channel_Setting(2)&""" onClick=""document.myform.Action.Value='Del'"">"
		'if Clng(Cl.Admin_Purview(0))=1 or Clng(Cl.Admin_Purview(3))=1 then
			Response.write "&nbsp;&nbsp; <input type=""submit"" name=""Submit"" value=""批量移动到栏目..."" onClick=""document.myform.Action.value='MoveMore'"">"
			Response.write "&nbsp;&nbsp; <input type=""submit"" name=""Submit"" value=""移动到专题："" onClick=""document.myform.Action.value='MoveToSpecial'"">"
			Response.write "<select name=""SpecialID"">"&ShowSpecial_Option(ChannelID,SpecialID,1)&"</select>"
		'end if
	End Select
End Sub

Sub AddMain()
	Dim strCusTom
	Dim sKeyword,sAuthor,sKeywordV,sAuthorV
	strCusTom	= Split(Cl.Channel_Setting(21),"@@@")
	sKeyword	= Split(strCusTom(0),"$")
	sAuthor		= Split(strCusTom(1),"$")
	sKeywordV	= Split(Cl.GotTopic(strCusTom(0),60),"$")
	sAuthorV	= Split(Cl.GotTopic(strCusTom(1),60),"$")
%>
<script language="JavaScript" type="text/javascript">
function CheckForm()
{
  if (document.myform.ClassID.value=="0")
  {
    alert("<%=Cl.Channel_Setting(2)%>所属栏目为外部栏目或您无此栏目添加权限！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.PhotoName.value=="")
  {
    alert("<%=Cl.Channel_Setting(2)%>名称不能为空！");
	document.myform.PhotoName.focus();
	return false;
  }
  if (document.myform.Keyword.value=="")
  {
    alert("关键字不能为空！");
	document.myform.Keyword.focus();
	return false;
  }
  if (document.myform.PhotoPicUrl.value=="")
  {
    alert("缩略图地址不能为空！");
	document.myform.PhotoPicUrl.focus();
	return false;
  }
  if (document.myform.PhotoUrl.length==0)
  {
    alert("<%=Cl.Channel_Setting(2)%>地址不能为空！");
	document.myform.PhotoUrl.focus();
	return false;
  }
	for(var i=0;i<document.myform.PhotoUrl.length;i++){
      if (document.myform.PhotoUrls.value=="") document.myform.PhotoUrls.value=document.myform.PhotoUrl.options[i].value;
      else document.myform.PhotoUrls.value+="@@@"+document.myform.PhotoUrl.options[i].value;
    }
  for(var i=0;i<document.myform.TempUploadFiles.length;i++){
      if (document.myform.UploadFiles.value=="") document.myform.UploadFiles.value=document.myform.TempUploadFiles.options[i].value;
      else document.myform.UploadFiles.value+="@@@"+document.myform.TempUploadFiles.options[i].value;
  }
  return true;
}
</script>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="Admin_Photo.Asp" target="_self">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
    <tr>
      <td height="22" align="center" class="title" colspan="3"><b>添加<%=Cl.Channel_Setting(2)%></b></td>
    </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>所属栏目：</b></td>
            <td colspan="2">
				<select name="ClassID">
				<option value="0" selected>请选择<%=Cl.Channel_Setting(2)%>栏目</option>
                    <%=ShowClass_Option(ChannelID,ClassID,0,1)%>
				</select>&nbsp;&nbsp;<font color="#FF0000"><b>注意：</b></font><font color="#0000FF">不能指定为外部栏目</font>
			</td>
          </tr>
          <tr class="tdbg">
            <td width="100" align="right"><strong>所属专题：</strong></td>
            <td colspan="2">
			<select name="SpecialID" id="SpecialID" multiple style="height:90px;width:200px;">
			<%=ShowSpecial_Option(ChannelID,0,1)%>
			</select>&nbsp;&nbsp
			  <font color="#FF0000"><strong>说明：</strong></font><font color="#0000FF">按“Shift”“Ctrl”可多选</font>
			</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>名称：</b></td>
            <td colspan="2"><input name="PhotoName" type="text" id="PhotoName" value="" size="65" maxlength="255"> 
              <font color="#FF6600">*</font>&nbsp;<input name="Check" type="button" id="Check" value="检测名称" onClick="CheckTitle('PhotoName','<%=ChannelID%>');"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>关键字：</b></td>
            <td colspan="2"><input name="Keyword" type="text"
           id="Keyword" size="80" maxlength="255" Value="<%if ubound(sKeywordV)>-1 then response.write sKeywordV(0)%>"> <font color="#FF6600">*</font><br />
			<font color="#808080">关 键 字：</font><font color="#0000FF"><%for i=0 to Ubound(sKeywordV)
			Response.write "<a href=""javascript:ToValue('add','Keyword','|"&sKeywordV(i)&"')"">"&sKeyword(i)&"</a>"
			if i<Ubound(sKeywordV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br /> 
              <font color="#0066cc">用来查找相关<%=Cl.Channel_Setting(2)%>，可输入多个关键字，中间用<font color="#FF6600">“|”</font>隔开。不能出现&quot;&quot;'*?,.()等字符。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>作者：</b></td>
            <td colspan="2"><b>姓名：</b><input name="Author" type="text"
           id="Author" size="30" maxlength="100" Value="<%if ubound(sAuthorV)>-1 then response.write sAuthorV(0)%>"> <font color="#FF6600">&nbsp;</font> 
              <b>信箱：</b><input name="AuthorEmail" type="text" id="AuthorEmail" size="32" maxlength="100"><br />
			<font color="#808080">姓名选择：</font><font color="#0000FF"><%for i=0 to Ubound(sAuthorV)
			Response.write "<a href=""javascript:ToValue('','Author','"&sAuthorV(i)&"')"">"&sAuthor(i)&"</a>"
			if i<Ubound(sAuthorV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br />
              <b>主页：</b><input name="AuthorHomepage" type="text"
           id="AuthorHomepage" value="http://" size="74" maxlength="100"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>缩略图地址：</b></td>
            <td colspan="2"><input name="PhotoPicUrl" type="text" id="PhotoPicUrl" size="80" maxlength="200" onclick="doPreview('PhotoPicUrl','<%=Cl.WebDir%>','<%=Cl.UploadDir%>')"><br /> 
                <iframe style="top:2px" ID="UpFile" src="../User/Upload.asp?ID=<%=ChannelID%>&Type=0&Obj=PhotoPicUrl&TObj=TempUploadFiles" frameborder=0 scrolling=no width="530" height="25"></iframe></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>地址：</b></td>
            <td colspan="2"><input type="hidden" name="PhotoUrls" value="">
				<select name='PhotoUrl' style='width:95%;height:150' size='2' ondblclick="return ModifyUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');"></select> <font color="#FF0000">*</font><br />
				<input type="button" name="addurl" value="添加<%=Cl.Channel_Setting(2)%>地址" onclick="AddUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="addurl" value="修改当前地址" onclick="ModifyUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="addurl" value="删除当前地址" onclick="DelUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="upurl" value="↑" onclick="UpUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="downurl" value="↓" onclick="DownUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>上传<%=Cl.Channel_Setting(2)%>：</b></td>
            <td colspan="2"><iframe style="top:2px" ID="UpFile" src="../User/Upload.asp?ID=<%=ChannelID%>&Type=4&Obj=PhotoUrl&TObj=TempUploadFiles" frameborder=0 scrolling=no width="530" height="25"></iframe></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>已 上 传：</strong></td>
            <td><select name="TempUploadFiles" style="width:500;height:132" size="2" onclick="doPreview('TempUploadFiles','<%=Cl.WebDir%>','<%=Cl.UploadDir%>')"></select><br />
				<input type="button" name="SetDefaultPic" value="设为首页图片" onclick="SetPicUrl('TempUploadFiles','PhotoPicUrl');">
				<input type="button" name="InsEditor" value="插入编辑器" onclick="InsertEditor('TempUploadFiles','<%=Cl.WebDir%>','<%=Cl.UploadDir%>');">
				<input type="hidden" name="UploadFiles" value="">
			</td>
            <td width=180>
				<fieldset style="height:100%">
				<legend>预览</legend>
				<table border=0 cellpadding=0 cellspacing=1 width="180" height="150" valign=top>
				<tr><td align=center valign=middle id=tdPreview height="100%">

				</td></tr>
				</table>
				</fieldset>
			</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right" valign="middle"><b><%=Cl.Channel_Setting(2)%>简介：</b><br />
              支持各种UBB代码</td>
            <td colspan="2"><textarea name="PhotoIntro" style="display:none"></textarea>
			<IFRAME ID="editor" src="../Editor/Editor.asp?id=PhotoIntro&style=other&cid=<%=ChannelID%>&TObj=TempUploadFiles" frameborder="0" scrolling="no" width="95%" height="350"></IFRAME>
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>属性：</b></td>
            <td> <input name="OnTop" type="checkbox" id="OnTop" value="yes">
              固顶<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Hot" type="checkbox" id="Hot" value="yes" onclick="javascript:document.myform.Hits.value=<%=Clng(Cl.Web_Setting(14))%>">
              热门<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Elite" type=checkbox id="Elite" value="yes">
              推荐<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="IsDownLoad" type=checkbox id="IsDownLoad" value="yes">
              允许下载</td>
            <td><b>评分等级：</b> <select name="Stars" id="Stars">
                <option value="5">★★★★★</option>
                <option value="4">★★★★</option>
                <option value="3" selected>★★★</option>
                <option value="2">★★</option>
                <option value="1">★</option>
                <option value="0">无</option>
              </select> <font color="#FF6600">*</font></td>
          </tr>
		<tr class="tdbg">
            <td width="100" align="right"><b>点击次数：</b></td>
            <td colspan="2">本日： 
              <input name="DayHits" type="text" id="DayHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本周： 
              <input name="WeekHits" type="text" id="WeekHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本月： 
              <input name="MonthHits" type="text" id="MonthHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;总计： 
              <input name="Hits" type="text" id="Hits" value="0" size="10" maxlength="10"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看等级：</b></td>
            <td colspan="2">
			<input name="PhotoLevel" type="hidden" id="PhotoLevel" value="5">
			<input name="PhotoLevelView" type="text" id="PhotoLevelView" value="<%=Cl.GetUserGroupName(5)%>" size="80" onclick="SelectUserGroup('PhotoLevel');" Readonly Disabled>&nbsp;<input type="checkbox" name="GetClassPurview" value="yes" checked onclick="document.myform.PhotoLevelView.disabled=this.checked">继承栏目权限<br /><font color="#0066cc">只有具有相应权限的人才能查看此<%=Cl.Channel_Setting(2)%>。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看<%=Cl.Web_Setting(28)%>：</b></td>
            <td colspan="2"><input name="PhotoPoint" type="text" id="PhotoPoint" value="0" size="8" maxlength="5"> <%=Cl.Web_Setting(29)%> 
              &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0066cc">如果大于0，则用户查看此<%=Cl.Channel_Setting(2)%>时将消耗相应<%=Cl.Web_Setting(28)%>。（对游客无效）</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看<%=Cl.Web_Setting(26)%>：</b></td>
            <td colspan="2"><input name="PhotoMoney" type="text" id="PhotoMoney" value="0" size="8" maxlength="5"> <%=Cl.Web_Setting(27)%>
              &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0066cc">如果大于0，则用户查看此图片时将消耗相应<%=Cl.Web_Setting(26)%>。（对游客无效）</font></td>
          </tr>
          <tr class="tdbg">
            <td width="100" align="right"><strong>回扣设置：</strong></td>
            <td colspan="2">
			<%=Cl.Web_Setting(28)%>：<input name="BackPoint" type="text" id="BackPoint" value="0" size="5" maxlength="3" style="text-align: right;">&nbsp;<%=Cl.Web_Setting(29)%>＋<%=Cl.Web_Setting(28)%>的<input name="BackPointRate" type="text" id="BackPointRate" value="0" size="5" maxlength="2" style="text-align: right;">%<br />
			<%=Cl.Web_Setting(26)%>：<input name="BackMoney" type="text" id="BackMoney" value="0" size="5" maxlength="3" style="text-align: right;">&nbsp;<%=Cl.Web_Setting(27)%>＋<%=Cl.Web_Setting(26)%>的<input name="BackMoneyRate" type="text" id="BackMoneyRate" value="0" size="5" maxlength="2" style="text-align: right;">%<br /><font color="#0000FF">即当用户游览或下载此内容时，给予一定的回扣给添加者！</font>
			</td>
		  </tr>
		<tr class="tdbg"> 
            <td width="100" align="right"><b>录入时间：</b></td>
            <td colspan="2"><input name="UpdateTime" type="text" id="UpdateTime" value="<%=now()%>" maxlength="50">
              时间格式为“年-月-日 时:分:秒”，如：<font color="#0066cc"><%=Now%></font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>立即发布：</b></td>
            <td colspan="2"><input name="Passed" type="checkbox" id="Passed" value="yes" checked>
              是<font color="#0066cc">（如果选中的话将直接发布，否则审核后才能发布。）</font>&nbsp;&nbsp;<input name="NowCreate" type="checkbox" value="yes" checked>立即生成</td>
          </tr>
	</table>
	<div align="center"> 
    <p> 
	  <input name="ChannelID" type="hidden" id="ChannelID" value="<%=ChannelID%>">
      <input name="Action" type="hidden" id="Action" value="SaveAdd">
      <input name="Add" type="submit"  id="Add" value=" 添&nbsp;&nbsp;加 ">
      &nbsp; 
      <input name="Cancel" type="button" id="Cancel" value=" 取&nbsp;&nbsp;消 " onClick="window.location.href='Admin_Photo.Asp?ChannelID=<%=ChannelID%>'">
    </p>
	</div>
</form>
<%
End Sub

Sub ModifyMain()
	Dim rsInfo
	dim strCusTom
	Dim sKeyword,sAuthor,sKeywordV,sAuthorV
	FoundErr= False
	PhotoID	= Cl.ChkClng(Trim(request("PhotoID")))
	if PhotoID=0 then Admin_ShowErr("<li>请指定要修改的ID</li>")
	sql="select * from Cl_Photo where PhotoID=" & PhotoID & ""
	Set rsInfo= Cl.Execute(sql)
	if rsInfo.bof and rsInfo.eof then
		Admin_ShowErr("<li>找不到图片</li>")
	else
		ClassID=rsInfo("ClassID")
		set tClass=Cl.Execute("select ClassName,RootID,ParentID,Depth,ParentPath from Cl_Class where ChannelID="&ChannelID&" and ClassID=" & ClassID)
		if tClass.bof and tClass.eof then
			tClass.Close :Set tClass=Nothing
			Admin_ShowErr("<li>找不到指定的栏目</li>")
		else
			ClassName=tClass(0):RootID=tClass(1)
			ParentID=tClass(2):Depth=tClass(3)
			ParentPath=tClass(4)
			tClass.Close :Set tClass=Nothing
			if Not Cl.TrueChannelPurview(2,ChannelID) then
				dim sTempP,IsTruePurview
				sTempP=Split(ParentPath & "," & ClassID,",")
				IsTruePurview=False
				if rsInfo("Passed")=True then
					for i=1 to Ubound(sTempP)
						IsTruePurview = Cl.TrueClassPurview(1,ChannelID,sTempP(i))
						if IsTruePurview Then Exit For
					Next
				elseif rsInfo("Editor")=Cl.User_Info(5) then
					IsTruePurview=True
				else
					for i=1 to Ubound(sTempP)
						IsTruePurview = Cl.TrueClassPurview(2,ChannelID,sTempP(i))
						if IsTruePurview Then Exit For
					Next
				end if
				if Not IsTruePurview then
					Admin_ShowErr("<li>你无权修改此栏目下资料</li>")
				end if
			end if
		end if
	end if
	strCusTom	= Split(Cl.Channel_Setting(21),"@@@")
	sKeyword	= Split(strCusTom(0),"$")
	sAuthor		= Split(strCusTom(1),"$")
	sKeywordV	= Split(Cl.GotTopic(strCusTom(0),60),"$")
	sAuthorV	= Split(Cl.GotTopic(strCusTom(1),60),"$")
%>
<script language="JavaScript" type="text/javascript">
function CheckForm()
{
  if (document.myform.ClassID.value=="0")
  {
    alert("<%=Cl.Channel_Setting(2)%>所属栏目为外部栏目或您无此栏目添加权限！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.PhotoName.value=="")
  {
    alert("<%=Cl.Channel_Setting(2)%>名称不能为空！");
	document.myform.PhotoName.focus();
	return false;
  }
  if (document.myform.Keyword.value=="")
  {
    alert("关键字不能为空！");
	document.myform.Keyword.focus();
	return false;
  }
  if (document.myform.PhotoPicUrl.value=="")
  {
    alert("缩略图地址不能为空！");
	document.myform.PhotoPicUrl.focus();
	return false;
  }
  if (document.myform.PhotoUrl.length==0)
  {
    alert("<%=Cl.Channel_Setting(2)%>地址不能为空！");
	document.myform.PhotoUrl.focus();
	return false;
  }
    for(var i=0;i<document.myform.PhotoUrl.length;i++){
      if (document.myform.PhotoUrls.value=="") document.myform.PhotoUrls.value=document.myform.PhotoUrl.options[i].value;
      else document.myform.PhotoUrls.value+="@@@"+document.myform.PhotoUrl.options[i].value;
    }
  for(var i=0;i<document.myform.TempUploadFiles.length;i++){
      if (document.myform.UploadFiles.value=="") document.myform.UploadFiles.value=document.myform.TempUploadFiles.options[i].value;
      else document.myform.UploadFiles.value+="@@@"+document.myform.TempUploadFiles.options[i].value;
  }
  return true;
}
</script>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="Admin_Photo.Asp" target="_self">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
    <tr class="title">
      <td height="22" align="center" colspan=3><b>修改<%=Cl.Channel_Setting(2)%></b></td>
    </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>所属栏目：</b></td>
            <td colspan="2">
				<select name="ClassID">
				  <%=ShowClass_Option(ChannelID,rsInfo("ClassID"),0,1)%>
				  </select>&nbsp;&nbsp;
				<font color="#FF0000"><b>注意：</b></font><font color="#0000FF">不能指定为外部栏目</font>
			</td>
          </tr>
          <tr class="tdbg">
            <td width="100" align="right"><strong>所属专题：</strong></td>
            <td colspan="2">
			<select name="SpecialID" id="SpecialID" multiple style="height:90px;width:200px;">
			<%=ShowSpecial_Option(ChannelID,rsInfo("SpecialID"),1)%>
			</select>&nbsp;&nbsp
			  <font color="#FF0000"><strong>说明：</strong></font><font color="#0000FF">按“Shift”“Ctrl”可多选</font>
			</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>名称：</b></td>
            <td colspan="2"><input name="PhotoName" type="text" id="PhotoName" value="<%=rsInfo("PhotoName")%>" size="65" maxlength="255"> 
              <font color="#FF0000">*</font>&nbsp;<input name="Check" type="button" id="Check" value="检测名称" onClick="CheckTitle('PhotoName','<%=ChannelID%>');"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>关键字：</b></td>
            <td colspan="2"><input name="Keyword" type="text"
           id="Keyword" value="<%=rsInfo("Keyword")%>" size="80" maxlength="255"> <font color="#FF0000">*</font><br />
			<font color="#808080">关 键 字：</font><font color="#0000FF"><%for i=0 to Ubound(sKeywordV)
			Response.write "<a href=""javascript:ToValue('add','Keyword','|"&sKeywordV(i)&"')"">"&sKeyword(i)&"</a>"
			if i<Ubound(sKeywordV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br /> 
              <font color="#0066cc">用来查找相关<%=Cl.Channel_Setting(2)%>，可输入多个关键字，中间用<font color="#FF6600">“|”</font>隔开。不能出现&quot;&quot;'*?,.()等字符。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>作者：</b></td>
            <td colspan="2"><b>姓名：</b><input name="Author" type="text"
           id="Author" size="30" maxlength="100" value="<%=rsInfo("Author")%>"> <font color="#FF6600">&nbsp;</font> 
              <b>信箱：</b><input name="AuthorEmail" type="text" id="AuthorEmail" size="32" maxlength="100" value="<%=rsInfo("AuthorEmail")%>"><br />
			<font color="#808080">姓名选择：</font><font color="#0000FF"><%for i=0 to Ubound(sAuthorV)
			Response.write "<a href=""javascript:ToValue('','Author','"&sAuthorV(i)&"')"">"&sAuthor(i)&"</a>"
			if i<Ubound(sAuthorV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br />
              <b>主页：</b><input name="AuthorHomepage" type="text"
           id="AuthorHomepage" size="74" maxlength="100" value="<%=rsInfo("AuthorHomepage")%>"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>缩略图地址：</b></td>
            <td colspan="2"><input name="PhotoPicUrl" type="text" id="PhotoPicUrl" size="80" maxlength="200" Value="<%=rsInfo("PhotoPicUrl")%>" onclick="doPreview('PhotoPicUrl','<%=Cl.WebDir%>','<%=Cl.UploadDir%>')"><br /> 
                <iframe style="top:2px" ID="UpFile" src="../User/Upload.asp?ID=<%=ChannelID%>&Type=0&Obj=PhotoPicUrl&TObj=TempUploadFiles" frameborder=0 scrolling=no width="530" height="25"></iframe></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>地址：</b></td>
            <td colspan="2">
				<input type="hidden" name="PhotoUrls" value="">
				<select name="PhotoUrl" style="width:95%;height:150" size="2" ondblclick="return ModifyUrl('图片地址','PhotoUrl');">
				<%
				dim StrPhotoUrl
				StrPhotoUrl=Trim(rsInfo("PhotoUrl"))
				if Instr(StrPhotoUrl,"@@@") >0 then
					StrPhotoUrl=Split(StrPhotoUrl,"@@@")
					for i=0 to Ubound(StrPhotoUrl)
				%>
					<option value="<%=StrPhotoUrl(i)%>"><%=StrPhotoUrl(i)%></option>
				<%
					Next
				else
				%>
				<option value="<%=StrPhotoUrl%>"><%=StrPhotoUrl%></option>
				<%end if%>
				</select> <font color="#FF0000">*</font> <br />
				<input type="button" name="addurl" value="添加<%=Cl.Channel_Setting(2)%>地址" onclick="AddUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="addurl" value="修改当前地址" onclick="ModifyUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="addurl" value="删除当前地址" onclick="DelUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="upurl" value="↑" onclick="UpUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
				<input type="button" name="downurl" value="↓" onclick="DownUrl('<%=Cl.Channel_Setting(2)%>地址','PhotoUrl');">
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>上传<%=Cl.Channel_Setting(2)%>：</b></td>
            <td colspan="2"><iframe style="top:2px" ID="UpFile" src="../User/Upload.asp?ID=<%=ChannelID%>&Type=4&Obj=PhotoUrl&TObj=TempUploadFiles" frameborder=0 scrolling=no width="530" height="25"></iframe></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>已 上 传：</strong></td>
            <td><select name="TempUploadFiles" style="width:500;height:132" size="2" onclick="doPreview('TempUploadFiles','<%=Cl.WebDir%>','<%=Cl.UploadDir%>')"><%
				dim sUploadFiles
				sUploadFiles = Trim(rsInfo("UploadFiles"))
				if Instr(sUploadFiles,"@@@") >0 then
					sUploadFiles = Split(sUploadFiles,"@@@")
					for i=0 to Ubound(sUploadFiles)
				%>
					<option value="<%=sUploadFiles(i)%>"><%=sUploadFiles(i)%></option>
				<%
					Next
				elseif sUploadFiles<>"" then
				%>
				<option value="<%=sUploadFiles%>"><%=sUploadFiles%></option>
				<%end if%></select><br />
				<input type="button" name="SetDefaultPic" value="设为首页图片" onclick="SetPicUrl('TempUploadFiles','PhotoPicUrl');">
				<input type="button" name="InsEditor" value="插入编辑器" onclick="InsertEditor('TempUploadFiles','<%=Cl.WebDir%>','<%=Cl.UploadDir%>');">
				<input type="hidden" name="UploadFiles" value="">
			</td>
            <td width=180>
				<fieldset style="height:100%">
				<legend>预览</legend>
				<table border=0 cellpadding=0 cellspacing=1 width="180" height="150" valign=top>
				<tr><td align=center valign=middle id=tdPreview height="100%">

				</td></tr>
				</table>
				</fieldset>
			</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right" valign="middle"><b><%=Cl.Channel_Setting(2)%>简介：</b><br />
              支持各种UBB代码</td>
            <td colspan="2"><textarea name="PhotoIntro" style="display:none"><%=rsInfo("PhotoIntro")%></textarea>
			<IFRAME ID="editor" src="../Editor/Editor.asp?id=PhotoIntro&style=other&cid=<%=ChannelID%>&TObj=TempUploadFiles" frameborder="0" scrolling="no" width="95%" height="350"></IFRAME>
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>属性：</b></td>
            <td> <input name="OnTop" type="checkbox" id="OnTop" value="yes" <%if rsInfo("OnTop")=True then response.write " checked"%>>
              固顶<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Hot" type="checkbox" id="Hot" value="yes" <%if rsInfo("Hot")=True then response.write " checked"%>>
              热门<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Elite" type=checkbox id="Elite" value="yes"<%if rsInfo("Elite")=True then response.write " checked"%>>
              推荐<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="IsDownLoad" type=checkbox id="IsDownLoad" value="yes"<%if rsInfo("IsDownLoad")=True then response.write " checked"%>>
              允许下载</td>
            <td><b>评分等级：</b> <select name="Stars" id="Stars">
                <option value="5" <%if rsInfo("Stars")=5 then response.write " selected"%>>★★★★★</option>
                <option value="4" <%if rsInfo("Stars")=4 then response.write " selected"%>>★★★★</option>
                <option value="3" <%if rsInfo("Stars")=3 then response.write " selected"%>>★★★</option>
                <option value="2" <%if rsInfo("Stars")=2 then response.write " selected"%>>★★</option>
                <option value="1" <%if rsInfo("Stars")=1 then response.write " selected"%>>★</option>
                <option value="0" <%if rsInfo("Stars")=0 then response.write " selected"%>>无</option>
              </select> <font color="#FF0000">*</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看次数：</b></td>
            <td colspan="2">本日： 
              <input name="DayHits" type="text" id="DayHits" value="<%=rsInfo("DayHits")%>" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本周： 
              <input name="WeekHits" type="text" id="WeekHits" value="<%=rsInfo("WeekHits")%>" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本月： 
              <input name="MonthHits" type="text" id="MonthHits" value="<%=rsInfo("MonthHits")%>" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;总计： 
              <input name="Hits" type="text" id="Hits" value="<%=rsInfo("Hits")%>" size="10" maxlength="10"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看等级：</b></td>
            <td colspan="2">
			<input name="PhotoLevel" type="hidden" id="PhotoLevel" value="<%=rsInfo("PhotoLevel")%>">
			<input name="PhotoLevelView" type="text" id="PhotoLevelView" value="<%=Cl.GetUserGroupName(rsInfo("PhotoLevel"))%>" size="80" onclick="SelectUserGroup('PhotoLevel');" Readonly>&nbsp;<input type="checkbox" name="GetClassPurview" value="yes" onclick="document.myform.PhotoLevelView.disabled=this.checked">继承栏目权限<br /><font color="#0066cc">只有具有相应权限的人才能查看此<%=Cl.Channel_Setting(2)%>。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看<%=Cl.Web_Setting(28)%>：</b></td>
            <td colspan="2"><input name="PhotoPoint" type="text" id="PhotoPoint" value="<%=rsInfo("PhotoPoint")%>" size="8" maxlength="5"> <%=Cl.Web_Setting(29)%>
              &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000FF">如果大于0，则用户查看此图片时将消耗相应<%=Cl.Web_Setting(28)%>。（对游客无效）</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看<%=Cl.Web_Setting(26)%>：</b></td>
            <td colspan="2"><input name="PhotoMoney" type="text" id="PhotoMoney" value="<%=rsInfo("PhotoMoney")%>" size="8" maxlength="5"> <%=Cl.Web_Setting(27)%>
              &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000FF">如果大于0，则用户查看此图片时将消耗相应<%=Cl.Web_Setting(26)%>。（对游客无效）</font></td>
          </tr>
          <tr class="tdbg">
            <td width="100" align="right"><strong>回扣设置：</strong></td>
            <td colspan="2">
			<%=Cl.Web_Setting(28)%>：<input name="BackPoint" type="text" id="BackPoint" value="<%=rsInfo("BackPoint")%>" size="5" maxlength="3" style="text-align: right;">&nbsp;<%=Cl.Web_Setting(29)%>＋<%=Cl.Web_Setting(28)%>的<input name="BackPointRate" type="text" id="BackPointRate" value="<%=rsInfo("BackPointRate")%>" size="5" maxlength="2" style="text-align: right;">%<br />
			<%=Cl.Web_Setting(26)%>：<input name="BackMoney" type="text" id="BackMoney" value="<%=rsInfo("BackMoney")%>" size="5" maxlength="3" style="text-align: right;">&nbsp;<%=Cl.Web_Setting(27)%>＋<%=Cl.Web_Setting(26)%>的<input name="BackMoneyRate" type="text" id="BackMoneyRate" value="<%=rsInfo("BackMoneyRate")%>" size="5" maxlength="2" style="text-align: right;">%<br /><font color="#0000FF">即当用户游览或下载此内容时，给予一定的回扣给添加者！</font>
			</td>
		  </tr>
            <tr class="tdbg"> 
            <td width="100" align="right"><b>录入时间：</b></td>
            <td colspan="2"><input name="UpdateTime" type="text" id="UpdateTime" value="<%=rsInfo("UpdateTime")%>" maxlength="50"> <font color=blue><--【<a href='javascript:ToValue("","UpdateTime","<%=now%>")'>设为当前时间</a>】</font><br />
              时间格式为“年-月-日 时:分:秒”，如：<font color="#0066cc"><%=Now%></font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>立即发布：</b></td>
            <td colspan="2"><input name="Passed" type="checkbox" id="Passed" value="yes" <%if rsInfo("Passed")=True then response.write " checked"%>>
              是<font color="#0000FF">（如果选中的话将直接发布，否则审核后才能发布。）</font>&nbsp;&nbsp;<input name="NowCreate" type="checkbox" value="yes" checked>立即生成</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><font color=blue><strong>快捷操作：</strong></font></td>
            <td colspan="3"><%
'if Cl.TrueChannelPurview(2,ChannelID) then
	if rsInfo("Passed")=False then
		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetPassed&InfoID=" & rsInfo("PhotoID") & "'>审核通过</a>[&nbsp;"
		for i=0 to 21 step 3
     		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetPassed&InfoID=" & rsInfo("PhotoID") & "&Point="&i&"'>"&i&"点</a>&nbsp;"
		Next
	Else
		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=CancelPassed&InfoID=" & rsInfo("PhotoID") & "'>取消审核</a>&nbsp;&nbsp;<font color=blue>设点</font>[&nbsp;"
		for i=0 to 21 step 3
     		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetPoint&InfoID=" & rsInfo("PhotoID") & "&Point="&i&"'>"&i&"点</a>&nbsp;"
		Next
  	end if
	Response.write "]&nbsp;&nbsp;||&nbsp;&nbsp;"
  	if rsInfo("OnTop")=False then
   		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetOnTop&InfoID=" & rsInfo("PhotoID") & "'>固顶</a>&nbsp;&nbsp;"
   	else
		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=CancelOnTop&InfoID=" & rsInfo("PhotoID") & "'>解固</a>&nbsp;&nbsp;" 
   	end if
  	if rsInfo("Elite")=False then
   		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=SetElite&InfoID=" & rsInfo("PhotoID") & "'>设为推荐</a>&nbsp;&nbsp;"
   	else
		response.write "<a href='Admin_Property.asp?ChannelID="&ChannelID&"&Action=CancelElite&InfoID=" & rsInfo("PhotoID") & "'>取消推荐</a>&nbsp;&nbsp;"
    end if
	if rsInfo("Deleted")=True then
		response.write "<a href='Admin_InfoDel.asp?ChannelID="&ChannelID&"&Action=Restore&InfoID="&rsInfo("PhotoID")&"'>还原</a>&nbsp;&nbsp;"
	else
		response.write "<a href='Admin_InfoDel.asp?Action=Del&InfoID=" & rsInfo("PhotoID") & "'>删除</a>&nbsp;&nbsp;" 
	end if
'end if
%>&nbsp;&nbsp;<a href="Admin_Comment.asp?ChannelID=<%=ChannelID%>&InfoID=<%=rsInfo("PhotoID")%>"> 管理此<%=Cl.Channel_Setting(2)%>的评论</a></td>
          </tr>
  </table>
  	<div align="center"> 
    <p> 
	  <input name="ChannelID" type="hidden" id="ChannelID" value="<%=ChannelID%>">
	  <input name="PhotoID" type="hidden" id="PhotoID" value="<%=PhotoID%>"> 
	  <input name="Action" type="hidden" id="Action" value="SaveModify">
	  <input name="Save" type="submit"  id="Save" value="保存修改结果" style="cursor:hand;">
	  &nbsp; 
	  <input name="Add" type="submit" id="Add" value="添加为新<%=Cl.Channel_Setting(2)%>" onClick="document.myform.Action.value='SaveAdd';" style="cursor:hand;">
	  &nbsp; 
	  <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Admin_Photo.Asp?ChannelID=<%=ChannelID%>'" style="cursor:hand;">
    </p>
	</div>
</form>
<%
rsInfo.close:set rsInfo=Nothing
End Sub

Sub DoSaveRecord()
	FoundErr		= False
	PhotoID			= Cl.ChkClng(request.Form("PhotoID"))
	ClassID			= Cl.ChkClng(request.form("ClassID"))
	SpecialID		= Trim(request.Form("SpecialID"))
	PhotoName		= Trim(request.form("PhotoName"))
	Keyword			= Trim(request.form("Keyword"))
	Author			= Trim(request.form("Author"))
	AuthorEmail		= Trim(request.form("AuthorEmail"))
	AuthorHomepage	= Trim(request.form("AuthorHomePage"))
	PhotoPicUrl		= Trim(request.form("PhotoPicUrl"))
	PhotoUrl		= Trim(request.form("PhotoUrls"))
	PhotoIntro		= Trim(request.form("PhotoIntro"))
	OnTop			= Trim(request.form("OnTop"))
	Hot				= Trim(request.form("Hot"))
	Elite			= Trim(request.form("Elite"))
	Stars			= Cl.ChkClng(request.form("Stars"))
	Hits			= Cl.ChkClng(request.form("Hits"))
	DayHits			= Cl.ChkClng(request.form("DayHits"))
	WeekHits		= Cl.ChkClng(request.form("WeekHits"))
	MonthHits		= Cl.ChkClng(request.form("MonthHits"))
	PhotoLevel		= Trim(request.form("PhotoLevel"))
	PhotoPoint		= Cl.ChkClng(request.form("PhotoPoint"))
	PhotoMoney		= Cl.ChkClng(request.form("PhotoMoney"))
	BackPoint		= Cl.ChkClng(request.form("BackPoint"))
	BackPointRate	= Cl.ChkClng(request.form("BackPointRate"))
	BackMoney		= Cl.ChkClng(request.form("BackMoney"))
	BackMoneyRate	= Cl.ChkClng(request.form("BackMoneyRate"))
	UpdateTime		= Trim(request.form("UpdateTime"))
	Passed			= Trim(request.form("Passed"))
	IsDownLoad		= Trim(request.form("IsDownLoad"))
	NowCreate		= Trim(request.form("NowCreate"))
	UploadFiles		= Trim(request.form("UploadFiles"))
	Editor			= Cl.User_Info(5)
	if ClassID<=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>指定了非法的栏目（外部栏目或不存在的栏目）</li>"
	end if
	if PhotoName="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>图片名称不能为空</li>"
	end if
	if Keyword="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入图片关键字</li>"
	end if
	if PhotoPicUrl="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>缩略图地址不能为空</li>"
	end if
	if PhotoUrl="" then
		founderr=true
		errmsg=errmsg & "<br /><li>图片地址不能为空</li>"
	end if
	if FoundErr=True then Admin_ShowErr(ErrMsg)
	set tClass=Cl.Execute("select ClassName,Depth,ParentPath,Child,BrowsePurview,DisabledAdd,AddPoint,AddIsChk,MaxLimit,IsOuter From Cl_Class where ClassID=" & ClassID)
	if tClass.bof and tClass.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>找不到指定的栏目</li>"
	else
		if tClass(9)=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>不能指定外部栏目</li>"
		elseif tClass(5)<>0 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>对不起，此栏目禁止添加资料</li>"
		else
			ClassName=tClass(0):Depth=tClass(1)
			ParentPath=tClass(2):Child=tClass(3)
			sAddPoint=tClass(6):sAddIsChk=tClass(7)
			sMaxLimit=tClass(8)
			if request("GetClassPurview")="yes" then PhotoLevel="5"
		end if
	end if
	tClass.Close :Set tClass=Nothing
	if PhotoIntro="" then
		PhotoIntro="暂无简介"
	else
		if Cl.strLength(PhotoIntro)>sMaxLimit and sMaxLimit<>0 then
			founderr=true
			errmsg=errmsg & "<br /><li>简介内容大小超过了最大限制（"&sMaxLimit&" 字节！）</li>"
		end if
		if Trim(Cl.Web_Setting(9))="Yes" then
			PhotoIntro=Cl.DeCode(PhotoIntro,Trim(Cl.Web_Setting(10)))
		end if
	end if
	if FoundErr=True then Admin_ShowErr(ErrMsg)
	if SpecialID="" then
		SpecialID="0"
	else
		SpecialID=Replace(SpecialID," ","")
		if Len(SpecialID)>250 then
			Dim TempStr,SpecialStr
			TempStr=Split(SpecialID,",")
			SpecialStr="0"
			For i=0 to Ubound(TempStr)
				if TempStr(i)<>"" then SpecialStr=SpecialStr & "," & TempStr(i)
				if Len(SpecialStr)>=230 then Exit For
			Next
			SpecialID=SpecialStr
		End if
		SpecialID=Replace(SpecialID,"0,","")
	end if
	Keyword=Cl.ReplaceBadChar(Keyword)
	Keyword=Replace(Keyword,"||","|")
	if Left(Keyword,1)="|" then Keyword=Right(Keyword,Len(Keyword)-1)
	if Right(Keyword,1)="|" then Keyword=Left(Keyword,Len(Keyword)-1)
	if UpdateTime<>"" and IsDate(UpdateTime)=true then
		UpdateTime=CDate(UpdateTime)
	else
		UpdateTime=now()
	end if
	PhotoLevel=Replace(PhotoLevel," ","")
	if Not IsNumeric(Replace(PhotoLevel,",","")) then PhotoLevel="5"
	if OnTop="yes" then
		OnTop=True
	else
		OnTop=False
	end if
	if Hot="yes" then
		Hot=True
	else
		Hot=False
	end if
	if Elite="yes" then
		Elite=True
	else
		Elite=False
	end if
	if Passed="yes" then
		Passed=True
	else
		Passed=False
	end if
	if IsDownLoad="yes" then
		IsDownLoad=True
	else
		IsDownLoad=False
	End if
	set rs=server.createobject("adodb.recordset")
	if Action="SaveAdd" then
		Dim MaxTID
		MaxTID=Cl.Execute("select max(PhotoID) from Cl_Photo")(0)
		if isnull(MaxTID) or Not IsNumeric(MaxTID) then MaxTID=0
		PhotoID=MaxTID+1
		sql="select * from Cl_Photo" 
		OpenConn : rs.open sql,Conn,1,3
		rs.addnew
		rs("PhotoID")=PhotoID
		rs("ChannelID")=ChannelID
		call SaveData()
		rs("Editor")=Editor
		rs.update
	elseif Action="SaveModify" then
  		if PhotoID=0 then
			Admin_ShowErr("<br /><li>不能确定PhotoID的值</li>")
		else
			sql="select * from Cl_Photo where Photoid=" & PhotoID
			OpenConn : rs.open sql,Conn,1,3
			if rs.bof and rs.eof then
				rs.close : set rs=Nothing
				Admin_ShowErr("<br /><li>找不到此图片，可能已经被其他人删除。</li>")
 			else
				Editor	= Rs("Editor")
				if rs("Passed")=True then
					Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "-"&sAddPoint&"," & Db.UserDataNum & "=" & Db.UserDataNum & "-1 where " & Db.UserName & "='" & Editor & "'")
				end if
				call SaveData()
				rs.update
			end if
		end if
	else
		Admin_ShowErr("<br /><li>参数错误!</li>")
	end if
	rs.close : set rs=Nothing
	Cl.ChkUploadFile PhotoID,PhotoPicUrl & PhotoUrl & PhotoIntro,UploadFiles
	Cl.SaveAdminLog
	SaveSuccess
End Sub

Sub SaveData()
	rs("ClassID")		= ClassID
	rs("SpecialID")		= SpecialID
	rs("PhotoName")		= PhotoName
	rs("Keyword")		= Keyword
	rs("Author")		= Author
	rs("AuthorEmail")	= AuthorEmail
	rs("AuthorHomepage")= AuthorHomepage
	rs("PhotoPicUrl")	= PhotoPicUrl
	rs("PhotoUrl")		= PhotoUrl
	'rs("PhotoSize")	= PhotoSize
	rs("PhotoIntro")	= PhotoIntro
	rs("Hits")			= Hits
	rs("DayHits")		= DayHits
	rs("WeekHits")		= WeekHits
	rs("MonthHits")		= MonthHits
	rs("PhotoLevel")	= PhotoLevel
	rs("PhotoPoint")	= PhotoPoint
	rs("PhotoMoney")	= PhotoMoney
	rs("Stars")			= Stars
	rs("UpdateTime")	= UpdateTime
	if Passed and Cl.TrueChannelPurview(2,ChannelID) then
		rs("Passed")	= True
		rs("Censor")	= Cl.User_Info(5)
		rs("CensorTime")= Date()
		Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+"&sAddPoint&"," & Db.UserDataNum & "=" & Db.UserDataNum & "+1 where " & Db.UserName & "='" & Editor & "'")
	elseif Passed and sAddIsChk=True then
		dim IsTruePurview,sTempP
		sTempP=Split(ParentPath & "," & ClassID,",")
		for i=1 to Ubound(sTempP)
			IsTruePurview = Cl.TrueClassPurview(3,ChannelID,sTempP(i))
			if IsTruePurview Then Exit For
		Next
		if IsTruePurview then
			rs("Passed")	= True
			rs("Censor")	= Cl.User_Info(5)
			rs("CensorTime")= Date()
			Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+"&sAddPoint&"," & Db.UserDataNum & "=" & Db.UserDataNum & "+1 where " & Db.UserName & "='" & Editor & "'")
		else
			rs("Passed")= False
			Passed=False
		end if
	else
		if sAddIsChk=False then
			rs("Passed")	= True
			rs("Censor")	= Cl.User_Info(5)
			rs("CensorTime")= Date()
			Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+"&sAddPoint&"," & Db.UserDataNum & "=" & Db.UserDataNum & "+1 where " & Db.UserName & "='" & Editor & "'")
			Passed=True
		else
			rs("Passed")= False
			Passed=False
		end if
	end if
	rs("OnTop")			= OnTop
	rs("Hot")			= Hot
	rs("Elite")			= Elite
	rs("IsDownLoad")	= IsDownLoad
	rs("DownLoadNum")	= 0
	rs("UploadFiles")	= UploadFiles
	rs("Nopass")		= False
	rs("BackPoint")		= BackPoint
	rs("BackPointRate")	= BackPointRate
	rs("BackMoney")		= BackMoney
	rs("BackMoneyRate")	= BackMoneyRate
End Sub
	
Sub SaveSuccess()
%>
<br /><br />
<table class="border" align=center width="500" border="0" cellpadding="0" cellspacing="1" bordercolor="#999999">
  <tr align=center> 
    <td  height="22" colspan="2" align="center" class="title"><b> 
      <%if action="SaveAdd"then%>添加<%else%>修改<%end if%><%=Cl.Channel_Setting(2)%>成功</b></td>
  </tr>
  <%if Not Passed then%>
  <tr class="tdbg"> 
    <td height="60" colspan="2"><font color="#0000FF">注意：</font><br /> &nbsp;&nbsp;&nbsp; 
      你的<%=Cl.Channel_Setting(2)%>尚未真正发表！只有等管理员审核并通过了你的<%=Cl.Channel_Setting(2)%>后，你所添加的<%=Cl.Channel_Setting(2)%>才会发表。</td>
  </tr>
  <%end if%>
  <tr class="tdbg"> 
    <td height="5" colspan="2"></td>
  </tr>
  <tr class="tdbg"> 
    <td width="180" align="center" valign="top">
		<img src="<%=Cl.ReplaceDir(PhotoPicUrl)%>" width="180">
	</td>
    <td valign="top"><table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#ffffff">
        <tr class="tdbg">
          <td width="100" align="right"><strong>所属栏目：</strong></td>
          <td><%=ShowManageClassPath(ChannelID,ClassName,ParentPath,Depth)%></td>
        </tr>
        <tr class="tdbg">
          <td width="100" align="right"><strong><%=Cl.Channel_Setting(2)%>名称：</strong></td>
          <td><%=Cl.HTMLEncode(PhotoName) %></td>
        </tr>
        <tr class="tdbg">
          <td width="100" align="right"><strong><%=Cl.Channel_Setting(2)%>作者：</strong></td>
          <td><%=Cl.HTMLEncode(Author) %></td>
        </tr>
        <tr class="tdbg">
          <td width="100" align="right"><strong>关 键 字：</strong></td>
          <td><%=Keyword%></td>
        </tr>
      </table></td>
  </tr>
  <tr class="tdbg"> 
    <td height="40" colspan="2" align="center">【<a href="Admin_Photo.Asp?Action=Modify&ChannelID=<%=ChannelID%>&PhotoID=<%=PhotoID%>">修改此<%=Cl.Channel_Setting(2)%></a>】&nbsp;【<a href="Admin_Photo.Asp?Action=Add&ChannelID=<%=ChannelID%>">继续添加<%=Cl.Channel_Setting(2)%></a>】&nbsp;【<a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>"><%=Cl.Channel_Setting(2)%>管理</a>】</td>
  </tr>
</table>
<%
if Clng(Cl.Channel_Setting(10))=1 and Passed and NowCreate="yes" then
	Dim sCreate
	if CBool(Cl.Channel_Setting(14)) and CBool(Cl.Channel_Setting(15)) then

		sCreate="CreatePhoto,CreateClass,CreateUpDate,CreateElite,CreateIndex,CreateWebIndex"
		if SpecialID<>"0" then sCreate=sCreate&",CreateSpecial"
	else
		sCreate="CreatePhoto,CreateIndex,CreateWebIndex"
	end if
	%>
	<br /><br />
	<iframe width="100%" height="220" frameborder="0" src="Admin_Create_Photo.asp?ChannelID=<%=ChannelID%>&Action=<%=sCreate%>&InfoID=<%=PhotoID%>&ClassID=<%=ClassID%>&SpecialID=<%=SpecialID%>" name="Make"></iframe>
<%end if
end sub

Sub AddMoreMain()
	if Not Cl.TrueChannelPurview(1,ChannelID) then Admin_ShowErr("<li>您无此操作权限！</li>")
	dim strCusTom
	Dim sKeyword,sAuthor,sKeywordV,sAuthorV
	strCusTom	= Split(Cl.Channel_Setting(21),"@@@")
	sKeyword	= Split(strCusTom(0),"$")
	sAuthor		= Split(strCusTom(1),"$")
	sKeywordV	= Split(Cl.GotTopic(strCusTom(0),60),"$")
	sAuthorV	= Split(Cl.GotTopic(strCusTom(1),60),"$")
%>
<script language="JavaScript" type="text/javascript">
function CheckForm()
{
  if (document.myform.ClassID.value=="0")
  {
    alert("<%=Cl.Channel_Setting(2)%>所属栏目为外部栏目或您无此栏目添加权限！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.PhotoName.value=="")
  {
    alert("<%=Cl.Channel_Setting(2)%>名称不能为空！");
	document.myform.PhotoName.focus();
	return false;
  }
  if (document.myform.Keyword.value=="")
  {
    alert("关键字不能为空！");
	document.myform.Keyword.focus();
	return false;
  }
  if (document.myform.PhotoPicUrl.value=="")
  {
    alert("缩略图地址不能为空！");
	document.myform.PhotoPicUrl.focus();
	return false;
  }
  return true;  
}
</script>
<form name="chkform" action="../User/User_ChkInfo.Asp" method="post" target="_blank">
	<input type="hidden" name="TitleName" value="">
	<input type="hidden" name="ChannelID" value="<%=ChannelID%>">
</form>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="Admin_Photo.Asp" target="_self">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
    <tr>
      <td height="22" align="center" class="title" colspan="3"><b>添加<%=Cl.Channel_Setting(2)%></b></td>
    </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>所属栏目：</b></td>
            <td colspan="2">
				<select name="ClassID">
                <%=ShowClass_Option(ChannelID,ClassID,0,1)%>
				</select>&nbsp;&nbsp;
				<font color="#FF0000"><b>注意：</b></font><font color="#0000FF">不能指定为外部栏目</font>
			</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>所属专题：</b></td>
            <td colspan="2">
			<select name="SpecialID" id="SpecialID">
			<%=ShowSpecial_Option(ChannelID,SpecialID,1)%>
			</select></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>名称：</b></td>
            <td colspan="2"><input name="PhotoName" type="text" id="PhotoName" value="" size="80" maxlength="255"> 
              <font color="#FF6600">*</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>关键字：</b></td>
            <td colspan="2"><input name="Keyword" type="text"
           id="Keyword" size="80" maxlength="255" Value="<%=sKeywordV(0)%>"> <font color="#FF6600">*</font><br />
			<font color="#808080">关 键 字：</font><font color="#0000FF"><%for i=0 to Ubound(sKeywordV)
			Response.write "<a href=""javascript:ToValue('add','Keyword','|"&sKeywordV(i)&"')"">"&sKeyword(i)&"</a>"
			if i<Ubound(sKeywordV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br /> 
              <font color="#0066cc">用来查找相关<%=Cl.Channel_Setting(2)%>，可输入多个关键字，中间用<font color="#FF6600">“|”</font>隔开。不能出现&quot;&quot;'*?,.()等字符。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>作者：</b></td>
            <td colspan="2"><b>姓名：</b><input name="Author" type="text"
           id="Author" size="30" maxlength="100" Value="<%=sAuthorV(0)%>"> <font color="#FF6600">&nbsp;</font> 
              <b>信箱：</b><input name="AuthorEmail" type="text" id="AuthorEmail" size="32" maxlength="100"><br />
			<font color="#808080">姓名选择：</font><font color="#0000FF"><%for i=0 to Ubound(sAuthorV)
			Response.write "<a href=""javascript:ToValue('','Author','"&sAuthorV(i)&"')"">"&sAuthor(i)&"</a>"
			if i<Ubound(sAuthorV) then Response.write "/"
			next%></font>&nbsp;&nbsp;<font color=#66666>more...</font><br />
              <b>主页：</b><input name="AuthorHomepage" type="text"
           id="AuthorHomepage" value="http://" size="74" maxlength="100"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>缩略图地址：</b></td>
            <td colspan="2"><input name="PhotoPicUrl" type="text" id="PhotoPicUrl" size="50" maxlength="200" value='{%uploaddir%}PhotoPic/<%=year(now) & "-" & month(now)&"/(*).jpg"%>'>&nbsp;通配符为"(*)"&nbsp;&nbsp;&nbsp;通配符长度：<SELECT NAME="NumLen" id="NumLen">
			<%
			dim tmp
			for tmp=1 to 6
			response.write "<option value='"&tmp&"'>"&tmp&"</option>"
			next%>
			</SELECT></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>地址：</b></td>
            <td colspan="2"><input type="text" name="PhotoUrls" size="50" value='<%="图片地址|{%uploaddir%}Photo/" & year(now) & "-" & month(now)&"/(*).jpg"%>'>
			&nbsp;开始ID：<input type='text' name='BeginID' value='1' size='6' maxlength='6' style='text-align:center'> 结束ID：<input type='text' name='EndID' value='99' size='6' maxlength='6' style='text-align:center'>
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right" valign="middle"><b><%=Cl.Channel_Setting(2)%>简介：</b><br />
              支持各种UBB代码</td>
            <td colspan="2"><textarea name="PhotoIntro" style="display:none"></textarea>
			<IFRAME ID="editor" src="../Editor/Editor.asp?id=PhotoIntro&style=other&cid=<%=ChannelID%>" frameborder="0" scrolling="no" width="95%" height="350"></IFRAME>
            </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b><%=Cl.Channel_Setting(2)%>属性：</b></td>
            <td> <input name="OnTop" type="checkbox" id="OnTop" value="yes">
              固顶<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Hot" type="checkbox" id="Hot" value="yes" onclick="javascript:document.myform.Hits.value=<%=Clng(Cl.Web_Setting(14))%>">
              热门<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="Elite" type=checkbox id="Elite" value="yes">
              推荐<%=Cl.Channel_Setting(2)%>&nbsp;&nbsp;&nbsp; <input name="IsDownLoad" type=checkbox id="IsDownLoad" value="yes">
              允许下载</td>
            <td><b>评分等级：</b> <select name="Stars" id="Stars">
                <option value="5">★★★★★</option>
                <option value="4">★★★★</option>
                <option value="3" selected>★★★</option>
                <option value="2">★★</option>
                <option value="1">★</option>
                <option value="0">无</option>
              </select> <font color="#FF6600">*</font></td>
          </tr>
		<tr class="tdbg"> 
            <td width="100" align="right"><b>点击次数：</b></td>
            <td colspan="2">本日： 
              <input name="DayHits" type="text" id="DayHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本周： 
              <input name="WeekHits" type="text" id="WeekHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;本月： 
              <input name="MonthHits" type="text" id="MonthHits" value="0" size="10" maxlength="10"> 
              &nbsp;&nbsp;&nbsp;&nbsp;总计： 
              <input name="Hits" type="text" id="Hits" value="0" size="10" maxlength="10"></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看等级：</b></td>
            <td colspan="2"><input name="PhotoLevel" type="text" id="PhotoLevel" value="5" size="80" onclick="SelectUserGroup('PhotoLevel');" Readonly><br /><font color="#0066cc">只有具有相应权限的人才能查看此<%=Cl.Channel_Setting(2)%>。</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>查看<%=Cl.Web_Setting(28)%>：</b></td>
            <td colspan="2"><input name="PhotoPoint" type="text" id="PhotoPoint" value="0" size="5" maxlength="3"> 
              &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0066cc">如果大于0，则用户查看此<%=Cl.Channel_Setting(2)%>时将消耗相应<%=Cl.Web_Setting(28)%>。（对游客无效）</font></td>
          </tr>
		<tr class="tdbg"> 
            <td width="100" align="right"><b>录入时间：</b></td>
            <td colspan="2"><input name="UpdateTime" type="text" id="UpdateTime" value="<%=now()%>" maxlength="50">
              时间格式为“年-月-日 时:分:秒”，如：<font color="#0066cc"><%=Now%></font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><b>立即发布：</b></td>
            <td colspan="2"><input name="Passed" type="checkbox" id="Passed" value="yes" checked>
              是<font color="#0066cc">（如果选中的话将直接发布，否则审核后才能发布。）</font>&nbsp;&nbsp;<!--input name="NowCreate" type="checkbox" value="yes" checked>立即生成--></td>
          </tr>
	</table>
  	<div align="center"> 
    <p> 
	  <input name="ChannelID" type="hidden" id="ChannelID" value="<%=ChannelID%>">
      <input name="Action" type="hidden" id="Action" value="SaveAddMore">
      <input name="Add" type="submit"  id="Add" value=" 添&nbsp;&nbsp;加 ">
      &nbsp; 
      <input name="Cancel" type="button" id="Cancel" value=" 取&nbsp;&nbsp;消 " onClick="window.location.href='Admin_Photo.Asp?ChannelID=<%=ChannelID%>'">
    </p>
	</div>
</form>
<%
End Sub

Sub SaveAddMore()
	if Not Cl.TrueChannelPurview(1,ChannelID) then Admin_ShowErr("<br /><li>您无此操作权限！</li>")
	FoundErr		= False
	Action			= Trim(request("Action"))
	PhotoID			= Cl.ChkClng(Trim(Request.Form("PhotoID")))
	ClassID			= Cl.ChkClng(Trim(request.form("ClassID")))
	SpecialID		= Trim(request.Form("SpecialID"))
	PhotoName		= Trim(request.form("PhotoName"))
	Keyword			= Trim(request.form("Keyword"))
	Author			= Trim(request.form("Author"))
	AuthorEmail		= Trim(request.form("AuthorEmail"))
	AuthorHomepage	= Trim(request.form("AuthorHomePage"))
	'修改成批量的基础
	PhotoPicUrl		= Trim(request.form("PhotoPicUrl"))
	PhotoUrl		= Trim(request.form("PhotoUrls"))
	BeginID			= Trim(request.form("BeginID"))
	EndID			= Trim(request.form("EndID"))
	NumLen			= Trim(request.form("NumLen"))
	PhotoIntro		= Trim(request.form("PhotoIntro"))
	OnTop			= Trim(request.form("OnTop"))
	Hot				= Trim(request.form("Hot"))
	Elite			= Trim(request.form("Elite"))
	Stars			= Cl.ChkClng(Trim(request.form("Stars")))
	Hits			= Cl.ChkClng(Trim(request.form("Hits")))
	DayHits			= Cl.ChkClng(Trim(request.form("DayHits")))
	WeekHits		= Cl.ChkClng(Trim(request.form("WeekHits")))
	MonthHits		= Cl.ChkClng(Trim(request.form("MonthHits")))
	PhotoLevel		= Trim(request.form("PhotoLevel"))
	PhotoPoint		= Cl.ChkClng(Trim(request.form("PhotoPoint")))
	UpdateTime		= Trim(request.form("UpdateTime"))
	Passed			= Trim(request.form("Passed"))
	IsDownLoad		= Trim(request.form("IsDownLoad"))
	NowCreate		= Trim(request.form("NowCreate"))
	Editor			= Cl.User_Info(5)
	if ClassID<=0 then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>指定了非法的栏目（外部栏目或不存在的栏目）</li>"
	end if
	if PhotoName="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>图片名称不能为空</li>"
	end if
	if Keyword="" then
		founderr=true
		errmsg=errmsg & "<br /><li>请输入图片关键字</li>"
	end if
	if PhotoPicUrl="" then
		founderr=true
		errmsg=ErrMsg & "<br /><li>缩略图地址不能为空</li>"
	end if
	if PhotoUrl="" then
		founderr=true
		errmsg=errmsg & "<br /><li>图片地址不能为空</li>"
	end if
	if FoundErr=True then Admin_ShowErr(ErrMsg)
	set tClass=Cl.Execute("select ClassName,Depth,ParentPath,Child,BrowsePurview,DisabledAdd,AddPoint,AddIsChk,MaxLimit,IsOuter From Cl_Class where ClassID=" & ClassID)
	if tClass.bof and tClass.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br /><li>找不到指定的栏目</li>"
	else
		if tClass(9)=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br /><li>不能指定外部栏目</li>"
		else
			ClassName=tClass(0):Depth=tClass(1)
			ParentPath=tClass(2):Child=tClass(3)
			sAddPoint=tClass(6):sAddIsChk=tClass(7)
			sMaxLimit=tClass(8)
		end if
	end if
	tClass.Close :Set tClass=Nothing
	if PhotoIntro="" then
		PhotoIntro="暂无简介"
	else
		if Cl.strLength(PhotoIntro)>sMaxLimit and sMaxLimit<>0 then
			founderr=true
			errmsg=errmsg & "<br /><li>简介内容大小超过了最大限制（"&sMaxLimit&" 字节！）</li>"
		end if
		if Trim(Cl.Web_Setting(9))="Yes" then
			PhotoIntro=Cl.DeCode(PhotoIntro,Trim(Cl.Web_Setting(10)))
		end if
	end if
	if FoundErr=True then Admin_ShowErr(ErrMsg)
	if SpecialID="" then
		SpecialID="0"
	else
		SpecialID=Replace(SpecialID," ","")
		SpecialID=Replace(SpecialID,",,","")
		if Len(SpecialID)>250 then
			Dim TempStr,SpecialStr
			TempStr=Split(SpecialID,",")
			For i=0 to Ubound(TempStr)
				if TempStr(i)<>"" then SpecialStr=SpecialStr & "," & TempStr(i)
				if Len(SpecialStr)>=230 then Exit For
			Next
			SpecialID=SpecialStr
		End if
		SpecialID=Replace(","&SpecialID&",",",,",",")
	end if
	Keyword=Cl.ReplaceBadChar(Keyword)
	Keyword=Replace(Keyword,"||","|")
	if Left(Keyword,1)="|" then Keyword=Right(Keyword,Len(Keyword)-1)
	if Right(Keyword,1)="|" then Keyword=Left(Keyword,Len(Keyword)-1)
	if UpdateTime<>"" and IsDate(UpdateTime)=true then
		UpdateTime=CDate(UpdateTime)
	else
		UpdateTime=now()
	end if
	if OnTop="yes" then
		OnTop		= True
	else
		OnTop		= False
	end if
	if Hot="yes" then
		Hot			= True
	else
		Hot			= False
	end if
	if Elite="yes" then
		Elite		= True
	else
		Elite		= False
	end if
	if IsDownLoad="yes" then
		IsDownLoad	= True
	else
		IsDownLoad	= False
	end if
	if Passed="yes" then
		Passed		= True
	else
		Passed		= False
	end if
	' 保存
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 * from Cl_Photo"
	OpenConn : rs.open sql,Conn,1,3
	for batchi=BeginID to EndID
		rs.addnew
		if NumLen-len(batchi)>0 then
			call SaveDataMore(left("0000000000",NumLen-len(batchi))&batchi)
		else
			call SaveDataMore(batchi)
		end if
		rs("Editor")=Cl.User_Info(5)
		rs.update
	next
	rs.close:set rs=Nothing
	SaveSuccessMore
End Sub

Sub SaveDataMore(batchnum)
	rs("ChannelID")		= ChannelID
	rs("ClassID")		= ClassID
	rs("SpecialID")		= SpecialID
	rs("PhotoName")		= PhotoName & "_" & batchnum
	rs("Keyword")		= Keyword
	rs("Author")		= Author
	rs("AuthorEmail")	= AuthorEmail
	rs("AuthorHomepage")= AuthorHomepage
	rs("PhotoPicUrl")	= replace(PhotoPicUrl,"(*)",batchnum)
	rs("PhotoUrl")		= replace(PhotoUrl,"(*)",batchnum)
	rs("PhotoSize")		= PhotoSize
	rs("PhotoIntro")	= PhotoIntro
	rs("Hits")			= Hits
	rs("DayHits")		= DayHits
	rs("WeekHits")		= WeekHits
	rs("MonthHits")		= MonthHits
	rs("PhotoLevel")	= PhotoLevel
	rs("PhotoPoint")	= PhotoPoint
	rs("Stars")			= Stars
	rs("UpdateTime")	= UpdateTime
	rs("OnTop")			= OnTop
	rs("Hot")			= Hot
	rs("Elite")			= Elite
	rs("IsDownLoad")	= IsDownLoad
	rs("DownLoadNum")=0
	if Passed then
		rs("Passed")	= True
		Cl.Execute_U("update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+"&sAddPoint&"," & Db.UserDataNum & "=" & Db.UserDataNum & "+1 where " & Db.UserName & "='" & Editor & "'")
	end if
End Sub
	
Sub SaveSuccessMore()
%>
<br /><br />
<table class="border" align=center width="500" border="0" cellpadding="0" cellspacing="1">
  <tr align=center> 
    <td  height="22"  align="center" class="title"><b> 
      批量添加<%=Cl.Channel_Setting(2)%>成功</b></td>
  </tr>
  <%if Not Passed then%>
  <tr class="tdbg"> 
    <td height="60" ><font color="#0000FF">注意：</font><br /> &nbsp;&nbsp;&nbsp; 
      你的<%=Cl.Channel_Setting(2)%>尚未真正发表！只有等管理员审核并通过了你的<%=Cl.Channel_Setting(2)%>后，你所添加的<%=Cl.Channel_Setting(2)%>才会发表。</td>
  </tr>
  <%end if%>
  <tr class="tdbg"> 
    <td height="5" ></td>
  </tr>
  <tr class="tdbg"> 
    <td width="350" valign="top">
	<table width="100%" border="0" cellpadding="2" cellspacing="0">
        <tr> 
          <td width="100" align="right"><strong>所属栏目：</strong></td>
          <td><%=ShowManageClassPath(ChannelID,ClassName,ParentPath,Depth)%></td>
          <td width="100" align="right"><strong><%=Cl.Channel_Setting(2)%>名称：</strong></td>
          <td><%= Cl.HTMLEncode(PhotoName) %></td>
          <td width="100" align="right"><strong><%=Cl.Channel_Setting(2)%>作者：</strong></td>
          <td><%= Cl.HTMLEncode(Author) %></td>
        </tr>
        <tr> 
          <td width="100" align="right"><strong>关 键 字：</strong></td>
          <td colspan="5"><%=Keyword%></td>
        </tr>
      </table></td>
  </tr>
  <tr class="tdbg"> 
    <td height="40" align="center">【<a href="Admin_Photo.asp?Action=AddMore&ChannelID=<%=ChannelID%>">继续批量添加<%=Cl.Channel_Setting(2)%>数据</a>】&nbsp;【<a href="Admin_Photo.Asp?ChannelID=<%=ChannelID%>"><%=Cl.Channel_Setting(2)%>管理</a>】</td>
  </tr>
</table>
<%
end sub
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│														 │
'│		CreateLive CMS Version 3.1						 │
'│　　　　　　　　				Powered by Aspoo.CN	 	 │
'│　		　　　　　　　　　　						 │
'│　	邮箱: aspoo@126.com			Info@aspoo.cn　　	 │
'│		ＱＱ: 3315263				596197794			 │
'│		网站: www.aspoo.cn			www.aspoo.com		 │
'│		论坛: bbs.aspoo.cn			bbs.aspoo.com		 │
'│														 │
'│	Copyright (C) 2005 Aspoo.CN All Rights Reserved.	 │
'└───────────────────────────────────────────────────────┘
'-->
%>
