<!--#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>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p02")
'''''''''''''''''''''''''''''''''''''''''''''''
'获得大类
dim first,classid,catalogcache
classid=Cint(request("classid"))
dim i
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 then
	first=rs.GetRows()
	if(ubound(first,2)<0) then
	response.Write("暂时没有分类")
	end if
else
	response.Write("暂时没有分类,请先添加分类!")
	response.End()
end if
rs.close
set rs=nothing

Function getcatalogs(parentid,str)
	Dim Sql,rstemp,TemptempStr,tempStr	
	tempStr=str&"&nbsp;"
	sql="select id,title from catalogs where parentid="&parentid
	Set rstemp = Conn.Execute(Sql)
	do while Not rstemp.Eof
		getcatalogs = getcatalogs &"<option value="&rstemp(0)&">│"&tempStr&"└"&rstemp(1)&"</option>"&Chr(10)
		getcatalogs = getcatalogs & getcatalogs(rstemp(0),tempStr)
		rstemp.MoveNext
	loop
	rstemp.close
	Set rstemp = Nothing
End Function
Function getcatalogoption()
	dim ret
	ret=""
	for i=0 to ubound(first,2)
		ret=ret&"<option value="&first(0,i)&">├"&first(1,i)&"</option>"&Chr(10)
    	ret=ret&getcatalogs(first(0,i),"")
	next
	getcatalogoption=ret
end Function
%>
<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_add_ok.asp" style="margin:0 0 0 0; ">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="22" colspan="2"><div align="center"><span class="style1">◆ 添加文章 ◆</span></div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD width="16%" bgcolor="#E3EDF4">类别：</TD>
  <TD width="84%">
  <select name="newsclass" >
  	<%
	catalogcache=application(CachePrefix&"_catalogoption_"&classid)
	if(catalogcache="" or isempty(catalogcache) or len(catalogcache)<1) then
  		application.Lock()
		application(CachePrefix&"_catalogoption_"&classid)=getcatalogoption()
		application.UnLock()
		response.Write(application(CachePrefix&"_catalogoption_"&classid))
	else
		response.Write(catalogcache)
	end if
	%>
</select></TD></TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4"> 作者： </TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="26%"><div align="left">
        <input name="author" type="text" id="author" size="15" 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>)</div></td>
      <td width="11%"><div align="right">源自：</div></td>
      <td width="27%">
        <div align="left">
          <input name="newsfrom" type="text" id="newsfrom" size="15" 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>)&nbsp;</div></td>
      <td width="36%">编辑：
        <input name="editor" type="text" id="editor" size="10" maxlength="15"></td>
      </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">文章属性：</TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td>&nbsp;图文
        <input name="imgnews" type="checkbox" id="imgnews" value="1">
        &nbsp;头条
        <input name="top1" type="checkbox" id="top1" value="1">
        热点
        <input name="hot" type="checkbox" id="hot" value="1">        &nbsp;推荐
        <input name="recomm" type="checkbox" id="recomm" value="1">        &nbsp;置顶        
        <input name="top" type="checkbox" id="top" value="1"></td>
      </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">选择模板：</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
	if not rs.eof then
		Templetlist=rs.GetRows()
	else
		response.Write("<script>alert(""你还没有添加模板!请先添加模板。"");</script>")
	end if
	rs.close
	set rs=nothing
	if(isarray(Templetlist)) then	
		for i=0 to ubound(Templetlist,2)
  %>
    <option value="<%=Templetlist(0,i)%>"><%=Templetlist(2,i)%></option>
	<%
		next
	end if
	%>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4"><div align="left">所属专题：</div></TD>
  <TD><select name="specialid">
  <%=getSpecialSelect(0)%>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">上传图片：</TD>
  <TD><input name="photo" type="text" id="photo" size="30" readonly="true">
    <input type="button" name="Button" value="上传->" onClick="javascript:document.form1.photo.value=window.showModalDialog('upimg.htm',window,'dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">标 题：</TD>
  <TD><input name="title" type="text" size="40">
  色彩&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="#E3EDF4">是否外部链接：</TD>
  <TD><input name="isoutlink" type="radio" onClick="uplink(0);" value="0" checked>
    否
      <input name="isoutlink" type="radio" value="1" onClick="uplink(1);">
      是</TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent0" style="display:none; ">
  <TD bgcolor="#E3EDF4">转向链接地址：</TD>
  <TD><input name="outlinkurl" type="text" id="outlinkurl" size="50"></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent1">
  <TD bgcolor="#E3EDF4">相关文章关键字：</TD>
  <TD><input name="related_key" type="text" id="related_key" size="30"></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent2">
  <TD bgcolor="#E3EDF4">搜索引擎关键字：</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="#E3EDF4">保存远程图片：</TD>
  <TD><select name="saveremoteimg">
    <option value="0">否</option>
    <option value="1" selected>是</option>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">文章摘要：</TD>
  <TD><textarea name="demons" id="demons" cols="45" rows="5" style="width:99%; height:50px;"></textarea></TD>
</TR>
<TR bgcolor="#F5F5F5" id="div_incontent4">	
	<TD colspan="2">
		<INPUT type="hidden" name="content" value="">
	  <IFRAME ID="eWebEditor1" src="webedit/editor.html" frameborder="0" scrolling="no" width="98%" height="350"></IFRAME><br>
	  <div style="magin:5px; padding:5px;">需要分页时可使用分页标志符：<span class="style2">$Page_Split$</span>,即在需要分页的地方点击按钮<img src="webedit/ButtonImage/standard/about.gif" width="20" height="20" align="absmiddle">即可。</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();
	}
}
</script>
</BODY>
</HTML>
<%
call connclose()
%>