<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Function.asp" -->
<!--#include file="../Refresh/Function.asp" -->
<!--#include file="../Refresh/RefreshFunction.asp" -->
<!--#include file="../Refresh/SelectFunction.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
    Dim TempClassID,OldClassObj,OldClassEName,TTempExtStr,i,RsNewsModObj,TempNewsID,TempSpecialID,SpecialArr,SpecialTextArr,SpecialTextObj
		TempNewsID = Request("NewsID")
		Set RsNewsModObj = Conn.Execute("Select * From News where NewsID='"&TempNewsID&"'")
		if Not JudgePopedomTF(Session("Name"),""&RsNewsModObj("ClassID")&"") then Call ReturnError()
		if Not JudgePopedomTF(Session("Name"),"P0110") then Call ReturnError()
		If RsNewsModObj.eof then
		   Response.Write("<script>alert(""参数传递错误"");dialogArguments.location.reload();window.close();</script>")
		   Response.End
	    End If
	    TempClassID = RsNewsModObj("ClassID")
		TempSpecialID = RsNewsModObj("SpecialID")
		TTempExtStr = RsNewsModObj("FileExtName")
		if TempSpecialID<>"" or isnull(TempSpecialID)=false then
			SpecialArr = array("")
			SpecialArr = split(TempSpecialID,",")
			SpecialTextArr = ""
			For i=0 to Ubound(SpecialArr)
				Set SpecialTextObj = Conn.Execute("Select CName From Special where SpecialID='"&SpecialArr(i)&"'")
				if Not SpecialTextObj.Eof then
					If SpecialTextArr <> "" then
						SpecialTextArr = SpecialTextArr &","& SpecialTextObj("CName")
					Else
						SpecialTextArr = SpecialTextArr & SpecialTextObj("CName")
					End if
			    end if
				SpecialTextObj.Close
			Next
		else
			SpecialTextArr = ""
		end if
	Dim DummyPath_Riker
	If SysRootDir<>"" then
		DummyPath_Riker = "/" & SysRootDir
	Else
		DummyPath_Riker = ""
	End If

    Set OldClassObj = Conn.Execute("select ClassID,ClassEName from NewsClass where ClassID='"&TempClassID&"'")
	if Not OldClassObj.Eof then
		OldClassEName = OldClassObj("ClassEName")
	end if
	OldClassObj.Close
	Set OldClassObj = Nothing
	
dim TempClassListStr
TempClassListStr = ClassList
Function ClassList()
	Dim ClassListObj,SelectStr
	Set ClassListObj = Conn.Execute("select * from newsclass where ParentID = '0'")
	do while Not ClassListObj.Eof
		if OldClassEName = ClassListObj("ClassEName") then
			SelectStr = "selected"
		else
			SelectStr = ""
		end if
		ClassList = ClassList & "<option " & SelectStr & " value="&ClassListObj("ClassID")&"" & ">" & ClassListObj("ClassCName") & "</option><br>"
		ClassList = ClassList & ChildClassList(ClassListObj("ClassID"),"")
		ClassListObj.MoveNext	
	loop
	ClassListObj.Close
	Set ClassListObj = Nothing
End Function

Function ChildClassList(ClassID,Temp)
	Dim TempRs,TempStr,SelectStr
	Set TempRs = Conn.Execute("Select * from NewsClass where ParentID = '" & ClassID & "'")
	TempStr = Temp & " - "
	do while Not TempRs.Eof
		if OldClassEName = TempRs("ClassEName") then
			SelectStr = "selected"
		else
			SelectStr = ""
		end if
		if TempRs("ChildNum") = 0 then
			ChildClassList = ChildClassList & "<option " & SelectStr & " value="&TempRs("ClassID")&"" & ">" & TempStr & TempRs("ClassCName") & "</option><br>"
		else
			ChildClassList = ChildClassList & "<option " & SelectStr & " value="&TempRs("ClassID")&"" & ">" & TempStr & TempRs("ClassCName") & "</option><br>"
		end if
		ChildClassList = ChildClassList & ChildClassList(TempRs("ClassID"),TempStr)
		TempRs.MoveNext
	loop
	TempRs.Close
	Set TempRs = Nothing
End Function
	
Dim NewsContent
    If Request.Form("Content")<>"" then
		NewsContent = Replace(Replace(Request.Form("Content"),"""","%22"),"'","%27")
	Else
		NewsContent = Replace(Replace(RsNewsModObj("Content"),"""","%22"),"'","%27")
	End If
%>
<html>
<head>
<link href="../Inc/ModeWindow.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻修改</title>
</head>
<script language="JavaScript" src="../JS/PublicJS.js"></script>
<body>
<form action="" name="NewsForm" method="post">
  <table width="100%" border="0" cellspacing="4" cellpadding="0">
    <tr> 
      <td height="5" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><div align="center">并排<input name="SBSNews" type="checkbox" id="SBSNews" value="1" <%if RsNewsModObj("SBSNews")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">滚动<input name="MarqueeNews" type="checkbox" id="MarqueeNews2" value="1" <%if RsNewsModObj("MarqueeNews")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">允许评论<input name="ReviewTF" type="checkbox" id="ReviewTF2" value="1" onClick="ChooseRiview();" <%if RsNewsModObj("ReviewTF")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">显示评论<input name="ShowReviewTF" type="checkbox" id="ShowReviewTF2" value="1" disabled <%if RsNewsModObj("ShowReviewTF")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">公告<input name="ProclaimNews" type="checkbox" id="ProclaimNews2" value="1" <%if RsNewsModObj("ProclaimNews")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">推荐<input name="RecTF" type="checkbox" id="RecTF" value="1" <%if RsNewsModObj("RecTF")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">审核<input name="AuditTF" type="checkbox" id="AuditTF" value="1" <%if RsNewsModObj("AuditTF")="0" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">内部链接<input name="LinkTF" type="checkbox" id="LinkTF" value="1" <%if RsNewsModObj("LinkTF")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">投稿<input name="ManuTF" type="checkbox" id="ManuTF" value="1" <%if RsNewsModObj("ManuTF")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">远程存图<input type="checkbox" name="SavePic" value="1" <%if Request("SavePic")="1" then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">幻灯<input name="FilterNews" type="checkbox" id="FilterNews" value="1" <%if RsNewsModObj("FilterNews")=1 then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">焦点<input name="FocusNewsTF" type="checkbox" id="FocusNewsTF" value="1" <%if RsNewsModObj("FocusNewsTF")=1 then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">精彩<input name="ClassicalNewsTF" type="checkbox" id="ClassicalNewsTF" value="1" <%if RsNewsModObj("ClassicalNewsTF")=1 then Response.Write("checked") end if%>>
              </div></td>
            <td><div align="center">头条<input name="TodayNewsTF" type="checkbox" id="TodayNewsTF" value="1" <%if RsNewsModObj("TodayNewsTF")=1 then Response.Write("checked") end if%>>
              </div></td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="9%"><div align="right">新闻标题</div></td>
      <td colspan="3"> <input name="Title" type="text" id="Title" style="width:95%" value="<%=RsNewsModObj("Title")%>"></td>
    </tr>
    <tr> 
      <td><div align="right">标题颜色</div></td>
      <td width="38%"><select name="TitleColor" id="select">
          <option value="#UUUUUU" <%if InStr(1, RsNewsModObj("TitleStyle"),"#UUUUUU" ,1)<>0 then response.Write("selected") %>>字体颜色</option>
          <option value="#ff0000" style="background-color:#ff0000;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#ff0000" ,1)<>0 then response.Write("selected") %>>#ff0000</option>
          <option value="#000000" style="background-color:#000000;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#000000" ,1)<>0 then response.Write("selected") %>>#000000</option>
          <option value="#FFFFFF" style="background-color:#ffffff;color: #000000" <%if InStr(1, RsNewsModObj("TitleStyle"),"#FFFFFF" ,1)<>0 then response.Write("selected") %>>#FFFFFF</option>
          <option value="#000099" style="background-color:#000099;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#000099" ,1)<>0 then response.Write("selected") %>>#000099</option>
          <option value="#660066" style="background-color:#660066;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#660066" ,1)<>0 then response.Write("selected") %>>#660066</option>
          <option value="#FF6600" style="background-color:#FF6600;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#FF6600" ,1)<>0 then response.Write("selected") %>>#FF6600</option>
          <option value="#666666" style="background-color:#666666;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#666666" ,1)<>0 then response.Write("selected") %>>#666666</option>
          <option value="#009900" style="background-color:#009900;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#009900" ,1)<>0 then response.Write("selected") %>>#009900</option>
          <option value="#0066CC" style="background-color:#0066CC;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#0066CC" ,1)<>0 then response.Write("selected") %>>#0066CC</option>
          <option value="#990000" style="background-color:#990000;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#990000" ,1)<>0 then response.Write("selected") %>>#990000</option>
          <option value="#CC9900" style="background-color:#CC9900;color: #ffffff" <%if InStr(1, RsNewsModObj("TitleStyle"),"#CC9900" ,1)<>0 then response.Write("selected") %>>#CC9900</option>
          <option value="#CCCCCC" style="background-color:#CCCCCC;color: #000000" <%if InStr(1, RsNewsModObj("TitleStyle"),"#CCCCCC" ,1)<>0 then response.Write("selected") %>>#CCCCCC</option>
          <option value="#99FF00" style="background-color:#99FF00;color: #000000" <%if InStr(1, RsNewsModObj("TitleStyle"),"#99FF00" ,1)<>0 then response.Write("selected") %>>#99FF00</option>
          <option value="#0000FF" style="background-color:#0000FF;color: #FFFFFF" <%if InStr(1, RsNewsModObj("TitleStyle"),"#0000FF" ,1)<>0 then response.Write("selected") %>>#0000FF</option>
          <option value="#9966CC" style="background-color:#9966CC;color: #FFFFFF" <%if InStr(1, RsNewsModObj("TitleStyle"),"#9966CC" ,1)<>0 then response.Write("selected") %>>#9966CC</option>
        </select>
        　加粗 
        <input name="TitleBold" type="checkbox" id="TitleBold2" value="1" <%if Mid(RsNewsModObj("TitleStyle"),8,1)="1" then response.Write("checked")%>>
        斜体 
        <input name="Titles" type="checkbox" id="Titles2" value="1" <%if Right(trim(RsNewsModObj("TitleStyle")),1)="1" then response.Write("checked")%>></td>
      <td width="9%">副 标 题</td>
      <td width="41%"><input name="SubTitle" type="text" id="SubTitle2" style="width:90%" value="<%=RsNewsModObj("SubTitle")%>"></td>
    </tr>
    <tr> 
      <td><div align="right">所属栏目</div></td>
      <td> <select name="ClassID" id="select2" style="width:90%">
          <% =TempClassListStr %>
        </select></td>
      <td>浏览权限</td>
      <td><select name="BrowPop" id="BrowPop" style="width:90%" onChange="ChooseExeName();">
          <option value="0" selected> </option>
          <%
		Dim BrowPopObj
		Set BrowPopObj = Conn.Execute("Select Name,PopLevel from MemGroup order by PopLevel asc")
		while not BrowPopObj.eof
		%>
          <option value="<%=BrowPopObj("PopLevel")%>" <%If Cint(RsNewsModObj("BrowPop")) = Cint(BrowPopObj("PopLevel")) then Response.Write("selected") end if %>><%=BrowPopObj("Name")%></option>
          <%
		BrowPopObj.Movenext
		Wend
		BrowPopObj.Close
		Set BrowPopObj = Nothing
		%>
        </select></td>
    </tr>
    <tr> 
      <td><div align="right">新闻来源</div></td>
      <td><input name="TxtSourceText" type="text" size="24" value="<%=RsNewsModObj("TxtSource")%>"> 
        <input type="hidden" name="TxtSource" value="<%=RsNewsModObj("TxtSource")%>"> 
        <select name="SelTxtSource" style="width:27%" onChange="Dosusite(this.options[this.selectedIndex].value);">
          <option value="" selected> </option>
          <option value="<%=""&"***"&"Clean"%>" style="color:red">清空</option>
          <option value="本站原创">本站原创</option>
          <option value="不详">不详</option>
          <%
		Dim TxtSourceObj
		set TxtSourceObj = Conn.Execute("select * from Routine where Type=2 order by ID desc")
		While not TxtSourceObj.eof
		%>
          <option value="<%=TxtSourceObj("Name")&"***"&TxtSourceObj("Url")%>"><%=TxtSourceObj("Name")%></option>
          <%
		TxtSourceObj.Movenext
		Wend
		TxtSourceObj.Close
		Set TxtSourceObj = Nothing
		%>
        </select> </td>
      <td>图片地址</td>
      <td><input name="PicPath" type="text" id="PicPath" style="width:65%" value="<%=RsNewsModObj("PicPath")%>"> 
        <input type="button" name="Submit4" value="选择图片" onClick="OpenWindowAndSetValue('../inc/SelectPic.asp?CurrPath=/<% = UpFiles %>',550,290,window,document.NewsForm.PicPath);"></td>
    </tr>
    <tr> 
      <td><div align="right">所属专题</div></td>
      <td><input name="SpecialIDText" type="text" size="24" readonly value="<% = SpecialTextArr %>"> 
        <input type="hidden" name="SpecialID" value="<%=TempSpecialID%>"> <select name="SelSpecialID" style="width:27%" onChange=ChooseSpecial(this.options[this.selectedIndex].value)>
          <option value="" selected> </option>
          <option value="<%=""&"***"&"Clean"%>" style="color:red">清空</option>
          <%
		Dim SpecialIDObj
		set SpecialIDObj = Conn.Execute("Select CName,SpecialID from Special order by ID desc")
		while not SpecialIDObj.eof
		%>
          <option value="<%=SpecialIDObj("CName")&"***"&SpecialIDObj("SpecialID")%>"><%=SpecialIDObj("CName")%></option>
          <%
		SpecialIDObj.Movenext
		Wend
		SpecialIDObj.Close
		Set SpecialIDObj = Nothing
		%>
        </select></td>
      <td>新闻模板</td>
      <td><input name="NewsTemplet" type="text" id="NewsTemplet" style="width:65%" readonly value="<%=RsNewsModObj("NewsTemplet")%>"> 
        <input type="button" name="Submit" value="选择模板" onClick="OpenWindowAndSetValue('../Inc/SelectFileFrame.asp?CurrPath=/<% = TempletDir %>',400,300,window,document.NewsForm.NewsTemplet);document.NewsForm.NewsTemplet.focus();"></td>
    </tr>
    <tr> 
      <td><div align="right">关 键 字</div></td>
      <td><input name="KeywordText" type="text" size="24" value="<%=RsNewsModObj("KeyWords")%>"> 
        <input type="hidden" name="KeyWords" value="<%=RsNewsModObj("KeyWords")%>"> 
        <select name="SelKeyWords" style="width:27%" onChange=Dokesite(this.options[this.selectedIndex].value)>
          <option value="" selected> </option>
          <option value="Clean" style="color:red">清空</option>
          <%
		Dim KeyWordsObj
		set KeyWordsObj = Conn.Execute("select * from Routine where Type=1 order by ID desc")
		while not KeyWordsObj.eof
		%>
          <option value="<%=KeyWordsObj("Name")%>"><%=KeyWordsObj("Name")%></option>
          <%
		KeyWordsObj.Movenext
		Wend
		KeyWordsObj.Close
		Set KeyWordsObj = Nothing
		%>
        </select></td>
      <td>添加日期</td>
      <td><input name="AddDate" readonly type="text" id="AddDate" style="width:65%" value="<%=RsNewsModObj("AddDate")%>"> 
        <input type="button" name="Submit42" value="选择日期" onClick="OpenWindowAndSetValue('../Inc/SelectDate.asp',280,110,window,document.NewsForm.AddDate);document.NewsForm.AddDate.focus();"></td>
    </tr>
    <tr> 
      <td><div align="right">新闻作者</div></td>
      <td><input name="AuthorText" type="text" size="24" value="<%=RsNewsModObj("Author")%>"> 
        <input type="hidden" name="Author" value="<%=RsNewsModObj("Author")%>"> 
        <select name="SelAuthor" id="SelAuthor" style="width:27%" onChange="Doauthsite(this.options[this.selectedIndex].value);">
          <option value="" selected> </option>
          <option value="<%=""&"***"&"Clean"%>" style="color:red">清空</option>
          <option value="佚名">佚名</option>
          <option value="本站">本站</option>
          <option value="未知">未知</option>
          <%
		Dim AuthorObj
		set AuthorObj = Conn.Execute("select * from Routine where Type=3 order by ID desc")
		while not AuthorObj.eof
		%>
          <option value="<%=AuthorObj("Name")&"***"&AuthorObj("Url")%>"><%=AuthorObj("Name")%></option>
          <%
		AuthorObj.Movenext
		Wend
		AuthorObj.Close
		Set AuthorObj=nothing
		%>
        </select></td>
      <td>点击次数</td>
      <td><input name="ClickNum" type="text" id="ClickNum2" style="width:65%" value="<%=RsNewsModObj("ClickNum")%>">
        <select name="FileExtName" id="select3" style="width:23%" disabled>
          <option value="htm" <%If Cstr(RsNewsModObj("FileExtName"))="htm" then Response.Write("selected")%>>htm</option>
          <option value="html" <%If Cstr(RsNewsModObj("FileExtName"))="html" then Response.Write("selected")%>>html</option>
          <option value="shtm" <%If Cstr(RsNewsModObj("FileExtName"))="shtm" then Response.Write("selected")%>>shtm</option>
          <option value="shtml" <%If Cstr(RsNewsModObj("FileExtName"))="shtml" then Response.Write("selected")%>>shtml</option>
          <option value="asp" <%If Cstr(RsNewsModObj("FileExtName"))="asp" then Response.Write("selected")%>>asp</option>
        </select></td>
    </tr>
    <tr> 
      <td><div align="right">责任编辑</div></td>
      <td><input name="EditerText" type="text" size="24" value="<%=RsNewsModObj("Editer")%>"> 
        <input type="hidden" name="Editer" value="<%=RsNewsModObj("Editer")%>"> 
        <select name="Editer1" style="width:27%"  onChange="Editsite(this.options[this.selectedIndex].value);">
          <option value="" selected> </option>
          <option value="<%=""&"***"&"Clean"%>" style="color:red">清空</option>
          <%
		Dim EditerObj
		Set EditerObj = Conn.Execute("Select * from Routine where Type=4 order by ID desc")
		while not EditerObj.eof
		%>
          <option value="<%=EditerObj("Name")&"***"&EditerObj("Url")%>"><%=EditerObj("Name")%></option>
          <%
		EditerObj.Movenext
		Wend
		EditerObj.Close
		Set EditerObj = Nothing
		%>
        </select></td>
      <td>导航文字</td>
      <td><textarea name="NaviWords" rows="1" id="NaviWords" style="width:90%"><%=RsNewsModObj("NaviWords")%></textarea></td>
    </tr>
    <tr> 
      <td colspan="4"><div align="center"> 
          <iframe id='NewsContent' src='../Editer/NewsEditer.asp' frameborder=0 scrolling=no width='93%' height='360'></iframe>
        </div></td>
    </tr>
    <tr valign="top"> 
      <td height="50" colspan="4"> <div align="center"> 
          <input type="button" name="Submit2" value=" 修 改 " onClick="SubmitFun();">
          <input type="hidden" name="Content" value="<% = NewsContent %>">
          <input name="action" type="hidden" id="action" value="add">
          &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          <input type="reset" name="Submit5" value=" 还 原 ">
          &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          <input type="button" name="Submit3" value=" 取 消 " onClick="window.close();">
        </div></td>
    </tr>
  </table>
</form></body>
</html>
<script language="javascript">
 function ChooseRiview()
   {
      if (document.NewsForm.ReviewTF.checked==true)
	      {
		    document.NewsForm.ShowReviewTF.disabled=false;
		   }
      else
	      {
	        document.NewsForm.ShowReviewTF.disabled=true;
		   }
	}
	
function ChooseExeName()
{ 
  if (document.NewsForm.BrowPop.value!=0) document.NewsForm.FileExtName.disabled=true;
  else document.NewsForm.FileExtName.disabled=false;
 }

function SubmitFun()
{
	frames["NewsContent"].SaveCurrPage();
	var TempContentArray=frames["NewsContent"].NewsContentArray;
	document.NewsForm.Content.value='';
	for (var i=0;i<TempContentArray.length;i++)
	{
		if (TempContentArray[i]!='')
		{
			if (document.NewsForm.Content.value=='') document.NewsForm.Content.value=TempContentArray[i];
			else document.NewsForm.Content.value=document.NewsForm.Content.value+'[Page]'+TempContentArray[i];
		} 
	}
	document.NewsForm.submit();
}

ChooseRiview();
ChooseExeName();
</script>
<%
  if Request.Form("action")="add" then
     Dim ITitle,IClassID,INewsTemplet,IClickNum,IAddDate,INewsAddObj,INewsAddSql,TitleBoldstr,TitleUstr
     if Request.Form("Title")<>"" then
		ITitle = Replace(Replace(Request.Form("Title"),"""",""),"'","")
	 else
	    Response.Write("<script>alert('请输入新闻标题');</script>")
		Response.End
	 end if
     if Request.Form("ClassID")<>"" then
		IClassID = Replace(Replace(Request.Form("ClassID"),"""",""),"'","")
	 else
	    Response.Write("<script>alert('栏目参数传递错误');</script>")
		Response.End
	 end if
     if Request.Form("NewsTemplet")<>"" then
		INewsTemplet = Replace(Replace(Request.Form("NewsTemplet"),"""",""),"'","")
	 else
	    Response.Write("<script>alert('请选择新闻模板文件');</script>")
		Response.End
	 end if 
     if Isnumeric(Request.Form("ClickNum")) then
		IClickNum = Clng(Request.Form("ClickNum"))
	 else
	    Response.Write("<script>alert('新闻初始点击次数必须为数字类型');</script>")
		Response.End
	 end if 
	 if IsDate(Request.Form("AddDate")) then
	 	IAddDate = Formatdatetime(Request.Form("AddDate"))
	 else
	    Response.Write("<script>alert('新闻添加时间类型错误,请重新输入');</script>")
		Response.End
	 end if
	 if Request.Form("PicPath")="" then
	    Response.Write("<script>alert('新闻图片地址不能为空');</script>")
		Response.End
	 end if
	 if Request.Form("Content")="" or isnull(Request.Form("Content")) then
	    Response.Write("<script>alert('请输入新闻内容');</script>")
		Response.End
	 end if
	 Dim TempFileExtName,RsNewsConfigObj
	 if Request.Form("BrowPop") <> "0" then
	 	TempFileExtName = "asp"
	 else
	 	TempFileExtName = Cstr(Request.Form("FileExtName"))
	 end if
	 Set RsNewsConfigObj = Conn.Execute("Select DoMain from Config")
	  set INewsAddObj=server.createobject("adodb.recordset")
	  INewsAddSql="select * from News where NewsID='"&TempNewsID&"'"
	  INewsAddObj.open INewsAddSql,Conn,1,3
	  INewsAddObj("Title") =  ITitle
	  INewsAddObj("SubTitle") = Replace(Replace(Request.Form("SubTitle"),"""",""),"'","")
	  If request.form("TitleBold")<>"" then
	   		TitleBoldstr="1"		
	   else
	   		TitleBoldstr="0"		
	  end if
	  If request.form("Titles")<>"" then
	   		TitleUstr="1"		
	  else
	   		TitleUstr="0"		
	  end if
	  INewsAddObj("Titlestyle") =  Request.Form("TitleColor")&TitleBoldstr&TitleUstr
	  INewsAddObj("ClassID") =  IClassID
	  INewsAddObj("HeadNewsTF") =  "0"
	  If Request.Form("SavePic") = "1" then
		  INewsAddObj("Content") = ReplaceRemoteUrl(Request.Form("Content"),"/Files/"&BeyondPicDir,RsNewsConfigObj("DoMain"),DummyPath_Riker)
	  else
		  INewsAddObj("Content") = Request.Form("Content")
	  End If
	  if Request.Form("ManuTF")="1" then
		  INewsAddObj("ManuTF") =  "1"
	  else
		  INewsAddObj("ManuTF") =  "0"
	  end if
	  INewsAddObj("FileExtName") = TempFileExtName   '新闻文件扩展名 
	  INewsAddObj("AddDate") =  IAddDate
	  INewsAddObj("KeyWords") = Replace(Replace(Request.Form("KeywordText"),"""",""),"'","")
	  INewsAddObj("TxtSource") = Replace(Replace(Request.Form("TxtSourceText"),"""",""),"'","")
	  INewsAddObj("Author") = Replace(Replace(Request.Form("AuthorText"),"""",""),"'","")
	  INewsAddObj("Editer") = Replace(Replace(Request.Form("EditerText"),"""",""),"'","")
	  INewsAddObj("ClickNum") =  IClickNum
	  if Request.Form("RecTF") = "1" then
		  INewsAddObj("RecTF") =  "1"
	  else
		  INewsAddObj("RecTF") =  "0"
	  end if
	  INewsAddObj("SpecialID") = Replace(Replace(Request.Form("SpecialID"),"""",""),"'","")
	  if Request.Form("AuditTF") = "1" then
		  INewsAddObj("AuditTF") =  "0"
	  else
		  INewsAddObj("AuditTF") =  "1"
	  end if
	  If Request.Form("TodayNewsTF")<>"" then
		  INewsAddObj("TodayNewsTF") = 1
	  Else
		  INewsAddObj("TodayNewsTF") = 0
	  End If
	  if Request.Form("BrowPop") <> "" then
		  INewsAddObj("BrowPop") =  Replace(Replace(Request.Form("BrowPop"),"""",""),"'","")
	  end if
	  if Request.Form("ShowReviewTF") = "1" then
		  INewsAddObj("ShowReviewTF") =  "1"
	  else
		  INewsAddObj("ShowReviewTF") =  "0"
	  end if
	  if Request.Form("ReviewTF") = "1" then
		  INewsAddObj("ReviewTF") =  "1"
	  else
		  INewsAddObj("ReviewTF") =  "0"
	  end if
	  if Request.Form("SBSNews") = "1" then
		  INewsAddObj("SBSNews") =  "1"
	  else
		  INewsAddObj("SBSNews") =  "0"
	  end if
	  if Request.Form("MarqueeNews") = "1" then
		  INewsAddObj("MarqueeNews") =  "1"
	  else
		  INewsAddObj("MarqueeNews") =  "0"
	  end if
	  if Request.Form("ProclaimNews") = "1" then
		  INewsAddObj("ProclaimNews") =  "1"
	  else
		  INewsAddObj("ProclaimNews") =  "0"
	  end if
	  if Request.Form("LinkTF") = "1" then
		  INewsAddObj("LinkTF") =  "1"
	  else
		  INewsAddObj("LinkTF") =  "0"
	  end if
	  if Request.Form("FilterNews") = "1" then
		  INewsAddObj("FilterNews") =  "1"
	  Else
		  INewsAddObj("FilterNews") =  "0"
	  End if
	  If Request.Form("FocusNewsTF")<>"" then
	  	INewsAddObj("FocusNewsTF") = 1
	  Else
	  	INewsAddObj("FocusNewsTF") = 0
	  End If
	  If Request.Form("ClassicalNewsTF")<>"" then
	  	INewsAddObj("ClassicalNewsTF") = 1
	  Else
	  	INewsAddObj("ClassicalNewsTF") = 0
	  End If
	  INewsAddObj("NewsTemplet") =  INewsTemplet
	  INewsAddObj("PicPath") =  Request.Form("PicPath")
	  INewsAddObj("NaviWords") =  Request.Form("NaviWords")
	  INewsAddObj.Update
	  INewsAddObj.Close
	  Set INewsAddObj = Nothing
	  If Cstr(TTempExtStr)<>Cstr(TempFileExtName) then
		  Dim MyFile,CrHNJS,DelNewsFileObj
		  Set DelNewsFileObj = Conn.Execute("Select ClassEName,SaveFilePath from NewsClass where ClassID='"&TempClassID&"'")
			  Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
				  If MyFile.FileExists(Server.MapPath("\") & DelNewsFileObj("SaveFilePath") & "/" & DelNewsFileObj("ClassEName") & "/" & RsNewsModObj("FileName") &"."&TTempExtStr) then
					 MyFile.DeleteFile(Server.MapPath("\") & DelNewsFileObj("SaveFilePath") & "/" & DelNewsFileObj("ClassEName") & "/" & RsNewsModObj("FileName") &"."&TTempExtStr)
				  End if
			  Set MyFile=nothing
			DelNewsFileObj.Close
	  End If
	  if Request.Form("AuditTF") = "" then
	    Dim RsCreateObj
		Set DelNewsFileObj = Nothing
		Set RsCreateObj = Conn.Execute("Select * from News where NewsID='"&TempNewsID&"'")
		If Not RsCreateObj.eof then
			RefreshNews RsCreateObj 
		End if
		RsCreateObj.Close
		Set RsCreateObj = Nothing
	  end if
	  Response.Write("<script>alert(""图片新闻修改成功"");dialogArguments.location.reload();window.close();</script>")
	  Response.End
  end if
  RsNewsModObj.Close
  Set RsNewsModObj = Nothing
Conn.Close
Set Conn = Nothing
%>