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

📄 setup.asp

📁 一个不错的ASP论坛源码
💻 ASP
📖 第 1 页 / 共 5 页
字号:
<%
'########## Snitz Forums 2000 Version 3.1 SR4 ####################
'#                                                               #
'#  汉化修改: 资源搜罗站                                         #
'#  电子邮件: cgier@21cn.com                                     #
'#  主页地址: http://www.sdsea.com                               #
'#            http://www.99ss.net                                #
'#            http://www.cdown.net                               #
'#	     http://www.wzdown.com                               #
'#	     http://www.13888.net                                #
'#  论坛地址:http://ubb.yesky.net                                #
'#  最后修改日期: 2001/03/12    中文版本:Version 3.1 SR4        #
'#################################################################
'# 原始来源                                                      #
'# Snitz Forums 2000 Version 3.1 SR4                             #
'# Copyright 2000 http://forum.snitz.com - All Rights Reserved   #
'#################################################################
'#【版权声明】                                                   #
'#                                                               #
'# 本软体为共享软体(shareware)提供个人网站免费使用,请勿非法修改,#
'# 转载,散播,或用于其他图利行为,并请勿删除版权声明。          #
'# 如果您的网站正式起用了这个脚本,请您通知我们,以便我们能够知晓#
'# 如果可能,请在您的网站做上我们的链接,希望能给予合作。谢谢!  #
'#################################################################
'# 请您尊重我们的劳动和版权,不要删除以上的版权声明部分,谢谢合作#
'# 如有任何问题请到我们的论坛告诉我们                            #
'#################################################################

'#################################################################################
    strNewVersion = "Snitz Forums 2000 Version 3.1 SR4"
'#################################################################################

ResponseCode = Request.QueryString("RC")
if ResponseCode <> "" then 'No parameter
	blnSetup = "Y"
else
	strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
	Application(strCookieURL & "ConfigLoaded")= ""
end if
%>
<!--#INCLUDE FILE="config.asp" -->
<%
Response.Buffer = True
%>
<html>
<head>
<title>Forum-Setup Page</title>
<meta name="copyright" content="Snitz Forums 2000 Version 3.1 SR4 汉化修改:资源搜罗站">
<Style><!--
a:link    {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover   {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
--></style>
</head>

<body bgColor="white" text="midnightblue" link="darkblue" aLink=red vLink="red" onLoad="window.focus()">
<%
if ResponseCode = "" then 'No parameter

'	Check to see if all the fields are in the database
'	FORUM_CONFIG doesn't need to be checked, that is done in CONFIG.ASP
	
	on error resume next
	
	set my_Conn = Server.CreateObject("ADODB.Connection")
	my_Conn.Open strConnString	
	
	for counter = 0 to my_conn.Errors.Count -1
		ConnErrorNumber = my_conn.Errors(counter).Number
		if ConnErrorNumber <> 0 then 
			my_conn.Errors.Clear 
			Response.Redirect "Setup.asp?RC=1&EC=" & ConnErrorNumber
		end if
	next
	
	my_Conn.Errors.Clear

	strSql = "SELECT CAT_ID, FORUM_ID, F_STATUS, F_MAIL, F_SUBJECT, F_URL, F_DESCRIPTION, F_TOPICS, F_COUNT, "
	strSql = strSql & "F_LAST_POST, F_PASSWORD_NEW, F_PRIVATEFORUMS, F_TYPE, F_IP, F_LAST_POST_AUTHOR "
	strSql = strSql &  " FROM " & strTablePrefix & "FORUM"
	
	my_Conn.Execute strSql
	
	Call CheckSqlError()
	
	my_Conn.Errors.Clear
	
	strSql = "SELECT CAT_ID, FORUM_ID, TOPIC_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, "
	strSql = strSql & "T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR "
	strSql = strSql & " FROM " & strTablePrefix & "TOPICS"

	my_Conn.Execute strSql

	Call CheckSqlError()
	
	my_Conn.Errors.Clear
	
	strSql = "SELECT MEMBER_ID, M_STATUS, M_NAME, M_USERNAME, M_PASSWORD, M_EMAIL, M_COUNTRY, M_HOMEPAGE, "
	strSql = strSql & "M_SIG, M_DEFAULT_VIEW, M_LEVEL, M_AIM, M_YAHOO, M_ICQ, M_POSTS, M_DATE, "
	strSql = strSql & "M_LASTHEREDATE, M_LASTPOSTDATE, M_TITLE, M_SUBSCRIPTION, M_HIDE_EMAIL, "
	strSql = strSql & "M_RECEIVE_EMAIL, M_LAST_IP, M_IP, M_FIRSTNAME, M_LASTNAME, M_OCCUPATION, "
	strSql = strSql & "M_SEX, M_AGE, M_HOBBIES, M_LNEWS, M_QUOTE, M_BIO, M_MARSTATUS, "
	strSql = strSql & "M_LINK1, M_LINK2, M_CITY, M_STATE, M_PHOTO_URL FROM " & strMemberTablePrefix & "MEMBERS"
	strSql = strSql & " WHERE MEMBER_ID = 1;"

	my_Conn.Execute strSql

	Call CheckSqlError()
	
	my_Conn.Errors.Clear

	on error goto 0

	if strVersion <> strNewVersion then
		Response.Redirect "setup.asp?RC=2&MAIL=" & Server.UrlEncode(strSender) & "&VER=" & Server.URLEncode(strVersion) & "&EC=" & Server.UrlEncode("Different or New Version-ID detected")
	end if

'## This part of the code is only reached if all is ok !!
%>
<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">论坛设置完毕!</font></p>
</center></div>

<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
		<td bgColor=navyblue align="center">
		<p>
		<font face="宋体, Arial, Helvetica" size="2">
		<b>恭喜!!</b><br>
		论坛已经安装成功.<br>
		现在你可以开始使用 Snitz Forums 2000 论坛了.</font></p>
		<font face="宋体, Arial, Helvetica" size="2">
		<b>记得修改默认的论坛管理密码 !!</b></font></p>
		<font face="宋体, Arial, Helvetica" size="2">
		如果你还有什么问题可以到下面的网址跟我们联系: <a href="http://forum.snitz.com">http://forum.snitz.com</a></font></p></td>
	</tr>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
		<a href="default.asp" target="_top">点击这里进入论坛.</a>
		</font></td>
	</tr>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
		<a href="setup.asp?RC=3" target="_top">更新数据库.</a>
		</font></td>
	</tr>
<% if strDBType <> "access" then %>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
		<a href="setup.asp?RC=5" target="_top">建立数据库.</a>
		</font></td>
	</tr>
<% end if %>
</table>	

<%
elseif ResponseCode = 1 then '## cannot open database

ErrorCode = Request.QueryString("EC")	
CustomCode = Request.QueryString("CC")
%>
<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">安装不能继续进行,发现一个错误!!</font></p>
</center></div>

<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
		<td bgColor=navyblue align="center">
		<p>
		<font face="宋体, Arial, Helvetica" size="2">
<%
if CustomCode = 1 then
%>
		错误:不能打开数据库!!<br>
		检查你的 config.asp 文件设置好<br><b>strConnString</b>连接数据库参数.<br>
		<br>
<%
elseif CustomCode = 2 then
%>
		不能从数据库中读取 tables.<br> Make sure none of the tables are exclusively locked by another user.<br><br>
<%
elseif CustomCode = 3 then 
%>
		错误:不能打开数据库!!<br> 请确定你的数据库用户名跟连接密码是正确的.<br><br>
<%
else
%>
		错误:不能打开数据库!!<br>
		<br>
<%

end if
		if ErrorCode <> "" then 
			Response.Write("<p>Code :  " & ErrorCode & "</p>")
		end if
%>
		</font></p></td>
	</tr>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
<% 
if Request.QueryString("RET") <> "" then 
%>
		<a href="<%=Request.QueryString("RET")%>" target="_top">点击这里返回上一页.</a>
<%
else
%>
		<a href="setup.asp" target="_top">点击这里重试.</a>
<%
end if
%> 
		</font></td>
	</tr>
</table>	
<%
elseif ResponseCode = 2 then '## cannot find all the fields in the database

strSender = Request.QueryString("MAIL")
strVersion = Request.QueryString("VER")
ErrorCode = Request.QueryString("EC")
CustomCode = Request.QueryString("CC")

if ErrorCode = "-2147467259" then
	Response.Redirect "setup.asp?RC=5&EC=" & ErrorCode
	Response.End
elseif ErrorCode = "-2147217865" then
	if strDBType = "access" then
		Response.Redirect "setup.asp?RC=1&EC=" & server.URLEncode("The Access database has missing tables !!")
		Response.End
	else
		Session(strCookieURL & "Approval") = "15916941253"
%>
<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">The database needs to be installed !!</font></p>
</center></div>
<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
		<td bgColor=navyblue align="center">
		<p>
		<font face="宋体, Arial, Helvetica" size="2">
		使用论坛前请先建立数据库.<br>
		</font></p></td>
	</tr>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
		<a href="setup.asp?RC=5&strDBType=<% =strDBType %>"  target="_top">点击这里建立一个数据库.</a><br><br>
		<a href="setup.asp" target="_top">点击这里重试.</a>
		</font></td>
	</tr>
</table>
<%
	end if
else
%>
<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">The database needs to be upgraded !!</font></p>
</center></div>
<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
		<td bgColor=navyblue align="center">
		<p>
		<font face="宋体, Arial, Helvetica" size="2">
		The database you are using needs to be upgraded !!<br>
<%
	if MAIL <> ""then 
%>
		If you are not a Administrator at this forum<br> please report this error here: <a href="mailto:<% =strSender %>"><% =strSender %></a>.<br><br>
<%
	end if 
	if ErrorCode <> "" then 
			Response.Write("<p>Code :  " & ErrorCode & "</p>" )
	end if
%>
		</font></p></td>
	</tr>
	<tr>
		<td align="center">
		<font face="宋体, Arial, Helvetica" size="2">
		<a href="setup.asp?RC=3&MAIL=<% =Server.URLEncode(strSender) %>"  target="_top">Click here to upgrade the database.</a><br><br>
		<a href="default.asp" target="_top">Click here to retry.</a>
		</font></td>
	</tr>
</table>	
<%
end if


elseif ResponseCode = 3 then '## upgrade database

⌨️ 快捷键说明

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