<% Option Explicit %>
<!--#include file="inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="inc/Function.asp" -->
<%
'==============================================================================
'软件名称：风讯新闻采集系统V1.0
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
Dim DBC,Conn,CollectConn
Set DBC = New DataBaseClass
Set CollectConn = DBC.OpenConnection()
DBC.ConnStr = "DBQ=" + Server.MapPath(DataBaseConnectStr) + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'判断权限
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P1410") then Call ReturnError1()
'判断权限结束
Sub ShowInfo(InfoStr)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>移动新闻</title>
</head>
<link href="inc/ModeWindow.css" rel="stylesheet">
<body topmargin="0" leftmargin="0" scroll=no>
<div align="center">
  <table width="90%" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td height="30">
<div align="center">
          <% = InfoStr %>
        </div></td>
    </tr>
    <tr> 
      <td height="50"><div align="center"> 
          <input onClick="dialogArguments.location.reload();window.close();" type="button" name="Submit2" value=" 关 闭 ">
        </div></td>
    </tr>
  </table>
</div>
</body>
</html>
<%
End Sub

Dim MoveNewsList,RsSysNewsObj,SysNewsSql,MoveNewsNum
Dim SysTemplet,RsTempObj,Sql,RsNewsObj
MoveNewsNum = 0
MoveNewsList = Replace(Request("NewsIDStr"),"*",",")
if MoveNewsList = "" then
	ShowInfo "没有选择新闻"
	Response.End
end if
Sql = "Select * from News where ID in (" & MoveNewsList & ")"
'On Error Resume Next
Set RsNewsObj = CollectConn.Execute(Sql)
if Not RsNewsObj.Eof then
	SysNewsSql = "Select * from News where 1=0"
	Set RsSysNewsObj = Server.CreateObject("ADODB.RecordSet")
	RsSysNewsObj.Open SysNewsSql,Conn,3,3
	do while Not RsNewsObj.Eof
		Set RsTempObj = CollectConn.Execute("Select SysTemplet,SiteClass from Site where ID=" & RsNewsObj("SiteID"))
		if Not RsTempObj.Eof then
			SysTemplet = RsTempObj("SysTemplet")
		else
			SysTemplet = "/myhztemplets/NewsClass/News.shtml"
		end if
		Dim SiteName1
                  SiteName1=RsTempObj("SiteClass")
		Set RsTempObj = Nothing
		RsSysNewsObj.AddNew
		RsSysNewsObj("NewsID") = GetRandomID18
		RsSysNewsObj("Title") = RsNewsObj("Title")
		RsSysNewsObj("TitleStyle") = "#UUUUUU00"
		RsSysNewsObj("ClassID") = RsNewsObj("ClassID")
		RsSysNewsObj("Content") = RsNewsObj("Content")
		RsSysNewsObj("NewsTemplet") = SysTemplet
		RsSysNewsObj("FileName") = GetRandomID18
		RsSysNewsObj("FileExtName") = "shtml"
		RsSysNewsObj("Path") = "NoUse"
		RsSysNewsObj("AddDate") = RsNewsObj("AddDate")
        RsSysNewsObj("TxtSource") = SiteName1   '新闻来源，站点分类里的内容为新闻来源。
        RsSysNewsObj("AuditTF") = 1      '审核
        RsSysNewsObj("KeyWords") = RsNewsObj("ClassID") '关键字
		MoveNewsNum = MoveNewsNum + 1
		RsNewsObj.MoveNext
	loop
	RsSysNewsObj.UpDate
	RsSysNewsObj.Close
	Set RsSysNewsObj = Nothing
end if
Set RsNewsObj = Nothing
if Request("DelNews") = "true" then
	Sql = "Delete from News where ID in (" & MoveNewsList & ")"
else
	Sql = "Update News Set History=true where ID in (" & MoveNewsList & ")"
end if
CollectConn.Execute(Sql)
if Err.Number = 0 then
	ShowInfo "转移成功" & MoveNewsNum & "条新闻"
else
	ShowInfo "转移失败"
end if
Set CollectConn = Nothing
Set Conn = Nothing
%>