<!--#include file="../../inc/conn.asp"-->
<!-- #include file="../session.asp"-->
<!-- #include file="../vippass.asp"-->
<%function changechr(str) 
changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") 
changechr=replace(replace(replace(replace(changechr,"[sayyes]","<img src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>") 
changechr=replace(replace(replace(replace(changechr,"[/sayyes]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>") 
end function

if request("a")="add" then
  set rs=server.CreateObject("adodb.recordset")
  rs.open "select * from cdkey88_news where news_title='"&request("news_title")&"' and username='"&session("username")&"'",conn,1,3
  if not rs.eof then
  response.write"<script>alert('你已经添加过该新闻，请不要重复添加');history.go(-1)</script>"
  response.End()
  else
  rs.addnew
  rs("news_title")=request("news_title")
  rs("news_content")=request("content")
  rs("date")=date()
  rs("f")=0
  rs("username")=session("username")
  rs("game_id")=request("game_id")
  rs("typeid")=request("news_typeid")
  if request("news_flag")<>"" then
  rs("news_flag")=1
  else
  rs("news_flag")=0
  end if
  rs.update
  rs.close
  end if
  end if
  
  if request("a")="edit" then
 set rs=server.CreateObject("adodb.recordset")
  rs.open "select * from cdkey88_news where news_id="&cint(request("news_id")),conn,1,3
  rs("news_title")=request("news_title")
  rs("news_content")=request("content")
  rs("date")=date()
  rs("game_id")=request("game_id")
  rs("typeid")=request("news_typeid")
    if request("news_flag")<>"" then
  rs("news_flag")=1
  else
  rs("news_flag")=0
  end if
  rs.update
  rs.close
  set rs=nothing
  end if
  conn.close
  set conn=nothing
  %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>操作成功 - Powered by GoCDKEY! | www.gocdkey.cn</title>
<meta HTTP-EQUIV=refresh Content='1;url=list.asp'>
<style type="text/css">
<!--
body,td,th {
	font-size: 14px;
	color: #0590D3;
}
-->
</style></head>

<table border="0" cellspacing="0" width="100%" cellpadding="0" height="218" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="218" valign="middle" align="center">
<b>恭喜您，您的信息操作成功!<a href="list.asp">返回管理</a></b></td>
</tr>
</table>
</body>
</html>
