<!--#include file="conn1.asp"-->
<!--#include file="../Inc/saveimage.asp"-->
<!--#include file="../Inc/Function_Page.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equtv="Content-Type" content="text/html; charset=gb2312" />
<title>网站后台管理</title>
<link href="images/Admin_css.css" type=text/css rel=stylesheet>

<script src="js/admin.js"></script>
</head>

<body>
<script language=javascript>
function CheckForm()
{ 
  if (document.myform.Title.value==""){
	alert("请填写标题！");
	document.myform.Title.focus();
	return false;
  }
  if (document.myform.ClassID.value==""){
	alert("请选择分类！");
	document.myform.ClassID.focus();
	return false;
  }
  if (document.myform.Hits.value==""){
	alert("请填写浏览次数！");
	document.myform.Hits.focus();
	return false;
  }
  var filter=/^\s*[0-9]{1,6}\s*$/;
  if (!filter.test(document.myform.Hits.value)) { 
	alert("浏览次数填写不正确,请重新填写！"); 
	document.myform.Hits.focus();
	return false; 
  }
}
</script>













<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr> 
    <form name="form1" method="get" action="Admin_Article.asp?page=<%=page%>">
      <td height="29" bgcolor="#C5D5E4" >快速查找：
        <SELECT onChange="javascript:window.open(this.options[this.selectedIndex].value,'main')"  size="1" name="s">
        <OPTION value="" selected>-=请选择=-</OPTION>
        <OPTION value="?s=all">所有文章</OPTION>
        <OPTION value="?s=yn0">已审的文章</OPTION>
        <OPTION value="?s=yn1">未审的文章</OPTION>
        <OPTION value="?s=yn2">会员私有文章</OPTION>
          <OPTION value="?s=istop">固顶文章</OPTION>
        <OPTION value="?s=ishot">推荐文章</OPTION>
        <OPTION value="?s=img">有缩略图文章</OPTION>
        <OPTION value="?s=url">转向链接文章</OPTION>
        <OPTION value="?s=user">会员发表的文章</OPTION>
        <OPTION value="?hits=1">按浏览次数排序</OPTION>
      </SELECT>      </td>
      <td align="center" bgcolor="#C5D5E4" >
        <a href="?hits=1"></a>
        <input name="keyword" type="text" id="keyword" value="<%=request("keyword")%>" class="s26">
        <input type="submit" name="Submit2" class="bnt" value="搜索">
    </form></td>
      <td align="right">跳转到：
        <select name="ClassID" id="ClassID" onChange="javascript:window.open(this.options[this.selectedIndex].value,'main')">
    <%
   Dim Sqlp,Rsp,TempStr
   Sqlp ="select * from jle_Class Where TopID = 0 and link=0 order by num"   
   Set Rsp=server.CreateObject("adodb.recordset")   
   rsp.open sqlp,conn,1,1 
   Response.Write("<option value="""">请选择分类</option>") 
   If Rsp.Eof and Rsp.Bof Then
      Response.Write("<option value="""">请先添加分类</option>")
   Else
      Do while not Rsp.Eof   
         Response.Write("<option value=" & """?ClassID=" & Rsp("ID") & """" & "")
		 If int(request("ClassID"))=Rsp("ID") then
				Response.Write(" selected" ) 
		 End if
         Response.Write(">|-" & Rsp("ClassName") & " ("&Mydb("Select Count([ID]) From [jle_Article] Where ClassID="&rsp("ID")&"",1)(0)&")</option>")  & VbCrLf
		 
		    Sqlpp ="select * from jle_Class Where TopID="&Rsp("ID")&" and link=0 order by num"   
   			Set Rspp=server.CreateObject("adodb.recordset")   
   			rspp.open sqlpp,conn,1,1
			Do while not Rspp.Eof 
				Response.Write("<option value=" & """?ClassID=" & Rspp("ID") & """" & "")
				If int(request("ClassID"))=Rspp("ID") then
				Response.Write(" selected" ) 
				End if
         		Response.Write(">　|-" & Rspp("ClassName") & " ("&Mydb("Select Count([ID]) From [jle_Article] Where ClassID="&rspp("ID")&"",1)(0)&")")
				Response.Write("</option>" )   & VbCrLf
			Rspp.Movenext   
      		Loop
			
      Rsp.Movenext   
      Loop   
   End if
	%>
        </select></td>
    </tr>
</table>
<%
	if request("action") = "add" then 
		call add()
	elseif request("action")="edit" then
		call edit()
	elseif request("action")="savenew" then
		call savenew()
	elseif request("action")="savedit" then
		call savedit()
	elseif request("action")="yn1" then
		call yn1()
	elseif request("action")="yn2" then
		call yn2()
	elseif request("action")="del" then
		call del()
	elseif request("action")="delAll" then
		call delAll()
	else
		call List()
	end if

sub List()
%>

<form name="myform" method="POST" action="Admin_Article.asp?action=delAll">
<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr>  
  <td height="34" colspan="5" align=left class="admintitle">文章列表　[<a href="?action=add">添加</a>]</td></tr>
    <tr bgcolor="#f1f3f5" style="font-weight:bold;">
    <td width="5%" height="30" align="center" class="ButtonList">&nbsp;</td>
    <td width="53%" align="center" class="ButtonList">文章名称</td>
    <td width="20%" height="25" align="center" class="ButtonList">发布时间</td>
    <td width="7%" height="25" align="center" class="ButtonList">浏览</td>
    <td width="15%" height="25" align="center" class="ButtonList">管理</td>    
    </tr>
<%
Hits=request("hits")
s=Request("s")
Articleclass=request("ClassID")
keyword=request("keyword")
Set mypage=new xdownpage
mypage.getconn=conn
mysql="select * from jle_Article"
	if s="yn0" then
	mysql=mysql&" Where yn=0"
	elseif s="yn1" then
	mysql=mysql&" Where yn=1"
	elseif s="yn2" then
	mysql=mysql&" Where yn=2"
	elseif s="istop" then
	mysql=mysql&" Where istop=1"
	elseif s="ishot" then
	mysql=mysql&" Where ishot=1"
	elseif s="img" then
	mysql=mysql&" Where images<>''"
	elseif s="url" then
	mysql=mysql&" Where LinkUrl<>''"
	elseif s="user" then
	mysql=mysql&" Where UserName<>''"
	elseif Articleclass<>"" then
	mysql=mysql&" Where ClassID="&Articleclass&""
	elseif keyword<>"" then
	mysql=mysql&" Where Title like '%"&keyword&"%'"
	End if
mysql=mysql&" order by "
If Hits=1 then
mysql=mysql&"Hits desc"
Else
mysql=mysql&"DateAndTime desc"
End if
mypage.getsql=mysql
mypage.pagesize=15
set rs=mypage.getrs()
for i=1 to mypage.pagesize
    if not rs.eof then 
%>
    <tr bgcolor="#ffffff" onMouseOver="this.style.backgroundColor='#EAFCD5';" onMouseOut="this.style.backgroundColor='';this.style.color=''">
    <td height="25" align="CENTER" bgcolor="#E8EEF4"><input type="checkbox" value="<%=rs("ID")%>" name="ID" onClick="unselectall(this.form)" style="border:0;"></td>
    <td height="25" bgcolor="#E8EEF4">[<a href="?ClassID=<%=rs("ClassID")%>"><%=Classlist(rs("ClassID"))%></a>]<a href="<%=SitePath%><%If html=1 then Response.Write("NewsList.asp?ID="&rs("ID")&"") else Response.Write("Html/?"&rs("ID")&".html") End if%>" target="_blank"><%=rs("Title")%></a> <%if rs("IsTop")=1 then Response.Write("<font color=red>[顶]</font>") end if%><%if rs("IsHot")=1 then Response.Write("<font color=green>[荐]</font>") end if%><%if rs("Images")<>"" then Response.Write("<font color=blue>[图]</font>") end if%><%if rs("IsFlash")=1 then Response.Write("<font color=orange>[幻]</font>") end if%><%If rs("UserID")<>0 then Response.Write(" <font color=blue>["&rs("username")&"]</font>") end if%></td>
    <td height="25" align="center" bgcolor="#E8EEF4"><%=rs("DateAndTime")%></td>
    <td height="25" align="center" bgcolor="#E8EEF4"><%=rs("Hits")%></td>
    <td align="center" bgcolor="#E8EEF4"><%If rs("yn")=0 then Response.Write("已审") end if:If rs("yn")=1 then Response.Write("<font color=red>未审</font>") end if:If rs("yn")=2 then Response.Write("<font color=blue>私有</font>") end if%>|<a href="?action=edit&id=<%=rs("ID")%>&page=<%=page%>">编辑</a>|<%If Mydb("Select Count([ID]) From [jle_Pl] Where ArticleID="&rs("ID")&"",1)(0)>0 Then Response.Write("<a href=""Admin_pl.asp?id="&rs("ID")&""">评论</a>") else Response.Write("<a href=""#""><font style='color:#ccc;'>评论</font></a>") End if%></td>    
    </tr>
<%
        rs.movenext
    else
         exit for
    end if
next
%>
<tr><td align="center" bgcolor="f7f7f7"><input name="Action" type="hidden"  value="Del"><input name="chkAll" type="checkbox" id="chkAll" onClick=CheckAll(this.form) value="checkbox" style="border:0"></td>
  <td colspan="4" bgcolor="f7f7f7"><font color=red>移动到：</font>
    <select id="ytype" name="ytype">
      <%call Admin_ShowClass_Option()%>
    </select>
    &nbsp;
    <input name="Del" type="submit" class="bnt" id="Del" value="移动">
	<input name="Del" type="submit" class="bnt" id="Del" value="更新时间">
    <input name="Del" type="submit" class="bnt" id="Del" value="删除">
    <input name="Del" type="submit" class="bnt" id="Del" value="批量未审">
    <input name="Del" type="submit" class="bnt" id="Del" value="批量审核">
    <input name="Del" type="submit" class="bnt" id="Del" value="推荐">
    <input name="Del" type="submit" class="bnt" id="Del" value="解除推荐">
    <input name="Del" type="submit" class="bnt" id="Del" value="固顶">
    <input name="Del" type="submit" class="bnt" id="Del" value="解除固顶"></td>
  </tr><tr><td bgcolor="#E8EEF4" colspan="5">
<div id="page">
	<ul style="text-align:left;">
    <%=mypage.showpage()%>
    </ul>
</div>
</td></tr></table>
</form>
<%
	rs.close
	set rs=nothing
end sub

sub add()
%>
<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  
<form onSubmit="return CheckForm();" action="?action=savenew" name="myform" method=post>
<tr> 
    <td height="34" colspan="2" align=left class="admintitle">添加文章</td></tr>
<tr> 
<td width="20%" bgcolor="#E8EEF4">标题</td>
<td bgcolor="#E8EEF4"><input name="Title" type="text" id="Title" size="40" maxlength="50">
		<input name="TitleFontColor" type="hidden" id="TitleFontColor" onClick="Getcolor(ColorBG,'TitleFontColor');" Readonly>		&nbsp;<span class="note">注：最多50个字符</span></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">关键字</td>
  <td bgcolor="#E8EEF4"><input name="KeyWord" type="text" id="KeyWord" size="40" maxlength="50">&nbsp;<span class="note">多个关键字用|隔开</span></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">作者</td>
  <td bgcolor="#E8EEF4">
    <input name="Author" type="text" id="Author" value="不详" size="40" maxlength="200">    </td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">来源</td>
  <td bgcolor="#E8EEF4"><span class="td">
    <input name="CopyFrom" type="text" id="CopyFrom" value="网络" size="40" maxlength="200">
  </span></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">分类</td>
  <td bgcolor="#E8EEF4"><select ID="ClassID" name="ClassID">
    <%call Admin_ShowClass_Option()%></select>&nbsp;<span class="note">如果有二级分类,请选择二级分类.</span></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">转向链接</td>
  <td bgcolor="#E8EEF4"><input name="LinkUrl" type="text" size="50" disabled>
		  <INPUT name="UseLinkUrl" type="checkbox" class="noborder" id="UseLinkUrl" onClick="if(this.checked){
			  LinkUrl.disabled = false;
		  }else{
			  LinkUrl.disabled = true;
		  }" value="Yes">
      使用转向链接		</td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">浏览次数</td>
  <td bgcolor="#E8EEF4"><input name="Hits" type="text" id="Hits" value="0" size="6" maxlength="10"></td>
</tr>
<tr>
  <td rowspan="2" bgcolor="#E8EEF4">图片上传</td>
  <td bgcolor="#E8EEF4"><input name="Images" type="text" id="Images" size="40" maxlength="200"></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4"><iframe src="upload.asp?action=simg" width="400" height="25" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">文章摘要<br><span class="note">不填写则自动截取正文开始部分字符</span></td>
  <td bgcolor="#E8EEF4"><textarea name="ArtDescription" id="ArtDescription" cols="60" rows="6"></textarea></td>
</tr>
<tr>
  <td valign="top" bgcolor="#E8EEF4"><p>内容</p>
    <p>发布时间<br>
      <input name="DateAndTime" type="text" id="DateAndTime" value="<%=NOW()%>">
    </p>
    <p>
      <input name="sSaveFileSelect" type="checkbox" class="noborder" id="sSaveFileSelect" value="True">
    保存内容中的图片到本地</p></td>
  <td bgcolor="#E8EEF4"><textarea name="Content" cols="80" rows="10" id="Content" style="display:none"></textarea><IFRAME ID="eWebEditor" SRC="../Editor/ewebeditor.htm?id=Content&style=laoy" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="350"></IFRAME></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">附加选项</td>
  <td bgcolor="#E8EEF4">固顶
    <input name="IsTop" type="checkbox" class="noborder" id="IsTop" value="1">
    推荐
    <input name="IsHot" type="checkbox" class="noborder" id="IsHot" value="1">
    幻灯
    <input name="IsFlash" type="checkbox" class="noborder" id="IsFlash" value="1">
    <INPUT type=button class="bnt" onClick="eWebEditor.insertHTML('[jle_page]')" value="插入分页符"></td>
</tr>
<tr>
  <td bgcolor="#E8EEF4">自动分页字数</td>
  <td bgcolor="#E8EEF4"><input name="PageNum" type="text" id="PageNum" value="0" size="6" maxlength="4">
    <span class="note">　注:如果在内容中加入了手动分页符,请填写0</span></td>
</tr>
<tr> 
<td width="20%" bgcolor="#E8EEF4"></td>
<td bgcolor="#E8EEF4"><input name="Submit" type="submit" class="bnt" value="添 加"></td>
</tr>
</form>
</table>
<%
end sub

sub savenew()
	Title			=trim(request.form("Title"))
	Hits			=trim(request.form("Hits"))
	ClassID			=trim(request.form("ClassID"))
	Content			=request.form("Content")
	Author			=trim(request.form("Author"))
	CopyFrom		=trim(request.form("CopyFrom"))
	KeyWord			=trim(request.form("KeyWord"))
	IsTop			=request.form("IsTop")
	IsHot			=request.form("IsHot")
	IsFlash			=request.form("IsFlash")
	ArtDescription	=request.form("ArtDescription")
	TitleFontColor	=request.form("TitleFontColor")
	Images			=trim(request.form("Images"))
	PageNum			=trim(request.form("PageNum"))
	LinkUrl			=trim(request.form("LinkUrl"))
	UseLinkUrl		=request.form("UseLinkUrl")
	DateAndTime		=trim(request.form("DateAndTime"))
	sSaveFileSelect =request.Form("sSaveFileSelect")
	Vote			=request.form("Vote")
	Vote		 	=replace(Vote," ","")
	
	if Title="" or ClassID="" then
		Call Alert ("请填写完整再提交",-1)
	end if
	If ClassID="-1" then
		Call Alert ("请选择正确的分类！",-1)
	End if		
	If LinkUrl="" and Content="" then
		Call Alert ("你没有填写内容",-1)
	End if

	set rs = server.CreateObject ("adodb.recordset")
	sql="select * from jle_Article where Title='"&Title&"'"
	rs.open sql,conn,1,3
	if rs.eof and rs.bof then
		rs.AddNew 
		rs("Title")				=Replace(Title,CHR(34),"&quot;")
		rs("Hits")				=Hits
		rs("ClassID")			=ClassID
		rs("LinkUrl")			=LinkUrl
		rs("Author")			=Author
		rs("CopyFrom")			=CopyFrom
		rs("KeyWord")			=KeyWord
		If IsTop=1 then
			rs("IsTop")				=1
		else
			rs("IsTop")				=0
		end if
		If IsHot=1 then
			rs("IsHot")				=1
		else
			rs("IsHot")				=0
		end if
		If IsFlash=1 then
			rs("IsFlash")			=1
		else
			rs("IsFlash")			=0
		end if
		If ArtDescription<>"" then
			rs("ArtDescription")		=ArtDescription
		Else
			rs("ArtDescription")		=Left(LoseHtml(Content),250)
		End if
		rs("TitleFontColor")	=TitleFontColor
		rs("Images")			=Images
		rs("yn")				=0
		rs("PageNum")			=PageNum
		rs("DateAndTime")		=DateAndTime
		rs("Vote")				=Vote
		rs("UserName")			=Session("YaoAdmin")
		If sSaveFileSelect="True" Then
      		Rs("Content")=ReplaceRemoteUrl(Content,SitePath&SiteUp,sFileExt)
     	Else
      		Rs("Content")=Content
		End If

		rs.update
		session("YaoClassID")=ClassID
		Call Alert ("添加成功！","Admin_Article.asp")
	else
		Call Alert ("该文章已存在！",-1)
	end if
	rs.close
	set rs=nothing
end sub

sub edit()
id=request("id")
set rs = server.CreateObject ("adodb.recordset")
sql="select * from jle_Article where id="& id &""
rs.open sql,conn,1,1
%>
<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
<form onSubmit="return CheckForm();" name="myform" action="?action=savedit" method=post>
<tr> 
    <td colspan="5" class="admintitle">修改文章</td></tr>
<tr>
  <td width="20%"  class="tdbar">标题</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="Title" type="text" value="<%=rs("Title")%>" size="40" maxlength="50">
		<input name="TitleFontColor" type="hidden" id="TitleFontColor" value="<%=rs("TitleFontColor")%>" onClick="Getcolor(ColorBG,'TitleFontColor');" Readonly>
	  <img border=0 src="../images/Rect.gif" style="cursor:pointer;background:<%=rs("TitleFontColor")%>" onClick="Getcolor(this,'TitleFontColor');" title="选取标题颜色" align="absmiddle" ID="ColorBG">&nbsp;<span class="note">注：最多50个字符</span></td>
</tr>
<tr>
  <td  class="tdbar">关键字</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="KeyWord" type="text" id="KeyWord" value="<%=rs("KeyWord")%>" size="40">&nbsp;<span class="note">多个关键字用|隔开</span></td>
</tr>
<tr>
  <td  class="tdbar">作者</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="Author" type="text" id="Author" value="<%=rs("Author")%>" size="40"></td>
</tr>
<tr>
  <td  class="tdbar">录入员</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="UserName" type="text" id="UserName" value="<%=rs("UserName")%>" size="40"></td>
</tr>
<tr>
  <td  class="tdbar">来源</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="CopyFrom" type="text" id="CopyFrom" value="<%=rs("CopyFrom")%>" size="40"></td>
</tr>
<tr>
  <td  class="tdbar">分类</td>
  <td colspan=4 bgcolor="#E8EEF4" ><select ID="ClassID" name="ClassID">
    <%call Admin_ShowClass_Option()%></select>  </td></tr>
<tr>
  <td  class="tdbar">转向链接</td>
<td colspan=4 bgcolor="#E8EEF4" ><input name="LinkUrl" type="text" size="50" value="<%=rs("Linkurl")%>" disabled>
		  <INPUT name="UseLinkUrl" type="checkbox" class="noborder" id="UseLinkUrl" onClick="if(this.checked){
			  LinkUrl.disabled = false;
		  }else{
			  LinkUrl.disabled = true;
		  }" value="Yes"<%if rs("LinkUrl")<>"" then Response.Write(" checked") end if%>>
      使用转向链接		</td>
</tr>
<tr>
  <td  class="tdbar">浏览次数</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="Hits" type="text" id="Hits" value="<%=rs("Hits")%>" size="6" maxlength="5"></td>
</tr>
<tr>
  <td rowspan="2"  class="tdbar">图片上传</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="Images" type="text" id="Images" value="<%=rs("Images")%>" size="40" maxlength="200"></td></tr>
<tr>
  <td colspan=4 ><iframe src="upload.asp?action=simg" width="400" height="25" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
  <td  class="tdbar">文章摘要</td>
  <td colspan=4 bgcolor="#E8EEF4" ><textarea name="ArtDescription" id="ArtDescription" cols="60" rows="6"><%=rs("ArtDescription")%></textarea></td></tr>
<tr>
  <td valign="top"  class="tdbar"><p>内容</p>
    <p>发布时间<br>
      <input name="DateAndTime" type="text" id="DateAndTime" value="<%=rs("DateAndTime")%>">
</p>
    <p>
      <input name="sSaveFileSelect" type="checkbox" class="noborder" id="sSaveFileSelect" value="True">
保存内容中的图片到本地</p></td>
  <td colspan=4 bgcolor="#E8EEF4" ><textarea name="Content" cols="80" rows="10" id="Content" style="display:none;"><%=server.htmlencode(rs("Content"))%></textarea><IFRAME ID="eWebEditor" SRC="../Editor/ewebeditor.htm?id=Content&style=laoy" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="350"></IFRAME></td>
</tr>
<tr>
  <td  class="tdbar">附加选项</td>
  <td colspan=4 bgcolor="#E8EEF4" >固顶
    <input name="IsTop" type="checkbox" class="noborder" id="IsTop" value="1"<%if rs("IsTop")=1 then Response.Write("checked") end if%>>
推荐
<input name="IsHot" type="checkbox" class="noborder" id="IsHot" value="1"<%if rs("IsHot")=1 then Response.Write("checked") end if%>>
幻灯
<input name="IsFlash" type="checkbox" class="noborder" id="IsFlash" value="1"<%if rs("IsFlash")=1 then Response.Write("checked") end if%>>
<INPUT type=button class="bnt" onClick="eWebEditor.insertHTML('[jle_page]')" value="插入分页符"></td>
</tr>
<tr>
  <td  class="tdbar">自动分页字数</td>
  <td colspan=4 bgcolor="#E8EEF4" ><input name="PageNum" type="text" id="PageNum" value="<%=rs("PageNum")%>" size="6" maxlength="4"><span class="note">　注:如果在内容中加入了手动分页符,请填写0</span></td>
</tr>
<tr> 
<td width="20%"  class="tdbar"></td>
<td colspan=4 bgcolor="#E8EEF4" ><input name="id" type="hidden" value="<%=rs("ID")%>"><input name="page" type="hidden" value="<%=page%>"><input name="Submit" type="submit" class="bnt" value="编 辑"></td>
</tr>
</form>
</table>
<%
end sub

sub savedit()
	Dim Title
	id=request.form("id")
	page=request.form("page")
	Title			=trim(request.form("Title"))
	Hits			=trim(request.form("Hits"))
	ClassID			=trim(request.form("ClassID"))
	Content			=request.form("Content")
	Author			=trim(request.form("Author"))
	UserName		=trim(request.form("UserName"))
	CopyFrom		=trim(request.form("CopyFrom"))
	KeyWord			=trim(request.form("KeyWord"))
	IsTop			=request.form("IsTop")
	IsHot			=request.form("IsHot")
	IsFlash			=request.form("IsFlash")
	ArtDescription	=request.form("ArtDescription")
	TitleFontColor	=request.form("TitleFontColor")
	Images			=trim(request.form("Images"))
	PageNum			=trim(request.form("PageNum"))
	LinkUrl			=trim(request.form("LinkUrl"))
	UseLinkUrl		=request.form("UseLinkUrl")
	DateAndTime		=trim(request.form("DateAndTime"))
	sSaveFileSelect =request.Form("sSaveFileSelect")
	Vote			=request.form("Vote")
	Vote		 	=replace(Vote," ","")
	
	if Title="" or ClassID="" then
		Call Alert ("请填写完整再提交","-1")
	end if
	If ClassID="-1" then
		Call Alert ("请选择正确的分类！",-1)
	End if		
	If LinkUrl="" and Content="" then
		Call Alert ("你没有填写内容","-1")
	End if
	set rs = server.CreateObject ("adodb.recordset")
	sql="select * from jle_Article where ID="&id&""
	rs.open sql,conn,1,3
	if not(rs.eof and rs.bof) then
	
		rs("Title")				=Replace(Title,CHR(34),"&quot;")
		rs("Hits")				=Hits
		rs("ClassID")			=ClassID
		rs("LinkUrl")			=LinkUrl
		rs("Author")			=Author
		rs("UserName")			=UserName
		rs("CopyFrom")			=CopyFrom
		rs("KeyWord")			=KeyWord
		If IsTop=1 then
			rs("IsTop")				=1
		else
			rs("IsTop")				=0
		end if
		If IsHot=1 then
			rs("IsHot")				=1
		else
			rs("IsHot")				=0
		end if
		If IsFlash=1 then
			rs("IsFlash")			=1
		else
			rs("IsFlash")			=0
		end if
		If ArtDescription<>"" then
			rs("ArtDescription")		=ArtDescription
		Else
			rs("ArtDescription")		=Left(LoseHtml(Content),250)
		End if
		rs("TitleFontColor")	=TitleFontColor
		rs("Images")			=Images
		rs("yn")				=0
		rs("PageNum")			=PageNum
		rs("DateAndTime")		=DateAndTime
		rs("Vote")				=Vote
		If sSaveFileSelect="True" Then
      		Rs("Content")=ReplaceRemoteUrl(Content,SitePath&SiteUp,sFileExt)
     	Else
      		Rs("Content")=Content
		End If
		
		rs.update
		Call Alert("修改成功！",-2)
	else
		Call Alert("修改错误！",-2)
	end if
	rs.close
	set rs=nothing
end sub


sub Admin_ShowClass_Option()
   Dim Sqlp,Rsp,TempStr
   Sqlp ="select * from jle_Class Where TopID = 0 order by num"   
   Set Rsp=server.CreateObject("adodb.recordset")   
   rsp.open sqlp,conn,1,1 
   Response.Write("<option value="""">不限分类</option>") 
   If Rsp.Eof and Rsp.Bof Then
      Response.Write("<option value="""">请先添加分类</option>")
   Else
      Do while not Rsp.Eof   
         Response.Write("<option value=" & """" & Rsp("ID") & """" & "")
         Response.Write(">|-" & Rsp("ClassName") & "")
		 
		    Sqlpp ="select * from jle_Class Where TopID="&Rsp("ID")&" order by num"   
   			Set Rspp=server.CreateObject("adodb.recordset")   
   			rspp.open sqlpp,conn,1,1
			Do while not Rspp.Eof 
				Response.Write("<option value=" & """" & Rspp("ID") & """" & "")
         		Response.Write(">　|-" & Rspp("ClassName") & "")
				Response.Write("</option>" ) 
			Rspp.Movenext   
      		Loop
			rspp.close
			set rspp=nothing
         Response.Write("</option>" ) 
      Rsp.Movenext   
      Loop   
   End if
   rsp.close
   set rsp=nothing
end sub 


Sub delAll
ID=Trim(Request("ID"))
ytype=Request("ytype")
page=request("page")
If ID="" Then
	  Call Alert("请选择文章!",-1)
ElseIf Request("Del")="批量未审" Then
   set rs=conn.execute("Update jle_Article set yn = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="更新时间" Then
   set rs=conn.execute("Update jle_Article set DateAndTime = "&SqlNowString&" where ID In(" & ID & ")")
ElseIf Request("Del")="批量审核" Then
   set rs=conn.execute("Update jle_Article set yn = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="推荐" Then
   set rs=conn.execute("Update jle_Article set IsHot = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="解除推荐" Then
   set rs=conn.execute("Update jle_Article set IsHot = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="固顶" Then
   set rs=conn.execute("Update jle_Article set IsTop = 1 where ID In(" & ID & ")")
ElseIf Request("Del")="解除固顶" Then
   set rs=conn.execute("Update jle_Article set IsTop = 0 where ID In(" & ID & ")")
ElseIf Request("Del")="移动" Then
		If ytype="" or ytype="-1" then
			Call Alert("请选择正确的类别",-1)
		End if
   set rs=conn.execute("Update jle_Article set ClassID = "&ytype&" where ID In(" & ID & ")")
ElseIf Request("Del")="删除" Then
	'set rs=conn.execute("delete from jle_Article where ID In(" & ID & ")")
			for i=1 to request("ID").count
				if request("ID").count=1 then
				ArticleID=request("ID")
				else
				ArticleID=replace(request("id")(i),"'","")
				end if
				
				'删除文章
				Conn.Execute("Delete From [jle_Article] where ID = "&ArticleID&"")
				'删除文章相关评论
				
			next
End If
Dim LaoyOK
LaoyOK=request.servervariables("http_referer")
If LaoyOK="" then LaoyOK=-1
Call Alert("操作成功",LaoyOK)
End Sub
%>

</body>
</html>