📄 newsadd2.asp
字号:
<!--#include file=conn.asp -->
<!--#include file=../include/config.asp -->
<!--#include file=chkuser.asp -->
<%
Content=Request.Form("Content")
content=replace(content,"http://"&xpurl&"/uploadfile/","uploadfile/")
Response.cookies("content")=content
if Content="" then
%>
<script language=javascript>
history.back()
alert("请输入文章内容!")
</script>
<%
Response.End
end if
if request.cookies("key")="super" then
if request("viewhtml")<>"" then
%>
<script language=javascript>
history.back()
alert("请取消查看HTML源代码后再添加!")
</script>
<%
Response.End
end if
end if
SmallClassid=Request.Form("SmallClassid")
bigClassid=Request.Form("bigClassid")
typeid=Request.Form("typeid")
title=trim(request.form("title"))
if title="" then
%>
<script language=javascript>
history.back()
alert("请填写文章标题!")
</script>
<%
Response.End
end if
if len(title)>100 then
%>
<script language=javascript>
history.back()
alert("文章标题过长!")
</script>
<%
Response.End
end if
if request.Form("goodnews")="1" then
goodnews=1
else
goodnews=0
end if
if request.Form("picnews")="1" then
picnews=1
else
picnews=0
end if
if request.Form("istop")="1" then
istop=1
else
istop=0
end if
dim filename
filename=session("filename")
SpecialID=Request.Form("SpecialID")
SpecialID2=Request.Form("SpecialID2")
Author=replace(trim(Request.Form("Author")),"'","''")
Original=replace(trim(Request.Form("Original")),"'","''")
about=Request.Form("about")
editor=request.form("editor")
checkked=request.form("checkked")
image=Request.Form("image")
EnCode=Request.Form("EnCode")
newsrelated=Request.Form("newsrelated")
newslevel=Request.Form("newslevel")
title_color=Request.Form("title_color")
title_size=Request.Form("title_size")
title_type=Request.Form("title_type")
title_face=Request.Form("title_face")
set rs=server.createobject("adodb.recordset")
sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("Author")=Author
rs("content")=content
rs("Original")=Original
rs("goodnews")=goodnews
rs("image")=image
rs("picnews")=picnews
if newslevel="" then
rs("newslevel")=0
else
rs("newslevel")=newslevel
end if
rs("istop")=istop
rs("editor")=editor
rs("checkked")=checkked
rs("BigClassid")=BigClassid
rs("SmallClassid")=SmallClassid
rs("SpecialID")=SpecialID
rs("SpecialID2")=SpecialID2
rs("EnCode")=EnCode
rs("newsrelated")=newsrelated
rs("about")=about
rs("picname")=filename
rs("titletype")=title_type
rs("titlesize")=title_size
rs("titlecolor")=title_color
rs("titleface")=title_face
rs("typeid")=typeid
rs("UpdateTime")=now()
rs.update
newsid=rs("newsid")
dim username
username=request.cookies("username")
set rs2=server.createobject("adodb.recordset")
sql2="select * from admin where username='"&username&"'"
rs2.open sql2,conn,1,3
rs2("number")=rs2("number")+1
rs2.update
rs2.close
set rs2=nothing
rs.Close
set rs=nothing
Response.cookies("content")=""
Response.cookies("newsrelated")=""
if request.cookies("filename")<>"" then
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
<title><%=copyright%><%=version%> <%=ver%> - 图片管理</title>
</head>
<body topmargin="0"><!--#include file=top.asp--><br>
<center>
<table border="1" width="750" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="<%=border%>">
<form name="form1" method="post" action="newsadd3.asp">
<tr>
<td colspan="4" width="100%" align="center" valign="middle" height="24" bgcolor="<%=m_top%>"><b>选择显示在首页的文件</b> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="4" width="100%" align="center" valign="middle" ></td>
</tr>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql ="SELECT * From uploadpic where username='"&request.cookies("username")&"'"
RS.open sql,Conn,3,3
%>
<tr align="center" bgcolor="<%=m_top%>" height=25>
<td width="10%">上传文件顺序</td>
<td width="10%">选择</td>
<td width="30%">预览</td>
</tr>
<%
do while not rs.eof
fileExt=lcase(getFileExtName(rs("picname")))
%>
<tr align="center">
<td width="10%"><%=rs("id")%> </td>
<td width="10%"><input type="radio" name="picname" value="<%=rs("picname")%>"></td>
<td width="30%"><%if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then%><a target="_blank" href="../uploadfile/<%=rs("picname")%>"><img src="../uploadfile/<%=rs("picname")%>" height=100 border=0></a><%end if%>
<%if fileext="swf" then%><object width='133' height='100' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'><param name=movie value="../uploadfile/<%=rs("picname")%>"><param name=quality value=high><param name='Play' value='0'><param name='Loop' value='-1'><param name='Menu' value='-1'>
<embed src="../uploadfile/<%=rs("picname")%>" pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed></object><%end if%><%if fileext="wmv" or fileext="avi" or fileext="asf" or fileext="mpg" or fileext="mpeg" then%><object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width="133" height="100"><param name=Filename value="../uploadfile/<%=rs("picname")%>"><param name='BufferingTime' value='5'><param name='AutoSize' value='0'><param name='AutoStart' value="0"><param name='EnableContextMenu' value="-1"><param name='ShowDisplay' value='0'><param name='AnimationAtStart' value='-1'><param name='AllowChangeDisplaySize' value='-1'><param name='ShowPositionControls' value='0'><param name='TransparentAtStart' value='1'><param name='ShowStatusBar' value='0'></object><%end if%><%if fileext="rm" or fileext="ra" or fileext="ram" then%><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width="133" height="100"><param name='CONTROLS' value='ImageWindow'><param name=src value="../uploadfile/<%=rs("picname")%>"><param name='CONSOLE' value='Clip1'><param name='AUTOSTART' value="0">
<param name='LOOP' value="0">
<param name="_ExtentX" value="3519">
<param name="_ExtentY" value="2646">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000">
</object><%end if%>
</td>
</tr>
<%
RS.MoveNext
Loop
rs.close
set rs=nothing
conn.close
set conn=nothing%>
<tr bgcolor="<%=m_top%>" align="center">
<td colspan="4" height="30" width="760">
<input type="hidden" name="bigclassid" value="<%=bigclassid%>">
<input type="hidden" name="smallclassid" value="<%=smallclassid%>">
<input type="hidden" name="newsid" value="<%=newsid%>">
<input type="hidden" name="image" value="<%=image%>">
<input type="hidden" name="upload" value="<%=upload%>">
<input type="submit" value=" 添 加 " name="Submit" class="unnamed5"></td>
</tr>
</table>
</center></form>
</body>
</html>
<%else
if image=0 then
response.write "<p align=center><font color=red>恭喜您,文章“"&title&"”已经成功添加!<br>"&freetime&"秒钟后返回上页!</font>"
if smallclassid<>"" then
response.write "<meta http-equiv=""refresh"" content="""&freetime&";url=listnews.asp?smallclassid="&smallclassid&""">"
else
response.write "<meta http-equiv=""refresh"" content="""&freetime&";url=smallno.asp?bigclassid="&bigclassid&""">"
end if
else
if upload=1 then
Response.Redirect "newsuploadimage.asp?newsid=" &newsid
else
Response.Redirect "newsuploadfile.asp?newsid=" &newsid
end if
end if
end if
function getFileExtName(fileName)
dim pos
pos=instrrev(filename,".")
if pos>0 then
getFileExtName=mid(fileName,pos+1)
else
getFileExtName=""
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -