<%@ LANGUAGE = VBScript.Encode %>
<!--#include file="../Include/conn.asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="Admin_htmlconfig.asp"-->
<!--#include file="../Include/RemoteImg_save.asp"-->
<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方客服中心 http://www.ip126.com
'微信公众号 ip126com
'QQ:530051328 mail:bbfhq@163.com
'=====================================
%>
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="ContentCH-Type" ContentCH="text/html; charset=gb2312" />
<TITLE>新闻编辑</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>

<!--kindeditor编辑器-->
		<link rel="stylesheet" href="../KindEditor/themes/default/default.css" />
		<script charset="utf-8" src="../KindEditor/kindeditor.js"></script>
		<script charset="utf-8" src="../KindEditor/lang/zh_CN.js"></script>
		<script>
		KindEditor.ready(function(K) {
				K.create('#editor_ch', {
					urlType : 'absolute',
					afterBlur: function(){this.sync();},//失去焦点执行this获得值					
					uploadJson : '../KindEditor/asp/upload_json.asp?action=news'
				});
				K.create('#editor_en', {
					urlType : 'absolute',
					afterBlur: function(){this.sync();},//失去焦点执行this获得值					
					uploadJson : '../KindEditor/asp/upload_json.asp?action=news'
				});
		});
	</script>
<!--kindeditor编辑器END-->

<script language = "JavaScript">
function CheckForm()
{
	if (document.editForm.NewsNameCH.value.length == 0) {
		alert("中文标题没有填写.");
		document.editForm.NewsNameCH.focus();
		return false;
	}
	<%if chinato=1 then%>
	if (document.editForm.NewsNameEN.value.length == 0) {
		alert("英文标题没有填写.");
		document.editForm.NewsNameEN.focus();
		return false;
	}
	<%end if%>
	if (document.editForm.SeoKeywordsCH.value.length == 0) {
		alert("中文MetaKeywords没有填写.");
		document.editForm.SeoKeywordsCH.focus();
		return false;
	}
	if (document.editForm.SeoDescriptionCH.value.length == 0) {
		alert("中文SeoDescription没有填写.");
		document.editForm.SeoDescriptionCH.focus();
		return false;
	}
	<%if chinato=1 then%>
	if (document.editForm.SeoKeywordsEN.value.length == 0) {
		alert("英文MetaKeywords没有填写.");
		document.editForm.SeoKeywordsEN.focus();
		return false;
	}
	if (document.editForm.SeoDescriptionEN.value.length == 0) {
		alert("英文SeoDescription没有填写.");
		document.editForm.SeoDescriptionEN.focus();
		return false;
	}
	<%end if%>
	if (document.editForm.SortNameCH.value.length == 0) {
		alert("文章类别没有填写.");
		document.editForm.SortNameCH.focus();
		return false;
	}
	if (document.editForm.authorCH.value.length == 0) {
		alert("中文新闻作者没有填写.");
		document.editForm.authorCH.focus();
		return false;
	}
	<%if chinato=1 then%>
	if (document.editForm.authorEN.value.length == 0) {
		alert("英文新闻作者没有填写.");
		document.editForm.authorEN.focus();
		return false;
	}
	<%end if%>
	if (document.editForm.SourceCH.value.length == 0) {
		alert("中文新闻来源没有填写.");
		document.editForm.SourceCH.focus();
		return false;
	}
	<%if chinato=1 then%>
	if (document.editForm.SourceEN.value.length == 0) {
		alert("英文新闻来源没有填写.");
		document.editForm.SourceEN.focus();
		return false;
	}
	<%end if%>
var editor_ch=KindEditor.create('#editor_ch');
if (editor_ch.isEmpty())
	{
	  alert("请填中文内容！")	  
	  return false
	 }
	<%if chinato=1 then%>
var editor_en=KindEditor.create('#editor_en');
if (editor_en.isEmpty())
	{
	  alert("请填英文内容！")	  
	  return false
	 }
	<%end if%>  
	return true;
}
</script>
</HEAD>

<BODY>
<%
if Instr(session("AdminPurview"),"|8,")=0 then
  response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
  response.end
end if
dim Result
Result=request.QueryString("Result")
dim ID,NewsNameCh,NewsNameEn,ViewFlagCh,ViewFlagEn,SortNameCh,SortID,SortPath,titlecolor
dim GroupID,GroupIdName,Exclusive,CommendFlag,TopFlag,authorCh,authorEn,SourceCh,SourceEn,ContentCh,ContentEn,SeoKeywordsCH,SeoKeywordsEN,SeoDescriptionCH,SeoDescriptionEN
ID=request.QueryString("ID")
call NewsEdit()
call AdminSiteInfo'读出网站配置
%>
<br>
<form name="editForm" method="post" action="NewsEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>" onSubmit="return CheckForm()">
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">  
    <tr>
      <th height="22" colspan="2">【<%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>新闻】</th>
    </tr>
    <tr>
      <td width="20%" align="right" class="forumRow">中文标题：</td>
      <td width="80%" class="forumRowHighlight"><input name="NewsNameCH" type="text" id="NewsNameCH" style="width: 280" value="<%=NewsNameCH%>" maxlength="100">
        是否显示：<input name="ViewFlagCH" type="checkbox" value="1" checked <%if ViewFlagCH then response.write ("checked")%>>
        <font color="red">*</font> </td>
    </tr>
	<%if chinato=1 then%>
    <tr>
      <td width="20%" align="right" class="forumRow">英文标题：</td>
      <td width="80%" class="forumRowHighlight"><input name="NewsNameEN" type="text" id="NewsNameEN" style="width: 280" value="<%=NewsNameEN%>" maxlength="100">
        是否显示：<input name="ViewFlagEN" type="checkbox" id="ViewFlagEN" value="1" <%if ViewFlagCH then response.write ("checked")%>>
        </td>
    </tr>
	<%End if%>
    <tr>
      <td align="right" class="forumRow">标题颜色：</td>
      <td class="forumRowHighlight"><font face="宋体">
          
          <select name="titlecolor" >
            <option style="COLOR: black" value="0" selected>不使用 </option>
            <option style="background: #000088" value="000088" <% if titlecolor="000088" Then Response.write("Selected") %>> </option>
            <option style="background: #0000ff" value="0000ff" <% if titlecolor="0000ff" Then Response.write("Selected") %>> </option>
            <option style="background: #008800" value="008800" <% if titlecolor="008800" Then Response.write("Selected") %>> </option>
            <option style="background: #008888" value="008888" <% if titlecolor="008888" Then Response.write("Selected") %>> </option>
            <option style="background: #0088ff" value="0088ff" <% if titlecolor="0088ff" Then Response.write("Selected") %>> </option>
            <option style="background: #00a010" value="00a010" <% if titlecolor="00a010" Then Response.write("Selected") %>> </option>
            <option style="background: #1100ff" value="1100ff" <% if titlecolor="1100ff" Then Response.write("Selected") %>> </option>
            <option style="background: #111111" value="111111" <% if titlecolor="111111" Then Response.write("Selected") %>> </option>
            <option style="background: #333333" value="333333" <% if titlecolor="333333" Then Response.write("Selected") %>> </option>
            <option style="background: #50b000" value="50b000" <% if titlecolor="50b000" Then Response.write("Selected") %>> </option>
            <option style="background: #880000" value="880000" <% if titlecolor="880000" Then Response.write("Selected") %>> </option>
            <option style="background: #8800ff" value="8800ff" <% if titlecolor="8800ff" Then Response.write("Selected") %>> </option>
            <option style="background: #888800" value="888800" <% if titlecolor="888800" Then Response.write("Selected") %>> </option>
            <option style="background: #888888" value="888888" <% if titlecolor="888888" Then Response.write("Selected") %>> </option>
            <option style="background: #8888ff" value="8888ff" <% if titlecolor="8888ff" Then Response.write("Selected") %>> </option>
            <option style="background: #aa00cc" value="aa00cc" <% if titlecolor="aa00cc" Then Response.write("Selected") %>> </option>
            <option style="background: #aaaa00" value="aaaa00" <% if titlecolor="aaaa00" Then Response.write("Selected") %>> </option>
            <option style="background: #ccaa00" value="ccaa00" <% if titlecolor="ccaa00" Then Response.write("Selected") %>> </option>
            <option style="background: #ff0000" value="ff0000" <% if titlecolor="ff0000" Then Response.write("Selected") %>> </option>
            <option style="background: #ff0088" value="ff0088" <% if titlecolor="ff0088" Then Response.write("Selected") %>> </option>
            <option style="background: #ff00ff" value="ff00ff" <% if titlecolor="ff00ff" Then Response.write("Selected") %>> </option>
            <option style="background: #ff8800" value="ff8800" <% if titlecolor="ff8800" Then Response.write("Selected") %>> </option>
            <option style="background: #ff0005" value="ff0005" <% if titlecolor="ff0005" Then Response.write("Selected") %>> </option>
            <option style="background: #ff88ff" value="ff88ff" <% if titlecolor="ff88ff" Then Response.write("Selected") %>> </option>
            <option style="background: #ee0005" value="ee0005" <% if titlecolor="ee0005" Then Response.write("Selected") %>> </option>
            <option style="background: #ee01ff" value="ee01ff" <% if titlecolor="ee01ff" Then Response.write("Selected") %>> </option>
            <option style="background: #3388aa" value="3388aa" <% if titlecolor="3388aa" Then Response.write("Selected") %>> </option>
            <option style="background: #000000" value="000000" <% if titlecolor="000000" Then Response.write("Selected") %>> </option>
          </select>
         
        </font></td>
    </tr>	
    <tr>
      <td align="right" class="forumRow">中文MetaKeywords：</td>
      <td class="forumRowHighlight"><input name="SeoKeywordsCH" type="text" id="SeoKeywordsCH" style="width: 400" value="<%=SeoKeywordsCH%>" maxlength="250"> <input type="button" name="btn" value="从标题复制" title="复制标题到中文：MetaDescription、MetaKeywords" onClick="CopyWebTitleCH(document.editForm.NewsNameCH.value);"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">中文MetaDescription：</td>
      <td class="forumRowHighlight"><input name="SeoDescriptionCH" type="text" id="SeoDescriptionCH" style="width: 400" value="<%=SeoDescriptionCH%>" maxlength="250"></td>
    </tr>
	<%if chinato=1 then%>
    <tr>
      <td align="right" class="forumRow">英文MetaKeywords：</td>
      <td class="forumRowHighlight"><input name="SeoKeywordsEN" type="text" id="SeoKeywordsEN" style="width: 400" value="<%=SeoKeywordsEN%>" maxlength="250"> <input type="button" name="btn2" value="从标题复制" title="复制标题到英文：MetaDescription、MetaKeywords" onClick="CopyWebTitleEN(document.editForm.NewsNameEN.value);"></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">英文MetaDescription：</td>
      <td class="forumRowHighlight"><input name="SeoDescriptionEN" type="text" id="SeoDescriptionEN" style="width: 400" value="<%=SeoDescriptionEN%>" maxlength="250"></td>
    </tr>
	<%End if%>
    <tr>
      <td align="right" class="forumRow">新闻类别：</td>
      <td class="forumRowHighlight"><input name="SortID" type="text" id="SortID" style="width: 18; background-color:#fffff0" value="<%=SortID%>" readonly> <input name="SortPath" type="text" id="SortPath" style="width: 70; background-color:#fffff0" value="<%=SortPath%>" readonly> <input name="SortNameCH" type="text" id="SortNameCH" value="<%=SortNameCH%>" style="width: 180; background-color:#fffff0" readonly> <a href="javaScript:OpenScript('SelectSort.asp?Result=News',500,500,'')">点此选择类别</a> <font color="red">*</font></td>
    </tr>
    <tr>
      <td align="right" class="forumRow">中文新闻作者：</td>
      <td class="forumRowHighlight"><input name="authorCH" type="text" style="width: 280;" value="<%=authorCH%>" maxlength="100"> &lt;= <%If session("authorCH")<>"" Then response.write "<a href=""javascript:"" onClick=""document.editForm.authorCH.value='"&session("authorCH")&"'"">【"&session("authorCH")&"】</a>"%> <a href="javascript:" onClick="document.editForm.authorCH.value='<%=session("AdminName")%>'">【<%=session("AdminName")%>】</a> 【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="authorCH.value='站长'" 
      color=#993300>站长</FONT></FONT>】【<FONT 
      color=blue><FONT style="CURSOR: hand" onclick='authorCH.value="未知"' 
      color=#993300>未知</FONT></FONT>】【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="authorCH.value='佚名'" 
      color=#993300>佚名</FONT></FONT>】</td>
    </tr>
	<%if chinato=1 then%>
    <tr>
      <td align="right" class="forumRow">英文新闻作者：</td>
      <td class="forumRowHighlight"><input name="authorEN" type="text" id="authorEN" style="width: 280;" value="<%=authorEN%>" maxlength="100"> &lt;= <%If session("authorEN")<>"" Then response.write "<a href=""javascript:"" onClick=""document.editForm.authorEN.value='"&session("authorEN")&"'"">【"&session("authorEN")&"】</a>"%> <a href="javascript:" onClick="document.editForm.authorEN.value='<%=session("AdminName")%>'">【<%=session("AdminName")%>】</a> 【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="authorEN.value='webmaster'" 
      color=#993300>webmaster</FONT></FONT>】【<FONT 
      color=blue><FONT style="CURSOR: hand" onclick='authorEN.value="unknown"' 
      color=#993300>unknown</FONT></FONT>】【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="authorEN.value='anonymous'" 
      color=#993300>anonymous</FONT></FONT>】</td>
    </tr>
	<%End if%>
    <tr>
      <td align="right" class="forumRow">中文新闻来源：</td>
      <td class="forumRowHighlight"><input name="SourceCH" type="text" style="width: 280;" value="<%=SourceCH%>" maxlength="100"> &lt;= <%If session("SourceCH")<>"" Then response.write "<a href=""javascript:"" onClick=""document.editForm.SourceCH.value='"&session("SourceCH")&"'"">【"&session("SourceCH")&"】</a>"%> <a href="javascript:" onClick="document.editForm.SourceCH.value='<%=AdminComNameCH%>'">【<%=AdminComNameCH%>】</a> 【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="SourceCH.value='因特网'" 
      color=#993300>因特网</FONT></FONT>】</td>
    </tr>
	<%if chinato=1 then%>
    <tr>
      <td align="right" class="forumRow">英文新闻来源：</td>
      <td class="forumRowHighlight"><input name="SourceEN" type="text" id="SourceEN" style="width: 280;" value="<%=SourceEN%>" maxlength="100"> &lt;= <%If session("SourceEN")<>"" Then response.write "<a href=""javascript:"" onClick=""document.editForm.SourceEN.value='"&session("SourceEN")&"'"">【"&session("SourceEN")&"】</a>"%> <a href="javascript:" onClick="document.editForm.SourceEN.value='<%=AdminComNameEN%>'">【<%=AdminComNameEN%>】</a> 【<FONT color=blue><FONT 
      style="CURSOR: hand" onclick="SourceEN.value='Internet'" 
      color=#993300>Internet</FONT></FONT>】</td>
    </tr>
	<%End if%>
      <tr>
        <td width="20%" align="right" class="forumRow">状　　态：</td>
        <td width="80%" class="forumRowHighlight"><input name="CommendFlag" type="checkbox" style="HEIGHT: 13px;WIDTH: 13px;" value="1" <%if CommendFlag then response.write ("checked")%>>
          &nbsp;推荐&nbsp;<input name="TopFlag" type="checkbox" value="1" style="HEIGHT: 13px;WIDTH: 13px;" <%if TopFlag then response.write ("checked")%>>&nbsp;置顶</td>
      </tr>
	  <tr>
      <td align="right" class="forumRow">阅读权限：</td>
      <td class="forumRowHighlight"><select name="GroupID">
          <% call SelectGroup() %>
        </select>
        <input name="Exclusive" type="radio" value="&gt;=" <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>>
        隶属
        <input type="radio" <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">
        专属（隶属：权限值≥可查看，专属：权限值＝可查看）</td>
    </tr>
    <tr>
      <td align="right" class="forumRow">中文内容：</td>
      <td class="forumRowHighlight"><textarea id="editor_ch" name="ContentCH" style="width:670px;height:400px;"><%=ContentCH%></textarea></td>
    </tr>
	<%if chinato=1 then%>
	<tr>
      <td align="right" class="forumRow">英文内容：</td>
      <td class="forumRowHighlight"><textarea id="editor_en" name="ContentEN" style="width:670px;height:400px;"><%=ContentEN%></textarea></td>
    </tr>
	<%End if%>
    <tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input type="checkbox" name="T_SaveImg" value="1" /> 保存内容中远程图片到本地&nbsp;&nbsp;<input type="checkbox" name="AspJpeg" value="1" checked/>给上传图片加水印&nbsp;（<font color="red">注:<%if Result="Modify" then%>当距发布时间超过<%=Watermark_interval%>分钟时去掉勾确保图片不重复加水印。<%end if%>上传图片等宽度勿超760像素，否则页面变形</font>）</td>
    </tr>
	<tr>
      <td align="right" class="forumRow"></td>
      <td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" value="保存"> <input type="button" value="返回上一页" onClick="history.back(-1)"></td>
    </tr>
  </form>
</table>
</BODY>
</HTML>
<%
sub NewsEdit()
  dim Action,rsRepeat,rs,sql
  Action=request.QueryString("Action")
  if Action="SaveEdit" then'保存
  ContentCh=trim(Request.Form("ContentCh"))
  ContentEn=trim(Request.Form("ContentEn"))
    set rs = server.createobject("adodb.recordset")
    if len(trim(request.Form("NewsNameCH")))<1 then
      Call Alert ("中文标题为必填项目！","-1")
      response.end
    end if
    if request.Form("ViewFlagEn")=1 then
      if len(trim(request.Form("NewsNameEn")))<1 then
      Call Alert ("英文标题为必填项目！","-1")
      response.end
      end if
    end If

    


    if Result="Add" then'----------------添加
	session("SourceCH")=request.form("SourceCH")
    session("SourceEN")=request.form("SourceEN")
	  sql="select * from TianTianCMS_Article"
      rs.open sql,conn,1,3
      rs.addnew
      rs("NewsNameCh")=trim(Request.Form("NewsNameCh"))
      rs("NewsNameEn")=trim(Request.Form("NewsNameEn"))
	  if Request.Form("ViewFlagCh")=1 then
        rs("ViewFlagCh")=Request.Form("ViewFlagCh")
	  else
        rs("ViewFlagCh")=0
	  end if
	  if Request.Form("ViewFlagEn")=1 then
        rs("ViewFlagEn")=Request.Form("ViewFlagEn")
	  else
        rs("ViewFlagEn")=0
	  end if
	  if Request.Form("SortID")="" and Request.Form("SortPath")="" then
        Call Alert ("请选择所属分类！","-1")
        response.end
	  else
	    rs("SortID")=Request.Form("SortID")
		rs("SortPath")=Request.Form("SortPath")
	  end If
	  rs("authorCh")=trim(Request.Form("authorCh"))
	  rs("authorEn")=trim(Request.Form("authorEn"))	 	  
	  rs("SourceCh")=trim(Request.Form("SourceCh"))
	  rs("SourceEn")=trim(Request.Form("SourceEn"))	  
	  rs("ContentCh")=ContentCh
	  rs("ContentEn")=ContentEn
	  if Request.Form("CommendFlag")=1 then
        rs("CommendFlag")=Request.Form("CommendFlag")
	  else
        rs("CommendFlag")=0
	  end If
      if Request.Form("TopFlag")=1 then
		rs("TopFlag")=Request.Form("TopFlag")
      else
		rs("TopFlag")=0
      end if  
      GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
	  rs("GroupID")=GroupIdName(0)
	  rs("Exclusive")=trim(Request.Form("Exclusive"))	  
	  rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
	  rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
	  rs("SeoKeywordsEN")=trim(Request.Form("SeoKeywordsEN"))
	  rs("SeoDescriptionEN")=trim(Request.Form("SeoDescriptionEN"))
	  rs("titlecolor")=Request.Form("titlecolor")	  
	  rs("UpdateTime")=now()
	  rs("AddTime")=now()
	  rs.update
	  rs.close
	  set rs=Nothing
	  set rs=server.createobject("adodb.recordset")
	  sql="select top 1 ID from TianTianCMS_Article order by ID desc"
	  rs.open sql,conn,1,1
	  ID=rs("ID")
	  rs.close
	  set rs=Nothing
	  if ISHTML = 1 then
	  call html2("/CH/html/","/CH/",""&NewName&""&Separated&""&ID&"."&HTMLName&"","ArticleShow.Asp","ID=",ID,"","")
	  if chinato=1 then call html2("/EN/html/","/EN/",""&NewName&""&Separated&""&ID&"."&HTMLName&"","ArticleShow.Asp","ID=",ID,"","")
	  End If
	end if'----------------添加END

	if Result="Modify" then'----------------修改
      sql="select * from TianTianCMS_Article where ID="&ID
      rs.open sql,conn,1,3
      rs("NewsNameCh")=trim(Request.Form("NewsNameCh"))
      if chinato=1 then rs("NewsNameEn")=trim(Request.Form("NewsNameEn"))
	  if Request.Form("ViewFlagCh")=1 then
        rs("ViewFlagCh")=Request.Form("ViewFlagCh")
	  else
        rs("ViewFlagCh")=0
	  end if
	  if Request.Form("ViewFlagEn")=1 then
        if chinato=1 then rs("ViewFlagEn")=Request.Form("ViewFlagEn")
	  else
        if chinato=1 then rs("ViewFlagEn")=0
	  end if
	  if Request.Form("SortID")<>"" and Request.Form("SortPath")<>"" then
	    rs("SortID")=Request.Form("SortID")
		rs("SortPath")=Request.Form("SortPath")
	  Else
	  Call Alert ("请选择所属分类！","-1")        
        response.end
	  end If
	  rs("authorCh")=trim(Request.Form("authorCh"))
	  if chinato=1 then rs("authorEn")=trim(Request.Form("authorEn"))		  
	  rs("SourceCh")=trim(Request.Form("SourceCh"))
	  if chinato=1 then rs("SourceEn")=trim(Request.Form("SourceEn"))	  
	  if Request.Form("CommendFlag")=1 then
        rs("CommendFlag")=Request.Form("CommendFlag")
	  else
        rs("CommendFlag")=0
	  end If
      if Request.Form("TopFlag")=1 then
		rs("TopFlag")=Request.Form("TopFlag")
      else
		rs("TopFlag")=0
      end if	
      GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
	  rs("GroupID")=GroupIdName(0)
	  rs("Exclusive")=trim(Request.Form("Exclusive"))
	  rs("ContentCh")=ContentCh
	  if chinato=1 then rs("ContentEn")=ContentEn
	  rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
	  rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
	  if chinato=1 then rs("SeoKeywordsEN")=trim(Request.Form("SeoKeywordsEN"))
	  if chinato=1 then rs("SeoDescriptionEN")=trim(Request.Form("SeoDescriptionEN"))
	  rs("titlecolor")=Request.Form("titlecolor")
	  rs("UpdateTime")=now()
	  rs.update
	  rs.close
	  set rs=Nothing
	  if ISHTML = 1 then
	  call html2("/CH/html/","/CH/",""&NewName&""&Separated&""&ID&"."&HTMLName&"","ArticleShow.Asp","ID=",ID,"","")	  
	  if chinato=1 then call html2("/EN/html/","/EN/",""&NewName&""&Separated&""&ID&"."&HTMLName&"","ArticleShow.Asp","ID=",ID,"","")	  
	  End If
	end If'----------------修改END
	
    if ISHTML = 1 then
    response.write "<script language='javascript'>alert('设置成功，接着生成相关静态页！');location.replace('Admin_htmlindex.asp?htmlsc=Admin_htmlnewsort.asp');</script>"
	'response.write "<script language='javascript'>alert('设置成功，相关静态页面已更新！');location.replace('NewsEdit.asp?Result="&request.QueryString("Result")&"&ID="&id&"');</script>"
	Else
	response.write "<script language='javascript'>alert('设置成功！');location.replace('NewsEdit.asp?Result="&request.QueryString("Result")&"&ID="&id&"');</script>"
	End If
  else'编辑
	if Result="Modify" then
      set rs = server.createobject("adodb.recordset")
      sql="select * from TianTianCMS_Article where ID="& ID
      rs.open sql,conn,1,1
      if rs.bof and rs.eof then
        response.write ("<center>数据库记录读取错误！</center>")
        response.end
      end if
	  NewsNameCh=rs("NewsNameCh")
	  NewsNameEn=rs("NewsNameEn")
	  ViewFlagCh=rs("ViewFlagCh")
	  ViewFlagEn=rs("ViewFlagEn")
	  SortNameCh=SortText(rs("SortID"))
	  SortID=rs("SortID")
	  SortPath=rs("SortPath")
	  authorCh=rs("authorCh")
	  authorEn=rs("authorEn")
	  SourceCh=rs("SourceCh")
	  SourceEn=rs("SourceEn")
	  CommendFlag=rs("CommendFlag")
	  TopFlag=rs("TopFlag")
	  GroupID=rs("GroupID")
	  Exclusive=rs("Exclusive")
      ContentCh=rs("ContentCh")
      ContentEn=rs("ContentEn")
	  SeoKeywordsCH=rs("SeoKeywordsCH")
	  SeoDescriptionCH=rs("SeoDescriptionCH")
	  SeoKeywordsEN=rs("SeoKeywordsEN")
	  SeoDescriptionEN=rs("SeoDescriptionEN")
	  titlecolor=rs("titlecolor")
	  rs.close
      set rs=nothing
    end if
  end If  
end Sub

sub SelectGroup()'阅读权限
  dim rs,sql
  set rs = server.createobject("adodb.recordset")
  sql="select GroupID,GroupNameCH from TianTianCMS_MemGroup"
  rs.open sql,conn,1,1
  if rs.bof and rs.eof then
    response.write("未设组别")
  end if
  while not rs.eof
    response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupNameCH")&"'")
    if GroupID=rs("GroupID") then response.write ("selected")
    response.write(">"&rs("GroupNameCH")&"</option>")
    rs.movenext
  wend
  rs.close
  set rs=nothing
end sub

Function SortText(ID)'获得分类名称
  Dim rs,sql
  Set rs=server.CreateObject("adodb.recordset")
  sql="Select * From TianTianCMS_ArticleCategory where ID="&ID
  rs.open sql,conn,1,1
  SortText=rs("SortNameCH")
  rs.close
  set rs=nothing
End Function
%>