<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.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友情连接
'==============================================================================
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
    Dim NewsID,Rs,sql,rs1,sql1,ReadConfigObj,URL
	If Request("NewsID")<>"" then
	   NewsID = Cstr(Request("NewsID"))
	 else 
		Response.Write("<script>alert(""参数错误"");window.close();</script>")
	  response.end
	 end if
	 Set ReadConfigObj = Conn.Execute("Select DoMain from Config")
	   	Sql = "Select * from News  where NewsID='"&NewsID&"'"
		Set Rs = Server.CreateObject("ADODB.RecordSet")
		Rs.Open Sql,Conn,3,3
		Sql1 = "Select * from NewsClass  where ClassID='"&rs("ClassID")&"'"
		Set Rs1 = Server.CreateObject("ADODB.RecordSet")
		Rs1.Open Sql1,Conn,3,3
		if Not JudgePopedomTF(Session("Name"),""&Rs("ClassID")&"") then Call ReturnError()
		if Not JudgePopedomTF(Session("Name"),"P0110") then Call ReturnError()
	    if rs.eof then
			Response.Write("<script>alert(""没有找到数据"");window.close();</script>")
			response.end
		else
			if Rs("HeadNewsTF") <> "1" then	'判断标题新闻的预览方式为连接路径
				if Rs1("SaveFilePath") = "/" then
					URL = ReadConfigObj("DoMain") & Rs1("SaveFilePath") & Rs1("ClassEname")&"/"&Rs("FileName")&"."&Rs("FileExtName")&""
				else
					URL = ReadConfigObj("DoMain") & Rs1("SaveFilePath")&"/"&Rs1("ClassEname")&"/"&Rs("FileName")&"."&Rs("FileExtName")&""
				end if
			else
				URL = trim(Rs("HeadNewsPath"))
			end if
			response.Redirect(URL)
			response.end
		end if
	Set ReadConfigObj = Nothing
%>
