<!--#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>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p02")
'''''''''''''''''''''''''''''''''''''''''''''''
'获得大类
dim first,id,classid,NewsArr
dim i
'获得参数
id=Clng(request.QueryString("id"))
classid=Cint(request.QueryString("classid"))
set rs=server.CreateObject("adodb.recordset")
sql="select pagepath,author,title,content,totop,tohot,news_edit,news_from,imgnews,recommend,templetid,top1,keywords,photo,specialid,relate_key,title_color,isoutlink from news where id="&id
rs.open sql,conn,3,1
NewsArr=rs.GetRows()
rs.close
set rs=nothing
'获取 分类
set rs=server.CreateObject("adodb.recordset")
sql="select id,title from catalogs where parentid=0 order by id asc"
rs.open sql,conn,3,1
first=rs.GetRows()
rs.close
set rs=nothing
'response.Write("bigclass-----------------------"&ubound(first,2)&"----------------<br>")

'获得所有par_id=<>的类别------主类：par_id=0
if(ubound(first,2)<0) then
response.Write("暂时没有分类")
end if

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
		if(rstemp("id")=classid) then
				sele=" selected"
			else
				sele=""
		end if
		getcatalogs = getcatalogs &"<option value="&rstemp(0)&sele&">│"&tempStr&"└"&rstemp(1)&"</option>"&Chr(10)
		getcatalogs = getcatalogs & getcatalogs(rstemp(0),tempStr)
		rstemp.MoveNext
	loop
	rstemp.close
	Set rstemp = Nothing
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_modi_ok.asp" style="margin:0 0 0 0; ">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#F5F5F5">
  <TD height="24" colspan="2" bgcolor="#FF9900"><div align="center" class="style1">修改文章</div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">类别：</TD>
  <TD>      <select name="newsclass" >
  <%
  for i=0 to ubound(first,2)
 			if(first(0,i)=classid) then
				sele=" selected"
			else
				sele=""
			end if			
		response.Write("<option value="&first(0,i)&sele&">├"&first(1,i)&"</option>"&Chr(10))	
    	response.Write(getcatalogs(first(0,i),""))		
next	
%>
        
    </select></TD></TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4"> 作者： </TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="12%"><input name="author" type="text" id="author" size="10" maxlength="20" value="<%=NewsArr(1,0)%>"></td>
      <td width="13%"><div align="right">来源：</div></td>
      <td width="14%"><input name="newsfrom" type="text" id="newsfrom" size="10" maxlength="20" value="<%=NewsArr(7,0)%>"></td>
      <td width="61%">编辑：<input name="editor" type="text" id="editor" size="10" maxlength="20" value="<%=NewsArr(6,0)%>">&nbsp;</td>
      </tr>
  </table></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">源自：</TD>
  <TD><table width="100%"  border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td>图文
        <input name="imgnews" type="checkbox" id="imgnews" value="1" <%if(NewsArr(8,0)=true) then response.Write("checked")%>>
        &nbsp;头条
        <input name="top1" type="checkbox" id="top1" value="1" <%if(NewsArr(11,0)>0) then response.Write("checked")%>>
        热点
        <input name="hot" type="checkbox" id="hot" value="1" <%if(NewsArr(5,0)>0) then response.Write("checked")%>>        &nbsp;推荐
        <input name="recomm" type="checkbox" id="recomm" value="1" <%if(NewsArr(9,0)=true) then response.Write("checked")%>>        &nbsp;置顶        
        <input name="top" type="checkbox" id="top" value="1" <%if(NewsArr(4,0)>0) then response.Write("checked")%>></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
	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="#E3EDF4"><div align="left">所属专题：</div></TD>
  <TD><select name="specialid">
  <%=getSpecialSelect(NewsArr(14,0))%>
  </select></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">上传图片：</TD>
  <TD><input name="photo" type="text" id="photo" size="30" readonly="true" value="<%=NewsArr(13,0)%>">
    <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="#E3EDF4">标 题：</TD>
  <TD>
  <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>
<%
if(NewsArr(17,0)=1) then
%>
<TR bgcolor="#F5F5F5" id="div_incontent0">
  <TD bgcolor="#E3EDF4">转向链接地址：</TD>
  <TD><input name="outlinkurl" type="text" id="outlinkurl" value="<%=NewsArr(0,0)%>" size="50"></TD>
</TR>
<%
else
%>
<TR bgcolor="#F5F5F5" id="div_incontent1">
  <TD bgcolor="#E3EDF4">相关文章关键字：</TD>
  <TD><input name="related_key" type="text" id="related_key" size="30" value="<%=NewsArr(15,0)%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD bgcolor="#E3EDF4">搜索引擎关键字：</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 colspan="2">		
		<textarea name="content" style="display:none; "><%=NewsArr(3,0)%></textarea>
	  <IFRAME ID="eWebEditor1" src="webedit/editor.html" frameborder="0" scrolling="no" width="98%" height="350"></IFRAME>	</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=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";
	}
}
</script>
</BODY>
</HTML>
<%
call connclose()
%>