📄 update.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/md5.asp"-->
<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
call anysale.minHead("AnySale升级程序","","")
server.ScriptTimeout=9999999
dim uConn,uConnStr,uSql
dim b,e
b="<li class=""left"" style=""width:250px;"">"
e="</li>"
select case request("action")
case "step2"
'导入主体数据
call step2()
case "step3"
'清理数据
call step3()
case "step4"
'更新系统数据
call step4()
case "step5"
'压缩数据库
call step5()
case "step6"
'删除升级文件,返回首页
call step6()
case else
'选择数据库
call step1()
end select
sub step1()
%>
<div>
<ul>
<li> </li>
<li> </li>
<li class="txtCen title green">第一步:选择数据库</li>
<li> </li>
</ul>
</div>
<div class="minB">
<div class="list line30">
<form name="step1" id="step1" method="post" action="?action=step2">
<ul><li> </li></ul>
<ul>
<li class="name txtRig f14"><span class="red">*</span> 旧数据库地址:</li>
<li class="value"><input type="text" name="database" id="database" class="inpWidth" onblur="check('数据库地址',this.value,'databaseNote',0,0,1)" /></li>
<li><span class="note" id="databaseNote">相对路径,如data目录的data/anysale.mdb或者根目录anysale.mdb</span></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> </li></ul>
</form>
<ul class="borderB">
<li class="color f14"><strong>升级说明</strong></li>
</ul>
<ul>
<li><strong>操作说明,请仔细阅读操作说明后进行操作:</strong></li>
</ul>
<ul>
<li>1、升级程序为从AnySale v1.2升级到AnySale v2.0,V1.0或 V1.1请先升级至V1.2后再进行操作。</li>
</ul>
<ul>
<li>2、强烈建议您在本地计算机系统完成升级操作并做好<strong class="red">备份</strong>工作,如不能在本地进行升级操作也请升级前<strong class="red">备份</strong>好您的所有文件和数据。</li>
</ul>
<ul>
<li class="left">3、<strong>本地升级</strong>:</li>
<li class="left">
A.系统要求:使用W2k(Pro&Server)+IIS5.0或者Win2003+IIS6,请不要在Win9x下进行升级操作;<br />
B.在WEB目录中新建一目录,将v1.2网站数据库下载回本地放入新目录,将v1.2的upfile目录下上传文件下载回本地的upfile/目录;<br />
C.将程序包update目录下的update.asp复制到网站目录,在浏览器中执行http://website/update.asp文件,然后按照步骤和说明进行操作;<br />
D.如果出现<strong class="red">错误</strong>信息提示,请仔细阅读,一般都包含了解决办法,这时或许需要您手动调整部分信息,如果是出现异常的没有解决的问题,请到<a href="http://bbs.anysale.cn" class="links" target="_blank">AnySale论坛</a>发言讨论;<br />
E.完成升级后,为了安全,请确认update.asp文件及v1.2数据库文件是否成功删除;<br>
F.完成升级,在后台调整基本设置及广告内容;关于我们,使用帮助,会员权限等内容根据需要进行调整。将新版文件传至网站空间。
</li>
</ul>
<ul>
<li class="left">4、<strong>网络升级</strong>:</li>
<li class="left">
A.请做好数据库和网站文件备份;<br />
B.将新版文件传到网站目录,新建一目录,将v1.2旧版数据库上传到此目录,将v1.2上传目录下的文件夹上传到“upfile/”目录下;<br>
C.将程序包update目录下的update.asp复制到网站目录,在浏览器中执行http://website/update.asp文件,然后按照步骤和说明进行操作;<br />
D.如果出现<strong class="red">错误</strong>信息提示,请仔细阅读,一般都包含了解决办法,这时或许需要您手动调整部分信息,如果是出现异常的没有解决的问题,请到<a href="http://bbs.anysale.cn" class="links" target="_blank">AnySale论坛</a>发言讨论;<br />
E.完成升级后,为了安全,请确认update.asp文件及v1.2数据库文件是否成功删除;<br>
F.完成升级,在后台调整基本设置及广告内容;关于我们,使用帮助,会员权限等内容根据需要进行调整。
</li>
</ul>
<ul>
<li>5、欢迎访问 <a class="links" href="http://www.anyfor.cn" target="_blank">为为</a> <a class="links" href="http://www.anysale.cn">AnySale</a> <a class="links" href="http://bbs.anysale.cn">论坛</a>!</li>
</ul>
<ul><li> </li></ul>
<!--list.end-->
</div>
</div>
<%
end sub
sub step2()
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> </li>
<li> </li>
<li class="txtCen title green">第二步:导入主体数据</li>
<li> </li>
<li> </li>
</ul>
</div>
<form name="step2" id="step2" method="post" action="?action=step3">
<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> </li></ul>
<ul>
<%
Response.Flush
'导info至as_business
dim rs,i,rss
set rs=uConn.execute("select infoID from info order by infoID desc")
if not(rs.bof and rs.eof) then
for i=1 to rs(0)
conn.execute("insert into as_business(istrust)Values(0)")
next
end if
Response.Flush
i=0
set rs=conn.execute("select businessID from as_business order by businessID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
set rss=uConn.execute("select * from info where isdel=0 and infoID="&rs(0))
if not(rss.bof and rss.eof) then
i=i+1
conn.execute("update as_business set userID="&rss("userID")&",username='"&rss("username")&"',channelID="&rss("channelID")&",classID="&rss("classID")&",areaID=1,views="&rss("views")&",addtime='"&rss("addtime")&"',endtime='"&rss("endtime")&"',title='"&anysale.checkStr(rss("title"))&"',preview='"&anysale.checkStr(rss("miniature"))&"',[image]='"&anysale.checkStr(rss("miniature"))&"',tags='"&anysale.checkStr(rss("keyword"))&"',unit='0',price=0,detail='"&anysale.checkStr(rss("detail"))&"',iselite="&rss("iselite")&",istop="&rss("istop")&",islock="&rss("islock")&" where businessID="&rs(0))
else
conn.execute("delete from as_business where businessID="&rs(0))
end if
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条business数据"&e
Response.Flush
'导product至as_products
set rs=uConn.execute("select productid from product order by productid desc")
if not(rs.bof and rs.eof) then
for i=1 to rs(0)
conn.execute("insert into as_products(istrust)Values(0)")
next
end if
Response.Flush
dim price
i=0
set rs=conn.execute("select productsID from as_products order by productsID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
set rss=uConn.execute("select * from product where isdel=0 and productid="&rs(0))
if not(rss.bof and rss.eof) then
i=i+1
price=replace(rss("price"),",","")
if not isnumeric(price) then price=0 end if
conn.execute("update as_products set userID="&rss("userID")&",username='"&rss("username")&"',sortID="&rss("sortID")&",classID="&rss("classID")&",areaID=1,views="&rss("views")&",addtime='"&rss("addtime")&"',title='"&anysale.checkStr(rss("title"))&"',preview='"&anysale.checkStr(rss("miniature"))&"',[image]='"&anysale.checkStr(rss("image"))&"',tags='"&anysale.checkStr(rss("keyword"))&"',unit='"&anysale.checkStr(rss("unit"))&"',price="&price&",[number]=0,storage=0,detail='"&anysale.checkStr(rss("detail"))&"',iselite="&rss("iselite")&",istop="&rss("istop")&",islock="&rss("islock")&" where productsID="&rs(0))
else
conn.execute("delete from as_products where productsID="&rs(0))
end if
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条products数据"&e
Response.Flush
'导class至as_class
set rs=uConn.execute("select classID from class order by classID desc")
if not(rs.bof and rs.eof) then
for i=1 to rs(0)
conn.execute("insert into as_class(child)Values(0)")
next
end if
Response.Flush
i=0
set rs=conn.execute("select classID from as_class order by classID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
set rss=uConn.execute("select * from class where classID="&rs(0))
if not(rss.bof and rss.eof) then
i=i+1
conn.execute("update as_class set className='"&anysale.checkStr(rss("classType"))&"',readme='"&anysale.checkStr(rss("readme"))&"',parentID="&rss("parentID")&",parentStr='"&rss("parentStr")&"',depth="&rss("depth")&",rootID="&rss("rootID")&",child="&rss("child")&",orders="&rss("orders")&" where classID="&rs(0))
else
conn.execute("delete from as_class where classID="&rs(0))
end if
rs.movenext
loop
end if
channelChild("class")
checkAndFixChannel "class",0,1
response.write b&"成功更新"&i&"条class数据"&e
Response.Flush
'导comment至as_comment
i=0
set rs=uconn.execute("select * from comment where types=3 order by commentID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
i=i+1
conn.execute("insert into as_comment(ID,groups,username,userIP,addtime,detail,isuser,isbest)Values("&rs("ID")&",6,'"&rs("username")&"','"&rs("IP")&"','"&rs("addtime")&"','"&anysale.checkStr(rs("detail"))&"',"&rs("userType")&","&rs("isbest")&")")
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条comment数据"&e
Response.Flush
'导favorite至as_favorite
i=0
set rs=uconn.execute("select * from favorite order by ID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
i=i+1
conn.execute("insert into as_favorite(groups,userID,title,link,addtime)Values("&rs("groups")&","&rs("userID")&",'"&anysale.checkStr(rs("title"))&"','"&anysale.checkStr(rs("url"))&"','"&rs("addtime")&"')")
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条favorite数据"&e
Response.Flush
'导friend至as_friend
i=0
set rs=uconn.execute("select * from friend order by ID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
i=i+1
conn.execute("insert into as_friend(userID,friend,addtime)Values("&rs("userID")&",'"&rs("friend")&"','"&rs("addtime")&"')")
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条friend数据"&e
Response.Flush
'导links至as_links
i=0
set rs=uconn.execute("select * from links order by ID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
i=i+1
conn.execute("insert into as_links(site,link,logo,readme,islogo,ispass,orders,addtime)Values('"&anysale.checkStr(rs("siteName"))&"','"&anysale.checkStr(rs("url"))&"','"&anysale.checkStr(rs("logo"))&"','"&anysale.checkStr(rs("readme"))&"',"&rs("islogo")&","&rs("ispass")&","&rs("orders")&",'"&rs("addtime")&"')")
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条links数据"&e
Response.Flush
'导message至as_message
i=0
set rs=uconn.execute("select * from message order by ID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
i=i+1
conn.execute("insert into as_message(addtime,sender,incept,title,detail,groups,isread,isdel,isreply)Values('"&rs("sendtime")&"','"&rs("sender")&"','"&rs("incept")&"','"&anysale.checkStr(rs("title"))&"','"&anysale.checkStr(rs("detail"))&"',0,"&rs("flag")&","&rs("dels")&","&rs("isreply")&")")
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条message数据"&e
Response.Flush
'导news至as_news
set rs=uConn.execute("select newsID from news order by newsID desc")
if not(rs.bof and rs.eof) then
for i=1 to rs(0)
conn.execute("insert into as_news(islock)Values(0)")
next
end if
Response.Flush
i=0
set rs=conn.execute("select newsID from as_news order by newsID asc")
if not(rs.bof and rs.eof) then
do while not rs.eof
set rss=uConn.execute("select * from news where isdel=0 and newsID="&rs(0))
if not(rss.bof and rss.eof) then
i=i+1
conn.execute("update as_news set userID="&rss("userID")&",username='"&rss("username")&"',channelID="&rss("channelID")&",views="&rss("views")&",addtime='"&rss("addtime")&"',front='"&anysale.checkStr(rss("front"))&"',title='"&anysale.checkStr(rss("title"))&"',author='"&anysale.checkStr(rss("author"))&"',source='"&anysale.checkStr(rss("source"))&"',link='"&anysale.checkStr(rss("link"))&"',islink="&rss("uselink")&",tags='"&anysale.checkStr(rss("keyword"))&"',intro='"&anysale.checkStr(rss("intro"))&"',detail='"&anysale.checkStr(rss("detail"))&"',[image]='"&anysale.checkStr(rss("image"))&"',isimage="&rss("isimage")&",istoday="&rss("istoday")&",istopic="&rss("istopic")&",iselite="&rss("iselite")&",istop="&rss("istop")&",islock="&rss("islock")&" where newsID="&rs(0))
else
conn.execute("delete from as_news where newsID="&rs(0))
end if
rs.movenext
loop
end if
response.write b&"成功更新"&i&"条news数据"&e
Response.Flush
'导sort至as_sort
set rs=uConn.execute("select sortID from sort order by sortID desc")
if not(rs.bof and rs.eof) then
for i=1 to rs(0)
conn.execute("insert into as_sort(child)Values(0)")
next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -