<!--#include file="../Ku_inc/Ku_sql.asp"-->
<!--#include file="../Ku_inc/Ku_config.asp"-->
<!--#include file="Ku_conn.asp"-->

<!--#include file="../Ku_inc/inc.asp"-->

<!-- #include file="Session.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
if Trim(Request("title"))="" then
	FoundErr=True
	Message=Message & "<li>标题不能为空！</li>"
end if

jifen=request("jifen")
    If isInt(jifen)=False OR Not IsNumeric(jifen) Then
	Message=Message & "<li>积分只能为数字！</li>"
	end if
if cstr(Request("Mode"))=2 then
	if IsValIDURL(Trim(Request("URL")))=false then
		FoundErr=True
		Message=Message & "<li>链接地址(URL)格式错误！</li>"
	end if
end if

if Trim(Request("URL"))<>"" then
	if cstr(Request("Mode"))<>2 then
		FoundErr=True
		Message=Message & "<li>信息类型选择错误！</li>"
	end if
end if



if FoundErr<>True then
       pic=Replace(request("pic"),left(request("pic"),3),"")		
	   Set cmdTemp = Server.CreateObject("ADODB.Command")
       Set kurs = Server.CreateObject("ADODB.Recordset")
       cmdTemp.CommandText = "SELECT top 1 * FROM ku_news"
       cmdTemp.CommandType = 1
       Set cmdTemp.ActiveConnection = conn
       kurs.Open cmdTemp, , 1, 3
       kurs.addnew 
       kurs("class") =trim(request("class"))
       kurs("kind") =trim(request("kind"))
       kurs("title") =strLeach(trim(request("title")))
       kurs("yanse") =trim(request("dcolor"))
       if pic<>"" then
       kurs("picyes")=1       
       kurs("pic")=pic
       else
       rs("picyes")=0 
       end if


       kurs("zuozhe") =strLeach(trim(request("zuozhe")))
       kurs("laiyuan") =strLeach(trim(request("laiyuan")))
       kurs("pinglun") =strLeach(trim(request("pinglun")))
       if jifen > 0 then
       kurs("jifen") =jifen
       else
       kurs("jifen")=0
       end if
       kurs("URL") =trim(request("URL"))
       kurs("Mode") =trim(request("Mode"))
       kurs("dateandtime") =now()
       kurs("shenhe") =1

       kurs("content") =trim(request("content"))
       kurs.Update
       kurs.close
	   conn.close
       set kurs=nothing
       set conn=nothing
	   
       call performMsg("操作成功！","")
end if
if FoundErr=True then
	call ErrMsg(Message)
end if
%>
