<%
Randomize
dtt= int((999-100+1) * RND +100)
%>
<!--#include file = admin_conn.asp -->
<html>

<head>
<!--#include file = language.asp -->
<title>ÐÂ½¨ÍøÒ³ 1</title>
</head>
<%
if request("lm")<>"" or request("title")="" or request("content")="" then

  lm=trim(request("lm"))
  aaa=split(lm,"|")
  lm1=aaa(0)
  lm2=aaa(1)
  lm3=aaa(2)
  title=trim(request("title"))
  htitle=trim(request("htitle"))
  if htitle="" then htitle="&nbsp;"
  title=replace(title,"""","")
  title=replace(title,"'","")
  content=request("content")
  tj=trim(request("tj"))
  html=trim(request("html"))
  zz=trim(request("zz"))
  tuwen=trim(request("tuwen"))
  url=trim(request("url"))
  titlecolor=trim(request("titlecolor"))
  xgnews=trim(request("xgnews"))
  ontop=trim(request("ontop"))
  if ontop<>"5" then ontop=3
  ontop=int(ontop)
  if zz="" then zz=" "
  url=" "
  if tj="" then tj="²»ÍÆ¼ö"
  if html="1" then
     filename=date()&"-"&hour(now())&"-"&Minute(now())&"-"&Second(now())&"-"&dtt&".htm"
  else
     filename="0"
  end if
  response.write filename
  pic=" "
  nr=LCase(content)
  if instr(nr,"<img")<>0 and instr(nr,"src=")<>0 then
     nr=replace(nr,"""","")
     aa=Split(nr,"<img")
     bb=aa(1)
     cc=split(bb,">")
     dd=cc(0)
     ee=split(dd,"src=")
     ff=ee(1)
     gg=split(ff," ")
     if tuwen="1" then
       pic=gg(0)
     end if
  end if
  
 if request("id")="" then
 
  sql = "select top 1 * from news"
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,2
  
  rs.addnew
  rs("updat")=now()
  else
  
  sql = "select * from news where id="&request("id")
  Set rs = Server.CreateObject("ADODB.RecordSet")
  rs.Open sql,conn,1,2
  
 end if
 
  rs("lm")=lm1
  rs("lm2")=lm2
  rs("lm3")=lm3
  rs("html")=filename
  rs("title")=title
  'rs("htitle")=htitle
  rs("titlecolor")=titlecolor
  rs("content")=content
  rs("zz")=zz
  rs("tj")=tj
  rs("pic")=pic
  rs("url")=url
  rs("adduser")=session("admin__user")
  rs("xgnews")=xgnews
  rs("ontop")=ontop
  rs.update
  rs.close
  set rs=nothing
  'Response.Redirect "newstg.asp?lm="&lm2&"&titlecolor="&titlecolor
end if

conn.close
set conn=nothing
Response.Redirect "newstg.asp?lm="&lm2&"&titlecolor="&titlecolor&"&html="&html
%>
<body>

</body>

</html>
 
