📄 admin_news_add_save.asp
字号:
<%@ Language=VBScript codepage=936%>
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("News_Add") Then
Call ArtErr("","")
End If
%>
<!--#include file = admin_news_syscode.asp -->
<!--#include file = CreatHmlList.asp -->
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
</head>
<body>
<%
if request("lm")<>"" or request("title")<>"" or request("content")<>"" then
'取添加时间的返回值
add_time=trim(request("add_time"))
if not isdate(add_time) then
Response.Write "<Script Language=JavaScript>alert('新闻的日期/时间格式不正确 "&addtime&"');</Script> <meta http-equiv='refresh' content='0; url=javascript:window.history.go(-1);'>"
response.end
end if
lm=trim(request("lm"))
aaa=split(lm,"|")
lm1=aaa(0)
lm2=aaa(1)
lm3=aaa(2)
title=trim(request("title"))
htitle=trim(request("htitle"))
if htitle="" then htitle=" "
title=replace(title,"""","")
title=replace(title,"'","")
content=request("content")
tj=trim(request("tj"))
'html=trim(request("html"))
zz=trim(request("zz"))
piczz=trim(request("piczz"))
ztid=trim(Request("ztid"))
if (not isNumeric(ztid)) then
ztid=0
end if
tuwen=trim(request("tuwen"))
url=trim(request("url"))
titlecolor=trim(request("titlecolor"))
pic=trim(request("pic"))
xgnews=trim(request("xgnews"))
PaginationType=trim(request("PaginationType")) '2008_07_02art添加自动分页功能
MaxCharPerPage=trim(request("MaxCharPerPage"))
if MaxCharPerPage="" then MaxCharPerPage=10000
InfoPurview= ChkClng(G("InfoPurview"))
ArrGroupID = Trim(S("ArrGroupID"))
ReadPoint = ChkNumeric(Request("ReadPoint"))
ontop=trim(request("ontop"))
if ontop<>"5" then ontop=3
ontop=int(ontop)
hit=trim(Request("hit"))
if (not isNumeric(hit)) then
hit=1
end if
if zz="" then zz=" "
if piczz="" then piczz=" "
if url="" then url=" "
if tj="" then tj="不推荐"
if pic="" then
nr=content
nr=replace(nr,"<IMG","<img")
nr=replace(nr,"SRC=","src=")
nr=replace(nr,"","")
nr=replace(nr,"","")
nr=replace(nr,"","")
if instr(nr,"<img")<>0 and instr(nr,"src=")<>0 then
nr=replace(nr,"""","")
aa=Split(nr,"<img")
bb=aa(1)
cc=split(bb,">")
dd=cc(0)
ee=split(dd,"src=")
ff=ee(1)
gg=split(ff," ")
if tuwen="1" then
pic=gg(0)
if instr(pic,"small" )=0 and config("ThumbComponent") <> "0" then 'art增加显示远程上传缩图
pic=replace(pic,".","_s.")
end if
end if
end if
end if
if pic="" then pic=" "
if Request.Cookies(Art2008)("admindj")="2" then
if config("lrySH")=0 then
sh=2
else
sh=1
end if
else
sh=1
end if
addtime=formatdatetime(addtime,0)
If request("id")="" then
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select top 1 * from [news] order by id desc",conn,1,3
rs.addnew
addtime=add_time
rs("time")=addtime
rs("adduser")=Request.Cookies(Art2008)("adminuser")
rs("hit")=hit
rs("lm")=lm1
rs("lm2")=lm2
rs("lm3")=lm3
rs("title")=title
rs("htitle")=htitle
rs("titlecolor")=titlecolor
rs("content")=content
rs("zz")=zz
rs("piczz")=piczz
rs("ztid")=ztid
rs("tj")=tj
rs("html")="0"
pic=replace(pic,"../",path) '修改上传文件选择路径修改
rs("pic")=pic
rs("url")=url
rs("xgnews")=xgnews
rs("ontop")=ontop
rs("sh")=sh
rs("PaginationType")=PaginationType
rs("MaxCharPerPage")=MaxCharPerPage
rs("InfoPurview")=InfoPurview
rs("ArrGroupID")= ArrGroupID
rs("ReadPoint")= ReadPoint
rs.update
news_id=rs("id")
rs.close:set rs=nothing
conn.Execute "update [news] set [updat]="&news_id&" where id="&clng(news_id)
if sh=2 then
Call ArtErr("<li>请等待管理审核,审核之前,你仍然可以编辑新闻。</li>",2)
end if
Else
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select top 1 * from [news] where id="&trim(Request("id"))&" order by id desc",conn,1,3
rs("lm")=lm1
rs("lm2")=lm2
rs("lm3")=lm3
rs("title")=title
rs("htitle")=htitle
rs("titlecolor")=titlecolor
rs("content")=content
rs("zz")=zz
rs("piczz")=piczz
rs("ztid")=ztid
rs("tj")=tj
pic=replace(pic,"../",path) '修改上传文件选择路径修改
rs("pic")=pic
rs("url")=url
rs("xgnews")=xgnews
rs("ontop")=ontop
rs("html")="0"
rs("time")=add_time
rs("hit")=hit
rs("sh")=sh
rs("PaginationType")=PaginationType
rs("MaxCharPerPage")=MaxCharPerPage
rs("InfoPurview")=InfoPurview
rs("ArrGroupID")= ArrGroupID
rs("ReadPoint")= ReadPoint
rs.update
news_id=rs("id")
rs.close:set rs=nothing
if sh=2 then
Call ArtErr("<li>请等待管理审核,审核之前,你仍然可以编辑新闻。</li>",2)
end if
end if
'写入静态文件
'步骤一:取出静态文件的路径和文件名:
'取出配置文件中的是否生成静态html文件的设置
sql = "select * from news where id="&news_id
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,2
MaxCharPerPage=rs("MaxCharPerPage")
PaginationType=rs("PaginationType")
call create_html(news_id)
rs.close
set rs=nothing
end if
tgid=trim(request("tgid"))
if tgid<>"" then
conn.Execute "delete from [usertougao] where ID="&CInt(tgid)
end if
title=trim(request("title"))
content=trim(request("content"))
lmid=lm3
if lmid="0" or lmid="" then lmid=trim(lm2)
if lmid="0" or lmid="" then lmid=trim(lm1)
if lmid="" then lmid=0
sql2 = "select * from lm where id="&lmid
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
if rs2.recordcount<>0 then
lmname=rs2("lm")&rs2("lm2")&rs2("lm3")
end if
rs2.close
set rs2=nothing
title=trim(request("title"))
%>
<br>
<table width="100%" border="0" align=center cellpadding="3" cellspacing="1" bordercolor="#FFFFFF">
<tr>
<td width="100%" height=30 align="center" bgcolor="#FFFFFF" ><b>新闻:[<font color="red"><%=title%></font>] 保存成功!</b></td>
</tr>
<tr>
<td height="20" bgcolor="#EEF7FD" class="indhot" align="center">
<a href="admin_news_add.asp?lmid=<%=lmid%>&titlecolor=<%=titlecolor%>">1、要重新添加新闻</a>
<a href="admin_news_list.asp">2、返回新闻列表。(默认5秒钟后自动选择).</a>
</td>
</tr>
<%If config("listHtml")=0 then%>
<tr><td class="tdbg">
<%
Dim HtmlLm1,HtmlLm2,HtmlLm3
ggg=split(lm,"|")
Htmllm1=ggg(0)
Htmllm2=ggg(1)
Htmllm3=ggg(2)
if Htmllm3<>0 then CreatHmlList(Htmllm3)
if Htmllm2<>0 then CreatHmlList(Htmllm2)
if Htmllm1<>0 then CreatHmlList(Htmllm1)
%>
</td></tr>
<% End If%>
</table>
<!--#include file = xml-BaiDu.ASP -->
</body>
<META http-equiv="refresh" content="5;url=admin_news_list.asp">
</html>
<%
Call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -