<% if session("purview")="" then response.write "错误!!您没有权限或者连接超时,请重新登陆." %> 登陆 <% response.end end if set rs=server.createobject("adodb.recordset") '查找审核员权限,文章默认状态 rs.open "select * from news_parameter where parameterid=1",conn,1,1 if not rs.bof and not rs.eof then if rs("newsstatus")=1 then newsstatus=1 else newsstatus=0 end if if rs("auditer")=1 then auditer=1 else auditer=0 end if else auditer=0 newsstatus=0 end if rs.close set rs=nothing function invert(str) invert=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"
")," "," ") end function FormSize=Request.TotalBytes FormData=Request.BinaryRead(FormSize) Set Fields = GetUpload(FormData) imgsize= Fields("img").length imgtype= Fields("img").ContentType imgdata=Fields("img").Value typeid=Fields("typeid").Value page=Fields("page").Value borderid=Fields("borderid").Value newsid=Fields("newsid").Value topic=Fields("topic").Value ntime=Fields("ntime").Value keys=Fields("keys").Value nfrom=Fields("nfrom").Value content=invert(Fields("content").Value) if topic="" or keys="" or content="" then response.write "错误!!带*号的为必填项! 返回" response.end end if if (session("purview")="99998" and auditer=1) or session("purview")="99999" then audit=Fields("audit").Value end if writer=Fields("writer").Value action=Fields("action").Value hit=0 modify=cstr(session("name")) if (session("purview")="99998" and auditer=1) or session("purview")="99999" or cstr(typeid)=cstr(session("purview")) then if action="modify" then '*****************************修改文章****************************** set rs=server.createobject("ADODB.recordset") rs.Open "SELECT * from news Where newsid=" & newsid,conn,1,3 if ntime="" then response.write "错误!!时间不能为空!!! 返回" response.end end if if cstr(rs("imgsize"))<>0 then nochange=Fields("nochange").Value if nochange<>1 then if imgtype<>"image/pjpeg" and imgtype<>"image/gif" then rs("imgsize")=0 else rs("img").appendchunk imgdata rs("imgsize")=imgsize end if end if else if imgtype<>"image/pjpeg" and imgtype<>"image/gif" then rs("imgsize")=0 else rs("img").appendchunk imgdata rs("imgsize")=imgsize end if end if rs("typeid")=typeid rs("borderid")=borderid rs("topic")=topic rs("content")=content rs("ntime")=ntime rs("keys")=keys rs("nfrom")=nfrom if (session("purview")="99998" and auditer=1) or session("purview")="99999" then rs("audit")=audit end if rs("writer")=writer rs("modify")=modify if session("purview")>"99997" then rs("auditer")=cstr(session("name")) end if rs.update rs.close set rs=nothing response.redirect "newsmanage.asp?typeid=" & typeid & "&borderid=" & borderid & "&newsid=" & newsid & "&page=" & page end if 'action="modify" if action="add" then '*****************************添加新文章****************************** set rs=server.createobject("ADODB.recordset") rs.Open "SELECT * from news",conn,1,3 rs.addnew if imgtype<>"image/pjpeg" and imgtype<>"image/gif" then rs("imgsize")=0 else rs("img").appendchunk imgdata rs("imgsize")=imgsize end if rs("typeid")=typeid rs("borderid")=borderid rs("topic")=topic rs("content")=content rs("keys")=keys rs("nfrom")=nfrom rs("ntime")=now() if (session("purview")="99998" and auditer=1) or session("purview")="99999" then rs("audit")=audit else rs("audit")=newsstatus end if rs("writer")=writer rs("modify")=modify if session("purview")>"99997" then rs("auditer")=cstr(session("name")) end if rs.update rs.close set rs=nothing response.redirect "newsmanage.asp?typeid=" & typeid & "&borderid=" & borderid & "&newsid=" & newsid end if 'action="add" end if 'if auditer=1 or session("purview")="99999" or cstr(request("typeid"))=cstr(session("purview")) %>