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

📄 data.asp

📁 网页源码,是最好的网店代码。可以支持批量上传产品等功能。
💻 ASP
📖 第 1 页 / 共 4 页
字号:
end sub

function compactdb(dbpath, boolis97)
	dim fso,engine,strdbpath,jet_3x,content
	strdbpath = left(dbpath,instrrev(dbpath,"\"))
	set fso = createobject("scripting.filesystemobject")
	if fso.fileexists(dbpath) then
		fso.copyfile dbpath,strdbpath & "temp.mdb"
		set engine = createobject("jro.jetengine")
		if boolis97 = "true" then
			engine.compactdatabase "provider=microsoft.jet.oledb.4.0;data source=" & strdbpath & "temp.mdb", _
			"provider=microsoft.jet.oledb.4.0;data source=" & strdbpath & "temp1.mdb;" _
			& "jet oledb:engine type=" & jet_3x
		else
			engine.compactdatabase "provider=microsoft.jet.oledb.4.0;data source=" & strdbpath & "temp.mdb", _
			"provider=microsoft.jet.oledb.4.0;data source=" & strdbpath & "temp1.mdb"
		end if
	fso.copyfile strdbpath & "temp1.mdb",dbpath
	fso.deletefile(strdbpath & "temp.mdb")
	fso.deletefile(strdbpath & "temp1.mdb")
	set fso = nothing
	set engine = nothing
		compactdb = "<li>你的数据库 " & dbpath & ",已经压缩成功!" 
	else
		compactdb = "<li>数据库名称或路径不正确! 请重试!" 
	end if
end function

'检测目录是否存在
function checkdir(folderpath)
	dim fso1
	folderpath=server.mappath(".")&"\"&folderpath
    set fso1 = createobject("scripting.filesystemobject")
    if fso1.folderexists(folderpath) then
       '存在
       checkdir = true
    else
       '不存在
       checkdir = false
    end if
    set fso1 = nothing
end function
'建立目录
function makenewsdir(foldername)
	dim fso1
	dim f
    set fso1 = createobject("scripting.filesystemobject")
        set f = fso1.createfolder(foldername)
        makenewsdir = true
    set fso1 = nothing
end function

sub executesql
	dim sql,caption,content
	sql=request.form("sql")
	caption="执行sql语句"
	content="<form onsubmit=checkclick('注意!操作不当有可能破坏数据库!\n\n您确定要执行sql语句吗?') method=post style='margin:0'>指令:<input type=text name='sql' value='"&sql&"' style='width:90%'><br />注意:此操作不可恢复,如果对sql语法不了解,请慎用!<input type=submit value=' 确定执行 '></form>"
	call showtable(caption,content)
	if sql<>"" then
	response.write("<br />")
	on error resume next 
	yxbbs.execute(sql)
	if err.number=0 then
		caption="执行成功":content="<li>sql语句正确,已经成功的执行了下面这条语句!<li><font color=red>"&sql&"</font>"
	else
		caption="错误信息":content="<li>不能执行,语句有问题,具体出错如下:<li>"&err.description&"<br />"
		err.clear
	end if
	call showtable(caption,content)
	end if
end sub

sub delessay
%>
<form method=post name=form style='margin:0' action=?action=exedelessay&go=date>
<div class="ta">
<div class="th jz">删除指定日期前的帖子</div>
<div class="td1 h20">删除多少天前的帖子:</div>
<div class="td2 h20"><input name="datenum" type="text" value="365" size="5"> 天</div>
<div class="td1 h20">选择所在的论坛版面:</div>
<div class="td2 h20"><select name="boardid"><option value="0">所有的论坛</option><%=yxbbs.boardidlist(0,0)%></select></div>
<div class="td h20 w772">说明:此操作将删除指定天数前发表的主题帖,同时也包括主题的回复帖(当然,该主题最新的回复帖也会被删除)。</div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div> </div>
</form><br />
<form method=post name=form style='margin:0' action=?action=exedelessay&go=datenore>
<div class="ta">
<div class="th jz">删除指定日期前没有回复的主题</div>
<div class="td1 h20">删除多少天前的帖子:</div>
<div class="td2 h20"><input name="datenum" type="text" value="365" size="5"> 天</div>
<div class="td1 h20">删除帖子所在的论坛:</div>
<div class="td2 h20"><select name="boardid"><option value="0">所有的论坛</option><%=yxbbs.boardidlist(0,0)%></select></div>
<div style='clear: both;'></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div>
 </div>
</form>
<br />
<form method=post name=form style='margin:0' action=?action=exemoveessay&go=date>
<div class="ta">
<div class="th jz">按指定天数移动帖子</div>
<div class="td1 h20">移动多少天前的帖子:</div>
<div class="td2 h20"><input name="datenum" type="text" value="100" size="5"> 天</div>
<div class="td1 h20">帖子原来所在的论坛:</div>
<div class="td2 h20"><select size="1" name="boardid1"><%=yxbbs.boardidlist(0,0)%></select></div>
<div class="td1 h20">帖子要移动到的论坛:</div>
<div class="td2 h20"><select size="1" name="boardid2"><%=yxbbs.boardidlist(0,0)%></select></div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div>
</div>
</form><br />
<form method=post name=form style='margin:0' action=?action=exemoveessay&go=user>
<div class="ta">
<div class="th jz">移动指定用户的帖子</div>
<div class="td1 h20">请输入指定的用户名:</div>
<div class="td2 h20"><input name="name" type="text"  size="20"></div>
<div class="td1 h20">帖子原来所在的论坛:</div>
<div class="td2 h20"><select size="1" name="boardid1"><%=yxbbs.boardidlist(0,0)%></select></div>
<div class="td1 h20">帖子要移动到的论坛:</div>
<div class="td2 h20"><select size="1" name="boardid2"><%=yxbbs.boardidlist(0,0)%></select></div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div> </div>
</form>
<%
end sub

sub exedelessay
	dim username,datenum,boardid,alltable,i,tieid
	datenum=yxbbs.fun.getstr("datenum")
	boardid=yxbbs.fun.getstr("boardid")
	alltable=split(yxbbs.bbstable(0),",")
	select case request("go")
	case"date"
		if not isnumeric(datenum) then call goback("","天数必需用数字填写!"):exit sub
		if boardid=0 then
			for i=0 to ubound(alltable)
			yxbbs.execute("delete from[yx_bbs"&alltable(i)&"] where topicid in (select topicid from [yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&") or replytopicid in (select topicid from [yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&")")
			next
			yxbbs.execute("delete from[yx_topic] where  datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功删除所有论坛在"&datenum&"天前发表的主题帖(包括其回复帖)!<li>删除后建议对论坛做一次<a href=basic.asp?action=updatebbs>整理</a>","?action=delessay")
		else
			for i=0 to ubound(alltable)
			yxbbs.execute("delete from[yx_bbs"&alltable(i)&"] where boardid="&boardid&" and (topicid in (select topicid from [yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&") or replytopicid in (select topicid from [yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&"))")
			next
			yxbbs.execute("delete from[yx_topic] where boardid="&boardid&" and datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功删除在 "&yxbbs.execute("select boardname from[yx_board]where boardid="&boardid&"")(0)&" 上 "&datenum&" 天前发表的主题帖(包括其回复帖)!<li>删除后建议对论坛做一次<a href=basic.asp?action=updatebbs>整理</a>","?action=delessay")
		end if
	case"datenore"
		if not isnumeric(datenum) then call goback("","天数必需用数字填写!"):exit sub
		if boardid=0 then
			for i=0 to ubound(alltable)
			yxbbs.execute("delete from[yx_bbs"&alltable(i)&"] where topicid in (select topicid from [yx_topic] where datediff('d',lasttime,'"&yxbbs.nowbbstime&"')>"&datenum&") or replytopicid in (select topicid from [yx_topic] where datediff('d',lasttime,'"&yxbbs.nowbbstime&"')>"&datenum&")")
			next
			yxbbs.execute("delete from[yx_topic] where  datediff('d',lasttime,'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功删除所有论坛在"&datenum&"天前没有回复的所有主题帖(包括其回复)!<li>建议删除后对论坛做一次<a href=basic.asp?action=updatebbs>整理</a>","?action=delessay")
		else
			for i=0 to ubound(alltable)
			yxbbs.execute("delete from[yx_bbs"&alltable(i)&"] where topicid in (select topicid from [yx_topic] where boardid="&boardid&" and datediff('d',[lasttime],'"&yxbbs.nowbbstime&"')>"&datenum&") or replytopicid in (select topicid from [yx_topic] where boardid="&boardid&" and datediff('d',[lasttime],'"&yxbbs.nowbbstime&"')>"&datenum&")")
			next
			yxbbs.execute("delete from[yx_topic] where boardid="&boardid&" and datediff('d',[lasttime],'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功删除在 "&yxbbs.execute("select boardname from[yx_board]where boardid="&boardid&"")(0)&" 上 "&datenum&" 天前没回复的主题帖(包括其回复帖)!<li>删除后建议对论坛做一次<a href=basic.asp?action=updatebbs>整理</a>","?action=delessay")
		end if
	case else
		call goback("","提交的路径不正确")
	end select
end sub



sub exemoveessay
	dim boardid1,boardid2,datenum,username,alltable,i
	boardid1=yxbbs.fun.getstr("boardid1")
	boardid2=yxbbs.fun.getstr("boardid2")
	if boardid1=boardid2 then call goback("","您还没有选择目标论坛!"):exit sub
	alltable=split(yxbbs.bbstable(0),",")
	datenum=yxbbs.fun.getstr("datenum")
	username=yxbbs.fun.getstr("name")
	select case request("go")
		case"date"
			if not isnumeric(datenum) then call goback("","天数必需用数字填写!"):exit sub
			for i=0 to ubound(alltable)
				yxbbs.execute("update [yx_bbs"&alltable(i)&"] set boardid="&boardid2&" where topicid in (select topicid from[yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&" and boardid="&boardid1&") or replytopicid in (select topicid from[yx_topic] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&" and boardid="&boardid1&")")
			next
			yxbbs.execute("update [yx_topic] set boardid="&boardid2&" where boardid="&boardid1&" and datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功的把"&datenum&"天前的帖子从 "&yxbbs.execute("select boardname from[yx_board] where boardid="&boardid1&"")(0)&" 移动到 "&yxbbs.execute("select boardname from[yx_board] where boardid="&boardid2&"")(0)&"!","?action=delessay")
		case"user"
			if username="" then call goback("",""):exit sub
			if yxbbs.execute("select name from[yx_user] where name='"&username&"'").eof then
				call goback("","这个用户根本不存在!"):exit sub
			else
			for i=0 to ubound(alltable)
				yxbbs.execute("update [yx_bbs"&alltable(i)&"] set boardid="&boardid2&" where topicid in(select topicid from[yx_topic] where boardid="&boardid1&" and name='"&username&"') or replytopicid in (select topicid from[yx_topic] where boardid="&boardid1&" and name='"&username&"')")
			next
				yxbbs.execute("update [yx_topic] set boardid="&boardid2&"  where boardid="&boardid1&" and name='"&username&"'")
				call suc("","已经成功的把"&username&"的帖子从 "&yxbbs.execute("select boardname from[yx_board] where boardid="&boardid1&"")(0)&" 移动到 "&yxbbs.execute("select boardname from[yx_board] where boardid="&boardid2&"")(0)&"!","?action=delessay")
			end if
	end select
end sub

sub delsms
%>
<form method=post name=form style='margin:0' action=?action=exedelsms&go=date>
<div class="ta">
<div class="th jz">删除指定日期前的所有留言</div>
<div class="td1 h20">删除多少天前的留言:</div>
<div class="td2 h20"><input name="datenum" type="text" value="60" size="5"> 天</div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div></div>
</form><br />
<form method=post name=form style='margin:0' action=?action=exedelsms&go=user>
<div class="ta">
<div class="th jz">删除指定用户的所有留言</div>
<div class="td1 h20">请输入指定用户名称:</div>
<div class="td2 h20"><input name="name" type="text" size="20"></div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div></div>
</form><br />
<form method=post name=form style='margin:0' action=?action=exedelsms&go=auto>
<div class="ta">
<div class="th jz">删除自动发送的信件</div>
<div class="td1 h20">删除多少天前自动发送的信件:</div>
<div class="td2 h20"><input name="datenum" type="text" value="30" size="5">天</div>
<div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 提 交 " onclick=checkclick('注意:删除后将不能恢复!您确定删除吗?')> &nbsp;&nbsp;<input type="reset" name="submit" value=" 重 置 "></div></div>
</form>
<%
end sub

sub exedelsms
	dim username,datenum,boardid
	datenum=yxbbs.fun.getstr("datenum")
	select case request("go")
	case"date"
		if not isnumeric(datenum) then 
			call goback("","天数必需用数字填写!")
		else
			yxbbs.execute("delete from[yx_sms] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&"")
			call suc("","已经成功删除在"&datenum&"天前的所有留言信件!","?action=delsms")
		end if
	case"user"
		username=yxbbs.fun.getstr("name")
		if yxbbs.execute("select name from[yx_user] where lcase(name)='"&lcase(username)&"'").eof then
			call goback("","这个用户根本不存在!")
		else
		yxbbs.execute("delete from[yx_sms] where myname='"&username&"'")
		call suc("","已经成功删除了 "&username&" 的所有留言信件!","?action=delsms")
		end if
	case"auto"
		if not isnumeric(datenum) then 
			call goback("","天数必需用数字填写!")
		else
			yxbbs.execute("delete from[yx_sms] where datediff('d',[addtime],'"&yxbbs.nowbbstime&"')>"&datenum&" and name='系统消息'")
			call suc("","已经成功删除在"&datenum&"天前的所有论坛自动送信的留言信件!","?action=delsms")
		end if
	end select
end sub
sub allsms
%>
<form method=post  name=yimxu style='margin:0' action=?action=exeallsms  onsubmit="ok.disabled=true;ok.value='正在群发信件-请稍等。。。'">

<div class="ta">
<div class="th jz">群发站内信</div>
<div class="td3 w770">注意:此操作可能将消耗大量服务器资源。请慎用!</div>
<div class="td1 h20">接收用户:</div>
<div class="td2 h20"><select name='user' style='font-size: 9pt'>
<option value=0 selected>所有在线用户</option>
<option value=1>所有注册用户</option>
<option value=2>所有论坛版主</option>
<option value=3>所有总版主</option>
<option value=4>所有管理员</option>
<option value=5>管理团队(管理员+总版主+版主)</option>
</select></div>
<div class="td1 h20">消息标题:</div>
<div class="td2 h20"><input name="title" type="text" id="title" size="40" maxlength="50"></div>
<div class="td1 h70">消息内容:</div>
<div class="td2 h70 w446"><textarea name=content  cols=90 rows='4'></textarea></div>
<div style='clear: both;'></div><div class="tf jz"><input  type='submit' value='确定送出' name="ok">&nbsp;<input type='reset' value='取消重写'></div> </div></form>

<br>

<form method=post  name=yimxu style='margin:0' action=?action=allmail  onsubmit="ok.disabled=true;ok.value='正在群发信件-请稍等。。。'">

<div class="ta">
<div class="th jz">群发E-mail</div>
<div class="td3 w770">注意:服务器如果不支持Jmail将不能使用此功能!</div>
<div class="td1 h20">接收用户:</div>
<div class="td2 h20"><select name='mailusertype' style='font-size: 9pt'>
<option value=0 selected>所有注册用户</option>
<option value=1>管理团队(管理员+总版主+版主)</option>
</select></div>
<div class="td1 h20">邮件标题:</div>
<div class="td2 h20"><input name="mailtitle" type="text" id="title" size="40" maxlength="50"></div>
<div class="td1 h70">邮件内容:</div>
<div class="td2 h70 w446"><textarea name=mailcontent  cols=90 rows='4'></textarea></div>
<div style='clear: both;'></div><div class="tf jz"><input  type='submit' value='确定送出' name="ok">&nbsp;<input type='reset' value='取消重写'></div> </div></form>


<%

⌨️ 快捷键说明

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