<!--#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;
}
.style2 {color: #FF0000}
</style>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
if(checkIfHasPrevilege(Session("Name"),"p02") or checkIfHasPrevilege(Session("Name"),"pext01")) then
else
	response.Write("<script>alert('您没有此权限!');location.href=""login.asp"";</script>")
end if
'''''''''''''''''''''''''''''''''''''''''''''''
'获得大类
dim first,classid,i,rs
if(request.QueryString("classid")<>"") then
	classid=Clng(request.QueryString("classid"))
else
	classid=0
end if
set rs=server.CreateObject("adodb.recordset")
sql="select id,title from catalogs where parentid="&classid&" order by id asc"
rs.open sql,conn,3,1
if not rs.eof and not rs.bof then
	first=rs.GetRows()
else
	response.Write("暂时没有分类,请先<a href=""tree.asp"">添加</a>分类!")
	response.End()
end if
rs.close
set rs=nothing
%>
<script language="JavaScript" src="../JS/PublicJS.js"></script>
<script language="JavaScript">
function check(obj){
	with(obj){
		if(newsclass.value==""){
			alert("请选择栏目!");
			newsclass.focus();
			return false;
		}		
		else if(title.value==""){
			alert("文章标题不能为空!");
			title.focus();
			return false;
		}
		return true;
	}
}
function DoSplits(){
	var o_Editor = document.getElementById("eWebEditor1").contentWindow;
	o_Editor.insertHTML("$Page_Split$");
}
</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_add_ok.asp" style="margin:0 0 0 0; " onSubmit="return check(this)">
  <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" >
  <%
  for i=0 to ubound(first,2)
		response.Write("<option value="&first(0,i)&">├"&first(1,i)&"</option>"&Chr(10))    	
  next	
  %>
  </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="37%"><input name="author" type="text" id="author" size="18" maxlength="20"><br>
      [<a href="#" onClick="document.form1.author.value='本站'">本站</a> <a href="#" onClick="document.form1.author.value='未知'">未知</a> <a href="#" onClick="document.form1.author.value='佚名'">佚名</a> <a href="#" onClick="OpenWindowAndSetValue('editor/authorlist.asp',230,210,window,document.form1.author);">更多</a>]</td>
      <td width="22%">
	  编辑：<input name="editor" type="text" id="editor" size="5" maxlength="15" value="<%=UserName%>"><br>
	  [<a href="#" onClick="OpenWindowAndSetValue('editor/editorlist.asp',230,210,window,document.form1.editor);">选择----&gt;</a>]
&nbsp;	  </td>
      <td width="41%">
        源自:<input name="newsfrom" type="text" id="newsfrom4" size="20" maxlength="20" value="<%=SiteName%>"><br>
[<a href="#" onClick="document.form1.newsfrom.value='本站'">本站</a> <a href="#" onClick="document.form1.newsfrom.value='未知'">未知</a> <a href="#" onClick="document.form1.newsfrom.value='网络'">网络</a> <a href="#" onClick="OpenWindowAndSetValue('editor/fromlist.asp',230,210,window,document.form1.newsfrom);">更多</a>]</td>
      </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">文章属性：</div></TD>
  <TD>
  <label><input name="imgnews" type="checkbox" id="imgnews3" value="1" />图文&nbsp;</label>
	<label><input name="top1" type="checkbox" id="top13" value="1" />头条&nbsp;</label>
	<label><input name="hot" type="checkbox" id="hot2" value="1" />热点&nbsp;</label>
	<label><input name="recomm" type="checkbox" id="recomm2" value="1" />推荐&nbsp;</label>
	<label><input name="top" type="checkbox" id="top2" value="1" />置顶&nbsp;
	<label><input name="isslide" type="checkbox" id="isslide" value="1" />幻灯片&nbsp;</label>
</TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">选择模板：</div></TD>
  <TD>  
  <%
  	dim Templetlist
	set rs=server.CreateObject("adodb.recordset")
	sql="select id,templetname from templet order by id asc"
	rs.open sql,conn,3,1
	if rs.eof or rs.bof then
		rs.close
		set rs=nothing
		response.Write("你还没有添加模板!请先添加模板。<a href=""templet_add.asp"">添加新模板</a>")
	else
		Templetlist=rs.GetRows()
		rs.close
		set rs=nothing
		response.write("<select name=""templet"" title=""选择新闻生成所用的详细页面的模板"">")
		for i=0 to ubound(Templetlist,2)
			response.write("<option value="""&Templetlist(0,i)&""">"&Templetlist(1,i)&"</option>"&Chr(10))
		next
		response.write("</select>")
	end if
  %>  </TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">所属专题：</div></TD>
  <TD>
  <select name="specialid">
  <option value="0" selected="selected">不属于任何专题</option>
  <%=getSpecialSelect(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">
    <input type="button" name="Button" value="上传->" onClick="javascript:document.form1.photo.value=window.showModalDialog('upimg.htm','','dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">标 题：</div></TD>
  <TD bgcolor="#E8F3FF"><input name="title" type="text" size="40">
  (<span class="style2">*</span>)色彩&nbsp;
  <input type="text" size="8" name="title_color">
  &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"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E8F3FF"><div align="right">是否外部链接：</div></TD>
  <TD><label><input name="isoutlink" type="radio" onClick="uplink(0);" value="0" checked />
    否</label>
      <label><input name="isoutlink" type="radio" value="1" onClick="uplink(1);">
      是</label></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent0" style="display:none; ">
  <TD bgcolor="#E8F3FF"><div align="right">转向链接地址：</div></TD>
  <TD><input name="outlinkurl" type="text" id="outlinkurl" size="50"></TD>
</TR>
<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"></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent2">
  <TD bgcolor="#E8F3FF"><div align="right">搜索引擎关键字：</div></TD>
  <TD><input name="keywords" type="text" id="keywords" size="30">
    (用于搜索引擎优化)<a href="#" onClick="document.form1.keywords.value=document.form1.title.value">同标题</a></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent3">
  <TD bgcolor="#E8F3FF"><div align="right">保存远程图片：</div></TD>
  <TD><select name="saveremoteimg" onChange="chanRemoteImgItem(this)">
    <option value="0" selected>否</option>
    <option value="1">是</option>
  </select>
    <div id="rmtimgcheck" style="display:none;">将相对地址
    <input name="rmtimg_urlf" type="text" id="rmtimg_urlf" size="20">
    转成绝对地址
    <input name="rmtimg_urlt" type="text" id="rmtimg_urlt" size="20">
	</div>	</TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align="right" bgcolor="#E8F3FF">文章摘要：</TD>
  <TD><textarea name="demons" id="demons" style="width:99%;"rows="5"></textarea></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent4">
	<TD colspan="2">
		<INPUT type="hidden" name="content1" value="">
	    <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>
<TR bgcolor="#F5F5F5">
	<TD colspan=2 align=right>
	  <div align="center">
	  <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 uplink(linkflag){
	if(linkflag==0){
		for(var j=1;j<=4;j++){
			document.getElementById("div_incontent"+j).style.display="";
		}
		document.getElementById("div_incontent0").style.display="none";		
	}
	else if(linkflag==1){
		for(var j=1;j<=4;j++){
			document.getElementById("div_incontent"+j).style.display="none";
		}
		document.getElementById("div_incontent0").style.display="";
		document.form1.outlinkurl.focus();
	}
}
function chanRemoteImgItem(obj){
	
	if(obj.value==0){		
		document.getElementById("rmtimgcheck").style.display="none";
	}
	if(obj.value==1){		
		document.getElementById("rmtimgcheck").style.display="";
	}
}
function addParentOption()
{
	var arr = showModalDialog("tree_container.asp", "", "dialogWidth:410px; dialogHeight:420px; status:0");
  	if (arr != null){ 
		for (m=document.form1.newsclass.options.length-1;m>=0;m--)
		{
	  		document.form1.newsclass.options[m]=null;
	 	}
   		document.form1.newsclass.options[0]=new Option(arr[1],arr[0]);
  	}
	
}
</script>
</BODY>
</HTML>
<%
call connclose()
%>