<%@ Language=VBScript %>
<%
If Request("id")<>"" and not IsNumeric(Request("id")) Then
	ef=True
	ec="编号必须是数字"
end If

if not ef then
ismaindomain=false
if session("agentname")<>"n" then
for i=0 to ubound(Application("sitearry"))
if Application("sitearry")(i)=Request.ServerVariables("SERVER_NAME") then
ismaindomain=true
exit for
end if
Next
If ismaindomain=True And Application("apipubdomain")<>Request.ServerVariables("SERVER_NAME") Then
	ef=True
	ec="不是此域名名下的新闻!"
End if
end If
end If

if not ef then
if session("agentname")="n" And session("agentusername")="" then
for i=0 to ubound(Application("sitearry"))
if Application("sitearry")(i)=Request.ServerVariables("SERVER_NAME") then
ismaindomain=true
exit for
end if
Next
If ismaindomain=false Then
	ef=True
	ec="不是此主域名名下的新闻-B-或不是AGN用户角色-"&Request.ServerVariables("SERVER_NAME")
End if
end If
end If

if not ef then%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html12")%>
<%=htmlwrite("html13")%>
<%
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsnewsone = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"'"
if session("agentname")="n" Then Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"' and ((username='freehost' and (type2=100 or type2=101)) or (username='"&session("agentname")&"' and (type2=100 or type2=101)) or (type1=0 or type1=1))"
if session("agentname")<>"n" then 	Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"' and  ( (username='freehost' and  (type2=100 or type2=102)) or (username='"&session("agentname")&"' and (type2=100 or type2=101 or type2=102)) or (type1=0 or type1=1)  )" '代理名下用户
If session("agentusername")<>"" Then Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"' and (((username='freehost' and (type2=100 or type2=102 or  type2=103 or type2=104 or type2=105)) or (type1=0 or type1=1)) or username='"&session("agentusername")&"')" '直接用户

if session("agentname")=session("username") and session("agenttype")<>"子代理" then Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"' and (username='freehost' and (type2=103 or type2=104))" '直接代理

If session("admau")<>"" Then 	Sql="Select * from FreeHost.FreeHost_News where id='"&Request("id")&"'"
'response.write sql&"<br>"&session("agentname")&"<br>"&session("username")
'response.end
	dsnewsone.Open Sql,conn,1,1
if dsnewsone.eof then
	ef=True
	ec="没找到要显示的ID！"
end if

if not ef then%>
  <table width="100%" height="36"  border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
    <tr bgcolor="#CCCCCC">
      <td bgcolor="#E3E3E3">　　　　<strong><font color="#000000"><%=dsnewsone("title")%></font></strong></td>
    </tr>
  </table>
  <table width="100%"  border="0" cellspacing="1">
    <tr>
      <td width="4%" height="56" rowspan="2" bgcolor="#FAFAFA">&nbsp;
</td>
      <td width="90%" rowspan="2" valign="top" bgcolor="#FAFAFA"><br>
        <br>
      <%=dsnewsone("con")%><br>
      <br>
      <br>
      <br></td>
      <td width="6%" rowspan="2" bgcolor="#FAFAFA">&nbsp;</td>
    </tr>
</table>
<br>
<br>
<script type="text/javascript">
document.title='<%=dsnewsone("title")%>';
</script>
<%end if
dsnewsone.close
set dsnewsone=nothing%>
<%=htmlwrite("html14")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
