<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Include/Connect.asp"-->
<!--#include file="FCKeditor/fckeditor.asp" -->
<%
articleid=Checkstr(request.querystring("articleid"))
if articleid="" then
response.redirect("../default.asp")
end if

set rs = server.CreateObject("adodb.recordset")
sql="select * from Show5_ALLArticle where ArticleID="&ArticleID&""
rs.open sql,cn,1,1
if rs("Username") <> session("username") then
response.redirect("http://www.show5.net")
else
%>
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../CSS/Hompy/hompy.css" type=text/css rel=stylesheet>
<title></title>
<SCRIPT language="javascript">
<!--
function CheckPost(){
  try{
	if (document.forms[0].articlegroup.value=="") {
		 alert("请选择文章文类!")
		 document.forms[0].articlegroup.focus()
		 return false
		}
	}
  catch(e){}

  try{
	if (document.forms[0].topic.value=="") {
		 alert("标题不能为空,请写日志标题!")
		 document.forms[0].topic.focus()
		 return false
		}
	}
  catch(e){}

  try{
   if (GetMessageLength()==0){
		 alert("内容不能为空!")
		 return false
   }
  }
  catch(e){
	if (Trim(document.forms[0].content.value)=="") {
		 alert("内容不能为空!")
		 document.forms[0].content.focus()
		 return false
	}
  }

return true
}

function GetMessageLength()
{
	var oEditor = FCKeditorAPI.GetInstance('content') ;
	var oDOM = oEditor.EditorDocument ;
	var iLength ;

	if ( document.all )		// If Internet Explorer.
	{
		iLength = oDOM.body.innerText.length ;
	}
	else					// If Gecko.
	{
		var r = oDOM.createRange() ;
		r.selectNodeContents( oDOM.body ) ;
		iLength = r.toString().length ;
	}
//	oEditor.InsertHtml('')
return iLength
}	
//-->
</SCRIPT>
</head>
<body  oncontextmenu="window.event.returnValue=false">
<TABLE cellSpacing=0 cellPadding=0 width=473 border=0>
  <TBODY>
    <TR> 
      <TD height=33 valign="top"> 
        <div align="center"> 
          <table width="97%" border="0" cellspacing="0" cellpadding="0">
            <TR> 
              <TD width="397" height=25 class="orange2_b">编辑文章</TD>
              <TD width="62" class=font_gray9b>&nbsp;</TD>
            </TR>
            <TR> 
              <TD height=1 colspan="2" bgColor=#dddddd></TD>
            </TR>
          </table>
        </div></TD>
    </TR>
    <TR> 
      <TD height=24><div align="center"> 
<table width="97%"  border="0" cellspacing="0" cellpadding="0">
<form name="articleeidt" action="articleeidt_save.asp" method="post" onSubmit="return CheckPost()">
<input name="articleid" type="hidden" value="<%=articleid%>">
<input name="username" type="hidden" value="<%=rs("Username")%>">
  <tr>
    <td><TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
                    <TBODY>
                    <TR>
                      <TD 
                      style="BORDER-RIGHT: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" 
                      bgColor=#bcbcbc height=1></TD></TR>
                    <TR>
                        <TD 
                      style="BORDER-RIGHT: #bcbcbc 1px solid; BORDER-LEFT: #bcbcbc 1px solid" 
                      align=middle> <table cellspacing=0 cellpadding=0 width=458 border=0>
                            <tbody>
                              <tr> 
                                <td width=67 height=28> <div align=center>文件夹</div></td>
                                <td width=391><select name=articlegroup>
<%
set rs_agroup = server.CreateObject("adodb.recordset")
sql="select * from Show5_Articlegroup where Username='"&rs("Username")&"'"
rs_agroup.open sql,cn
do while not rs_agroup.eof
%> 
                                <OPTION value=<%=rs_agroup("GroupID")%> <%if rs_agroup("GroupID")=rs("GroupID") then%> selected <%end if%>><%=rs_agroup("Groupname")%></OPTION>
<%
rs_agroup.movenext
loop
rs_agroup.close
set rs_agroup=nothing
%>
                                  </select> </td>
                              </tr>
                              <tr> 
                                <td class=li_x_02 colspan=3 height=1></td>
                              </tr>
                              <tr> 
                                <td width=67 height=28> <div align=center>标题</div></td>
                                <td width=391><input 
                              name=topic class=input id=topic 
                              style="WIDTH: 240px; HEIGHT: 21px" value="<%=rs("Topic")%>" maxlength=30> </td>
                              </tr>
                            </tbody>
                          </table>
                          <DIV id=imgview style="DISPLAY: none">
                        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                          <TBODY>
                          <TR>
                            <TD class=li_x_02 height=1></TD></TR></TBODY></TABLE>
                          </DIV>
                        <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                          <TBODY>
                          <TR>
                            <TD class=li_x_02 height=1></TD></TR></TBODY></TABLE>
<%
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = "FCKeditor/"

oFCKeditor.ToolbarSet = "Basic"
oFCKeditor.Width = "100%"
oFCKeditor.Height = "300"

oFCKeditor.Value = ""&rs("Content")&""
oFCKeditor.Create "content"
%>

                        </TD>
                      </TR>
                    <TR>
          <TD 
                      style="BORDER-RIGHT: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" 
                      bgColor=#bcbcbc height=1></TD></TR></TBODY></TABLE>
          <table width="97%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                      <td width="62%" height="27" align="right" style="PADDING-LEFT: 6px"> 
                        &nbsp; <INPUT type="image" src="../Images/Hompy/btn_confirm.gif" width="39" height="18" border="0" align="absmiddle"></td>
  </tr>
</table></td>
  </tr>
<textarea name="content" cols="50" rows="50" id="content" style="display:none"></textarea>
</form>
<%
end if
%>
</table>
<table width="97%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="62%" height="27" align="center">&nbsp;</td>
  </tr>
</table>
   </div></TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>
