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

📄 data.asp

📁 网页源码,是最好的网店代码。可以支持批量上传产品等功能。
💻 ASP
📖 第 1 页 / 共 4 页
字号:
	if bbsfiles="" then bbsfiles="0"
	set fso=server.createobject("scripting.filesystemobject")
	if not fso.folderexists(server.mappath(del)) then fso.createfolder(server.mappath(del))
	set folder=fso.getfolder(server.mappath(topicfile))
	set files=folder.files
	for each upname in files
		if instr(bbsfiles,upname.name)<=0 then
		yxbbs.execute("delete * from [yx_upfile] where filename='"&upname.name&"'")
		if go="move" then
			fso.movefile server.mappath(topicfile&upname.name),server.mappath(del&upname.name)
		else
			fso.deletefile(server.mappath(topicfile&upname.name))
		end if
		end if
	next
	set folder=nothing
	set files=nothing
	set fso=nothing
	response.write"<script>abc.style.visibility = ""hidden"";</script>"
	if go="move" then
		call suc("","无用的上传文件已经被转移至"&del&"目录下 !","?action=uploadfile")
	else
		call suc("","无用的上传文件已经删除 !","?action=uploadfile")
	end if
end sub

function tblist(num)
	dim alltable,i,temp
	alltable=split(yxbbs.bbstable(0),",")
	for i=0 to ubound(alltable)
		if int(alltable(i))=int(num) then
		temp=temp&"【<font color=red>数据表"&alltable(i)&"</font>】"
		else
		temp=temp&"【<a href='?action=tbinfo&tb="&alltable(i)&"'>数据表"&alltable(i)&"</a>】"
		end if
	next
	tblist=temp
end function

sub recycle()
%>
<form name='yimxu'  style='margin:0' method='post' action='?action=submit'>
<div class="ta">
<div class="th jz">帖 子 回 收 站</div>
<div class="tf w770" style="text-align: left;">【<a href="?action=recycle"><font color="red">列出全部主题</font></a>】<%=tblist(0)%> 【<a onclick=checkclick('您确定要清空回收站的全部帖子吗?') href="?action=recycledelall"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle" />清空回收站</a>】</div>
<div class="td3 jz w87">选择</div>
<div class="td3 jz w332">帖子</div>
<div class="td3 jz w106">作者</div>
<div class="td3 jz w219">最后时间</div>
<%
	dim intpagenow,arr_rs,i,pages,conut,page,strpageinfo
	dim temp,bbsid
	intpagenow = request.querystring("page")
	set pages = new cls_pageview
	pages.strtablename = "[yx_topic]"
	pages.strpageurl = "?action=recycle"
	pages.strfieldslist = "topicid,sqltableid,caption,name,lasttime,boardid"
	pages.strcondiction = "isdel=true"
	pages.strorderlist = "topicid desc"
	pages.strprimarykey = "topicid"
	pages.intpagesize = 25
	pages.intpagenow = intpagenow
	pages.strcookiesname = "recycle"&yxbbs.tb'客户端记录总数
	pages.reloadtime=3'每三分钟更新cookies
	pages.strpagevar = "page"
	pages.initclass
	arr_rs = pages.arrrecordinfo
	strpageinfo = pages.strpageinfo
	set pages = nothing
	if isarray(arr_rs) then
	for i = 0 to ubound(arr_rs, 2)
	set rs=yxbbs.execute("select bbsid from[yx_bbs"&arr_rs(1,i)&"] where topicid="&arr_rs(0,i)&" and boardid="&arr_rs(5,i))
	if not rs.eof then bbsid=rs(0)
	rs.close
		response.write"<div class=""td3 jz h20 w87""><input type='checkbox' name='topic' value='"&arr_rs(0,i)&"|"&arr_rs(5,i)&"|"&arr_rs(1,i)&"'></div>"&_
		"<div class=""td3 h20 w332"" style=""text-align: left;"">&nbsp;"&_
		"<a href=?action=seerecycle&bbsid="&bbsid&">"&yxbbs.fun.strleft(arr_rs(2,i),35)&"</a></div>"&_
		"<div class=""td3 h20 w106""><a target=_blank  href='../profile.asp?name="&arr_rs(3,i)&"' title='查看 "&arr_rs(3,i)&" 的资料'>"&arr_rs(3,i)&"</a></div>"&_
		"<div class=""td3 h20 w219"">"&arr_rs(4,i)&"</div>"
	next
	else
	response.write"<div style=""clear: both;""></div><div class=""tf jz w770"">这个数据表中没有发现被删除的帖子</div>"
	end if
	%>
<div style="clear: both;"></div><div class="td w772" style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=chkall value=on onclick="checkall(this.form)"> 全选
&nbsp;&nbsp;<input type="submit"  value="删除所选" name="go"><input type="submit" class="submit" value="还原所选" name="go">
</div>
<div style="clear: both;"></div><div class="tf jz w770"><%=strpageinfo%></div></div></form>
<%
end sub

sub seerecycle()
dim bbsid,yxbbs_ubb,essaytype,sql
bbsid=trim(request.querystring("bbsid"))

set rs=yxbbs.execute("select bbsid,caption,content,name,lasttime,boardid,topicid,replytopicid,ubbstring from [yx_bbs"&yxbbs.tb&"] where bbsid="&bbsid)
if rs.eof then 
	call goback("","该帖不存在或者已经被永久删除")
	exit sub
end if
if rs(7)=0 then essaytype="主题帖:" else essaytype="回复帖:"
set yxbbs_ubb=new yxbbsubb_cls
yxbbs_ubb.ubbstring=rs(8)
%>
<div class="ta">
<div class="th jz">回收站 查看帖子</div>
<div class="td1 jz"><%=essaytype&yxbbs.fun.htmlcode(rs(1))%></div>
<div class="td2 jz">【<a href="?action=delrecycle&bbsid=<%=rs(0)%>&topicid=<%=rs(6)%>&tb=<%=yxbbs.tb%>"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle" />永久删除</a>】 【<a href="?action=giveback&bbsid=<%=rs(0)%>&tb=<%=yxbbs.tb%>&boardid=<%=rs(5)%>"><img src="../images/mail.gif" width="16" height="16" border="0" align="absmiddle" />还原帖子</a>】</div>
<div class="td w772" style="text-align: left;">
<%if rs(7)=0 then response.write "<br /><b>"&yxbbs.fun.htmlcode(rs(1))&"</b>"%>
<br /><%=yxbbs_ubb.ubb(rs(2),1)%></div>
<div class="td3 w770">&nbsp;帖子作者:<%=rs(3)%>&nbsp;&nbsp;更新时间:<%=rs(4)%></div>
<div style="clear: both;"></div><div class="tf jz"><a href=javascript:history.go(-1)>【返回】</a></div>
</div>
<%set yxbbs_ubb=nothing
rs.close
end sub

sub tbinfo()
response.write"<form name='yimxu' style='margin:0' method='post' action='?action=submit'>"
%>
<div class="ta">
<div class="th jz">回收站</div>
<div class="tf w770" style="text-align: left;">【<a href="?action=recycle">列出全部主题</a>】<%=tblist(yxbbs.tb)%> 【<a onclick=checkclick('您确定要清空回收站的全部帖子吗?') href="?action=recycledelall"><img src="../images/del.gif" width="18" height="18" border="0" align="absmiddle" />清空回收站</a>】</div>
<div class="td3 jz w87">选择</div>
<div class="td3 jz w332">帖子</div>
<div class="td3 jz w106">作者</div>
<div class="td3 jz w219">最后时间</div>
<%
	dim intpagenow,arr_rs,i,pages,conut,page,strpageinfo
	dim temp
	intpagenow = request.querystring("page")
	set pages = new cls_pageview
	pages.strtablename = "[yx_bbs"&yxbbs.tb&"]"
	pages.strpageurl = "?action=tbinfo&tb="&yxbbs.tb
	pages.strfieldslist = "bbsid,topicid,caption,name,lasttime,replytopicid,boardid"
	pages.strcondiction = "isdel=true"
	pages.strorderlist = "bbsid desc"
	pages.strprimarykey = "bbsid"
	pages.intpagesize = 25
	pages.intpagenow = intpagenow
	pages.strcookiesname = "recycle"&yxbbs.tb'客户端记录总数
	pages.reloadtime=3'每三分钟更新cookies
	pages.strpagevar = "page"
	pages.initclass
	arr_rs = pages.arrrecordinfo
	strpageinfo = pages.strpageinfo
	set pages = nothing
	if isarray(arr_rs) then
	for i = 0 to ubound(arr_rs, 2)
	response.write"<div class=""td3 jz w87""><input type='checkbox' "
	if arr_rs(1,i)=0 then
		response.write "name='reply' value='"&arr_rs(0,i)&"|"&arr_rs(5,i)&"|"&arr_rs(6,i)&"|"&yxbbs.tb&"'"
	else
		response.write "name='topic' value='"&arr_rs(1,i)&"|"&arr_rs(6,i)&"|"&yxbbs.tb&"'"
	end if
	response.write"></div>"&_
		"<div class=""td3 jz w332"" style=""text-align: left;"">&nbsp;"&_
		"<a href=?action=seerecycle&bbsid="&arr_rs(0,i)&">"&yxbbs.fun.strleft(arr_rs(2,i),35)&"</a></div>"&_
		"<div class=""td3 jz w106""><a target=_blank  href='../profile.asp?name="&arr_rs(3,i)&"' title='查看 "&arr_rs(3,i)&" 的资料'>"&arr_rs(3,i)&"</a></div>"&_
		"<div class=""td3 jz w219"">"&arr_rs(4,i)&"</div>"
	next
	else
	response.write"<div style=""clear: both;""></div><div class=""tf jz w770"">这个数据表中没有发现被删除的帖子</div>"
	end if
	%>
<div style="clear: both;"></div><div class="td w772" style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=chkall value=on onclick="checkall(this.form)"> 全选
&nbsp;&nbsp;<input type="submit"  value="删除所选" name="go"><input type="submit" class="submit" value="还原所选" name="go">
</div>
<div style="clear: both;"></div><div class="tf jz w770"><%=strpageinfo%></div></div></form>
<%
end sub

sub delrecycle()
	dim bbsid,topicid
	bbsid=request.querystring("bbsid")
	topicid=request.querystring("topicid")
	if topicid=0 then
	yxbbs.execute("delete from [yx_bbs"&yxbbs.tb&"] where isdel=true and bbsid="&bbsid)
	call suc("","成功删除了这个回复帖!","?action=recycle")
	else
	yxbbs.execute("delete from [yx_topic] where  isdel=true and topicid="&topicid)
	yxbbs.execute("delete from [yx_topicvote] where topicid="&topicid)
	yxbbs.execute("delete from [yx_topicvoteuser] where topicid="&topicid)
	yxbbs.execute("delete from [yx_bbs"&yxbbs.tb&"] where isdel=true and (bbsid="&bbsid&" or replytopicid="&topicid&")")
	call suc("","成功删除这个主题(包括其回复帖)!","?action=recycle")
	end if
end sub

sub recycledelall()
	dim alltable,i
	alltable=split(yxbbs.bbstable(0),",")
	for i=0 to ubound(alltable)
		yxbbs.execute("delete from [yx_bbs"&alltable(i)&"] where isdel=true")
	next
	yxbbs.execute("delete from [yx_topic] where isdel=true")
	yxbbs.execute("delete * from [yx_topicvote] where  not exists (select name from [yx_topic] where [yx_topicvote].topicid=[yx_topic].topicid)")
	yxbbs.execute("delete * from [yx_topicvoteuser] where  not exists (select name from [yx_topic] where [yx_topicvoteuser].topicid=[yx_topic].topicid)")
	call suc("","成功清空了回收站!","?action=recycle")
end sub

sub giveback
	dim bbsid,topicid,replytopicid,boardid,temp
	bbsid=request.querystring("bbsid")
	set rs=yxbbs.execute("select topicid,replytopicid,boardid,isdel from[yx_bbs"&yxbbs.tb&"] where bbsid="&bbsid)
	if rs.eof then
		call goback("","该帖不存在或者已经被永久删除"):exit sub
	elseif rs(3)=false then
		call suc("","该帖已经恢复了","?action=recycle"):exit sub
	end if
	if rs(0)=0 and rs(1)<>0 then
		yxbbs.execute("update [yx_config] set allessaynum=allessaynum+1")
		yxbbs.execute("update [yx_board] set essaynum=essaynum+1 where boardid="&rs(2)&" and parentid<>0")
		yxbbs.execute("update [yx_topic] set replynum=replynum+1,isdel=false where topicid="&rs(1))
		yxbbs.execute("update [yx_bbs"&yxbbs.tb&"] set isdel=false where topicid="&rs(1)&" or bbsid="&bbsid)
	else
		temp=yxbbs.execute("select count(bbsid) from[yx_bbs"&yxbbs.tb&"] where replytopicid="&rs(0)&" and boardid="&rs(2))(0)
		if isnull(temp) then temp=0
		yxbbs.execute("update [yx_config] set topicnum=topicnum+1,allessaynum=allessaynum+"&temp+1&"")
		yxbbs.execute("update [yx_board] set essaynum=essaynum+"&temp+1&",topicnum=topicnum+1 where boardid="&rs(2)&" and parentid<>0")
		yxbbs.execute("update [yx_topic] set replynum="&temp&",isdel=false where topicid="&rs(0))
		yxbbs.execute("update [yx_bbs"&yxbbs.tb&"] set isdel=false where bbsid="&bbsid&" or replytopicid="&rs(0))
	end if
	rs.close
	call suc("","成功的恢复帖子","?action=recycle")
end sub

sub submit()
dim topic,reply,go,temp,i
topic=request.form("topic")
reply=request.form("reply")
if topic="" and reply="" then call goback("","请先选择项目。"):exit sub
topic=split(topic,",")
reply=split(reply,",")
go=request.form("go")
	if go="删除所选" then
		for i=0 to ubound(topic)
		temp=split(topic(i),"|")
		yxbbs.execute("delete from [yx_bbs"&temp(2)&"] where topicid="&temp(0)&" or replytopicid="&temp(0))
		yxbbs.execute("delete from [yx_topic] where topicid="&temp(0))
		yxbbs.execute("delete from [yx_topicvote] where topicid="&temp(0))
		yxbbs.execute("delete from [yx_topicvoteuser] where topicid="&temp(0))
		next
		for i=0 to ubound(reply)
		temp=split(reply(i),"|")
		yxbbs.execute("delete from [yx_bbs"&temp(3)&"] where bbsid="&temp(0)&" and isdel=true")
		next
		call suc("","成功的删除所选的帖子","?action=recycle")
	elseif go="还原所选" then
		dim tempnum
		for i=0 to ubound(topic)
			temp=split(topic(i),"|")
			tempnum=yxbbs.execute("select count(bbsid) from[yx_bbs"&temp(2)&"] where replytopicid="&temp(0)&" and boardid="&temp(1))(0)
			if isnull(tempnum) then tempnum=0
			yxbbs.execute("update [yx_config] set topicnum=topicnum+1,allessaynum=allessaynum+"&tempnum+1&"")
			yxbbs.execute("update [yx_board] set essaynum=essaynum+"&tempnum+1&",topicnum=topicnum+1 where boardid="&temp(1)&" and parentid<>0")
			yxbbs.execute("update [yx_topic] set replynum="&tempnum&",isdel=false where topicid="&temp(0))
			yxbbs.execute("update [yx_bbs"&temp(2)&"] set isdel=false where topicid="&temp(0)&" or replytopicid="&temp(0))
		next
		for i=0 to ubound(reply)
		temp=split(reply(i),"|")
		set rs=yxbbs.execute("select top 1 bbsid from[yx_bbs"&temp(3)&"] where bbsid="&temp(0)&" and isdel=true")
		if not rs.eof then
		yxbbs.execute("update [yx_config] set allessaynum=allessaynum+1")
		yxbbs.execute("update [yx_board] set essaynum=essaynum+1 where boardid="&temp(2)&" and parentid<>0")
		yxbbs.execute("update [yx_topic] set replynum=replynum+1,isdel=false where topicid="&temp(1))
		yxbbs.execute("update [yx_bbs"&temp(3)&"] set isdel=false where topicid="&temp(1)&" or bbsid="&temp(0))
		end if
		rs.close
		next
		call suc("","成功的还原所选的帖子","?action=recycle")
	end if
end sub


%>
<script language="javascript">
<!--
function checkall(form){
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.name != 'chkall'){
	e.checked = form.chkall.checked;}
	}
  }
//-->
</script>

⌨️ 快捷键说明

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