⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_newsadd3.asp

📁 庐江二中
💻 ASP
字号:
<!--#include file="session.asp"-->
<%checkAdmin1%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="inc/ubb.asp"-->
<%
founderr=false
function changechr(str)
changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," "," ")
changechr=replace(changechr,"'","&quot;")
changechr=replace(changechr,mid(" "" ",2,1),"&quot;")
end function


SmallClassName=Request.Form("SmallClassName")
txttitle=request.form("txttitle")
if len(txttitle)>128 then
errmsg=errmsg+"<li>文章标题过长!限定128个字符。"
founderr=true
end if

title=changechr(trim(request.form("txttitle")))
Author=replace(trim(Request.Form("Author")),"'","''")
if len(Author)>20 then
errmsg=errmsg+"<li>文章作者过长!限定20个字符。"
founderr=true
end if

Original=replace(trim(Request.Form("Original")),"'","''")
if len(Original)>20 then
errmsg=errmsg+"<li>文章来源过长!限定20个字符。"
founderr=true
end if

Content=Request.Form("Content")
Content=UBBCode(content)
titleurl=Request.Form("titleurl")
if titleurl="" then
if Content="" then
errmsg=errmsg+"<li>没有输入文章内容。"
founderr=true
end if
end if

if Not IsNumeric(Request.Form("image")) Or IsEmpty(Request.Form("image")) Or Request.Form("image")=<0 then
image=0
else
image=Request.Form("image")
end if

if image>0 then
for i=1 to image
if instr(Content,"[[image"&i&"]]")=0 then
errmsg=errmsg+"<li>没有插入图片代码:[[image"&i&"]]。"
founderr=true
end if
next
end if

FocusNews=Request.Form("FocusNews")
if IsEmpty(FocusNews) then
FocusNews=false
else
FocusNews=true
end if

goodnews=Request.Form("goodnews")
if IsEmpty(goodnews) then
goodnews=false
else
goodnews=true
end if

hot=Request.Form("hot")
if IsEmpty(hot) then
hot=false
else
hot=true
end if

if OpenCheck=1 then
checked=Request.Form("checked")
if IsEmpty(checked) Then
checked=false
else
checked=true
end if
else
checked=true
end if

if OpenCheck=0 Then
checked=true
end if

OnTop=Request.Form("OnTop")
if IsEmpty(OnTop) Then
OnTop=false
else
OnTop=true
end if

if founderr=true then
set rs=nothing
conn.close
set conn=nothing
call error()
else

sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("titleurl")=titleurl
rs("Author")=Author
rs("content")=content
rs("Original")=Original
rs("image")=image
rs("FocusNews")=FocusNews
rs("goodnews")=goodnews
rs("hot")=hot
rs("checked")=checked
rs("OnTop")=OnTop
rs("model")=Request.Form("model")
rs("BigClassName")=Request.Form("BigClassName")
rs("SmallClassName")=Request.Form("SmallClassName")
rs("SpecialName")=Request.Form("SpecialName")
rs("about")=Request.Form("about")
rs("UpdateTime")=Request.Form("UpdateTime")
rs("username")=Session("username")
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing

if image=0 then
Response.Redirect "admin_NewsAdd1.asp?BigClassName="&Request.Form("BigClassName")&"&SmallClassName="&Request.Form("SmallClassName")
else
if UploadFlag=0 then Response.Redirect "admin_NewsAdd1.asp?BigClassName="&Request.Form("BigClassName")&"&SmallClassName="&Request.Form("SmallClassName")
if UploadFlag=1 then Response.Redirect "admin_uploadSelect.asp?Time=" & Request.Form("UpdateTime") &"&image="&image
if UploadFlag=2 then Response.Redirect "admin_UploadImgSelect.asp?Time=" & Request.Form("UpdateTime") &"&image="&image
end if

end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -