<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<HTML>
<HEAD>
<TITLE>添加文章</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {color: #FFFFFF;
	font-weight: bold;
}
</style>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
if(checkIfHasPrevilege(Session("Name"),"p02") or checkIfHasPrevilege(Session("Name"),"pext02")) then
else
	response.Write("<script>alert('您没有此权限!');location.href=""login.asp"";</script>")
end if
'''''''''''''''''''''''''''''''''''''''''''''''
'获得大类
dim newsSql,id,classid,NewsArr,catalogName
'获得参数
id=Clng(request.QueryString("id"))
classid=Cint(request.QueryString("classid"))
set rs=server.CreateObject("adodb.recordset")
newsSql="select pagepath,author,title,content,totop,tohot,news_edit,news_from,imgnews,recommend,templetid,top1,keywords,photo,specialid,relate_key,title_color,isoutlink,isslide,title2,linkurl,demons from news where id="&id
rs.open newsSql,conn,3,1
if not rs.eof and not rs.bof then
	NewsArr=rs.GetRows()
else
	call alertstr("没有找到记录!",1)
end if
rs.close
set rs=nothing
'获取 分类
set rs=server.CreateObject("adodb.recordset")
rs.open "select title from catalogs where id="&classid,conn,3,1
if not rs.eof and not rs.bof then
	catalogName=rs("title")
end if
rs.close
set rs=nothing
%>
<script language="JavaScript" src="../js/PublicJS.js"></script>
</HEAD>
<BODY>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<FORM method="POST" name="form1" action="news_modi_ok.asp" style="margin:0 0 0 0; ">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<TR bgcolor="#FF9900">
  <TD height="22" colspan="2"><div align="center"><span class="style1">◆ 修改文章 ◆</span></div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD width="120" bgcolor="#E8F3FF"><div align="right">所属栏目：</div></TD>
  <TD>
  <select name="newsclass" >
  <option value="<%=classid%>"><%=catalogName%></option>  
  </select>&nbsp;&nbsp;<a href="#" onClick="addParentOption();">＋</a>
  </TD></TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"> <div align="right">作者： </div></TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="13%"><input name="author" type="text" id="author" size="10" maxlength="20" value="<%=NewsArr(1,0)%>"></td>
      <td>编辑：<input name="editor" type="text" id="editor" size="10" maxlength="20" value="<%=NewsArr(6,0)%>">&nbsp;</td>
      <td width="60%">源自：
        <input name="newsfrom" type="text" id="newsfrom2" size="20" maxlength="20" value="<%=NewsArr(7,0)%>"></td>
    </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">文章属性：</div></TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td>
	  	<label><input name="imgnews" type="checkbox" id="imgnews" value="1" <%if(NewsArr(8,0)<>0) then response.Write("checked")%>>图文&nbsp;</label>
      <label><input name="top1" type="checkbox" id="top1" value="1" <%if(NewsArr(11,0)<>0) then response.Write("checked")%>>头条&nbsp;</label>
      <label><input name="hot" type="checkbox" id="hot" value="1" <%if(NewsArr(5,0)<>0) then response.Write("checked")%>>热点&nbsp;	</label>
      <label><input name="recomm" type="checkbox" id="recomm" value="1" <%if(NewsArr(9,0)<>0) then response.Write("checked")%>>推荐&nbsp;</label>
      <label><input name="top" type="checkbox" id="top" value="1" <%if(NewsArr(4,0)<>0) then response.Write("checked")%>>置顶</label>
      <label><input name="isslide" type="checkbox" id="isslide" value="1" <%if(NewsArr(18,0)<>0) then response.Write("checked")%>>幻灯片&nbsp;</label>
		</td>
      </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">选择模板：</div></TD>
  <TD>
  
  <select name="templet">
  <%
  	dim Templetlist
	set rs=server.CreateObject("adodb.recordset")
	sql="select * from templet order by id asc"
	rs.open sql,conn,3,1
	Templetlist=rs.GetRows()
	rs.close
	set rs=nothing
	for i=0 to ubound(Templetlist,2)
  %>
    <option value="<%=Templetlist(0,i)%>" <%if(Templetlist(0,i)=NewsArr(10,0)) then response.Write("selected") end if%>><%=Templetlist(2,i)%></option>
	<%
	next
	%>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">所属专题：</div></TD>
  <TD><select name="specialid">
  <option value="0" <%if(Cint(NewsArr(14,0))=0) then response.Write("selected=""selected""") end if%>>不属于任何专题</option>
  <%=getSpecialSelect(NewsArr(14,0))%>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">上传图片：</div></TD>
  <TD><input name="photo" type="text" id="photo" size="30" value="<%=NewsArr(13,0)%>">
    <input type="button" name="Button" value="上传->" onClick="GetPhoto(document.form1.photo)"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">标 题：</div></TD>
  <TD bgcolor="#E8F3FF">
  <input name="title" type="text" size="50" value="<%=NewsArr(2,0)%>">
  色彩&nbsp;<input type="text" size="8" name="title_color" value="<%=NewsArr(16,0)%>">&nbsp;<input type="button" name="title_colors" value="选色" onClick="OpenWindowAndSetValue('editor/selcolor.htm',230,190,window,document.form1.title_color);">  </TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">副标题：</div></TD>
  <TD><input name="title2" type="text" size="60" value="<%=NewsArr(19,0)%>"></TD>
</TR>
<%
if(NewsArr(17,0)=1) then
%>
<TR bgcolor="#F5F5F5" id="div_incontent0">
  <TD bgcolor="#E8F3FF"><div align="right">转向链接地址：</div></TD>
  <TD><input name="outlinkurl" type="text" id="outlinkurl" value="<%=NewsArr(20,0)%>" size="50"></TD>
</TR>
<%
else
%>
<TR bgcolor="#F5F5F5" id="div_incontent1">
  <TD bgcolor="#E8F3FF"><div align="right">相关文章关键字：</div></TD>
  <TD><input name="related_key" type="text" id="related_key" size="30" value="<%=NewsArr(15,0)%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">搜索引擎关键字：</div></TD>
  <TD><input name="keywords" type="text" id="keywords" size="30" value="<%=NewsArr(12,0)%>">
(用于搜索引擎优化)<a href="#" onClick="document.form1.keywords.value=document.form1.title.value">同标题</a></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align="right" bgcolor="#E8F3FF">文章摘要：</TD>
  <TD><textarea name="demons" id="demons" style="width:99%;"rows="5"><%=NewsArr(21,0)%></textarea></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD colspan="2" bgcolor="#E8F3FF">
		<!--<INPUT type="hidden" name="content1" value="">-->
    <%
		new_c=NewsArr(3,0)
		if(new_c<>"") then
			new_c=replace(new_c,"<","&lt;")
			new_c=replace(new_c,">","&gt;")
		end if
		%>
		<textarea name="content1" style="display:none; "><%=new_c%></textarea>
	    <IFRAME ID="eWebEditor1" src="webedits/ewebeditor.htm?id=content1&style=coolblue" frameborder="0" scrolling="no" width="100%" height="350"></IFRAME><br>
			<div style="magin:5px; padding:5px;">需要分页时可使用分页标志符：<span class="style2">$Page_Split$</span>,即在需要分页的地方点击按钮<a href="javascript:DoSplits()"><img src="webedit/ButtonImage/standard/about.gif" width="20" height="20" border="0" align="absmiddle"></a>即可。</div>
	</TD>
	</TR>
<%
end if
%>
<TR bgcolor="#F5F5F5">
	<TD colspan=2 align=right>
	  <div align="center">
	  <input type="hidden" name="id" value="<%=id%>">
	  <input type="hidden" name="isoutlink" value="<%=NewsArr(17,0)%>">
	  <input type="hidden" name="pagepath" value="<%=NewsArr(0,0)%>">
		<input type="hidden" name="linkurl" value="<%=NewsArr(20,0)%>">
	  <INPUT type=submit name=b1 value="提交"> 
	  <INPUT type=reset name=b2 value="重填"> 
	  <INPUT type=button name=b3 value="查看源文件" onClick="location.replace('view-source:'+location)">	
	    </div></TD>
</TR>
</TABLE>
</FORM>
<script language="javascript">
function chanSele(){
	if(document.getElementById("imglistconfig").style.display=="none"){
		document.getElementById("imglistconfig").style.display="";
	}
	else{
		document.getElementById("imglistconfig").style.display="none";
	}
}
function addParentOption()
{
	var arr = showModalDialog("tree_container.asp", "", "dialogWidth:410px; dialogHeight:420px; status:0");
  	if (arr != null){  
   		document.form1.newsclass.options[0]=new Option(arr[1],arr[0]);
  	}
	
}
function DoSplits(){
	var o_Editor = document.getElementById("eWebEditor1").contentWindow;
	o_Editor.insertHTML("$Page_Split$");
}
</script>
</BODY>
</HTML>
<%
call connclose()
%>