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

📄 update.asp

📁 请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。
💻 ASP
📖 第 1 页 / 共 4 页
字号:
end if
Response.Flush

i=0
set rs=conn.execute("select sortID from as_sort order by sortID asc")
if not(rs.bof and rs.eof) then
	do while not rs.eof
		set rss=uConn.execute("select * from sort where sortID="&rs(0))
		if not(rss.bof and rss.eof) then
			i=i+1
			conn.execute("update as_sort set sortName='"&anysale.checkStr(rss("sortType"))&"',readme='"&anysale.checkStr(rss("readme"))&"',parentID="&rss("parentID")&",parentStr='"&rss("parentStr")&"',depth="&rss("depth")&",rootID="&rss("rootID")&",child="&rss("child")&",orders="&rss("orders")&",userID="&rss("userID")&",groups=1 where sortID="&rs(0))
		else
			conn.execute("delete from as_sort where sortID="&rs(0))
		end if
		rs.movenext
	loop
end if
channelChild("sort")
checkAndFixChannel "sort",0,1
response.write b&"成功更新"&i&"条sort数据"&e
Response.Flush


'导upfile至as_upfile
i=0
set rs=uconn.execute("select * from upfile order by fileID asc")
if not(rs.bof and rs.eof) then
	do while not rs.eof
		i=i+1
		conn.execute("insert into as_upfile(userID,username,[group],ID,views,downs,fileName,showName,fileExt,fileType,fileSize,readme,flag)Values("&rs("userID")&",'"&rs("username")&"',"&rs("group")&","&rs("ID")&","&rs("views")&","&rs("downs")&",'"&rs("fileName")&"','"&rs("fileName")&"','"&rs("filetype")&"',1,"&rs("fileSize")&",'"&anysale.checkStr(rs("readme"))&"',"&rs("flag")&")")
		rs.movenext
	loop
end if
response.write b&"成功更新"&i&"条upfile数据"&e
Response.Flush

'导channel至as_channel
'只更新了 types=3 资讯类
'types=3 然后在news里改变channelID
i=0
dim newChannel
set rs=uconn.execute("select * from channel where types=3 order by channelID asc")
if not(rs.bof and rs.eof) then
	do while not rs.eof
		i=i+1
		conn.execute("insert into as_channel(channelName,readme,parentID,parentStr,depth,rootID,child,orders,groups)Values('"&anysale.checkStr(rs("channelType"))&"','"&anysale.checkStr(rs("readme"))&"',"&rs("parentID")&",'"&rs("parentStr")&"',"&rs("depth")&","&rs("rootID")&","&rs("child")&","&rs("orders")&",6)")
		'取出最新的newchannelID
		newChannel=clng(anysale.getValue("as_channel","channelID","groups=6 order by channelID desc"))
		'将新的newchannelID替换as_news里的oldchannelID
		conn.execute("update as_news set channelID="&newChannel&" where channelID="&rs("channelID"))
		rs.movenext
	loop
end if
response.write b&"成功更新"&i&"条channel数据"&e
Response.Flush


'导member至as_user
set rs=uConn.execute("select userID from member where isdel=0 order by userID desc")
if not(rs.bof and rs.eof) then
	if rs(0)>1 then
		for i=2 to rs(0)
			conn.execute("insert into as_user(views)Values(0)")
		next
	end if
end if
Response.Flush

i=0
dim oldbusiness,oldcontact,im,business,contact,about,experience,userInfo,face
dim direct,istrust,nickname,classID
set rs=conn.execute("select userID from as_user order by userID asc")
if not(rs.bof and rs.eof) then
	do while not rs.eof
		set rss=uConn.execute("select * from member where isdel=0 and userID="&rs(0))
		if not(rss.bof and rss.eof) then
			i=i+1
			oldbusiness=split(anysale.checkStr(rss("business")),"|||")
			oldcontact=split(anysale.checkStr(rss("contact")),"|||")
			im=split(anysale.checkStr(rss("im")),"|||")
			if oldbusiness(2)=1 then
				direct="生产"
			elseif oldbusiness(2)=2 then
				direct="贸易"
			else
				direct="生产,贸易"
			end if
			if rss("userType")=2 or rss("userType")=3 then
				istrust=1
				conn.Execute("update as_business set istrust=1 where userID="&rs(0))
				conn.Execute("update as_products set istrust=1 where userID="&rs(0))
			else
				istrust=0
			end if	
			
			if rss("classID")=0 then
				classID=anysale.getValue("as_class","classID","classID>0 order by classID asc")   '先要更新classID表
			else
				classID=rss("classID")
			end if
			
			nickname=anysale.checkStr(rss("nickname"))
			if rss("nickname")="" then
				nickname=rss("username")
			end if
			
			business=oldbusiness(0)&"|||"&oldcontact(2)&"|||"&direct&"|||法人代表|||"&oldbusiness(7)&"|||000000|||"&oldbusiness(3)&","&oldbusiness(4)&"|||"&anysale.checkStr(rss("homepage"))
			contact=oldcontact(0)&"|||"&oldcontact(1)&"|||86-000-"&oldcontact(4)&"|||86-000-"&oldcontact(5)&"|||"&rss("qq")&"|||"&im(1)&"|||"&im(2)&"|||000000|||"&oldbusiness(7)
			about=anysale.checkStr(rss("birthday"))&"|||保密|||中国|||0|||保密|||保密|||无|||http://|||暂无兴趣爱好|||暂无自我介绍相关信息"
			experience="暂无工作经历及相关信息|||暂无教育经历及相关信息|||暂无所获荣誉及相关信息|||暂无技能专长及相关信息"
			userInfo="0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0|||0"
			if instr(rss("userface"),"userface/")>0 then
				face="images/userface/face1.gif|||100|||100"
			else
				face=anysale.checkStr(rss("face"))&"|||"&rss("faceWidth")&"|||"&rss("faceHeight")
			end if
			if rss("lastLogin")<>"" then conn.execute("update as_user set logintime='"&rss("lastLogin")&"'") end if
			if rss("VIPStart")<>"" then conn.execute("update as_user set trustStartTime='"&rss("VIPStart")&"'") end if
			if rss("VIPEnd")<>"" then conn.execute("update as_user set trustEndTime='"&rss("VIPEnd")&"'") end if
			conn.execute("update as_user set username='"&rss("username")&"',nickname='"&nickname&"',[password]='"&lcase(rss("password"))&"',question='"&anysale.checkStr(rss("question"))&"',answer='"&lcase(rss("answer"))&"',regtime='"&rss("regtime")&"',loginIP='"&rss("lastIP")&"',logins="&rss("logins")&",views="&rss("views")&",myStyle='style/default/style.css|||style/default/style.jpg',groups=7,[level]=10,title='"&anysale.checkStr(rss("title"))&"',email='"&anysale.checkStr(rss("email"))&"',classID="&classID&",areaID=1,face='"&face&"',logo='images/nologo.gif|||120|||60',mobile='"&oldcontact(6)&"',business='"&business&"',contact='"&contact&"',about='"&about&"',experience='"&experience&"',myareaID=1,sign='"&left(anysale.checkStr(rss("sign")),250)&"',detail='"&anysale.checkStr(rss("profile"))&"',userInfo='"&userInfo&"',istrust="&istrust&",istop="&rss("istop")&",islock="&rss("islock")&" where userID="&rs(0))
		else
			conn.execute("delete from as_user where userID<>1 and userID="&rs(0))
		end if
		rs.movenext
	loop
end if
conn.execute("update as_user set groups=1 where userID=1") '管理员提升用户组
response.write b&"成功更新"&i&"条user数据"&e
'md5,为32位,大小转为小写
'money统计
'userInfo统计


'导config至as_config
Response.Flush
dim siteInfo,siteSet,upSet
dim asSet,asInfo,asReg,asUser,asMail,asUp,agreement
set rs=uconn.execute("select * from config")
if not(rs.bof and rs.eof) then
	siteInfo=split(rs("siteInfo"),"|||")
	siteSet=split(rs("siteSet"),"|||")
	upSet=split(rs("upSet"),"|||")
	
	if right(trim(siteInfo(1)),1)<>"/" Then siteInfo(1)=trim(siteInfo(1))&"/"

	asSet="skins/default/style.css|||1|||"&siteSet(1)
	asInfo=siteInfo(0)&"|||"&siteInfo(1)&"|||"&siteInfo(2)&"|||"&siteInfo(3)&"|||"&siteInfo(4)&"|||"&siteInfo(6)&"|||粤ICP备:123456号|||"&siteInfo(9)&"|||版权所有 {$siteName} Copyright © 2006-2008 {$siteURL}. All Rights Reserved|||为为工作室|||广东省深圳市福田区|||518000|||0755-81905010|||0755-81905010|||13510523912|||SZ001|||117883|||anysalecn@hotmail.com|||anysale"
	asReg=siteSet(10)&"|||1|||"&siteSet(13)&"|||"&siteSet(15)&"|||"&siteSet(16)&"|||{$siteName} 全体管理人员欢迎您的到来:"&chr(10)&"如有任何疑问请及时联系系统管理员。"&chr(10)&"如有任何使用上的问题请查看使用帮助。"&chr(10)&"感谢您注册本系统,让我们一起来建设这个网上家园!|||20"
	asUser=siteSet(27)&"|||"&siteSet(34)&"|||"&siteSet(28)&"|||120|||100|||100|||"&siteSet(33)&"|||3|||1|||"&siteSet(21)&"|||"&siteSet(22)&"|||30|||120|||120|||60|||1"
	asMail=siteSet(23)&"|||"&siteSet(24)&"|||"&siteSet(25)&"|||"&siteSet(26)&"|||"&siteInfo(9)&"|||"&siteInfo(0)
	asUp=upSet(0)&"|||"&upSet(2)&"|||"&upSet(3)&"|||"&upSet(4)&"|||"&upSet(5)&"|||"&upSet(6)&"|||"&upSet(7)&"|||"&upSet(8)&"|||"&upSet(9)&"|||"&upSet(10)&"|||"&upSet(11)&"|||"&upSet(12)&"|||"&upSet(13)&"|||"&upSet(14)&"|||"&upSet(15)&"|||"&upSet(16)&"|||"&upSet(17)&"|||"&upSet(18)&"|||"&replace(upSet(20),"|",",")&"|||200"
	
	conn.execute("update as_config set asSet='"&asSet&"',asInfo='"&asInfo&"',asReg='"&asReg&"',asUser='"&asUser&"',asMail='"&asMail&"',asUp='"&asUp&"'")
	if rs("register")<>"" then
		conn.execute("update as_config set agreement='"&anysale.checkStr(rs("register"))&"'")
	end if	
	if rs("badwords")<>"" then
		conn.execute("update as_config set badwords='"&rs("badwords")&"',rebadwords='"&rs("rebadwords")&"'")
	end if	
	if rs("splitwords")<>"" then
		conn.execute("update as_config set regwords='"&rs("splitwords")&"'")
	end if
end if
response.write b&"成功更新网站配置数据"&e
'siteInfo 统计

'更新upfile目录
dim path,newfile
path=lcase(upSet(19))
if path<>"upfile/" then

	'as_business
	set rs=conn.execute("select businessID,[image] from as_business")
	if not(rs.bof and rs.eof) then
		do while not rs.eof
			if inStr(rs("image"),":")=0 or inStr(rs("image"),"//")=0 then
				newfile=replace(rs("image"),path,"upfile/")
				conn.execute("update as_business set [image]='"&anysale.checkStr(newfile)&"' where businessID="&rs("businessID"))
			end if
			rs.movenext
		loop
	end if
	'as_products
	set rs=conn.execute("select productsID,[image] from as_products")
	if not(rs.bof and rs.eof) then
		do while not rs.eof
			if inStr(rs("image"),":")=0 or inStr(rs("image"),"//")=0 then
				newfile=replace(rs("image"),path,"upfile/")
				conn.execute("update as_products set [image]='"&anysale.checkStr(newfile)&"' where productsID="&rs("productsID"))
			end if
			rs.movenext
		loop
	end if
	'as_news
	set rs=conn.execute("select newsID,[image] from as_news")
	if not(rs.bof and rs.eof) then
		do while not rs.eof
			if inStr(rs("image"),":")=0 or inStr(rs("image"),"//")=0 then
				newfile=replace(rs("image"),path,"upfile/")
				conn.execute("update as_news set [image]='"&anysale.checkStr(newfile)&"' where newsID="&rs("newsID"))
			end if
			rs.movenext
		loop
	end if
	'as_user
	set rs=conn.execute("select userID,face,logo from as_user")
	if not(rs.bof and rs.eof) then
		do while not rs.eof
			if inStr(rs("face"),":")=0 or inStr(rs("face"),"//")=0 then
				newfile=replace(rs("face"),path,"upfile/")
				conn.execute("update as_user set face='"&anysale.checkStr(newfile)&"' where userID="&rs("userID"))
			end if
			if inStr(rs("logo"),":")=0 or inStr(rs("logo"),"//")=0 then
				newfile=replace(rs("logo"),path,"upfile/")
				conn.execute("update as_user set logo='"&anysale.checkStr(newfile)&"' where userID="&rs("userID"))
			end if
			rs.movenext
		loop
	end if
	
	'as_upfile
	set rs=conn.execute("select fileID,fileName,viewName,showName from as_upfile")
	if not(rs.bof and rs.eof) then
		do while not rs.eof
			if inStr(rs("fileName"),":")=0 or inStr(rs("fileName"),"//")=0 then
				newfile=replace(rs("fileName"),path,"upfile/")
				conn.execute("update as_upfile set fileName='"&anysale.checkStr(newfile)&"' where fileID="&rs("fileID"))
			end if
			if inStr(rs("viewName"),":")=0 or inStr(rs("viewName"),"//")=0 then
				newfile=replace(rs("viewName"),path,"upfile/")
				conn.execute("update as_upfile set viewName='"&anysale.checkStr(newfile)&"' where fileID="&rs("fileID"))
			end if
			if inStr(rs("showName"),":")=0 or inStr(rs("showName"),"//")=0 then
				newfile=replace(rs("showName"),path,"upfile/")
				conn.execute("update as_upfile set showName='"&anysale.checkStr(newfile)&"' where fileID="&rs("fileID"))
			end if
			rs.movenext
		loop
	end if
	response.write b&"成功更新上传目录"&e

end if


rss.close
set rss=nothing
rs.close
set rs=nothing
%>
  </ul>
 <!--list.end-->
 </div>
</div>

<div>
 <ul>
  <li>&nbsp;</li>
  <li>&nbsp;</li>
  <li class="txtCen title green"><input type="submit" name="submit" value="下一步:清理系统数据" class="button" onmouseover="this.className='buttonH'" onmouseout="this.className='button'" /></li>
  <li>&nbsp;</li>
  <li>&nbsp;</li>
  <li>&nbsp;</li>
 </ul>
</div>
</form>
<%
closeData()
end sub


sub step3()
	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"))
%>
<div>
 <ul>
  <li>&nbsp;</li>
  <li>&nbsp;</li>
  <li class="txtCen title green">第三步:清理系统数据</li>
  <li>&nbsp;</li>
  <li>&nbsp;</li>
 </ul>
</div>

<form name="step3" id="step3" method="post" action="?action=step4">
 <input type="hidden" value="<%=request("database")%>" name="database">
<div class="minB">
 <div class="list line30">
  <ul class="borderB">
   <li><strong class="color f14">操作说明:</strong>正在处理数据,未出现下一步之前,请勿刷新或关闭浏览器!</li>
  </ul>
  <ul><li>&nbsp;</li></ul>
  <ul>
<%
dim rs,sql,i,n,rss,rsz
n=0
set rs=conn.execute("select userID,businessID from as_business")
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_business where businessID="&sql(1,i))
			n=n+1
		end if
		rss.close
		set rss=nothing
	next
end if
response.write b&"成功清理"&n&"条as_business数据"&e
Response.Flush

n=0
set rs=conn.execute("select userID,productsID from as_products")
if not(rs.bof and rs.eof) then
	sql=rs.getRows(-1)

⌨️ 快捷键说明

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