📄 update.asp
字号:
rs.close : set rs=nothing
for i=0 to ubound(sql,2)
set rss=conn.execute("select userID from as_user where userID="&trim(sql(0,i)))
if rss.bof or rss.eof then
conn.execute("delete from as_products where productsID="&sql(1,i))
n=n+1
end if
rss.close
set rss=nothing
next
end if
response.write b&"成功清理"&n&"条as_products数据"&e
Response.Flush
n=0
set rs=conn.execute("select userID,favoriteID from as_favorite")
if not(rs.bof and rs.eof) then
sql=rs.getRows(-1)
rs.close : set rs=nothing
for i=0 to ubound(sql,2)
set rss=conn.execute("select userID from as_user where userID="&trim(sql(0,i)))
if rss.bof or rss.eof then
conn.execute("delete from as_favorite where favoriteID="&sql(1,i))
n=n+1
end if
rss.close
set rss=nothing
next
end if
response.write b&"成功清理"&n&"条as_favorite数据"&e
Response.Flush
n=0
set rs=conn.execute("select userID,friendID from as_friend")
if not(rs.bof and rs.eof) then
sql=rs.getRows(-1)
rs.close : set rs=nothing
for i=0 to ubound(sql,2)
set rss=conn.execute("select userID from as_user where userID="&trim(sql(0,i)))
if rss.bof or rss.eof then
conn.execute("delete from as_friend where friendID="&sql(1,i))
n=n+1
end if
rss.close
set rss=nothing
next
end if
response.write b&"成功清理"&n&"条as_friend数据"&e
Response.Flush
dim rsc,siteInfo
set rsc=uconn.execute("select siteInfo from config")
siteInfo=split(rsc(0),"|||")
rsc.close
set rsc=nothing
n=0
set rs=conn.execute("select sender,incept,messageID from as_message")
if not(rs.bof and rs.eof) then
sql=rs.getRows(-1)
rs.close : set rs=nothing
for i=0 to ubound(sql,2)
set rss=conn.execute("select userID from as_user where username='"&trim(sql(0,i))&"'")
if rss.bof or rss.eof then
if trim(sql(0,i))<>trim(siteInfo(0)) then
conn.execute("delete from as_message where messageID="&sql(2,i))
n=n+1
else
set rsz=conn.execute("select userID from as_user where username='"&trim(sql(1,i))&"'")
if rsz.bof or rsz.eof then
conn.execute("delete from as_message where messageID="&sql(2,i))
n=n+1
end if
rsz.close
set rsz=nothing
end if
else
set rsz=conn.execute("select userID from as_user where username='"&trim(sql(1,i))&"'")
if rsz.bof or rsz.eof then
conn.execute("delete from as_message where messageID="&sql(2,i))
n=n+1
end if
rsz.close
set rsz=nothing
end if
rss.close
set rss=nothing
next
end if
response.write b&"成功清理"&n&"条as_message数据"&e
Response.Flush
dim path,objFSO,fileName,upname,uploadFiles,uploadFolder,upfilename,m,datepath,ii
n=0
m=0
path="upfile/"
set objFSO = server.createObject("scripting.fileSystemObject")
if objFSO.folderExists(server.mapPath(path))=false then
response.write b&"路径:"&path&"不存在"&e
end if
set rs=conn.execute("select userID,fileID,fileName,viewName from as_upfile")
if not(rs.bof and rs.eof) then
sql=rs.getRows(-1)
rs.close : set rs=nothing
for i=0 to ubound(sql,2)
set rss=conn.execute("select userID from as_user where userID="&trim(sql(0,i)))
if rss.bof or rss.eof then
if inStr(sql(2,i),":")=0 or inStr(sql(2,i),"//")=0 then
fileName=path&sql(2,i)
if objFSO.fileExists(server.mapPath(fileName)) then
objFSO.deleteFile(server.mapPath(fileName))
m=m+1
end if
end if
if inStr(sql(3,i),":")=0 or inStr(sql(3,i),"//")=0 then
fileName=path&sql(3,i)
if objFSO.fileExists(server.mapPath(fileName)) then
objFSO.deleteFile(server.mapPath(fileName))
m=m+1
end if
end if
conn.execute("delete from as_upfile where fileID="&trim(sql(1,i)))
n=n+1
end if
rss.close
set rss=nothing
next
end if
Response.Flush
for ii=0 to datediff("m","2006-10",now())
datepath=DateAdd("m",-ii,now())
datepath=year(datepath)&"-"&month(datepath)&"/"
if objFSO.folderExists(server.mapPath(path))=false then
set uploadFolder=objFSO.GetFolder(server.mapPath(path&datepath))
set uploadFiles=uploadFolder.Files
for each upname in uploadFiles
upfilename=path&datepath&upname.name
set rs=conn.execute("select top 1 fileID from as_upfile where fileName = '"&datepath&upname.name&"'")
if rs.eof then
m=m+1
objFSO.deleteFile(server.mapPath(upFileName))
end if
rs.close
set rs=nothing
next
end if
next
set uploadFolder=nothing
set uploadFiles=nothing
set objFSO=nothing
response.write b&"成功清理"&n&"条as_upfile数据"&e
response.write b&"成功清理"&m&"个无用文件"&e
%>
</ul>
<!--list.end-->
</div>
</div>
<div>
<ul>
<li> </li>
<li> </li>
<li class="txtCen title green"><input type="submit" name="submit" value="下一步:更新系统数据" class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" /></li>
<li> </li>
<li> </li>
<li> </li>
</ul>
</div>
</form>
<%
closeData()
end sub
sub step4()
if request.form("database")="" then
response.write"<div class=""txtCen title"" style=""padding:150px 0 226px 0;"">请输入正确的数据库名称!<br /><br /><br /><br /><button onclick=""javascript:history.go(-1);"" class=""button"" onmouseover=""this.className='buttonH'"" onmouseout=""this.className='button'""> 返 回 </button></div>"
exit sub
end if
Conntting(Request("database"))
dim rsc,isnext,step
isnext=false
step=5
set rsc=uconn.execute("select channelID from channel where types=1")
if not(rsc.bof and rsc.eof) then
isnext=true
step=4
end if
rsc.close
set rsc=nothing
%>
<form name="step4" id="step4" method="post" action="?action=step<%=step%>">
<input type="hidden" value="<%=request("database")%>" name="database">
<div>
<ul>
<li> </li>
<li> </li>
<li class="txtCen title green">第四步:更新系统数据</li>
<li> </li>
<li> </li>
</ul>
</div>
<%
if isnext then
'as_business channelID
%>
<div class="minB">
<!--31-->
<div class="list line30">
<ul class="borderB">
<li><strong class="color f14">操作说明:</strong>正在处理数据,未出现下一步之前,请勿刷新或关闭浏览器!</li>
</ul>
<ul><li> </li></ul>
<ul>
<li class="name txtRig f14"><span class="red">*</span> 将供求内容从:</li>
<li><select name="oldChannel"><%=IDSelect("channel",0,1,0,0)%></select> 转移到 <select name="newChannel"><%=anysale.IDSelect("channel",0,1,0,0)%></select></li>
</ul>
<ul>
<li class="left name"> </li>
<li class="value">
<input type="submit" name="submit" value=" 转移 " class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" />
</li>
</ul>
<ul>
<li class="left name"> </li>
<li class="value green">
<%
if clng(request("newChannel"))>0 and clng(request("oldChannel"))>0 then
dim newChannel
dim oldChannel
dim parentStr, iParentStr
dim depth, iparentID, child
dim parentID, rootID
dim rs,i,gid
gid=1
newChannel = clng(request("newChannel"))
oldChannel = clng(request("oldChannel"))
'将本频道及其下属版面的帖子都转移至目标频道,并删除本频道及其下属版面
'得到当前版面下属频道
set rs=uconn.execute("select parentStr,channelID,depth,parentID,child,rootID from channel where types="&gid&" and channelID="&oldChannel)
if rs(0)="0" then
parentStr=rs(1)
iparentID=rs(1)
parentID=0
else
parentStr=rs(0) & "," & Rs(1)
iparentID=rs(3)
parentID=rs(3)
end if
iParentStr=rs(1)
depth=rs(2)
child=rs(4)+1
rootID=rs(5)
'得到当前版面下频道ID
i=0
set rs=uconn.execute("select channelID from channel where types="&gid&" and rootID="&rootID&" and parentStr like '%"&parentStr&"%'")
if not (rs.eof and rs.bof) then
do while not rs.eof
if i=0 then
iParentStr=rs(0)
else
iParentStr=iParentStr & "," & rs(0)
end if
i=i+1
rs.movenext
loop
end if
if i>0 then
parentStr=iParentStr & "," & oldChannel
else
parentStr=oldChannel
end if
'更新其原来所属频道版面数
if depth>0 then
uconn.execute("update channel set child=child-"&child&" where types="&gid&" and channelID="&iparentID)
'更新其原来所属频道数据,排序相当于剪枝而不需考虑
for i=1 to depth
'得到其父类的父类的版面ID
set rs=uconn.execute("select parentID from channel where types="&gid&" and channelID="&iparentID)
if not (rs.eof and rs.bof) then
iparentID=rs(0)
uconn.execute("update channel set child=child-"&child&" where types="&gid&" and channelID="&iparentID)
end if
next
end if
uconn.commandTimeOut = 0
'更改被合并栏目的typs值 相当于删除被合并栏目
uconn.execute("update channel set types=0 where types="&gid&" and rootID="&rootID&" and channelID in ("&parentStr&")")
'更新频道数据
conn.execute("update as_business set channelID="&newChannel&" where channelID in ("&parentStr&")")
rs.close
set rs=nothing
response.write "操作成功,请继续"
end if
%>
</li>
</ul>
<ul><li> </li></ul>
<ul class="borderB">
<li class="color f14"><strong>转移说明</strong></li>
</ul>
<ul>
<li><strong>说明,请仔细阅读操作说明后进行操作:</strong></li>
</ul>
<ul>
<li>1、所有操作不可逆,请慎重操作;</li>
</ul>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -