<!--#include file="../../conn/conn2.asp"-->
<!--#include file="inc/configf.asp"-->
<!--#include file="../inc.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>添加文章</title>
<%
dim id
dim more
id=replace(request("id")," ","")
if isnumeric(id)=0 or id="" then
response.write "非法ID参数,欠扁啊你!"
response.end
end if
set rs=server.createobject("adodb.recordset") 	  
sql="select * from article where articleid="&id&"" 
rs.open sql,conn,1,1
more=rs("content")
%>
<script language = "JavaScript">
function AddItem(strFileName){
  document.myform.IncludePic.checked=true;
  document.myform.DefaultPicUrl.value=strFileName;
  document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
  document.myform.DefaultPicList.selectedIndex+=1;
  if(document.myform.UploadFiles.value==''){
	document.myform.UploadFiles.value=strFileName;
  }
  else{
    document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
  }
}
function selectPaginationType()
{
  document.myform.PaginationType.value=2;
}

function CheckForm()
{
  if (editor.EditMode.checked==true)
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
  else
	  document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML; 

  if (document.myform.Title.value=="")
  {
    alert("文章标题不能为空！");
	document.myform.Title.focus();
	return false;
  }
  if (document.myform.Content.value=="")
  {
    alert("文章内容不能为空！");
	editor.HtmlEdit.focus();
	return false;
  }
  if (document.myform.Content.value.length>65536)
  {
    alert("文章内容太长，超出了ACCESS数据库的限制（64K）！建议将文章分成几部分录入。");
	editor.HtmlEdit.focus();
	return false;
  }
  return true;  
}
</script>

<link href="../../css/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>

<body>
<form method="POST" name="myform" onSubmit="return CheckForm();" action="Admin_editsave.asp" target="_self">
  <input name="id" type="hidden" value="<%=rs("articleid")%>">
  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#99CC00" class="border">
    <tr class="title">
      <td height="22" align="center" bgcolor="#660066"><span class="STYLE1"> 文 章 修 改 </span></td>
    </tr>
    <tr align="center">
      <td>
	<table width="100%" border="0" cellpadding="2" cellspacing="1">
          <tr class="tdbg">
            <td height="30" align="right" ><strong>管理导航：</strong></td>
            <td><a href="Admin_ArticleManage.asp">文章管理首页</a>&nbsp;|&nbsp;<a href="add.asp">添加文章</a>&nbsp;</td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>所属分类：</strong></td>
            <td><select name="classid" id="classid">
              <%
      set rstype=server.createobject("adodb.recordset")
      sqltype="select * from aclass"
      rstype.open sqltype,conn,1,1
      do while not rstype.eof
      if rs("classid")=rstype("classid") then
         sel="selected"
      else
         sel=""
      end if
      response.write "<option " & sel & " value='"+CStr(rstype("classid"))+"' name=classid>"+rstype("class")+"</option>"+chr(13)+chr(10)
      rstype.movenext
      loop
      rstype.close
	  set rstype=nothing
    %>
                        </select>
            ** </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>文章标题：</strong></td>
            <td><input name="Title" type="text" id="Title" value="<%=rs("title")%>" size="50" maxlength="255"> 
              <font color="#FF0000">*</font></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>作者：</strong></td>
            <td> <input name="Author" type="text"
           id="Author" value="<%=rs("Author")%>" size="50" maxlength="100">
              <select name="font2" onChange="Author.value=this.value;">
       <option value="春风君">选择作者</option>
                <option value="佚名">佚名</option>
                <option value="网络花园">网络花园</option>
				<option value="林夕">林夕</option>
                <option value="牛永生">牛永生</option>
				<option value="管理员">管理员</option>
				<option value="站长">站长</option>
                <option value="编辑">编辑</option>
              </select></td>
          </tr>
          <tr class="tdbg">
            <td align="right"><strong>来源：</strong></td>
            <td><input name="CopyFrom" type="text"
           id="CopyFrom" value="<%=rs("CopyFrom")%>" size="50" maxlength="100">
              <select name="select" onChange="CopyFrom.value=this.value;">
                <<option value="春风君官方中文网">选择网站</option>
                <option value="网络花园文学网">网络花园文学网</option>
                <option value="春风君">春风君</option>
				<option value="其他网站">其他网站</option>
                <option value="海外网站">海外网站</option>
				<option value="官方网站">官方网站</option>
                <option value="网络媒体">网络媒体</option>
              </select></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right"><strong>是否推荐：</strong></td>
            <td><input name="flag" type="radio" value="0" <% if rs("flag")=0 then response.Write("checked") end if%>>
否
  <input type="radio" name="flag" value="1" <% if rs("flag")=1 then response.Write("checked") end if%>>
<font color="#FF0000">是</font> </td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" align="right" valign="middle"><p><strong>文章内容：</strong></p>
              <p align="left">&nbsp;</p></td>
            <td align="center" bgcolor="#D7E3F2">
              <textarea name="Content" style="display:none"><%=more%></textarea> 
              <iframe id="myEditor" src="Edit/editor.htm?id=content&ReadCookie=0" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" width="621" height="457"></iframe>            </td>
          </tr>
          <tr class="tdbg"> 
            <td colspan="2" align="right"><font color="#99CC00">网络花园文学网</font></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <div align="center"> 
    <p>
      <input
  name="Modify" type="submit"  id="Modify" value="确定修改 " onClick="document.myform.action='Admin_editsave.asp';document.myform.target='_self';" style="cursor:hand;">
      &nbsp; 
      &nbsp; 
      <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Admin_ArticleManage.asp'" style="cursor:hand;">
    </p>
  </div>
</form>
</body>
</html>
<%
call CloseConn()
%>
