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

📄 admin_wz.asp

📁 文章管理系统,生成静态网页 .
💻 ASP
字号:
<!--#include file=setup.asp-->
<!--#include file=conn.asp-->
<!--#include file=admin_cookie.asp-->
<!--#include file=head.asp-->
<!--#include file=tohtml.asp-->
<!--#include file=include.asp-->
<%
self=request.servervariables("url")
%>
<%
function ok(a)
response.write "<br><table width=90% align=center cellpadding=3 cellspacing=1 bgcolor=black><tr><td bgcolor=white valign=middle height=120 align=center>"&a&"</table><meta http-equiv='refresh' content='2 url=admin_wz.asp'>"
response.end
end function
%>
<%
set conn=server.createobject("adodb.connection")
conn.open connstr



	if conn.execute("select * from wz").eof then 
	response.write "<table width=90% align=center cellpadding=3 cellspacing=1 bgcolor=#FFFFFF><tr><td height=120 valign=middle align=center bgcolor=#FFFFFF>全部文章已经被删除/或者没有添加</table>"
%>


<%
	response.end
	end if
%>

<%
if request("action")="del" then
	if conn.execute("select * from wz where num="&request("num")&"").eof then ok("错误!要删除的资料没有找到,,可能已经被删除了")
conn.execute("delete * from wz where num="&request("num")&"")
set fso=server.createobject("scripting.filesystemobject")
file="58down/"&request("num")&".htm"

if not fso.fileexists(server.mappath(file)) then
set fso=nothing
ok("你要删除的文章可能已经被删除 返回!")
end if
fso.deletefile(server.mappath(file))
set fso=nothing
ok("删除成功")
end if
%>
<%
if request("xgwz")<>"" then
	if request.cookies("num")="" then ok("未知错误!操作失败")
	num1=request.cookies("num")
	title1=server.htmlencode(trim(request("title1")))
	nr1=to_html(request("nr1"))
	nrtodata1=server.htmlencode(trim(request("nr1")))
	cla1=request("class1")
if len(title)>60 then err("你的标题不能大于30个汉字")
if len(nrtodata1)>60000 then err("你的内容不能大于30000个汉字")
set conn=server.createobject("adodb.connection")
conn.open connstr
conn.execute("update wz set title='"&title1&"',nr='"&nrtodata1&"',class='"&cla1&"' where num="&num1&"")
conn.close

'************** 文章内容模版开始 ***************


main= "<html><title>"&webtitle&":"&title1&"</title><meta http-equiv=Content-Type content=text/html; charset=gb2312><link href=../Style.css rel=stylesheet type=text/css></head><table width=750 border=0 align=center cellpadding=0 cellspacing=0><tr> <td width=150><img src=../logo.gif></td><td height=80>&nbsp;</td></tr></table><table width=750 border=0 align=center cellpadding=0 cellspacing=0><tr> <td width=150><img src=../213cn_gif/ar.gif>&nbsp;<a class=SoftMeun href=../index.asp>"&webtitle&"</a><b>:</b>"&cla1&"</td></tr></table><table width=750 border=0 align=center cellpadding=5 cellspacing=1 bgcolor=#DDDDDD><tr><td height=30 align=center bgcolor=#F2F2F2><strong><font color=#000000>"&title1&"</font></strong></td></tr><tr><td bgcolor=#FFFFFF><br><div align=center>作者:"&request.cookies("user")&"&nbsp;&nbsp;&nbsp;加入时间:"&now()&"</div><br><strong>内容: </strong><br><br>&nbsp;&nbsp;"&nr1&"</td></tr></table><br><table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=2 align=center bgcolor=#DDDDDD></td></tr></table><TABLE cellSpacing=0 cellPadding=0 width=100% border=0><TR><TD bgColor=#f9f9f9 height=60><table width=750 height=60 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=15></td></tr><tr><td align=center height=20>驰志网络版权所有 2003-2005&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;法律声明&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;服务条款&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;隐私声明&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;联系我们&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;广告服务</td></tr><tr><td height=25></td></tr></table></TD></TR></TABLE></body></html>"



'************** 文章内容模版结束 ***************


set fso=server.createobject("scripting.filesystemobject")
set fp=fso.createtextfile(server.mappath("58down/"&num1&".htm"))
fp.write(main)
%>
<table width=90% align=center cellpadding=3 cellspacing=1 bgcolor=#FFFFFF>
<tr><td bgcolor=#FFFFFF valign=middle height=120 align=center>
修改成功<br>
<a class=SoftMeun href=<%=self%>>继续修改文章</a>
<meta http-equiv="refresh" content="2 url=<%=self%>">
</table>
<%
response.end
end if
%>
<%
if request("action")="gl" then
	nums=request("num")
	response.cookies("num")=nums
	if conn.execute("select * from wz where num="&nums&"").eof then ok("没有你要修改的资料")
set rs=conn.execute("select * from wz where num="&nums&"")
title=rs("title")
nr=rs("nr")
user=rs("user")
cla=rs("class")
fbtime=rs("date")
conn.close
%>
<table width=98% align=center cellpadding=3 cellspacing=1 bgcolor=black>
<tr><td bgcolor=white><br>
<form name=form1 action=admin_wz.asp method=post>
<table width=95% align=center cellpadding=3 cellspacing=1 bgcolor=black>

<tr><td bgcolor=white colspan=2 align=center>文章管理</tr>
<tr><td bgcolor=white width=>作者:<td bgcolor=white><%=user%>
<tr><td bgcolor=white width=>发表时间<td bgcolor=white><%=fbtime%>
<tr><td bgcolor=white width=>标题:<td bgcolor=white><input class="inputf" name=title1 size=40 value=<%=title%>>
<tr><td bgcolor=white width= valign=top>内容:
<td bgcolor=white><img src="map/toolbar.gif" width="139" height="22" align="absmiddle" usemap="#Map" border="0"> 
<tr><td bgcolor=white><td bgcolor=white>
<textarea class="input4" name=nr1 cols=50 rows=10><%=nr%></textarea>
<tr><td bgcolor=white width=>分类:<td bgcolor=white>
<select name=class1>
<option value=<%=cla%>><%=cla%></option>
<%
set conn=server.createobject("adodb.connection")
conn.open connstr
set rs1=conn.execute("select * from class order by id desc")
do while not rs1.eof
%>
<option value=<%=rs1("class")%>><%=rs1("class")%></option>

<%
rs1.movenext
loop
%>
</select>
<tr><td colspan=2 bgcolor=white align=center><input name=xgwz class="input1" type=submit value="修改资料"><input class="input1" type=reset value="取消">
</table>

<SCRIPT>
function addcode(code)
{ var tmp=code
 form1.nr1.value=form1.nr1.value+tmp;
 }
</script>

<map name="Map"> 
 <area shape="rect" coords="1,1,23,23" href="javascript:addcode('[b]文字[/b]');" alt="粗体字">
 <area shape="rect" coords="23,1,45,21" href="javascript:addcode('[i]文字[/i]');" alt="斜体字">
 <area shape="rect" coords="45,1,69,20" href="javascript:addcode('[u]文字[/u]');" alt="下划线文字">
 <area shape="rect" coords="69,1,91,22" href="javascript:addcode('[url=链接地址]说明[/url]');" alt="插入网址">
 <area shape="rect" coords="92,0,115,22" href="javascript:addcode('[email=电子信箱地址]说明[/email]');" alt="插入电子邮件">
 <area shape="rect" coords="115,1,138,22" href="javascript:addcode('[img]图片链接地址[/img]');" alt="插入图片">
</map>
</table>

<%
conn.close
response.cookies("user")=user
response.end
end if
%>

<%
'删除全部
if request("action")="delall" then
conn.execute("delete * from wz")
conn.close
set fso=server.createobject("scripting.filesystemobject")

if fso.folderexists(server.mappath("58down")) then
fso.deletefolder(server.mappath("58down"))
fso.createfolder(server.mappath("58down"))
end if
%>
<table width=90% align=center><tr><td height=120 valign=middle align=center>删除全部文章成功</table>
<%
response.end
end if
%>

<%
set rs=server.createobject("adodb.recordset")
cla=request("class")
if cla="" then
rs.open "select * from wz order by id desc",conn,1,1
else
	if conn.execute("select * from wz where class='"&cla&"'").eof then ok("没有文章!")

rs.open "select * from wz where class='"&cla&"' order by id desc",conn,1,1
end if
c=rs.recordcount
onepage=15
rs.pagesize=onepage
pages=rs.pagecount

page=request("page")
if page<=0 then page=1
pump=onepage*(page-1)
%>
<br>
<table width=90% align=center bgcolor=black cellpadding=3 cellspacing=1>
<tr><td bgcolor=white>
共有<%=c%>个文章&nbsp<%=page%>/<%=pages%>页

<%
if page<6 then
firstnum=1
lastnum=6
	if lastnum>pages then lastnum=pages
else
firstnum=page-3
lastnum=page+3
	if lastnum>pages then lastnum=pages
end if
%>
<a class=SoftMeun href=<%=self%>?class=<%=cla%>&page=1 title="第一页"> <<</a>
<%for i=firstnum to lastnum%>
<a class=SoftMeun href=<%=self%>?class=<%=cla%>&page=<%=i%>>
<%=i%>

</a>

<%next%>
<a class=SoftMeun href=<%=self%>?class=<%=cla%>&page=<%=pages%> title="最后一页"> >></a>

<td align=right bgcolor=#FFFFFF><a class=SoftMeun onclick="if(confirm('是否要删除全部吗??/用于最新安装'))location.href=this.href;else return false" href=<%=self%>?action=delall>删除全部文章</a>
</table><br>
<table width=90% align=center bgcolor=black cellpadding=3 cellspacing=1>
<tr><td bgcolor=white colspan=4 >类别:<a class=SoftMeun href=<%=self%>>所有文章</a>
<%
set rs3=conn.execute("select * from class order by num desc")
do while not rs3.eof
response.write "<a class=SoftMeun href="&self&"?class="&rs3("class")&">"&rs3("class")&"</a>&nbsp"
rs3.movenext
loop
%>
</table>



<table width=90% align=center bgcolor=black cellpadding=3 cellspacing=1>
<tr><td bgcolor=white colspan=4 align=center>文章管理
<tr><td bgcolor=white align=center width=70%>标题<td bgcolor=white align=center>发表时间/作者<td bgcolor=white align=center>管理

<%
rs.move pump
for i=1 to onepage
if rs.eof then exit for
%>
<tr><td bgcolor=white><a class=SoftMeun target=_blank href=58down/<%=rs("num")%>.htm title=发表时间:<%=rs("date")%> ><%=rs("title")%></a>
<td bgcolor=white><%=rs("date")%>
<td bgcolor=white><a class=SoftMeun href=admin_wz.asp?action=del&num=<%=rs("num")%>>删除</a>/<a class=SoftMeun                href=admin_wz.asp?action=gl&num=<%=rs("num")%>>管理</a>
<%
rs.movenext
next
%>
</table>



⌨️ 快捷键说明

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