<!--#include file="../include/Conn.jsp"-->
<!--#include file="../include/Char.jsp"-->
<!--#include file="../include/Const.jsp"-->
<!--#include file="../include/function.jsp"-->
<!--#include file="Admin_IsLogin.jsp" -->
<%
dim i
dim rs,rst
dim mTypeName,mGrade,mSql,mFlag,mBgColor,mpreviewimg,ma
dim mSmallCategoryID,mBigCategoryID
'initialization 
mFlag=true'add
'EditorMode=site_info(14)'编辑模试
'fsoMode=site_info(15)'编辑模试
mBigCategoryID = Request("BigCategoryID")
mSmallCategoryID = Request("SmallCategoryID")
mGrade = Request("Grade")
mSmallGrade = Request("SmallGrade")
Set rs = Server.CreateObject("Adodb.RecordSet")
'Display
if request("action")="edit" then 
  mSql="Select * From T_Article Where F_ID="&Request.QueryString("ModifyID")
  Set rs=Conn.Execute(mSql)
  If not rs.Eof then
    ID = Request.QueryString("ModifyID")
    mSmallCategoryID = rs("F_SmallCategoryID")
    mTitle = rs("F_Title")
    mKeyWords = rs("F_KeyWords")
    mAuthor = rs("F_Author")
	mpreviewimg = rs("F_previewimg")
    mContent = rs("F_Content")
	ma = rs("F_a")
	mLink = rs("F_Link")
	mFilePath = rs("F_FilePath")
	mComeFrom = rs("F_ComeFrom")
    mAddtime = rs("F_Addtime")
	mIsCommend = rs("F_IsCommend")
	mIsPic = rs("F_IsPic")
    rs.Close
  End if
  mFlag=false
end if

 'Save Records and Create Html
 If Request.ServerVariables("REQUEST_METHOD")="POST" then
    if Request.Form("txtContent")="" then
	  call Msgbox("请输入新闻内容！",1)
	  Response.end
	end if
    mSmallCategoryID = Request("selSmallCategory")

    'Read V_ArticlePath
	mSql = "Select top 1 * From V_ArticlePath Where F_SmallCateID=" & mSmallCategoryID
	Set rst = conn.Execute(mSql)
	if rst.Eof then
	   Response.write "对不起，请不要非法操作！"
	   Response.End()
	Else
	   'mBigCateID = rst("F_BigCateID")
	   mBigCateName = rst("F_BigCateName")
	   'mSmallCateID = rst("F_SmallCateID")
	   mSmallCateName = rst("F_SmallCateName")
	   mBigFolder = rst("F_BigFolder")
	   mSmallFolder = rst("F_SmallFolder")
	   mTemplatePath = rst("F_TemplatePath")
	 End if

	mTitle = checkStr(Trim(Request.Form("txtTitle")))
    mContent = checkStr(rTrim(Request.Form("txtContent")))
    mAuthor = checkStr(Trim(Request.Form("txtAuthor")))
	if mAuthor="" then mAuthor = "运城生活网"
    mLink = checkStr(Trim(Request.Form("txtLink")))
    mComeFrom = checkStr(Trim(Request.Form("txtComeFrom")))
	if mComeFrom="" then mComeFrom = "运城生活网"
	mpreviewimg = (Trim(Request.Form("previewimg")))
	ma = checkStr(Trim(Request.Form("a")))
    mAddtime =  checkStr(Trim(Request.Form("txtAddtime")))
    mKeywords = checkStr(Trim(Request.Form("txtKeywords")))
	if Request.Form("chkIsPic")=1 then  mIsPic = 1 else mIsPic = 0
    if Request.Form("chkIsCommend")=1 then mIsCommend = 1 else mIsCommend =0
    if session("curUserGrade")="超级用户" then	mIsAuditing = 1 else mIsAuditing = 0 
	If Request("action") = "Insert" then
	  mFileName = DateToFilename(now)
      mFilePath = mBigFolder + "/" + mSmallFolder + "/"+mFileName
      mSql = "Insert Into T_Article(F_BigCategoryID,F_SmallCategoryID,F_Title,F_KeyWords,F_previewimg,F_Content,F_Author,F_Link,F_FilePath,F_ComeFrom,F_AddTime,F_a,F_IsPic,F_IsCommend,F_IsAuditing,F_UserName)"
      mSql = mSql +"Values('"&mBigCategoryID&"','"&mSmallCategoryID&"','"&mTitle&"','"&mKeywords&"','"&mpreviewimg&"','"&mContent&"','"&mAuthor&"','"&mLink&"','"&mFilePath&"','"&mComeFrom&"','"&mAddtime&"','"&ma&"',"&mIsPic&","&mIsCommend&","&mIsAuditing&",'["&Session("master")&"]')"
	  conn.Execute(mSql)
      mFlag = True
	Else
   	  mFilePath = Request.Form("hidFilePath")
   	  mFileName = mid(mFilePath,instr(instr(1,mFilePath,"/")+1,mFilePath,"/")+1)
	  mSql = "update T_Article set F_SmallCategoryID='"&mSmallCategoryID&"',F_Title='"&mTitle&"',F_Keywords='"&mKeywords&"',F_previewimg='"&mpreviewimg&"',F_Content='"&mContent&"',F_Link='"&mLink&"',F_ComeFrom='"&mComeFrom&"',F_Addtime='"&mAddtime&"',F_a='"&ma&"',F_IsPic="&mIsPic&",F_IsCommend="&mIsCommend&",F_IsAuditing="&mIsAuditing
      mSql = mSql +" Where F_ID=" & Request("ModifyID")
	  conn.Execute(mSql)
      mFlag = False
	End if
   '------------------------------------------------------html
   'Read Max ID
    mSql = "Select Max(F_ID) from T_Article"
    Set rs = conn.Execute(mSql)
    ID = rs(0)
    rs.Close
    'Create Html
	Dim mTemplatePath,mTemplateAllPath
	Dim mNewsContent,mAllPath,mFileName,mPathDir
	Set fso = CreateObject("Scripting.FileSystemObject")
    mTemplateAllPath = Server.MapPath("../Article/Template/NewTemplate/"+mTemplatePath+".htm")
	If fso.FileExists(mTemplateAllPath) then
	   Set objStream = fso.OpenTextFile(mTemplateAllPath)
	Else
	   Call Msgbox("对不起，该类别文章的模板文件 "&mTemplatePath&".htm 找不到，\n请先创建该类别的模板文件!",1)
	End if

	Do While not objStream.AtEndOfStream
 	  mNewsContent = mNewsContent & objStream.ReadLine
	  mNewsContent = replace(mNewsContent,"[id]",ID)
	  mNewsContent = replace(mNewsContent,"[bigcategoryid]",mBigCategoryID)
	  mNewsContent = replace(mNewsContent,"[bigcategoryname]",mBigCateName)
	  mNewsContent = replace(mNewsContent,"[smallcategoryid]",mSmallCategoryID)
	  mNewsContent = replace(mNewsContent,"[smallcategoryname]",mSmallCateName)
	  mNewsContent = replace(mNewsContent,"[title]",HTMLEncode2(mTitle))
	  mNewsContent = replace(mNewsContent,"[content]",mContent)
	  mNewsContent = replace(mNewsContent,"[comefrom]",HTMLEncode2(mComeFrom))
	  mNewsContent = replace(mNewsContent,"[addtime]",mAddtime)
  	  mNewsContent = replace(mNewsContent,"[link]",mLink)
  	  mNewsContent = replace(mNewsContent,"[author]",HTMLEncode2(mAuthor))
  	  mNewsContent = replace(mNewsContent,"[keywords]",HTMLEncode2(mKeywords))
	Loop
	objStream.Close
    'Create BigFolder
	folderPath = Server.MapPath("../Htmls")
    mPathDir = folderPath & "\" & mBigFolder
	If Not fso.FolderExists(mPathDir) Then
	  Set f = fso.CreateFolder(mPathDir)
	  Set f=nothing
	end if
    'Create SmallFolder
    mPathDir = folderPath & "\" & mBigFolder&"\"& mSmallFolder
	If Not fso.FolderExists(mPathDir) Then
	  Set f = fso.CreateFolder(mPathDir)
	  Set f=nothing
	end if
	'Create FileName
	Set objHtml = fso.CreateTextFile(mPathDir+"\"+mFileName)
	objHtml.WriteLine mNewsContent
	objHtml.close
	set fso=nothing
    call MsgBox("文章文件生成成功！\n\n主题：\n"& mTitle &"\n\n路径：\n"&Replace(mPathDir+"\"+mFileName,"\","\\")&"\n\n显示：\nhttp://" & Request.ServerVariables("HTTP_HOST")&Replace(mid(request.ServerVariables("URL"),1,instr(2,Request.ServerVariables("URL"),"/")) &"Article/" &mBigFolder +"/"+mSmallFolder+"/"+ mFileName,"\","/")&"\n\n","Admin_Article.jsp?Grade="&mGrade&"&SmallGrade="&mSmallGrade&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&mSmallCategoryID&"&pageno="&Request("pageno"))
    response.end
 End if

'Delect Records
If Request("action")="Delete" then
  mBigCategoryID=Request("BigCategoryID")
  mSql = "DELETE FROM T_Article WHERE F_ID=" &Request.QueryString("DeleteID")
  conn.execute mSql
  'Delete Html
  DelFname=Server.MapPath("../Htmls/"+Request("FilePath"))
  Set TestFileObject=Server.Createobject("Scripting.FileSystemObject")
  If TestFileObject.FileExists(DelFname) then
     Set NewFile=TestFileObject.getfile(DelFname)
     Newfile.delete
  End if
  Response.write "<script>location.replace('Admin_Article.jsp?Grade="&mGrade&"&SmallGrade="&Request("SmallGrade")&"&SmallCategoryID="&Request("SmallCategoryID")&"&action=IsDelete&BigCategoryID="& mBigCategoryID &"&pageno="&Request.Querystring("pageno")&"')</script>"
end if
%>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=Delete';
}
</SCRIPT>
<script language="javascript">
function CheckData(){
  if (document.LatticeEditorForm.txtTitle.value=="")
   {
    errorMsg="对不起,文章标题不能为空，请输入！"
    alert(errorMsg+'\n\n　　　　　　Copyright by www.yclife.cn');
	document.LatticeEditorForm.txtTitle.focus();
	return false;
   }

}
</script>
</head>
<body text=#000000 leftmargin=0 topmargin=0 marginheight="0" marginwidth="0">
<TABLE width=100% height=95% border=1 align="center" cellPadding=0 
cellSpacing=0 borderColor=#7c96b8 borderColorDark=#ffffff>
  <TBODY>
    <TR> 
      <TD width="100%" align=center valign="top"> 
      <%
	  if Request("SmallGrade") <> "" then   admin_flag=",2|"&Request("Grade")&"|"&Request("SmallGrade")&""
      if instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true then
         Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
		 Response.end
	  end if
      %>
      <br>
   <table class=tableBorder width="95%" border="0" align="center" cellpadding="2" cellspacing="1" >
   <tr > 
     <th height="22" colspan="6"> 功能：分类显示</span></th>
   </tr>
		 <tr> 
            <td height="22" class=forumRow> 
              <%
			   Response.write "分类显示：| "
               mSql="Select F_ID,F_Value from T_SmallCategory Where F_BigCategoryID="& mBigCategoryID &" order by F_Grade"
               Set rs=conn.Execute(mSql)
			   if not rs.eof then
                  arrSmaillCategory = rs.getrows()
               end if
			   rs.close
			   if isarray(arrSmaillCategory) then
                 for i=0 to ubound(arrSmaillCategory,2)
                   admin_flag=",2|"&Request("Grade")&"|"&i+1&""
	               if not(instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true) then				   
				     Response.write "<a href='Admin_Article.jsp?Grade="&Request("Grade")&"&SmallGrade="&i+1&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&arrSmaillCategory(0,i)&"'>"
			         Response.write arrSmaillCategory(1,i)
				     Response.write "</a>"
				     Response.Write " | "
                   end if
				 Next
			  end if
			   %>
            </td>
          </tr>
        </table> 
        <br>
        <table class=tableBorder width="95%" border="0" align="center" cellpadding="2" cellspacing="1">
  		<tr > 
          <th height="22" colspan="9"> 功能：文章列表</th>
        </tr>
		  <tr style="cursor:hand" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EBEEF6'" align="center"> 
            <td width="7%" height="16" class=forumHeaderBackgroundAlternate><b>ID</b></td>
            <td width="33%" class=forumHeaderBackgroundAlternate><font color="#FFFFFF">&nbsp;<b>标题</b></font></td>
            <td width="12%"  class=forumHeaderBackgroundAlternate><b>二级类别</b></td>
            <td width="9%" class=forumHeaderBackgroundAlternate><b>操作者</b></td>
            <td width="11%" class=forumHeaderBackgroundAlternate><b>更新时间</b></td>
            <%if session("curUserGrade")="超级用户" then%>
            <td width="6%" class=forumHeaderBackgroundAlternate><b>审核</b></td>
            <td width="6%" class=forumHeaderBackgroundAlternate><b>推荐</b></td>
            <%end if%>
            <td width="16%" class=forumHeaderBackgroundAlternate> <b>管理</b></td>
          </tr>
    <%  
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=18 
    admin_flag=",2|"&Request("Grade")&"|"&Request("SmallCategoryID")&""
     
    mSql="Select * From V_Article Where (1=1)"
    if session("curUserName") <> "admin" then mSql = mSql +" and F_UserName='["&session("curUserName")&"]'"
    if Request("SmallCategoryID") <> "" then mSql = mSql + " and F_SmallCategoryID=" & mSmallCategoryID
    mSql = mSql + " and F_BigCategoryID="& mBigCategoryID &" order by F_ID desc"
	rs.open mSql,conn,1,1
	if not  rs.eof then
      rs.pagesize=pmcount
      mpage=rs.pagecount
      if pageno="" then pageno=1
      if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
      rs.absolutepage=pageno

     rc=rs.pagesize
     re=1
     do while not rs.eof and rc>0
       mBgColor=Request.Querystring("BgColor")
       if Trim(rs("F_ID"))=Trim(mBgColor) then mColor= "D6DFFF" else mColor= "ffffff"
    %>
          <tr  onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#EBEEF6'" > 
            <td  width="7%" height="2" align="center" class=forumRow><%=rs("F_ID")%></td>
            <td class=forumRow> <a title=<%=HTMLEncode(rs("F_Title"))%> target="_blank" href="../Htmls/<%=rs("F_FilePath")%>"> 
              <%
			  Response.write GetWord(rs("F_Title"),28,"")
			  Response.write "(<font color=red>"&rs("F_Hits")&"</font>)"
			  if rs("F_IsPic")=1 then Response.write "[<font color=D669A5>图</font>]"
			  %>
              </a> <a title="请确认是否要想重新生成该文章HTML文件?"  href="Admin_ArticleCreateHtml.jsp?ID=<%=rs("F_ID")%>&BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>"> 
              <font color=red>[生成]</font> </a> </td>
            <td width="12%" height="2" align="center" class=forumRow ><%=rs("F_SmallCategoryName")%> 
            </td>
            <td width="9%" align="center" class=forumRow ><%=rs("F_UserName")%> 
            </td>
            <td width="11%" align="center" class=forumRow ><%=formatdatetime(rs("F_Addtime"),2)%> 
            </td>
            <%if session("curUserGrade")="超级用户" then%>
            <td width="6%" align="center" class=forumRow > 
              <%
			'审核处理
			if Request("action") = "IsAuditing" then
			  mIsAuditing = Request("IsAuditing")
			  if mIsAuditing=1 then mIsAuditing = 0 else mIsAuditing = 1
			  mSql = "update T_Article Set F_IsAuditing= "&mIsAuditing&" Where F_ID="&Request("ID")
              conn.execute(mSql)
			  Response.redirect "Admin_Article.jsp?Grade="&mGrade&"&SmallGrade="&mSmallGrade&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&mSmallCategoryID&"&pageno="&Request("pageno")
			end if
			Response.Write "<a href='Admin_Article.jsp?action=IsAuditing&IsAuditing="&rs("F_IsAuditing")&"&Grade="&mGrade&"&SmallGrade="&mSmallGrade&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&mSmallCategoryID&"&pageno="&Request("pageno")&"&ID="&rs("F_ID")&"'>"
			if rs("F_IsAuditing")=1 then Response.Write "<font color=red>是</font>" Else Response.write "否"
			Response.Write "</a>"
			%>
            </td>
            <td width="6%" align="center" class=forumRow> 
              <%
			'推荐处理
			if Request("action") = "IsCommend" then
			  mIsCommend = Request("IsCommend")
			  if mIsCommend=1 then mIsCommend = 0 else mIsCommend = 1
			  mSql = "update T_Article Set F_IsCommend= "&mIsCommend&" Where F_ID="&Request("ID")
              conn.execute(mSql)
			  Response.redirect "Admin_Article.jsp?Grade="&mGrade&"&SmallGrade="&mSmallGrade&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&mSmallCategoryID&"&pageno="&Request("pageno")
			end if
			Response.Write "<a href='Admin_Article.jsp?action=IsCommend&IsCommend="&rs("F_IsCommend")&"&Grade="&mGrade&"&SmallGrade="&mSmallGrade&"&BigCategoryID="&mBigCategoryID&"&SmallCategoryID="&mSmallCategoryID&"&pageno="&Request("pageno")&"&ID="&rs("F_ID")&"'>"
			if rs("F_IsCommend")=1 then Response.Write "<font color=red>是</font>" Else Response.write "否"
			Response.Write "</a>"
			%>
            </td>
            <%end if%>
            <td width="16%" height="2" align="center" class=forumRow > <a title="添加记录" href='Admin_Article.jsp?BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>#anInsert'><font color="#666666">[添加]</font></a><a title="修改记录" href='Admin_Article.jsp?action=edit&ModifyID=<%=rs("F_ID")%>&BgColor=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>&BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>#anModify'><font color="#666666">[修改]</font></a><a title="请确定是否删除,删除后不能恢复!" href="javascript:jDelete('Admin_Article.jsp?DeleteID=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>&BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>&FilePath=<%=rs("F_FilePath")%>')"><font color="#666666">[删除]</font></a> 
            </td>
          </tr>
          <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
          <tr > 
            <td colspan="8" class=forumRow> <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="68%">&nbsp;共 <font color=red><strong> 
                    <% = rs.RecordCount%>
                    </strong></font> 条记录 当前第 <font color=red><strong> 
                    <% = Trim(pageno)%>
                    </strong></font>页/共 <font color=red><strong> 
                    <% = Trim(mpage)%>
                    </strong></font>页 </td>
                  <td width="32%" align="right"> 
<%
if pageno>1 then
   response.write "<a href='Admin_Article.jsp?BigCategoryID="&Request("BigCategoryID")&"&SmallCategoryID="&mSmallCategoryID&"'> <img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='Admin_Article.jsp?pageno="&pageno-1&"&BigCategoryID="&Request("BigCategoryID")&"&SmallCategoryID="&mSmallCategoryID&"'><img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='Admin_Article.jsp?pageno="&pno&"&BigCategoryID="&Request("BigCategoryID")&"&SmallCategoryID="&mSmallCategoryID&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='Admin_Article.jsp?pageno="&pageno+1&"&BigCategoryID="&Request("BigCategoryID")&"&SmallCategoryID="&mSmallCategoryID&"'><img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='Admin_Article.jsp?pageno="&mpage&"&BigCategoryID="&Request("BigCategoryID")&"&SmallCategoryID="&mSmallCategoryID&"'><img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'>"
end if
Response.write "&nbsp;&nbsp;"
%>
                  </td>
                </tr>
              </table></td>
          </tr>
        </table> 
<%if mFlag=true then'add%>
<form name="LatticeEditorForm" method="post" action="Admin_Article.jsp?action=Insert&BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>"  onSubmit="return CheckData()">
<table class=tableBorder width="95%" border="0" cellspacing="1" cellpadding="2" align="center">
					<tr > 
                    <th height="22" colspan="6"> 功能：添加记录</th>
                   </tr>
                        <tr> 
                          <td class=forumRow><font color="#FF0000">标题:</font></td>
                          <td colspan="5" class=forumRowHighlight> <input type="text" name="txtTitle" size="64" class=text>
                            <select name="a" id="a">
                                  <option style="COLOR: black" value="0" selected>不使用 </option>
                                  <option style="background: #000088" value="000088"> </option>
                                  <option style="background: #0000ff" value="0000ff"> </option>
                                  <option style="background: #008800" value="008800"> </option>
                                  <option style="background: #008888" value="008888"> </option>
                                  <option style="background: #0088ff" value="0088ff"> </option>
                                  <option style="background: #00a010" value="00a010"> </option>
                                  <option style="background: #1100ff" value="1100ff"> </option>
                                  <option style="background: #111111" value="111111"> </option>
                                  <option style="background: #333333" value="333333"> </option>
                                  <option style="background: #50b000" value="50b000"> </option>
                                  <option style="background: #880000" value="880000"> </option>
                                  <option style="background: #8800ff" value="8800ff"> </option>
                                  <option style="background: #888800" value="888800"> </option>
                                  <option style="background: #888888" value="888888"> </option>
                                  <option style="background: #8888ff" value="8888ff"> </option>
                                  <option style="background: #aa00cc" value="aa00cc"> </option>
                                  <option style="background: #aaaa00" value="aaaa00"> </option>
                                  <option style="background: #ccaa00" value="ccaa00"> </option>
                                  <option style="background: #ff0000" value="ff0000"> </option>
                                  <option style="background: #ff0088" value="ff0088"> </option>
                                  <option style="background: #ff00ff" value="ff00ff"> </option>
                                  <option style="background: #ff8800" value="ff8800"> </option>
                                  <option style="background: #ff0005" value="ff0005"> </option>
                                  <option style="background: #ff88ff" value="ff88ff"> </option>
                                  <option style="background: #ee0005" value="ee0005"> </option>
                                  <option style="background: #ee01ff" value="ee01ff"> </option>
                            </select><input name="chkIsPic" type="checkbox" value="1" >[<font color=D669A5>图文</font>]</td>
                        </tr>
				   <tr> 
                          <td width="11%" height="20" class=forumRow>所属分类:</td>
                          <td height="20" colspan="5" class=forumRowHighlight>
                <select name="selSmallCategory"  style="width:143">
               <%
			   if isarray(arrSmaillCategory) then
                 for i=0 to ubound(arrSmaillCategory,2)
                   admin_flag=",2|"&Request("Grade")&"|"&i+1&""
	               if not(instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true) then				   
                     if Trim(Request("SmallCategoryID")) = Trim(arrSmaillCategory(0,i)) then
     				   response.write "<option value=" + cstr(arrSmaillCategory(0,i))
           			   response.write " selected"
       				   response.write ">" + arrSmaillCategory(1,i)
                     else
                       Response.write "<option value='" & arrSmaillCategory(0,i) &"'>"& arrSmaillCategory(1,i) &"</option>"
                     end if
				   end if
				 Next
			  end if
  		      %>
            </select>
                              <%if session("curUserGrade")="超级用户" then%>
							      <input name="chkIsCommend" type="checkbox" value="1">[推荐]
							  <%end if%>
							 </td>
                        </tr>	
						
										   <tr> 
                          <td width="11%" height="20" class=forumRow>缩略图:</td>
                          <td height="20" colspan="5" class=forumRowHighlight><input type="text" name="previewimg" size="36"> </td>
                        </tr>		
                      <tr> 
                          <td height="20" width="10%" class=forumRow><font color="#FF0000">内容:</font> 
                          </td>
                        <td height="20" bgcolor="menu" class=forumRowHighlight><textarea name="txtContent" style="display:none" ></textarea> 
                          <IFRAME ID="LatticeEditDocument" SRC="../Editor/eWebEditor.jsp?id=txtContent&style=standard" FRAMEBORDER="0" SCROLLING="no" WIDTH="620" HEIGHT="350"></IFRAME>
                        </td>
                      </tr> 
					    <tr> 
                          <td width="11%" height="20" class=forumRow><font color="#FF0000">关键字:</font></td>
                          <td height="20" colspan="5" class=forumRowHighlight> <input type="text" name="txtKeyWords" size="52" class=text> 
                          </td>
                        </tr>                       
                        <tr> 
                          <td class=forumRow>作者:</td>
                          <td colspan="5" class=forumRowHighlight> <input type="text" name="txtAuthor" size="20" class=text>
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtAuthor.value='admin'">admin</a></td>
                        </tr>
                        <tr> 
                          <td height="0" class=forumRow>来源:</td>
                          <td height="10" colspan="5" class=forumRowHighlight> <input type="text" name="txtComeFrom" size="20" class=text>
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtComeFrom.value='<%=Site_info(0)%>'"><%=Site_info(0)%></a> 
                          </td>
                        </tr>
                        <tr> 
                          <td height="0" class=forumRow>相关链接：</td>
                          <td height="10" colspan="5" class=forumRowHighlight> 
                            <input type="text" name="txtLink" size="20" class=text>
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtLink.value='<%=Site_info(1)%>'"><%=Site_info(1)%></a> 
                          </td>
                        </tr>
                        <tr> 
                          <td height="20" class=forumRow>发布时间：</td>
                          <td height="20" colspan="5" class=forumRowHighlight> <font color="#FF0000"><font color="#FF0000"><font color="#000000"><span class=unnamed1> 
                            <input name="txtAddtime" type="text" class=text value="<%=date()%>" size="20">
                            </span></font></font></font></td>
                        </tr>
                        <tr> 
                          <td height="20" class=forumRowHighlight>&nbsp;</td>
                          <td height="20" colspan="5" class=forumRowHighlight> <input type="submit" name="Submit" value="提交" class=button > 
                            <input type="reset" name="Submit2" value="重置" class=button> 
                          </td>
                        </tr>
                      </table>
            </form>
        <%else%>
		<a name="anModify"></a>
            <form name="LatticeEditorForm" method="post" action="Admin_Article.jsp?pageno=<%=request("pageno")%>&action=EditSave&ModifyID=<%=request("ModifyID")%>&BigCategoryID=<%=Request("BigCategoryID")%>&Grade=<%=Request("Grade")%>&SmallGrade=<%=Request("SmallGrade")%>&SmallCategoryID=<%=Request("SmallCategoryID")%>" onSubmit="return CheckData()">
			<table class=tableBorder width="95%" border="0" cellspacing="1" cellpadding="2" align="center">
       		<tr > 
             <th height="22" colspan="6"> 功能：修改记录</th>
            </tr>
		                <tr> 
                          <td class=forumRowHighlight>标题:</td>
                          <td width="89%" colspan="5" class=forumRowHighlight> 
						  <input name="txtTitle" type="text" class=text value="<%=mTitle%>" size="64"> <select name="a">
                                  <option style="COLOR:#<%=ma%>" value="<%=ma%>" selected></option>
								  <option style="COLOR: black" value="">不使用 </option>
                                  <option style="background: #000088" value="000088"> </option>
                                  <option style="background: #0000ff" value="0000ff"> </option>
                                  <option style="background: #008800" value="008800"> </option>
                                  <option style="background: #008888" value="008888"> </option>
                                  <option style="background: #0088ff" value="0088ff"> </option>
                                  <option style="background: #00a010" value="00a010"> </option>
                                  <option style="background: #1100ff" value="1100ff"> </option>
                                  <option style="background: #111111" value="111111"> </option>
                                  <option style="background: #333333" value="333333"> </option>
                                  <option style="background: #50b000" value="50b000"> </option>
                                  <option style="background: #880000" value="880000"> </option>
                                  <option style="background: #8800ff" value="8800ff"> </option>
                                  <option style="background: #888800" value="888800"> </option>
                                  <option style="background: #888888" value="888888"> </option>
                                  <option style="background: #8888ff" value="8888ff"> </option>
                                  <option style="background: #aa00cc" value="aa00cc"> </option>
                                  <option style="background: #aaaa00" value="aaaa00"> </option>
                                  <option style="background: #ccaa00" value="ccaa00"> </option>
                                  <option style="background: #ff0000" value="ff0000"> </option>
                                  <option style="background: #ff0088" value="ff0088"> </option>
                                  <option style="background: #ff00ff" value="ff00ff"> </option>
                                  <option style="background: #ff8800" value="ff8800"> </option>
                                  <option style="background: #ff0005" value="ff0005"> </option>
                                  <option style="background: #ff88ff" value="ff88ff"> </option>
                                  <option style="background: #ee0005" value="ee0005"> </option>
                                  <option style="background: #ee01ff" value="ee01ff"> </option>
                                </select>
						  <input name="chkIsPic" type="checkbox" value="1" <%if mIsPic=1 then Response.write "checked"%>>[<font color=D669A5>图文</font>]
                          </td>
                        </tr>
                      <td width="11%" height="20" class=forumRow>缩略图:</td>
                          <td height="20" colspan="5" class=forumRowHighlight><input type="text" name="previewimg" value="<%=mpreviewimg%>" size="36"> </td>
                      <tr> 
                          <td height="20" width="10%" class=forumRowHighlight><font color="#FF0000">内容:</font> 
                          </td>
                        <td height="20" width="90%" class=forumRowHighlight><textarea name="txtContent" style="display:none"><%=mContent%></textarea>
                          <IFRAME ID="LatticeEditDocument" SRC="../Editor/eWebEditor.jsp?id=txtContent&style=standard" FRAMEBORDER="0" SCROLLING="no" WIDTH="620" HEIGHT="350"></IFRAME>
                        </td>
                      </tr>
                        <tr> 
                          <td width="11%" height="20" class=forumRowHighlight>所属分类:</td>
                          <td height="20" colspan="5" class=forumRowHighlight>
                            <select name="selSmallCategory"  style="width:140">
			  <%
           	if isarray(arrSmaillCategory) then
                 for i=0 to ubound(arrSmaillCategory,2)
                   admin_flag=",2|"&Request("Grade")&"|"&i+1&""
	               if not(instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true) then				   
                     if Trim(Request("SmallCategoryID")) = Trim(arrSmaillCategory(0,i)) then
     				   response.write "<option value=" + cstr(arrSmaillCategory(0,i))
           			   response.write " selected"
       				   response.write ">" + arrSmaillCategory(1,i)
                     else
                       Response.write "<option value='" & arrSmaillCategory(0,i) &"'>"& arrSmaillCategory(1,i) &"</option>"
                     end if
				   end if
				 Next
			  end if
			  %>
           </select>
		  <%if session("curUserGrade")="超级用户" then%>
          <input name="chkIsCommend" type="checkbox" value="1" <%if mIsCommend=1 then Response.write "checked"%>>[推荐]
		  <%end if%>
                          </td>
                        </tr>
						 <tr> 
                          <td width="11%" height="20" class=forumRowHighlight><font color="#FF0000">关键字:</font></td>
                          <td height="20" colspan="5" class=forumRowHighlight> <input name="txtKeyWords" type="text" class=text value="<%=mKeyWords%>" size="52"> 
                          </td>
                        </tr>
                        <tr> 
                          <td class=forumRowHighlight>作者:</td>
                          <td colspan="5" class=forumRowHighlight> <input name="txtAuthor" type="text" class=text value="<%=mAuthor%>" size="20">
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtAuthor.value='admin'">admin</a></td>
                        </tr>
                        <tr> 
                          <td height="0" class=forumRowHighlight>来源:</td>
                          <td height="10" colspan="5" class=forumRowHighlight> <input name="txtComeFrom" type="text" class=text value="<%=mComeFrom%>" size="20">
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtComeFrom.value='<%=Site_info(0)%>'"><%=Site_info(0)%></a> 
                          </td>
                        </tr>
                        <tr> 
                          <td height="0" class=forumRowHighlight>相关链接：</td>
                          <td height="10" colspan="5" class=forumRowHighlight> 
                            <input name="txtLink" type="text" class=text value="<%=mLink%>" size="20">
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtLink.value='<%=Site_info(1)%>'"><%=Site_info(1)%></a>
                            <input name="hidFilePath" type="hidden" value="<% = mFilePath%>"> </td>
                        </tr>
                        <tr> 
                          <td height="20" class=forumRowHighlight>发布时间：</td>
                          <td height="20" colspan="5" class=forumRowHighlight> <font color="#FF0000"><font color="#FF0000"><font color="#000000"><span class=unnamed1> 
                            <input name="txtAddtime" type="text" class=text value="<%=mAddtime%>" size="20">
                            ←<a href="javascript:" onClick="document.LatticeEditorForm.txtAddtime.value='<%=date()%>'">当前时间</a></span></font></font></font></td>
                        </tr>
                        <tr> 
                          <td height="20" class=forumRowHighlight>&nbsp;</td>
                          <td height="20" colspan="5" class=forumRowHighlight> <input type="submit" name="Submit" value="提交" class=button> 
                            <input type="reset" name="Submit2" value="重置" class=button> 
                          </td>
                        </tr>
                      </table>
            </form>
        <%end if%>
      </TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>
<%
 set rs1=nothing
 CloseDatabase
%>
