📄 admin_daily.asp
字号:
<!-- #include file="../conn.asp" -->
<!--#include file="session.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/GetFunction.asp"-->
<!--#include file="../inc/upfile.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
Select Case request.querystring("info")
Case "update_add"
Call update_add()
Case "update_edit"
Call update_edit()
Case "update_del"
Call update_del()
Case "update_listdel"
Call update_listdel()
Case "vote_add"
Call vote_add()
Case "vote_edit"
Call vote_edit()
Case "vote_del"
Call vote_del()
Case "add_choice"
Call add_choice()
Case "edit_choice"
Call edit_choice()
Case "del_choice"
Call del_choice()
Case "link_class_add"
Call link_class_add()
Case "link_class_edit"
Call link_class_edit()
Case "link_class_del"
Call link_class_del()
Case "aclass"
Call aclass()
Case "links_add"
Call links_add()
Case "links_edit"
Call links_edit()
Case "links_del"
Call links_del()
Case "gbook_del"
Call gbook_del()
Case "gbook_listdel"
Call gbook_listdel()
Case "gbook_reply"
Call gbook_reply()
Case "duanxin_del"
Call duanxin_del()
Case "duanxin_listdel"
Call duanxin_listdel()
end select
sub update_add()
if trim(request.form("Istop"))="" then
Istop=0
else
Istop=trim(request.form("Istop"))
end if
if trim(request.form("Iscontent"))="" then
Iscontent=0
else
Iscontent=trim(request.form("Iscontent"))
end if
if trim(request.form("Islink"))="" then
Islink=0
else
Islink=trim(request.form("Islink"))
end if
if request.form("subject")="" then
ErrCodes = ErrCodes & "<li>请添写公告标题!</li><br>"
FoundErr=True
end if
if len(request.form("subject"))>200 then
ErrCodes = ErrCodes & "<li>您发表的公告标题大于所规定字数(限定200字之内)!</li><br>"
FoundErr=True
end if
if request.form("subject")="" then
ErrCodes = ErrCodes & "<li>请添写公告内容!</li><br>"
FoundErr=True
end if
if len(request.form("message"))>50000 then
ErrCodes = ErrCodes & "<li>您发表的公告内容大于所规定字数(限定50000字之内)!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
set rs=server.createobject("adodb.recordset")
sql="select * from news order by id desc"
rs.open sql,conn,1,3
rs.addnew
rs("Istop")=Istop
rs("Iscontent")=Iscontent
rs("Islink")=Islink
rs("Ntype")=request.form("Ntype")
rs("txttitle")=htmlencode(request.form("subject"))
rs("txtcontent")=htmlencode(request.form("message"))
rs("username")=GetTextFromHtml(trim(request.form("username")))
rs.update
rs.close
rs.open sql,conn,1,1
ID=rs("ID")
rs.close
set rs=nothing
if request.form("attach")<>"" then
attachArray=Split(request.form("attach"),";")
For i1=0 To Ubound(attachArray)-1
if Instr(request.form("message"),attachArray(i1))> 0 then
attachid=CheckSql(Replace(Replace(attachArray(i1),"[attach]",""),"[/attach]",""))
CheckSqlnum(attachid)
conn.execute ("update filetest set fileurl_fileID="&ID&" where id="&attachid)
end if
Next
end if
if makeJS=1 then
temgonggao(gonggaoNum)
end if
call connclose()
Call ShowAdminSuccessMsg("公告添加成功!","admin_update.asp?info=list&cndb=all")
end if
end sub
'——————————
sub update_edit()
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
if trim(request.form("Istop"))="" then
Istop=0
else
Istop=trim(request.form("Istop"))
end if
if trim(request.form("Iscontent"))="" then
Iscontent=0
else
Iscontent=trim(request.form("Iscontent"))
end if
if trim(request.form("Islink"))="" then
Islink=0
else
Islink=trim(request.form("Islink"))
end if
if len(request.form("subject"))>200 then
ErrCodes = ErrCodes & "<li>您发表的公告标题大于所规定字数(限定200字之内)!</li><br>"
FoundErr=True
end if
if len(request.form("message"))>50000 then
ErrCodes = ErrCodes & "<li>您发表的公告内容大于所规定字数(限定50000字之内)!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
conn.execute ("update news set "&_
"Istop="&Istop&","&_
"Iscontent="&Iscontent&","&_
"Islink="&Islink&","&_
"Ntype="&request.form("Ntype")&","&_
"txttitle='"&htmlencode(request.form("subject"))&"',"&_
"txtcontent='"&htmlencode(request.form("message"))&"',"&_
"username='"&GetTextFromHtml(trim(request.form("username")))&"'"&_
" where id="&id)
if request.form("attach")<>"" then
attachArray=Split(request.form("attach"),";")
For i1=0 To Ubound(attachArray)-1
if Instr(request.form("message"),attachArray(i1))> 0 then
attachid=CheckSql(Replace(Replace(attachArray(i1),"[attach]",""),"[/attach]",""))
CheckSqlnum(attachid)
conn.execute ("update filetest set fileurl_fileID="&ID&" where id="&attachid)
end if
Next
end if
'处理文章中包含的上传附件开始
nolinkfile=""
set rs=server.createobject("adodb.recordset")
sql="select id from filetest where fileurl_class=0 and fileurl_fileID="&ID&" order by id desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
else
do while not rs.eof
attachs="[attachimg]attachment.asp?id="&rs("id")&"[/attachimg]"
attachs1="[attach]"&rs("id")&"[/attach]"
if Instr(request.form("message"),attachs)< 1 then
nolinkfile=nolinkfile&"||"&rs("id")
end if
if Instr(request.form("message"),attachs1)< 1 then
nolinkfile=nolinkfile&"||"&rs("id")
end if
Rs.MoveNext
Loop
end if
Rs.Close
Set Rs=Nothing
if nolinkfile<>"" then
arrnolink=split(nolinkfile,"||")
for i=1 to ubound(arrnolink)
conn.execute ("update filetest set fileurl_fileID=0 where id="&arrnolink(i))
next
end if
'处理文章中包含的上传附件结束
if makeJS=1 then
temgonggao(gonggaoNum)
end if
call connclose()
Call ShowAdminSuccessMsg("公告修改成功!","admin_update.asp?info=list&cndb=all")
end if
end sub
'——————————
sub update_del()
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
conn.execute"delete from news where id = "&id&""
set rsfile=server.createobject("adodb.recordset")
strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=0 and fileurl_fileID ="&id&""
rsfile.open strSQL,conn,1,1
if not(rsfile.eof and rsfile.bof) then
do while not rsfile.eof
file1=rsfile("fileurl_path")&rsfile("fileurl_name")
FSOFiledel(file1)
rsfile.movenext
loop
end if
rsfile.close
set rsfile=nothing
conn.execute"delete from filetest where fileurl_class=0 and fileurl_fileID ="&id&""
if makeJS=1 then
temgonggao(gonggaoNum)
end if
call connclose()
Call ShowAdminSuccessMsg("<li>公告删除成功!</li>","admin_update.asp?info=list&cndb=all")
end sub
'——————————
sub update_listdel()
id=trim(request("checked"))
If ID="" Then
ErrCodes = ErrCodes & "<li> 您至少需要选择一条公告!</li><br>"
FoundErr=True
End If
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:window.close()")
else
viewArray=Split(ID, ",")
For i=0 To UBound(viewArray)
conn.execute"delete from news where id = "&viewArray(i)&""
set rsfile=server.createobject("adodb.recordset")
strSQL ="select fileurl_name,fileurl_path from filetest where fileurl_class=0 and fileurl_fileID ="&viewArray(i)&""
rsfile.open strSQL,conn,1,1
if not(rsfile.eof and rsfile.bof) then
do while not rsfile.eof
file1=rsfile("fileurl_path")&rsfile("fileurl_name")
FSOFiledel(file1)
rsfile.movenext
loop
end if
rsfile.close
set rsfile=nothing
conn.execute"delete from filetest where fileurl_class=0 and fileurl_fileID ="&viewArray(i)&""
Next
if makeJS=1 then
temgonggao(gonggaoNum)
end if
call connclose()
response.write ("<script>opener.location.reload();</script>")
Call ShowAdminSuccessMsg("操作成功!","javascript:window.close()")
end if
end sub
'——————————
sub link_class_add()
if request.form("link_class")="" then
ErrCodes = ErrCodes & "<li>请添写分类名称!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
set rs=server.createobject("adodb.recordset")
sql="select link_class,link_info from link_class"
rs.open sql,conn,1,3
rs.addnew
rs("link_class")=GetTextFromHtml(trim(request.form("link_class")))
rs("link_info")=GetTextFrHtml(htmlencode(request.form("link_info")))
rs.update
rs.close
set rs=nothing
call connclose()
Call ShowAdminSuccessMsg("<li>连接分类添加成功!</li><br>","admin_links.asp?info=classlist")
end if
end sub
'——————————
sub link_class_edit()
classid=CheckSql(request.querystring("classid"))
CheckSqlnum(classid)
classid=int(classid)
if request.form("link_class")="" then
ErrCodes = ErrCodes & "<li>分类名称不能为空!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
conn.execute ("update link_class set "&_
"link_class='"&GetTextFromHtml(trim(request.form("link_class")))&"',"&_
"link_info='"&GetTextFrHtml(htmlencode(request.form("link_info")))&"'"&_
" where id="&classid)
if makeJS=1 then
temtxtlink(TXTNum)
temlogolink(LOGONum)
temtxt_link(TXTNum)
temlogo_link(LOGONum)
end if
call connclose()
Call ShowAdminSuccessMsg("<li>连接分类修改成功!</li><br>","admin_links.asp?info=classlist")
end if
end sub
'——————————
sub link_class_del()
id=CheckSql(request.querystring("id"))
CheckSqlnum(id)
id=int(id)
conn.execute "delete from link where link_class = "&id&""
conn.execute "delete from link_class where id = "&id&""
if makeJS=1 then
temtxtlink(TXTNum)
temlogolink(LOGONum)
temtxt_link(TXTNum)
temlogo_link(LOGONum)
end if
call connclose()
Call ShowAdminSuccessMsg(Success & "<li>连接分类删除成功!</li><br>","admin_links.asp?info=classlist")
end sub
'——————————
sub aclass()
oldclass=request("oldclass")
newclass=request("newclass")
if oldclass="" or newclass="" then
ErrCodes = ErrCodes & "<li>您需要选择原分类和目标分类!</li><br>"
FoundErr=True
end if
if newclass=oldclass then
ErrCodes = ErrCodes & "<li>原分类和目标分类不能相同!</li><br>"
FoundErr=True
end if
if FoundErr=True then
Call ShowAdminErrMsg(ErrCodes,"javascript:history.go(-1)")
else
conn.execute ("update link set link_class="&newclass&" where link_class="&oldclass)
if makeJS=1 then
temtxtlink(TXTNum)
temlogolink(LOGONum)
temtxt_link(TXTNum)
temlogo_link(LOGONum)
end if
call connclose()
Call ShowAdminSuccessMsg("<li> 合并连接分类 操作完成!</li><br>","admin_links.asp?info=classaclass")
end if
end sub
'——————————
sub links_add()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -